Blur

Package:
Class:
Inheritance:
biz.flashscript.filters
public class Blur
N/A
The Blur class allows blurring of an object and its reversal back to the original state. To trigger that use the constructor new Blur() and add parameters as desired. All parameters are required.
Public Methods
Method Defined By
Blur(bx:uint, by:uint, target:Object, myStatic:Boolean) Blur
Constructor Detail
Blur ()  Constructor
public function Blur(bx:uint, by:uint, target:Object, myStatic:Boolean)
Intializes a new Blur instance with the specified parameters.

Parameters

  • bx:uint ____ Specifies x direction blurring.
  • by:uint ____ Specifies the y direction blurring.
  • target:Object ____ The blur target.
  • myStatic:Boolean ____ If true the target will be remembered and blurring can be changed, for example reversed (see Example).
Examples
Create a new fla file and name it BlurExample.fla. Place the fla in the same folder as the biz folder. Add a MovieClip on the stage and name it myClip. Also place a component button on the timeline and name it startBut. Then create an Actionscript file, name it BlurExample.as and place this script.
package 
{
	import flash.display.Sprite;
	import flash.utils.Timer;
	import flash.events.TimerEvent;
	import flash.events.Event;
	import biz.flashscript.filters.Blur;
	import biz.flashscript.tweens.ApplyTweensTimer;
	import fl.controls.Button;
	import flash.events.MouseEvent;

	public class BlurExample extends Sprite
	{
		public var startBut:Button;
		private var myBlur:Blur;
		private var count01:int = 0;
		private var myTimer:Timer;
		private var startPosition:int;
		
		public function BlurExample ():void
		{
			startPosition = myClip.x;
			startBut.label = "START";
			startBut.addEventListener(MouseEvent.CLICK, startAnimation);
		}
		private function startAnimation (event:MouseEvent):void
		{
			myTimer = new Timer(100,1000);
			myTimer.start ();
			myTimer.addEventListener (TimerEvent.TIMER,blurHandler);
			var at:ApplyTweensTimer = new ApplyTweensTimer(myClip,75,"xMove",10,1000);
			at.xPosition = 400;
			at.easeIn = true;
			at.initTweens ();
			at.addEventListener (ApplyTweensTimer.CALL_BACK, callHandler);
		}
		private function blurHandler (ev:TimerEvent)
		{
			if (myClip.x < 300)
			{
				count01++;
			}
			else if (myClip.x >= 300)
			{
				count01--;
			}
			myBlur = new Blur(count01,count01,myClip,true);
		}
		private function callHandler (event:Event):void
		{
			myBlur = new Blur(0,0,myClip,false);
			myTimer.removeEventListener (TimerEvent.TIMER,blurHandler);
			count01 = 0;
			myClip.x = startPosition;
		}
	}
}