0
votes

I am using Flash CC. I have drawn 7 rectangles using the Rectangle Tool. I then converted the 7 as one movie clip (By hitting F8).

The Problem: I want to be able to iterate through these shapes and move each individually. However the 7 rectangles seem to be encapsulated into the ONE shape and I can't access them.? If I use .numChildren on the movie clip, it returns 1. If I use .getChildAt("anything > 0") its a null reference exception.

Please help, I don't understand how this is so difficult.

I have searched for ages to find the solution to this and for the life of me I can't. Thanks in advance.

(P.s) Instantiating the rectangles in code works, but I need to be able to do this via Flash CC as I will be importing artist material for manipulation.

1

1 Answers

0
votes

Your best choice is to make every shape in your made movie clip a movie clip as well. In Flash go into your made MovieClip (I will call it containerMC for easier understanding) and make every shape a MovieClip by hitting F8. You can also give them instance names, if you want, just make sure they're unique.

Then your containerMC will return numChildren value 7 in your case. You can move/access your shapes in the containerMC via getChildAt(), or by using their instance names that you've provided via containerMC.instance1 or containerMC["instance1"].