Hi,
I’ve got a movieclip(we’ll call this “A”) on my stage, which attaches another movieclip(“B”) into itself. So it’s nested.
Now, once this movieclip(“A”) has attached the other movieclip(“B”) into itself,
It uses a “gotoAndStop()” to send the frame of movieClip(“B”) to the right frame, eg. frame 2. Then it runs a loop which checks for all movieclips in “B” and populates an Array.
The script I’m using for this is :
for (var i=0; i<h.numChildren; i++) {// This loop is suppose to populate my "bitArray" Array with all of the attached clip's childclips
if (h.getChildAt(i) is MovieClip) {
bitArray.push(h.getChildAt(i));
trace(h.getChildAt(i).name);
}
}
So, if there were 22 MovieClips on frame 2 in movieClip"B" , this code would still be able to populate my array with all 22 clips right?
Well, that’s the problem I’m having. It doesn’t. For some reason, if there were 22 clips, then out of the 22, the loop would only pick up 9. However, doing a trace with numChildren() in movieClip"B", it would still show 22. But my array would only show 9.
I’ve attached a sample fla, I think it would explain my problem a lot better.
Once you run it, it should spit out an output telling you how many movieclips in the attached movieclip, and it’ll tell you how many clips it pushed onto the array.
My problem is that I can’t seem to get the number of movieclips in my array to equal the number of clips in total inside my attached movieclip.
Anyone got any ideas?
Thanks