How do I wait for flash (as2) to load child elements before running some code?
On the stage, I have seven buttons. I want to add events on these buttons, however most of them are "undefined"/null. How do I wait for the stage or _root in as2 to finish loading the child elements before doing anything.
Is there an equivalent to flex 3 applicationComplete开发者_运维问答?
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="init()">
To be sure that your movieclip is created with all children you should use onLoaded handler. http://help.adobe.com/en_US/as2/reference/flashlite/WS5b3ccc516d4fbf351e63e3d118cd9b5f6e-7868.html
It is strange that you experience such problem if you place you code in fla frame.
精彩评论