Scale

Package:
Class:
Inheritance:
biz.flashscript.tweens
public class Scale
Sprite
The Scale class scales objects up or down. Use the constructor new Scale().
Public Properties
Property Defined By
All inherited properties of the Sprite class.
Public Methods
Method Defined By
Scale()
Creates a new instance of the Scale class.
Scale
scaleUp(holder:Object, x_scale:Number, y_scale:Number, z_scale:Number, finaleScale_x:Number=1, finaleScale_y:Number=1, finaleScale_z:Number=1):void
Function scales object up.
Scale
scaleDown(holder:Object, x_scale:Number, y_scale:Number, z_scale:Number, finaleScale_x:Number=1, finaleScale_y:Number=1, finaleScale_z:Number=1):void
Function scales object down.
Scale
Events
Event Defined By

scaledComplete

Dispatched, when the final size is reached.

Scale
Constructor Detail
Scale ()  Constructor
public function Scale()
Intializes a new Scale instance.
Method Detail

scaleUp()  method
public function scaleUp(holder:Object, x_scale:Number, y_scale:Number, z_scale:Number, finaleScale_x:Number=1, finaleScale_y:Number=1, finaleScale_z:Number=1):void

Function scales object up.

Parameters

  • holder:Object ____ Specifies the object to scale.
  • x_scale:Number ____ Specifies the scale in x-Axis.
  • y_scale:Number ____ Specifies the scale in y-Axis.
  • z_scale:Number ____ Specifies the scale in z-Axis.
  • finaleScale_x:Number=1 ____ Optional: specifies the final x scale size. Default is 1.
  • finaleScale_y:Number=1 ____ Optional: specifies the final y scale size. Default is 1.
  • finaleScale_z:Number=1 ____ Optional: specifies the final z scale size. Default is 1.

scaleDown()  method
public function scaleUp(holder:Object, x_scale:Number, y_scale:Number, z_scale:Number, finaleScale_x:Number=1, finaleScale_y:Number=1, finaleScale_z:Number=1):void

Function scales object down.

Parameters

  • holder:Object ____ Specifies the object to scale.
  • x_scale:Number ____ Specifies the scale in x-Axis.
  • y_scale:Number ____ Specifies the scale in y-Axis.
  • z_scale:Number ____ Specifies the scale in z-Axis.
  • finaleScale_x:Number=1 ____ Optional: specifies the final x scale size. Default is 1.
  • finaleScale_y:Number=1 ____ Optional: specifies the final y scale size. Default is 1.
  • finaleScale_z:Number=1 ____ Optional: specifies the final z scale size. Default is 1.
Event Detail

scaledComplete event

Event Object Type: biz.flashscript.tweens.Scale
Event.type property = biz.flashscript.tweens.Scale.SCALED_COMPLETE

Description here....

Examples
Create a new fla file and name it ScaleExample.fla. Create two MovieClips and place one instance of each on the timeline. Name the small one sql and the large one c1. Place the fla in the same folder as the biz folder. Then create an Actionscript file, name it ScaleExample.as and place this script.
package 
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import biz.flashscript.tweens.Scale;
	import flash.events.Event;
	import flash.display.MovieClip;

	public class ScaleExample extends Sprite
	{
		public var c1:MovieClip;
		public var sq1:MovieClip;
		
		public function ScaleExample ():void
		{
			stage.addEventListener(MouseEvent.CLICK, chHandler);
		}
		private function chHandler(event:MouseEvent):void
		{
			stage.removeEventListener(MouseEvent.CLICK, chHandler);
			var zz:Scale = new Scale();
			zz.scaleUp (sq1,0.1,0.1,0.1,0.5,0.5);
			zz.scaleDown (c1,0.1,0.1,0.1,0.1,0.5,0.1);
			zz.addEventListener(Scale.SCALED_COMPLETE, compHandler);
		}
		private function compHandler(event:Event):void
		{
			trace("Scale complete");
		}
	}
}