效果图如图所示:

 

Flash ActionScript (19)抽象的as3.0效果_第1张图片

代码: 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;}}}