A wave effect animation of Flash as realization

Source: Internet
Author: User
The main use of masks and begingradientfill to achieve, the machine requirements are relatively high, the machine is not a good friend of the point of caution ...

Click to view Flash:
http://www.alixixi.com/UploadPic/2007-7/200778135930565.swf

The main code is as follows: var wavearray:array = new Array ();
var rel_btn:movieclip = this.loader.btn;
This.createemptymovieclip ("GRADIENT_MC", 3);
Gradient_mc.cacheasbitmap = true;
Mc.cacheasbitmap = true;
OnMouseDown = function () {
New Wave (Wavearray);
};
Onenterframe = Draw;
function Draw () {
With (GRADIENT_MC) {
Clear ();
Spreadmethod = "pad";
Interpolati;
Filltype = "Radial";
colors = [0x00ffff, 0xFFFFFF, 0X00FFFF];
var wal:number = wavearray.length;
for (var i:number = 0; i<wal; i++) {
Alphas = [0, wavearray.a, 0];
var t:number = wavearray.r-10;
ratios = [T>0 t:0, WAVEARRAY.R, wavearray.r+10];
Focalpointratio = 0;
Matrix = {matrixtype: "box", x:wavearray.x-550, y:wavearray.y-400, w:550*2, h:400*2, R:180*math.pi};
Begingradientfill (Filltype, colors, alphas, ratios, Matrix, Spreadmethod, Interpolationmethod, Focalpointratio);
MoveTo (0, 0);
LineTo (0, 400);
LineTo (550, 400);
LineTo (550, 0);
LineTo (0, 0);
Endfill ();
}
}
Mc.setmask (GRADIENT_MC);
The code in}WAVE.AS is as follows:///////////////////////////////////////////http://www.25swf.com
Code by 25SWF
Tinsgao@126.com
2006.11.23
////////////////////////////////////////////////////////////////////
Import Flash.geom.Point;
Class Wave {
field/////////////////////////
private var m_alpha:number = 100;
private var m_ratio:number = 0;
private Var M_point:point;
private Var Rel_array:array;
private Var M_iner:number;
attribute////////////////////
function Get A () {
return m_alpha;
}
function Get R () {
return m_ratio;
}
function Get X () {
return m_point.x;
}
function Get Y () {
return M_POINT.Y;
}
/////////////////////////////////////////////////////////
function Wave (_array:array) {
This.rel_array = _array;
_array.push (this);
M_point = new Point (_root._xmouse, _root._ymouse);
This.m_iner = setinterval (function (_rel) {
_rel.m_alpha--;
_rel.m_ratio+=2;
if (_rel.m_alpha<=1) {
_rel. Del ();
Clearinterval (_rel.m_iner);
}
}, this);
}
function Del () {
For (Var A in Rel_array) {
if (rel_array[a] = = this) {
Rel_array.splice (A, 1);
}
}
Delete this;
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.