您好!欢迎您光临本站! 体育 I 论坛 I 交友 I

会员注册

I

本站搜索

I

收藏本站

您好!欢迎您光临夏日动画网, Flash音画欣赏, 中国音画网!

当前位置:首页 >>>自编教程>>>as编辑火焰
as编辑火焰
发表日期:2012-10-13 22:41:00 出处:本站 作者:未知 发布人:夏日666 已被访问 552

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);

夏日编辑整理

双击自动滚屏 【打印本页】 【关闭窗口
 相关评论:

没有相关评论

 发表评论:

身份选择:会员 游客(游客不需要输入密码)
用 户 名: 密 码:
评论内容:
(最多评论字数:500)

夏日动画音画网, Flash音画欣赏, 中国音画网 | 设为首页 | 加入收藏 | 联系我们 | 进入管理 | 关于站长 | 本站搜索

联系电话:QQ:642850423 联系人:夏日