Wrap Multiple Objects

new ball review

Let's start by opening ball_array.fla

We may want to go back, so click File > Save As and name our new file: balls_wrap

Here are the sixteen lines of code we left off with:

What we want to do is animate.... we've got the making of the with our for loop. Think way back to the first time we animated a single ball. We used the ENTER_FRAME event listener to run the moveBall function over and over again:

var speed:Number = 2;
addEventListener(Event.ENTER_FRAME,moveBall);
function moveBall(event:Event){
ball1.y += speed;
}

This time, we need to repeat the contents of our for loop: