Flash CS3 - Text With Blur Effect - (Move your mouse over the text !!)
Move your mouse over the text !!
stage.frameRate=30;
var dragFactor:Number=.15;
var newFormat:TextFormat = new TextFormat();
newFormat.size=20;
newFormat.bold=true;
newFormat.color=0xFF0000;
newFormat.align=TextFormatAlign.LEFT;
var MyTextField = new TextField();
MyTextField.text="AS3 ROCKS!!";
MyTextField.width=200;
MyTextField.selectable=false;
MyTextField.setTextFormat(newFormat);
addChild(MyTextField);
stage.addEventListener(Event.ENTER_FRAME,MOUSE_MOVE_Handler);
function MOUSE_MOVE_Handler(e:Event):void {
var xPos:Number=mouseX;
var yPos:Number=mouseY;
xPos=MyTextField.x;
xPos -= (xPos-mouseX) * this.dragFactor;
yPos=MyTextField.y;
yPos -= (yPos-mouseY) * this.dragFactor;
MyTextField.x=xPos;
MyTextField.y=yPos;
MyTextField.filters=[new BlurFilter(Math.abs(xPos-mouseX),Math.abs(yPos-mouseY),1)];
}
Comments
Work from home India