开发者

Why is loaderInfo available only after applicationComplete fires?

开发者 https://www.devze.com 2022-12-10 12:56 出处:网络
In an AS3 project, we can access loaderInfo in the first line of the root class\' constructor.This means that the entire AS3 application can take advantage of the loaderInfo object.

In an AS3 project, we can access loaderInfo in the first line of the root class' constructor. This means that the entire AS3 application can take advantage of the loaderInfo object.

However, in Flex, it seems that the loaderInfo object is not available until after the applicationComplete event is sent. This is problematic for me, as other components (that need to leverage load开发者_运维百科erInfo) are initialized long before the applicationComplete event is sent.

I must be missing something. Thanks for your help, everyone! :)


Use Application.application.systemManager.stage.loaderInfo in Flex.

See: http://www.actionscript.org/forums/showthread.php3?p=938460&posted=1#post938460


Or for Flex 4:

FlexGlobals.topLevelApplication.systemManager.stage.loaderInfo


Because the applicationComplete event occurs when the application layout is added to the displaylist, so until then stage is not available.

0

精彩评论

暂无评论...
验证码 换一张
取 消