首页
设计理论
网页设计
平面设计
计算机疑难杂症
FLASH教程
最新病毒报告
幸运28算号
网站地图
文章搜索:
打开支付宝首页搜索“510617664”,即可领红包
首页-->
计算机
-->
FLASH教程
燃烧的火:纯代码火焰效果
http://www.xxqqss.com 学习轻松网 点击量:15276
希望需要的朋友拿去用,顺便也希望拿走代码的朋友能顶起来,不要只拿代码不回帖,到时候有人需要了就找不到了。好东西大家要分享嘛,不要让它沉下去...
顺便也给我,写代码的人一点动力
/*--------------------------------------------------------------
支持原创 ANT制作
--------------------------------------------------------------*/
/*--------------------------背景-------------------------------*/
var mcs:MovieClip = createEmptyMovieClip("query", -1);
with (mcs) {
beginFill(0x000000,100);
lineStyle(0,0x000000,0);
moveTo(0,0);
lineTo(Stage.width,0);
lineTo(Stage.width,Stage.height);
lineTo(0,Stage.height);
lineTo(0,0);
endFill();
}
/*--------------------------制作影片剪辑实例-------------------------------*/
import flash.geom.*;
var McR:Number = 40;
var McA:Number = 60;
var CreaMovie:MovieClip = this.createEmptyMovieClip("CreaMc", 0);
with (CreaMovie) {
fillType = "radial";
colors = [0xFFFF00, 0xFFFF00];
alphas = [McA, 0];
ratios = [0, 0xFF];
matrix = new Matrix();
matrix.createGradientBox(McR,McR,0,0,0);
beginGradientFill(fillType,colors,alphas,ratios,matrix);
moveTo(0,0);
lineTo(0,McR);
lineTo(McR,McR);
lineTo(McR,0);
lineTo(0,0);
endFill();
}
CreaMovie._visible = false;
/*--------------------------火效果-------------------------------*/
var McNum:Number = 1;
var McMore:Number = 200;
var McRandom:Number = 6;
var McY:Number = 4;
var Mc_x:Number = Stage.width/2;
var Mc_y:Number = Stage.height/2+Stage.height/4;
var Mc_more:Number = 100;
var Mc_scal:Number = 50;
flame = function(){;
var scale:Number=random(Mc_scal)+1;
var flames:MovieClip=CreaMovie.duplicateMovieClip("flames"+McNum,McNum,{_x:Mc_x,_y:Mc_y,_alpha:Mc_more/2,_xscale:scale,_yscale:scale});
flames.blendMode = "add";
flames.fast=Math.floor(scale/10);
flames.action=(random(2)==1)?1:-1;
flames.scal=10-flames.fast;
flames.n=flames.s=1;
flames._r = flames._g = 255;
flames._b =0;
flames.gs=(10-flames.scal+2)*3;
flames.onEnterFrame=function(){
this._x+=this.fast*this.action*this.n*this.s;
this._y-=McY;
this._xscale+=this.scal*this.n*this.s;
this._yscale+=this.scal*this.n*this.s;
this._alpha+=10*this.n*this.s;
this._g-=this.gs;
if(this._g<=0){
this._g=0;
}
new Color(this).setRGB(this._r << 16 | this._g << 8 | this._b);
if(this._xscale>=Mc_more){;
this.n=-1;
this.s=0.2;
};
if(this._alpha>=Mc_more){;
this._alpha=Mc_more;
}else if(this._alpha<=random(20)){;
this.removeMovieClip();
delete this.onEnterFrame();
};
};
if(McNum>=McMore){;
McNum=0;
};
McNum++;
};
setInterval(flame,10);
看看效果:
/UploadTeach/200710/2007101012615942.swf
来源:闪吧 作者:lvan
【
打印
】 【
关闭
】
免责声明 :本站刊载此文不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。对本文有任何异议,请发送
fiyeadwyv@163.com
最热门点击排行
版权所有 2006-2021:学习轻松网 Copyright
http://www.xxqqss.com
All rights reserved
浙ICP备14013707号-1
广告联系电话: 13958357030 联系QQ:9792414
工具条下载