Blur Documentation

Author: Alex Uhlmann
Last Modified: 09/23/05 19:43:25


Summary

Blur class:

- description

Blur Properties:

- movieclip
- duration
- easing
- callback

Blur Methods:

- alphaIn
- put
- alphaOut
- remove
- applyFunc
- animationStyle
- stop
- pause
- resume
- lock
- unlock
- isTweening
- getStartValue
- getEndValue
- getCurrentValue
- getDurationElapsed
- getDurationRemaining
- addEventListener
- removeEventListener
- removeAllEventListeners
- eventListenerExists
- getID
- toString


Blur class

version: Documentation not provided.

description:

Creates, removes and manipulates movieclip instances inside a container movieclip to simulate a blur effect.

There are two ways to use this class. One way is to specify the duration, easing equation and callback properties outside the current method, either with setting the properies directly or with the animationStyle() method like it is used in de.alex_uhlmann.animationpackage.drawing.

Example 1:

			var myBlur:Blur = new Blur(mc.inner_mc);
			myBlur.animationStyle(3000,Sine.easeIn,"onCallback");
			myBlur.alphaIn();
			myBlur.put(10,1,2,2);
			
Example 2: The alternative way is shorter.
	
			var myBlur:Blur = new Blur(mc.inner_mc);
			myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
			myBlur.put(10,1,2,2);
			
Example 3: (Example .swf) Blur in, blur out loop. Use animationStyle() to define default animation properties. Later, modify animation properties directly, to customize animation.
			var myBlur:Blur = new Blur(mc.inner_mc);
			myBlur.animationStyle(3000,Sine.easeIn,"onCallback");
			myBlur.alphaIn();
			myBlur.put(10,1,2,0);
			myListener.onCallback = function()
			{
				myBlur.callback = "onCallback2";
				myBlur.alphaOut();
			}
			myListener.onCallback2 = function()
			{		
				myBlur.callback = "onCallback";	
				myBlur.alphaIn();	
				myBlur.put(10,1,2,0);
			}
			

usage:

var myBlur:Blur = new Blur(inner_mc);

parameters:


Blur Properties:

movieclip

(MovieClip) Movieclip to animate. Movieclip should have a parent clip.

duration

(Number) Duration of animation in milliseconds or frames. Default is milliseconds.

easing

(Object) Easing equation in Robert Penner style. Default equation is Linear.easeNone. www.robertpenner.com/easing/

callback

(String) Function to invoke after animation. See AnimationCore class.


Blur Methods:

alphaIn

description: Fade in blur. Works in combination with put method.

Example 1: Put a blur gradually with animation. Note: The alphaIn method has to be above the put method.

			
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
				myBlur.put(10,1,2,2);
				
Example 2: Define animation properties outside of method.
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.animationStyle(3000,Sine.easeIn,"onCallback");
				myBlur.alphaIn();
				myBlur.put(10,1,2,2);
				

usage:

myBlur.alphaIn();
myBlur.alphaIn(duration);
myBlur.alphaIn(duration, callback);
myBlur.alphaIn(duration, easing, callback);

parameters:

returns: void

put

description: Creates the blur.

Example 1: Put a blur instantly.

				var myBlur:Blur = new Blur(mc.inner_mc);				
				myBlur.put(10,1,2,2);
				
Example 2: Put a blur gradually with animation. Note: The alphaIn method has to be placed above the put method.
			
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
				myBlur.put(10,1,2,2);
				

usage:

myBlur.put(strength);
myBlur.put(strength, posFactor, scaleFactor, rotFactor);

parameters:

returns: void

alphaOut

description: Fade out blur.

Example 1: Fade out a blur gradually with Default animation style properties. Note: The alphaOut method has to be placed below the put method.

			
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.put(10,1,0);
				myBlur.alphaOut();
				
Example 2: Do the same just with customized animation style properties.
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.put(10,1,0);
				myBlur.alphaOut(3000,Sine.easeIn,"onCallback");
				

usage:

myBlur.alphaOut();
myBlur.alphaOut(duration);
myBlur.alphaOut(duration, callback);
myBlur.alphaOut(duration, easing, callback);

parameters:

returns: void

remove

description: Removes blur instances. Note: alphaOut method removes blur instances automatically.

Example 1: (Example .swf) Remove a blur after fade in animation instantly.

			
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
				myBlur.put(10,1,2,2);
				myListener.onCallback = function()
				{	
					myBlur.remove();				
				}
				
Example 2: To delete blur instances of a movieclip directly, specify the movieclip as a parameter. Do the same like above to illustrate this.
				var myBlur:Blur = new Blur(mc.inner_mc);
				var myOtherBlur:Blur = new Blur();
				myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
				myBlur.put(10,1,2,2);
				delete myBlur;
				myListener.onCallback = function()
				{	
					myOtherBlur.remove(mc);
				}
				

