| 首页 | 新闻 | 网页 | 设计 | 色彩 | 原创 | 视觉 | 素材 | 动漫 | 酷站 | 策划 | 文案 | 访谈 | 运营 | 编程 | 数据库 | 服务器 | 下载 | 图库 | 
您的位置: 幽幽天空 > 网页 > 网页制作 > Flash教程 > ActionScript教程 > 文章正文 用户登录
没有相关文章

纯AS的运动模糊效果           

纯AS的运动模糊效果

作者:flashman… 来源:闪吧bbs 更新:2007-3-13 19:03:49 错误报告 我要投稿
import flash.filters.*;
var blur:BlurFilter = new BlurFilter(blurX, blurY, 1);
var num = 10;
for (var i = 0; i<num; i++) {
 scale = random(300);
 alpha = random(10000/scale)+30;
 var temp_mc = _root.createEmptyMovieClip("ball"+i, this.getNextHighestDepth());
 temp_mc.createTextField("my_txt", 1, 0, 0, 300, 100);
 temp_mc.my_txt.multiline = true;
 temp_mc.my_txt.wordWrap = true;
 temp_mc.my_txt.text = "WWW.3C800.COM";
 var my_fmt:TextFormat = new TextFormat();
 my_fmt.color = 0xFF6600;
 my_fmt.size = 20;
 my_fmt.font = "BM bug";
 temp_mc.my_txt.setTextFormat(my_fmt);
 with (temp_mc) {
  _x = random(Stage.width);
  _y = random(Stage.height);
  _xscale = scale;
  _yscale = scale;
  _alpha = alpha;
 }
 temp_mc.onEnterFrame = function() {
  Yspeed = (Stage.height/2-_ymouse)/this._yscale*12;
  Xspeed = (Stage.width/2-_xmouse)/this._xscale*12;
  blur.blurX = Math.abs(Xspeed);
  blur.blurY = Math.abs(Yspeed);
  this.filters = [blur];
  this._y += Yspeed;
  if (this._y>Stage.height) {
   this._y = 0;
  }
  if (this._y<0) {
   this._y = Stage.height;
  }
  this._x += Xspeed;
  if (this._x>Stage.width) {
   this._x = 0;
  }
  if (this._x<0) {
   this._x = Stage.width;
  }
 };
}
  
文章录入:skyuu    责任编辑:skyuu 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
    姓名:  评 分: 1分 2分 3分 4分 5分
     
  • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
  • 用户需对自己在使用幽幽天空服务过程中的行为承担法律责任。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表机友个人观点,与本网站立场无关。