Skip to main content
Inspiring
November 21, 2008
Question

Accessing dynamically created movieclips

  • November 21, 2008
  • 1 reply
  • 408 views
I have an application that I am adding movieclips to a container movieclip through a for loop and repeatedly calling myClip.addChild(theNewClip). Now I have a dozen clips in my container and it seems like the only way to access the clip is to use the getChildByName() method and cast it into a temporary clip so I can get at the its properties.

Is this the best and/or only way to do this? Does the old AS2 myContainer["theName"].property not work with dynamically created movieclips? It doesn't seem to work for me anymore.

Anyway I am getting the clips now, but I was hoping someone could show me a better way to access a dynamically created movie clip.
This topic has been closed for replies.

1 reply

Participant
November 21, 2008
In AS3, this is probably not much better, but you can generically loop through all movie clips: