View Full Version : Adding two instances of a MovieClip in different spots using AS3
wyattt
02-15-2009, 08:36 PM
I am trying to add a single MovieClip in two different spots on my stage. I've added the first by using addChild but I have no idea about how I would also add the second. Basically, it's a button that the user interacts with using a keypress, but in two different spots.
Any help would be greatly appreciated. Thank you :)
matbury
02-15-2009, 08:41 PM
Hi wyattt,
Am I right in thinking that you've changed over from AS 2.0? (Just a hunch)
If you want to put two instances on the stage, then create two instances:
var mymc1:MovieClip = new MovieClip();
var mymc2:MovieClip = new MovieClip();
addChild(mymc1);
addChild(mymc2);
wyattt
02-15-2009, 08:49 PM
No, I'm haven't changed over from AS2, but I have pretty much no experience in programming. AS3 is my first language.
What you have posted is a good solution, I don't know why I didn't think of that myself. I suppose I was just wondering if there is a way so that I could refer to both instances with just one name.
Thank you very much for your help!
matbury
02-15-2009, 09:02 PM
You're welcome! Glad I could help. :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.