Hi guys,
I’m more than after just a rain effect, basically how can I addChild from the library onto a stage, scatter hundered of it acrros the screen, then tween each of these instances.
in this case I’m trying to animate a rain sequence using AS3 without much progress in the last couple hours.
the logic I’m trying to follow is, generate 50 drop for example, scattered across the screen, and then animate each one using only code.
The mc is not on stage either.
this is my wrecked code so far!
if you can pls give me a hand if u got some spare time.
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
function startRaining() {
for (var i:int = 0; i<50; i++)
{
var drops:mcDrop = new mcDrop ();
drops.cacheAsBitmap = true;
drops.x = Math.random()*640;
drops.y = Math.random()*480;
addChild(drops);
animateDrops(drops);
}
}
function animateDrops(something)
{
var Xanim:Tween = new Tween (something,"x",None.easeIn,Math.random()*640,Math.random()*640,0.7,true);
Xanim.looping = true;
var Yanim:Tween = new Tween (something,"y",None.easeIn,Math.random()*480-100,480,0.7,true);
Yanim.looping=true;
}
startRaining();
thx