Hi,
How can I remove the Water Fall to stop flowing (It is keep on flowing continuously)? The following is the code.
//WaterFall Code:
import com.flashandmath.dg.display.*;
var waterfall:Waterfall;
init();
function init():void {
/*
We create a waterfall display of width 200 and height 300 (those are the
dimensions of the display area, not necessarily the water itself).
The third parameter "true" means that the waterfall will have a transparent
background. This allows you to place graphics behind the waterfall if you wish.
*/
waterfall = new Waterfall(150,235,true);
waterfall.x = 0;
waterfall.y = 422;
stage.addChild(waterfall);
//WaterFall_mc.addChild(waterfall);
waterfall.startFlow();
//Since the Waterfall class extends Sprite, it is interactive and can listen for mouse clicks.
waterfall.addEventListener(MouseEvent.CLICK, toggleFlow);
}
function toggleFlow (evt:MouseEvent):void {
if (waterfall.flowOn) {
waterfall.stopFlow();
}
else {
waterfall.startFlow();
waterfall.noSplashes = false;
waterfall.dropsToAddEachFrame = 8;
waterfall.targetColor = 0x33B2FF;
waterfall.waterTopWidth = 72;
waterfall.leftMargin = 2;
waterfall.minAngle = Math.PI/12;
waterfall.maxAngle = Math.PI/3;
waterfall.minMagnitude = 0.7;
waterfall.maxMagnitude = 1.3;
waterfall.fadeAmount = -1;
waterfall.display.minGray = 0.9;
}
}
Thanks.