usage:

myBlur.remove();
myBlur.remove(mc);

parameters:

returns: MovieClip that contained the blur instances.

applyFunc

description: Invoke a specified method of a class with parameters that effects all blur instances. The class needs to have a movieclip property, which applyFunc will use to set the Blur movieclip instance. If the last paremeter is a String it is treated as a callback and therefore send only to one Blur movieclip. Therefore I recommend using the functions of AnimationPackage that are compatible to these limitations. Furthermore, you cannot use pause(), stop() and resume() methods on animations created by myBlur.applyFunc().

Example 1: (Example .swf) colors blur movieclips slightly red after fading in.

			
				var myBlur:Blur = new Blur(mc.inner_mc);
				myBlur.alphaIn(3000,Sine.easeIn,"onCallback");
				myBlur.put(10,1,2,0);
				myListener.onCallback = function()
				{	
					myBlur.applyFunc(new ColorTransform(), "run", [0xff0000, 100, 4000, Quad.easeOut]);
				}
				

usage:

myBlur.applyFunc(scope, funcStr);
myBlur.applyFunc(scope, funcStr, param);

parameters:

returns: void

animationStyle

description: set the animation style properties for your animation. Notice that if your easing equation supports additional parameters you can send those parameters with the easing parameter in animationStyle. You have to send an Array as easing parameter. The first element has to be the easing equation in Robert Penner style. The following parameters can be your additional parameters. i.e.:

				var myRotation:Rotation = new Rotation(mc);
				myRotation.animationStyle(2000,[Back.easeOut,4]);
				myRotation.run(360);
				
See also "Customizable easing equations" in readme for more information.

usage:

myInstance.animationStyle(duration);
myInstance.animationStyle(duration, callback);
myInstance.animationStyle(duration, easing, callback);

parameters:

returns: Void.

stop

description: stops the animation if not locked..

usage: myInstance.stop();

returns: true if instance was successfully stopped. false if instance could not be stopped, because it was locked.

pause

description: pauses the animation if not locked. Call resume() to continue animation.

usage: myInstance.pause();

parameters:

returns: true if instance was successfully paused. false if instance could not be paused, because it was locked.

resume

description: continues the animation if not locked.

usage: myInstance.resume();

returns: true if instance was successfully resumed. false if instance could not be resumed, because it was locked.

lock

description: locks the animation to prevent pausing, resuming and stopping. Default is unlocked.

usage: myInstance.lock();

returns: Void.

unlock

description: unlocks the animation to allow pausing, resuming and stopping. Default is unlocked.

usage: myInstance.unlock();

returns: Void.

isTweening

description: checks if the instance is currently animated.

usage: myInstance.isTweening();

returns: true if instance is tweening, false if instance is not tweening.

getStartValue

description: returns the original, starting value of the current tween. Percentage.

usage: myInstance.getStartValue();

returns: Number

getEndValue

description: returns the targeted value of the current tween. Percentage.

usage: myInstance.getEndValue();

returns: Number

getCurrentValue

description: returns the current value of the current tween. Percentage.

usage: myInstance.getCurrentValue();

returns: Number

getDurationElapsed

description: returns the elapsed time or frames since the current tween started tweening.

usage: myInstance.getDurationElapsed();

returns: Number

getDurationRemaining

description: returns the remaining time or frames since the current tween started tweening.

usage: myInstance.getDurationRemaining();

returns: Number

addEventListener

description: Subscribe to a predefined event. The following standard EventDispatcher events are broadcasted

onStart, broadcasted when animation starts.
onEnd, broadcasted when animation ends.

The even object returned, contains the following properties:

type (String) event broadcasted.
target (Object) event source.

usage:

myBlur.addEventListener(event, listener);
myBlur.addEventListener(event, listener, handler);

parameters:

returns: Void.

removeEventListener

description: Removes a listener from a subscribed event.

usage:

myBlur.removeEventListener(event, listener);
myBlur.removeEventListener(event, listener, handler);

parameters:

returns: Void.

removeAllEventListeners

description: GDispatcher specific feature. Removes all listeners for a specific event, or for all events.

usage:

myBlur.removeAllEventListeners();
myBlur.removeAllEventListeners(event);

parameters:

returns: Void.

eventListenerExists

description: GDispatcher specific feature. Checks if a listener is already subscribed to a certain event.

usage:

myBlur.eventListenerExists(event, listener);
myBlur.eventListenerExists(event, listener, handler);

parameters:

returns: true if event exists on listener. false if event doesn't exist on listener.

getID

description: returns a unique ID of the instance. Usefull for associative arrays.

usage: myInstance.getID();

returns: Number

toString

description: returns the name of the class.

usage: myInstance.toString();

returns: String




generated with AS2docGenerator beta 0.5.3