MirrorImageAnim

Package:
Class:
Inheritance:
biz.flashscript.animation
public class MirrorImageAnim
Sprite
The MirrorImageAnim class is used to create realistic reflection images of objects. When used in conjunction with dragging objects the mirror image will move with the objects. The difference to the MirrorImage class is that animated objects can be reflected and the animation will be reflected in this case. To create an instance of the MirrorImageAnim use the constructor new MirrorImageAnim() to create an instance of the class and add parameters as desired.

See also

   biz.flashscript.animation.MirrorImage

Public Properties
Property Defined By
skewA : Number
Changing this property value will change the width of the mirror image.
MirrorImageAnim
skewB : Number
Changing this property value will change the rotation of the mirror image.
MirrorImageAnim
skewC : Number
Changing this property value will change the x position and when negative or positive the skew direction of the mirror image.
MirrorImageAnim
skewD : Number
Changing this property value will change the y position of the mirror image.
MirrorImageAnim
Public Methods
Method Defined By
MirrorImageAnim()
Creates a new instance of the MirrorImageAnim class.
MirrorImageAnim
setBitmap(origClip:MovieClip, _alpha:Number=1, distance:int=0, blurX:int=5, blurY:int=5, haveMask:MovieClip=null):void  method
Will initiate the creation of a mirror image reflection of an object (must be MovieClip).
MirrorImageAnim
Events
Event Defined By
All inherited events for the Sprite class. N/A
Property Detail
skewA property
skewA:Number [read-write]

Changing this property value will change the width of the mirror image.

The default value is 1.

Implementation

public function get skewA():Number
public function set skewA(value:Number):void
skewB property
skewB:Number [read-write]

Changing this property value will change the rotation of the mirror image.

The default value is 0.

Implementation

public function get skewB():Number
public function set skewB(value:Number):void
skewC property
skewC:Number [read-write]

Changing this property value will change the x position and when negative or positive the skew direction of the mirror image.

The default value is -0.3.

Implementation

public function get skewC():Number
public function set skewC(value:Number):void
skewD property
skewD:Number [read-write]

Changing this property value will change the y position of the mirror image.

The default value is -1.

Implementation

public function get skewD():Number
public function set skewD(value:Number):void
Constructor Detail
MirrorImageAnim ()  Constructor
public function MirrorImageAnim()
Intializes a new MirrorImageAnim instance.
Method Detail

setBitmap()  method
public function setBitmap(origClip:MovieClip, _alpha:Number=1, distance:int=0, blurX:int=5, blurY:int=5, haveMask:MovieClip=null):void

This method will initiate the mirror image methods.

Parameters

  • origClip:MovieClip ____ Specifies the MovieClip to create a mirror image from.
  • _alpha:Number=1 ____ Allows to reduce the alpha value further.
  • distance:int=0 ____ Specifies the distance of the mirror image from the MovieClip .
  • blurX:int=5 ____ Specifies the amount of x blurring.
  • blurY:int=5 ____ Specifies the amount of y blurring.
  • haveMask:MovieClip=null ____ Specifies whether the mirror image should be on a separate MovieClip using a mask.
Examples
Create a new fla file and name it MirrorImageAnimExample.fla. Place the fla in the same folder as the biz folder. Create an animated MovieClip and place it on the timeline. Give the name mc. Then create an Actionscript file, name it MirrorImageAnimExample.as and place this script.
package 
{
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import biz.flashscript.animation.MirrorImageAnim;

	public class MirrorImageAnimExample extends Sprite
	{
		private var mi:MirrorImageAnim;
		public var mc:MovieClip;
		public function MirrorImageAnimExample ():void
		{
			mi = new MirrorImageAnim();
			addChild (mi);
			mi.setBitmap (mc,1,-2);
			mc.buttonMode = true;
			mc.addEventListener (MouseEvent.MOUSE_DOWN,mo);
			addEventListener (MouseEvent.MOUSE_UP,mu);
		}
		private function mo (e:MouseEvent):void
		{
			e.currentTarget.startDrag ();
		}
		private function mu (e:MouseEvent):void
		{
			stopDrag ();
		}
	}
}