80行代码打造flash奇幻光影

author: chenlangeer
msn: [email=chenlangeer@hotmail.com]chenlangeer@hotmail.com[/email]
 blog: cgs.flash8.net 
 
import flash.display.BitmapData;
import flash.filters.*;
import flash.geom.*;
_quality = "LOW";
_root.createTextField("logo", 10, 10, 10, 220, 18);
logo.html = true;
logo.htmlText = "Core Graph Studio    click to redraw";
_root.createTextField("para", 9, Stage.width-150, Stage.height-30, 150, 18);
para.html = true;
var bmp:BitmapData = new BitmapData(Stage.width, Stage.height, false, 0x0);
_root.attachBitmap(bmp, 0);
_root.createEmptyMovieClip("world", 2);
world.createEmptyMovieClip("_mc", 0);
world._mc._x = Stage.width/2;
world._mc._y = Stage.height/2;
var rad_speed:Number = 2;
var blurFilter:BlurFilter = new BlurFilter(2, 2, 1);
var f:Number = -.01;
var colorFilter:ColorMatrixFilter = new ColorMatrixFilter([.9, -.1, 0, 0, f, 0, .8, -.2, 0, f, .1, 0, .9, 0, f, 1, 0, 0, 1, 0]);
var total_nums:Number = 10;
onMouseDown = function () {
for (var i in world._mc) {
  world._mc[i].removeMovieClip();
}
var a = Math.random()*.2;
t = (Math.random()-.5)*a;
z = (Math.random()-.5)*a;
para.htmlText = "z="+Math.round(z*10000)/10000+"    t="+Math.round(t*10000)/10000+"";
rad_speed = (Math.random()-.5)*3.8;
line_bool = random(5);
swirl_bool = random(3);
rnd_xy_bool = random(4);
var i = 0;
for (k=0; k1) {
     this.moveTo(this.ox-this._x, this.oy-this._y);
     this.lineTo(this.__x-this._x, this.__y-this._y);
    } else if (line_bool == 1) {
     this.moveTo(this.ox, this.oy);
     this.lineTo(this.__x+this.lx, this.__y+this.ly);
    } else {
     this.moveTo(this.ox-this.lx, this.oy-this.ly);
     this.lineTo(this.__x-this.lx, this.__y-this.ly);
    }
    this.ox = this.__x;
    this.oy = this.__y;
   };
   i++;
  }
}
clearInterval(val);
val = setInterval(onMouseDown, 20000);
};
onEnterFrame = function () {
world._mc._rotation += rad_speed;
bmp.draw(world);
bmp.applyFilter(bmp, bmp.rectangle, new Point(0, 0), blurFilter);
bmp.applyFilter(bmp, bmp.rectangle, new Point(0, 0), colorFilter);
};
world._visible = false;
world._y = 100000;
onMouseDown();
附件: 奇幻光影.swf
本文转自:http://www.5uflash.com/flashjiaocheng/Flashaschengxu/662.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值