Skip to main content
Inspiring
May 17, 2013
Question

which children in which movieclip

  • May 17, 2013
  • 1 reply
  • 356 views

I've made an array of movieclip instances, clipArray[0] to clipArray [16]. They are places inside 3 movieclips. Eight are place inside the left clip, 8 inside the right and the center is still empty. Got button instances on all of them. When I click on such an array clip it moves the the center movieclip.

Now I want to determine how much array clips are left in the movieclip in which I just clicked on an array clip. So let's say I've got 8 array clips in movieclip colomn 'leftClips'. In that left column I click on one of the clipArray[] clips so it moves to the center movieclip column. Now I want to read how many clips are still left in the left column 'leftClips' (7!) and more specifically which ones.

So if the clipArray[] I just click on was number 6, I'd like to see that clipArray[0] to clipArray[5] and clipArray[7] are still left in movieclip 'leftClips.

How could I do that?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 17, 2013

you can loop through a parent movieclip using:

for(var i:int=0;i<leftClips.numChildren;i++){

trace(leftClips.getChildAt(i).name);

}