Hey,
I have a code here that drops a first row then drops a second row down right after. First row drops right away and second row is on a timer.
// Bring in first row
var blueY:Tween = new Tween(blue, "y", Bounce.easeOut, -295, -49, 2, true);
var pinkertonY:Tween = new Tween(pinkerton, "y", Bounce.easeOut, -295, -49, 2, true);
var oddsEndsY:Tween = new Tween(oddsEnds, "y", Bounce.easeOut, -283, -37, 2, true);
var raditudeY:Tween = new Tween(raditude, "y", Bounce.easeOut, -283, -37, 2, true);
// Create and start second row timer
var coverDropTimer:Timer = new Timer(500, 1);
coverDropTimer.addEventListener(TimerEvent.TIMER, dropCovers);
coverDropTimer.start();
// Bring in second row on timer
var greenY:Tween;
var maladroitY:Tween;
var makeBelieveY:Tween;
var redY:Tween;
function dropCovers(e:TimerEvent):void{
greenY = new Tween(green, "y", Bounce.easeOut, -460, -40, 2.5, true);
maladroitY = new Tween(maladroit, "y", Bounce.easeOut, -460, -40, 2.5, true);
makeBelieveY = new Tween(makeBelieve, "y", Bounce.easeOut, -457, -37, 2.5, true);
redY = new Tween(red, "y", Bounce.easeOut, -457, -37, 2.5, true);
coverDropTimer.removeEventListener(TimerEvent.TIMER, dropCovers);
}
How would I drop each cover individually at random between two set numbers? I assume I would have to apply a separate timer for each one then somehow make the time at which it drops random between two numbers?
Not sure how to go about doing that though.
Thanks, Wade