In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

boon

/**
 * Copyright ketatony ( http://wonderfl.net/user/ketatony )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/5tCt
 */

package
{
	import flash.display.Sprite;
	import flash.display.BitmapData;
	import flash.display.Bitmap;
	import flash.text.*;
	import flash.events.Event;
	import flash.filters.BlurFilter;
	import flash.geom.*;
	
	[SWF(width="465", height="465", frameRatee="60", backgroundColor="0x0")]
	
	public class Boon extends Sprite
	{
		private var txt:TextField;
		private var canvas:BitmapData;
		private var base:Sprite;
	
		public function Boon()
		{
			txt = new TextField();
			var fmt:TextFormat = new TextFormat("MS Gothic",20);
			fmt.color = 0x3366ff;
			fmt.bold = true;
			txt.defaultTextFormat = fmt;
			txt.text = "⊂二二二二二( ^ω^)二二⊃";
			txt.autoSize = TextFieldAutoSize.LEFT;
			
			base = new Sprite();
			base.addChild( txt );
			
			canvas = new BitmapData( 465, 465, true, 0xff000000);
			addChild( new Bitmap( canvas ));
			
			stage.addEventListener( Event.ENTER_FRAME, enterFrameHandler );
		}
		
		private function enterFrameHandler( evt:Event ):void
		{
			canvas.lock();
			canvas.applyFilter( canvas, canvas.rect, new Point(), new BlurFilter(2,2,3));
			canvas.colorTransform( canvas.rect, new ColorTransform(1,1,1,1,-2,-1,-1,0));
			canvas.draw( base, null, null, "add" );
			txt.x +=  ((stage.mouseX-txt.width/2) - txt.x)/10;
			txt.y +=  ((stage.mouseY-txt.height/2) - txt.y)/10;
			canvas.unlock();
		}
	}
}