Parent Child MC

I would like to know how I would create a MC with a number of other MC in side it.

I am using the addChild so that flash will keep adding MC after reaching a given number.

I am guessing that I would need two var one for the parent and one for the children that are to be created.

If it helps I am creating a gallery that would move with mouse events but I am taking it one step at a time.

I am learning AS 3.0 and I am really typing to keep things as clean as I can.

thank you
var workGallery:MovieClip = new MovieClip;
var projectPeices:MovieClip = new MovieClip;
 
addChild(workGallery);
 
for (var i:Number = 0; i < 3; i++) {
addChild(projectPeices);
}

Open in new window

saul_roldanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rascalpantsCommented:

try just doing this...

addChild( workGallery );

workGallery.addChild( projectPieces );


rp / ZA
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
saul_roldanAuthor Commented:
I would like to know how I would create a MC with a number of other MC in side it.

I am using the addChild so that flash will keep adding MC after reaching a given number.

I am guessing that I would need two var one for the parent and one for the children that are to be created.

If it helps I am creating a gallery that would move with mouse events but I am taking it one step at a time.

I am learning AS 3.0 and I am really typing to keep things as clean as I can.

thank you
var workGallery_mc:MovieClip = new MovieClip;
var projectPeices_mc:MovieClip = new MovieClip;
 
addChild(workGallery_mc);
 
for (var i:Number = 0; i < 3; i++) {
workGallery_mc.addChild(projectPeices_mc);
}

Open in new window

gallery.jpg
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.