主要使用了遮罩和beginGradientFill来实现,对机器要求比较高,机器不是很好的朋友慎狂点...
点击查看Flash:
[url=/Files/BeyondPic/2006-11/25/wave.swf]
[color="#800080"]/Files/BeyondPic/2006-11/25/wave.swf[/color]
[/url]
主要代码如下:
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; i0 ? 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);
}wave.as 中的代码如下:
///////////////////////////////////////////http://www.25swf.com
//////code by 25swf
//////
[email protected]
//////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
本文转自:http://www.5uflash.com/flashjiaocheng/Flashaschengxu/627.html