Test test ShipNK forked:0favorite:2lines:50license : MIT License modified : 2011-07-26 00:08:27 Embed Tweet package { import flash.display.Shape; import flash.display.Sprite; import flash.events.Event import flash.events.MouseEvent; public class FlashTest extends Sprite { private var i:int; public var shape:Shape = new Shape; public var arr:Array = new Array; public function FlashTest() { stage.addEventListener( Event.ENTER_FRAME, process ); stage.addEventListener( MouseEvent.CLICK, clickEvent ); } public function clickEvent ( e:MouseEvent ) :void { for( i = 0; i < 100; ++ i ) { shape = new Shape(); shape.graphics.beginFill( int( Math.random() * Math.pow( 16, 6 ) ) ); shape.graphics.drawCircle( 0, 0, Math.random() * 5 ); addChild( shape ); shape.x = mouseX + Math.random() * 401 - 200; shape.y = mouseY + Math.random() * 401 - 200; arr.push( shape ); } } public function process ( e:Event ) :void { shape = new Shape(); shape.graphics.beginFill( int( Math.random() * Math.pow( 16, 6 ) ) ); shape.graphics.drawCircle( 0, 0, Math.random() * 30 ); addChild( shape ); shape.x = mouseX + Math.random() * 71 - 35; shape.y = mouseY + Math.random() * 71 - 35; arr.push( shape ); // for( i = arr.length -1; i > -1; -- i ) { shape = arr[ i ] as Shape; shape.x -= (mouseX - 275) / 30; shape.y -= (mouseY - 200) / 30; shape.alpha *= 0.9; if( shape.alpha < 0.05 ) { removeChild( shape ); arr.splice( i, 1 ); } } } } } Code Fullscreen Preview Fullscreen sabisin hidrodixtion.. : coolmousetrail cool mouse test trail mouseY mouseX alpha Math.pow removeChild addEventListener splice push MouseEvent.CLICK MouseEvent.ENTER_FRAME addChild MouseEvent Math.random length Array Sprite int