Hi, pretty new to flash and AS3 and I’m having some problems when adding multiple instances of a movie clip then controlling their movement. I had it working fine when I was only adding one child.
With the code I currently have 20 versions of the movieclip are added to the screen but don’t more. I just want them to float up and once out of screen new ones added.
private function addBubbles():void {
var list:Array=[];
for (var i:int=0; i<20; i++) {
var newBubble:bubbleMC = new bubbleMC();
addChild(newBubble);
list.push(newBubble);
newBubble.x=Math.random()*stage.stageWidth;
newBubble.y=Math.random()*stage.stageHeight;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
private function onEnterFrame(event:Event):void {
newBubble.y += vy;
}
Anyone know what is going wrong?
Thanks