九 05
闲来无事,发个as效果
需要 Flash Player 10
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | package org.mousebomb.effectlab.flyParticle { import flash.display.GradientType; import flash.display.BlendMode; import flash.display.Shape; import flash.display.Sprite; import flash.events.Event; [SWF(width = 900, height = 600, frameRate = 50)] /** * @author Mousebomb * @date 2009-9-4 */ public class Main extends Sprite { private var scont : Sprite = new Sprite(); public function Main() { scont.x = 450; scont.y = 300; addChild(scont); scont.rotationY = 90; for(var i : int = 0 ;i < 48; i++) { var s : Shape = new Shape(); s.graphics.beginFill((0xcc0000 + (i % 16) * 0x10000),.6); //s.graphics.drawCircle(Math.floor(i / 3) * 15, i, 25); s.graphics.drawRect(Math.floor(i / 3) * 15 - 25, i - 25, 50,50); s.graphics.endFill(); scont.addChild(s); } addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event : Event) : void { for(var i : int = 0 ;i < 48;i++) { var s : Shape = scont.getChildAt(i) as Shape; s.rotation += (i / 6) * .7; } scont.rotation+=.7; scont.rotationY += .3; } } } |
flash地址
虽然电闪雷鸣之类的更逼真更常用,但我自己玩的时候还是比较喜欢这样抽象的效果。
万事万物的道理都在这个旋转的flash里体现了。

九月 13th, 2009 at 09:13
效果挺好
[回复]
九月 14th, 2009 at 18:11
NB,佩服得不得了!!
[回复]
九月 18th, 2009 at 13:06
真厉害。。看得我头晕
[回复]
九月 22nd, 2009 at 15:18
很少读闪客高手的博客,以后要常来。哈
[回复]
十月 9th, 2009 at 08:46
像魔术牌。
[回复]
十一月 4th, 2009 at 16:01
hi 我是AS3初学者,蜗牛的同学
关于这段代码有些问题请教下:
[回复]
十一月 4th, 2009 20:03
[回复]