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 { //forked from http://wonderfl.net/c/sM3y/ import flash.display.Sprite; import flash.display.Bitmap; import flash.display.BitmapData; import flash.events.Event; import flash.filters.GlowFilter; import flash.filters.BlurFilter; import flash.display.BlendMode; import flash.geom.ColorTransform; [SWF(width = "900", height = "900", backgroundColor = "0x000000", frameRate = "30")] public class FlashTest extends Sprite { public var layer:Array = new Array(); public function FlashTest() { layer[0] = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x00000000)); layer[0].filters = [new BlurFilter(2,2,1)] layer[1] = new Sprite(); layer[1].filters = [new BlurFilter(2,2,1), new GlowFilter(0x4411ff, 1, 32, 32, 8, 3)] addChild(layer[0]); addChild(layer[1]); addEventListener(Event.ENTER_FRAME, loop); } public function loop(e:Event):void{ lightning(layer[1]); var cash:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x00000000); cash.draw(this, null, new ColorTransform(1,1,1,0.9), BlendMode.ADD); layer[0].bitmapData = cash; } public function lightning(tg:Sprite):void{ var xx:Number = mouseX; var yy:Number = mouseY; var th:Number = random(2) +1 tg.graphics.clear(); tg.graphics.moveTo(xx, yy); while(yy < stage.stageHeight){ xx += random(20) * (random(2)*2 -1); yy += random(30) + 4 ; tg.graphics.lineStyle(th,0xffffff,1); tg.graphics.lineTo(xx,yy); } } public function random(n:Number):Number{ return Math.floor(Math.random() * n); } } }
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