I ve done simple dripping effect, but I need those drops to have some delay between their droping, lets say 2 sec..
Heres the code:
Actionscript Code:
var nDrop:uint = 1;
var dripping:Drop = new Drop();
function init(){
setD();
}
function setD():void{
addChild(dripping);
dripping.ySpeed = 35 + Math.random() * 5;
dripping.cacheAsBitmap = true;
addEventListener(Event.ENTER_FRAME, drip, false, 0, true);
}
function drip(event:Event):void {
for (var i = 0; i < nDrop; i++) {
dripping.y += dripping.ySpeed;
if (dripping.y > 500 + Math.random() * 450) {
dripping.x = Math.random() * 790;
dripping.y = Math.random() * -1000;// Here, I ve moved startingY point to way off stage
//to simulate delay..
}
}
}
init();
I cant get it right..help..
Thnx