ForumsProgramming ForumAS3: Count number of children movieclips?

1 11474
JefferyWright
offline
JefferyWright
1 posts
Nomad

I have buttons that create specific movie clips such as a library object named "Clip_1":

function b_Add_Clip_1(event:MouseEvent):void
{
var b:MovieClip = new Clip_1();
b.name = "Clip_1";

container.addChild(b);
}

So I can add many Clip_1's, Clip_2's and so on, by their corresponding buttons.

I cannot figure out how to count the number of them that exist on the stage, however and I've looked all over the nets.

I would like the number of Clip_1 instances to display in a text field.

For example: If there are 20 on the stage, the text field should display 20, if one is removed, it should display 19.

I would be grateful for any helpful hints, thank you.

  • 1 Reply
Showing 211-210 of 1