Matthew Rhoden
Matthew Rhoden

Reputation: 728

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()">

Upvotes: 4

Views: 415

Answers (1)

Stan Reshetnyk
Stan Reshetnyk

Reputation: 2036

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.

Upvotes: 1

Related Questions