This is some code that I built into a game and decided not to use.
I’m keeping it here to show the declaration of the library item.
// a MovieClip from the library linked as "Bags_mc"
var NewBags:Bags_mc;
NewBags = new Bags_mc();
NewBags.name = String( "bag_" + i );
this.addChild( NewBags );
// reset indexes
setChildIndex( NewBags, _bagIarr[ i ] );
// reset everything else
NewBags.x = _bagXarr[ i ];
NewBags.y = _bagYarr[ i ];
NewBags.scaleX = _bagSXarr[ i ];
NewBags.scaleY = _bagSYarr[ i ];
trace( "{ NEW BAG CREATED: " + NewBags.name + " }" );

Post a Comment