Hello guys
I’ve this code which is working fine…the issue is… I’ve got those “boxesFlying.boxesFlying” …about 70, so I know I’ve have to use array…? the second issue I’ve got is that the random is fine but those boxes act same random x and y so I’ve changed the delay time, but again if I will have to do about 70mc I will be sitting here all night…
Can you please help me…
var min:Number = -15;
var max:Number = 15;
var fiveToFive:Number = Math.round(Math.random()*(1+ max - min) + min);
var p49:Number = boxesFlying.boxesFlying49.x;
var p49Y:Number = boxesFlying.boxesFlying49.y;
var p40X:Number = boxesFlying.boxesFlying40.x;
var p40Y:Number = boxesFlying.boxesFlying40.y;
var boxesFlyingTweenSpace40:TimelineLite = new TimelineLite();
boxesFlyingTweenSpace40.insert(new TweenLite(boxesFlying.boxesFlying40,3,{x:p40X + fiveToFive,ease:Bounce.easeOut}));
boxesFlyingTweenSpace40.append(new TweenLite(boxesFlying.boxesFlying40,3,{y:p40Y + fiveToFive,ease:Bounce.easeOut}),-2.5);
boxesFlyingTweenSpace40.append(new TweenLite(boxesFlying.boxesFlying40,3,{x:p40X - fiveToFive,ease:Bounce.easeOut}),-2);
boxesFlyingTweenSpace40.append(new TweenLite(boxesFlying.boxesFlying40,3,{y:p40Y - fiveToFive,ease:Bounce.easeOut}),-2.5);
boxesFlyingTweenSpace40.append(new TweenLite(boxesFlying.boxesFlying40,3,{x:-59.30, y:-46}),-2);
var boxesFlyingTweenSpace:TimelineLite = new TimelineLite();
boxesFlyingTweenSpace.insert(new TweenLite(boxesFlying.boxesFlying49,2.5,{x:p49 + fiveToFive,ease:Bounce.easeOut}));
boxesFlyingTweenSpace.append(new TweenLite(boxesFlying.boxesFlying49,3,{y:p49Y + fiveToFive,ease:Bounce.easeOut}),-2.4);
boxesFlyingTweenSpace.append(new TweenLite(boxesFlying.boxesFlying49,3,{x:p49 - fiveToFive,ease:Bounce.easeOut}),-2);
boxesFlyingTweenSpace.append(new TweenLite(boxesFlying.boxesFlying49,3,{y:p49Y - fiveToFive,ease:Bounce.easeOut}),-2.9);
boxesFlyingTweenSpace.append(new TweenLite(boxesFlying.boxesFlying49,3,{x:51.50, y:-66}),-2);