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.
精彩评论