forked from: boon
/**
* Copyright hacker_ciaxk5up ( http://wonderfl.net/user/hacker_ciaxk5up )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/oEWU
*/
// forked from ketatony's boon
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();
}
}
}