|
楼主 |
发表于 2010-12-17 00:23
|
显示全部楼层
代码1复制下面
=====================================
var TotalSnows = 3000;
//------------------------------
var ArrSnows:Array = new Array();
var mcDraw:MovieClip = this.createEmptyMovieClip("mcDraw", 0);
var Index = 0;
var Counter = 0;
mcSnow._visible = false;
//==============================
onEnterFrame = function () {
for (var i = 0; i<4; i++) {
Index++;
duplicateMovieClip("mcSnow", "mcSnow"+Index, Index);
}
for (var i = 0; i<ArrSnows.length; i++) {
var Snow:MovieClip = ArrSnows[i];
if (mcShap.hitTest(Snow._x+this._x, Snow._y+this._y, true)) {
DrawLine(Snow._x, Snow._y, Snow._width/3);
//DrawRound(Snow._x, Snow._y, Snow._width/3);
Snow.removeMovieClip();
Counter++;
}
}
if (Counter>=TotalSnows) {
Reset();
} else if (Counter>=TotalSnows-100) {
mcDraw._visible = true;
mcDraw._alpha -= 2;
} else if (Counter>=TotalSnows-200) {
mcDraw._visible = (Counter & 20)<15;
}
ArrSnows.length = 0;
};
mcShap.onRelease = function() {
Counter = TotalSnows-200;
};
function DrawLine(X, Y, r) {
mcDraw.lineStyle(2*r, 0xFFFFFF, 90);
mcDraw.moveTo(X-r/2, Y);
mcDraw.lineTo(X+r/2, Y);
}
function DrawRound(X, Y, r) {
mcDraw.beginFill(0xFFFFFF);
mcDraw.moveTo(X, Y-r);
mcDraw.curveTo(X+r, Y-r, X+r, Y);
mcDraw.curveTo(X+r, Y+r, X, Y+r);
mcDraw.curveTo(X-r, Y+r, X-r, Y);
mcDraw.curveTo(X-r, Y-r, X, Y-r);
mcDraw.endFill();
}
function Reset() {
mcDraw.clear();
mcDraw._visible = true;
mcDraw._alpha = 100;
Index = 0;
Counter = 0;
}
============================================
复制等号线上面的部分 |
|