Using Array to create movie clips
I'm attempting to convert my teachers flash game to AS3 because I don't like AS2 all that much. I've got 90% of it converted. I just need to actually spawn the enemies for you to kill.
I've got an int called dragons that is set to 12. Then I have an array called movieList which is set to the number in the int dragons (I'm going to later add an option for you to upgrade the number of dragons in game. That's why it's set this way). Now, I need to spawn a dragon for each item in the array.
I've got this so far:
function initDragons():void
{
for (var i:int=0;i< dragons;i++) {//Works
movieList = "dragon"+String(i);
movieList.push();
}
for(var j:int=0; j< movieList.length;j++){//Doesn't work
var movieList
addChild(movieList
}
}
the :dragon = new dragon(); is used because I have a MovieClip in my library that's linked to AS with the name dragon.
I didn't set an X or Y to the newly added movie clip's because they don't work. I'd like to get them to spawn first ![]()
