Toggle navigation
Sign Up
Log In
Explore
Works
Folders
Tools
Collections
Artists
Groups
Groups
Topics
Tasks
Tasks
Jobs
Teams
Jobs
Recommendation
More Effects...
ActionScript
package { import flash.display.Sprite; import flash.display.Bitmap; import flash.display.BitmapData; import flash.events.Event; import flash.filters.BlurFilter; import flash.geom.ColorTransform; import flash.geom.Point; [SWF(width="465", height="465", backgroundColor=0x000000, frameRate="60")] public class Main extends Sprite { public function Main():void { with(graphics) { beginFill(0) drawRect(0,0,465,465); endFill(); } _bitmap = new Bitmap( new BitmapData(465, 465, true, 0) ); addChild( _bitmap ); _bitmapData = _bitmap.bitmapData; addEventListener( Event.ENTER_FRAME, _enterFrameHandler ); } private function _enterFrameHandler(e:Event):void { _create(); _bitmapData.lock(); _bitmapData.colorTransform( _bitmapData.rect, new ColorTransform(1, 1, 1, 0.95)); _bitmapData.applyFilter( _bitmapData,_bitmapData.rect,new Point(), new BlurFilter(5,5,3) ); var len:int = _dots.length; for ( var i:int = len-1; i >=0 ; i--) { var dot:MyPoint = _dots[i] as MyPoint; _bitmapData.setPixel32( dot.x, dot.y, dot.color); dot.x += dot.xv; dot.y += dot.yv; dot.xv *= 0.95; dot.yv += 0.1; if ( dot.y < 145 ) { dot.xv = Math.random() * 16 -8; dot.yv = Math.random() * 5; } if ( dot.y > 465 ) _dots.splice(i, 1); } _bitmapData.unlock(); } private function _create():void { for ( var i:int = 0; i < _loop; i++ ) { _dots.push( new MyPoint() ); } } private var _loop:int = 30; private var _dots:/*MyPoint*/Array = []; private var _bitmapData:BitmapData; private var _bitmap:Bitmap; } } internal class MyPoint { public function MyPoint() { xv = Math.random() * 3 - 1.5; yv = (Math.random() * -20)-20; x = Math.random()*5 + 226; y = 485; } public var color:uint = 0xFFEEEFFF; public var xv:Number; public var yv:Number; public var x:Number; public var y:Number; }
Join Effecthub.com
Working with Global Gaming Artists and Developers!
Login
Sign Up
Or Login with Your Email Address:
Email
Password
Remember
Or Sign Up with Your Email Address:
Your Email
This field must contain a valid email
Set Password
Password should be at least 1 character
Stay informed via email