Send a small tutorial to a triple friend who likes the waterfall effect.
AS3 Waterfall class: You can change your waterfall properties by manipulating simple parameters, or you can make your waterfall background transparent and placed on a background image of your choice. The waterfall class extends from the Sprite class. Therefore, Waterfall is an interactive display object that can be added to the stage. To create a waterfall, simply call the constructor with "new" as the keyword.
Example:
1, the download of the name of the COM source files extracted to a directory.
2, open Flash, create a FLA document, stored in the same directory of COM's class library.
3, select Layer 1 frame 1th, press F9 to open the Action panel, enter the code:
Import Class Library
Import com.flashandmath.dg.display.*;
Creates an instance and initializes the
var waterfall:waterfall = new Waterfall (200,300,false);
Coordinate positioning
waterfall.x = 100;
WATERFALL.Y = 30;
Add to display list
Stage.addchild (waterfall);
Waterfall.startflow ();
The above code creates a width of 200 heights of 300 waterfalls (these are only the dimensions of the display area, not the size of the water itself). If the third argument is set to "true", the waterfall will have a background transparency, allowing you to replace the background behind the waterfall, and if the transparency parameter is set to "false", the waterfall will have a black background.
If you want to modify the width and height of the waterfall, open the waterfall.as file under Comflashandmathdgdisplay to modify it.