Help Adding Mulitple Movie clips from libaray AS3

  • CStrauss
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122
  • Loc: St. Louis MO. USA

Post 3+ Months Ago

I was wondering if anyone has an explanation on adding multiple movie clips from the library in AS2 it was done with attachMovie() and you can assign each instance a new instance name with that method. In AS3 I tried something like this but flash didnt like it to much and gave me a bunch of errors lol.

Code: [ Select ]
var numberOfBoxes = 3;
xs:Number = 0;
ys:Number = 60;

for(var i:int = 0; i < numbOfBoxes; i++){
    var Box:picHolder = new BoxMC();
    Box.name = "Box" + String(i);
    addChild(Box);
    Box[i].x = xs + 60;
}
  1. var numberOfBoxes = 3;
  2. xs:Number = 0;
  3. ys:Number = 60;
  4. for(var i:int = 0; i < numbOfBoxes; i++){
  5.     var Box:picHolder = new BoxMC();
  6.     Box.name = "Box" + String(i);
  7.     addChild(Box);
  8.     Box[i].x = xs + 60;
  9. }


What i was trying to do here is create three instances of the BoxMC movie clip and give them instance names of Box0,Box1,Box2 and so on and place them on stage but like I said didnt work, anyone have a suggestion?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 3 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.