public function animate(disp:DisplayObject, props:Object, durationMillis:int = 400, endCallback:Function = null, easeFunc:Function = null):DisplayProperties
Animates a DisplayObject according to supplied properties.
If the supplied display object is a plugin, the properties can contain relative values and percentage values.
A relative value specifies a new position relative
to the plugin's current position. For example:
animations.animate("content", { top: "+20px", left: "-20%", width: 90 });
Here we animate the content plugin so that the top position is increased by 20 pixels, left position is decreased by 20%,
and the width is set to 90 pixels. Following display properties can be animated with relative and absolute, pixel based
and percentage values:
- left
- right
- top
- bottom
- width
- height
The opacity
property only supports absolute numeric values.
All changes made to the plugin's display propertites are stored into the PluginRegistry
Parameters
| disp:DisplayObject — the name of the plugin to animate, the plugin is looked up from the PluginRegistry using this name
|
|
| props:Object — an object containing display properties
|
|
| durationMillis:int (default = 400 ) — the duration it takes for the animation to complete
|
|
| endCallback:Function (default = null ) — a function to be called when the animation is complete
|
|
| easeFunc:Function (default = null )
|
Returns
See also
public function animateProperty(view:DisplayObject, propertyName:String, target:Number, durationMillis:int = 500, callback:Function = null, easeFunc:Function = null):void
Animates a single DisplayObject property.
Parameters
| view:DisplayObject — the display object to animate
|
|
| propertyName:String — the property to animate
|
|
| target:Number — property target value
|
|
| durationMillis:int (default = 500 )
|
|
| callback:Function (default = null )
|
|
| easeFunc:Function (default = null )
|
public function cancel(view:DisplayObject, currentAnimation:Animation = null):void
Cancels all animations that are currently running for the specified view. The callbacks specified in animation calls
are not invoked for canceled animations.
Parameters
| view:DisplayObject — if specified all other animations except the specified one will be canceled
|
|
| currentAnimation:Animation (default = null )
|
public function fadeIn(view:DisplayObject, durationMillis:Number = 500, callback:Function = null, updatePanel:Boolean = true):Animation
Fades in a DisplayObject.
Parameters
| view:DisplayObject |
|
| durationMillis:Number (default = 500 )
|
|
| callback:Function (default = null )
|
|
| updatePanel:Boolean (default = true )
|
Returns
public function fadeOut(view:DisplayObject, durationMillis:Number = 500, callback:Function = null, updatePanel:Boolean = true):Animation
Fades out a DisplayObject.
Parameters
| view:DisplayObject |
|
| durationMillis:Number (default = 500 )
|
|
| callback:Function (default = null )
|
|
| updatePanel:Boolean (default = true )
|
Returns
public function fadeTo(view:DisplayObject, alpha:Number, durationMillis:Number = 500, callback:Function = null, updatePanel:Boolean = true):Animation
Fades a DisplayObject to a specified alpha value.
Parameters
| view:DisplayObject |
|
| alpha:Number |
|
| durationMillis:Number (default = 500 )
|
|
| callback:Function (default = null )
|
|
| updatePanel:Boolean (default = true )
|
Returns