Hi,
I have three balls. What do I do?
They should look like they are being juggled when animated, but
I'm not indexing them correctly. Please help.
Thanks
Edit
Maybe I should just use an array. getChildAt sort of works, but it's not looping though perfectly. It moves one or two balls, not one by one...
//JUGGLING ANIMATION WITH 3 BALLS
var myTimer:Timer = new Timer(444);
myTimer.addEventListener(TimerEvent.TIMER,someFunction);
myTimer.start();
function someFunction(event:TimerEvent) {
var T:Number =0;
//WHERE I'M SETTING IT WRONG
T++;
T %= 3;
var dr:*;
dr = getChildAt(numChildren - 1);
for(var i:int; i <T; i++){
setChildIndex(dr,i);
trace(i);
}
}
Output
The output traces zero, and the animation looks like it moves either 1 or 2 balls at once, rather than looping through each.