i am making fruit collection game in as3,total four fruits i selected that must fall from backstage and at a ground there is bucket who will collect the fruits,but problem is how to run for 60 Seconds,that process.i am using random function for x and y axis , for one time its working,but how to do for 60 seconds.i am using Enter Frame Event.what to update in my coding for 60 seconds. Please help meeeee
import flash.events.Event;
var speed=5;
stage.addEventListener(Event.ENTER_FRAME,randomlistener);
rect.x = 0 + Math.random() * 250;
rect2.x = 1 + Math.random() * 150;
rect3.x = 2 + Math.random() * 100;
rect4.x = 3 + Math.random() * 75;
function randomlistener(evt:Event):void{
rect.y +=5;
rect.rotationX +=speed;
rect2.y +=11;
rect2.rotationY +=speed;
rect3.y +=7;
rect3.rotation +=speed;
rect4.y +=3;
rect4.rotation +=speed;
}
import flash.events.Event;
var speed=5;
stage.addEventListener(Event.ENTER_FRAME,randomlistener);
rect.x = 0 + Math.random() * 250;
rect2.x = 1 + Math.random() * 150;
rect3.x = 2 + Math.random() * 100;
rect4.x = 3 + Math.random() * 75;
function randomlistener(evt:Event):void{
rect.y +=5;
rect.rotationX +=speed;
rect2.y +=11;
rect2.rotationY +=speed;
rect3.y +=7;
rect3.rotation +=speed;
rect4.y +=3;
rect4.rotation +=speed;
}