Packageardisia.components.animatedImage
Classpublic class AnimatedImage
InheritanceAnimatedImage Inheritance spark.primitives.BitmapImage

Animates a spritesheet at the requested frames per second. Is not locked to the stage frames per second. Supports the BitmapImage API. See http://en.wikipedia.org/wiki/Sprite_(computer_graphics) for information on sprite sheets.

Source can be of any type the BitmapImage class can accept.

Will play automatically when the source is set.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  currentFrame : int
[read-only] The currently displayed frame.
AnimatedImage
  framesLastRow : Number
The total number of frames present in the last row of the spritesheet.
AnimatedImage
  framesPerRow : Number
The total number of frames per row in the spritesheet.
AnimatedImage
  framesPerSecond : int
The number of frames to display per second.
AnimatedImage
  isPlaying : Boolean
[read-only] True if the animation is playing.
AnimatedImage
  rows : Number
The number of rows of frames in the spritesheet.
AnimatedImage
  source : Object
[override] [write-only] Set the spritesheet bitmapdata here.
AnimatedImage
Public Methods
 MethodDefined By
  
AnimatedImage
  
dispose():void
Call to remove the component from the display list, remove any event listeners and dispose of any BitmapData.
AnimatedImage
  
jumpToFrame(frame:int = -1):void
Jump to the passed frame.
AnimatedImage
  
play():void
Start the animation.
AnimatedImage
  
stop(endFrame:int = -1):void
Stop the animation.
AnimatedImage
Protected Methods
 MethodDefined By
  
Displays the current frame.
AnimatedImage
  
eventHandler(event:Event):void
Handles events on the component.
AnimatedImage
  
nextFrame():void
Displays the next frame in the animation.
AnimatedImage
Property Detail
currentFrameproperty
currentFrame:int  [read-only]

The currently displayed frame.

The default value is 0.


Implementation
    public function get currentFrame():int
framesLastRowproperty 
framesLastRow:Number

The total number of frames present in the last row of the spritesheet.

Must be at least 1.

The default value is 1.


Implementation
    public function get framesLastRow():Number
    public function set framesLastRow(value:Number):void
framesPerRowproperty 
framesPerRow:Number

The total number of frames per row in the spritesheet.

Must be at least 1.

The default value is 1.


Implementation
    public function get framesPerRow():Number
    public function set framesPerRow(value:Number):void
framesPerSecondproperty 
framesPerSecond:int

The number of frames to display per second.

The default value is 3.


Implementation
    public function get framesPerSecond():int
    public function set framesPerSecond(value:int):void
isPlayingproperty 
isPlaying:Boolean  [read-only]

True if the animation is playing.

The default value is false.


Implementation
    public function get isPlaying():Boolean
rowsproperty 
rows:Number

The number of rows of frames in the spritesheet.

The default value is 1.


Implementation
    public function get rows():Number
    public function set rows(value:Number):void
sourceproperty 
source:Object  [write-only] [override]

Set the spritesheet bitmapdata here.


Implementation
    public function set source(value:Object):void
Constructor Detail
AnimatedImage()Constructor
public function AnimatedImage()



Method Detail
displayCurrentFrame()method
protected function displayCurrentFrame():void

Displays the current frame.

dispose()method 
public function dispose():void

Call to remove the component from the display list, remove any event listeners and dispose of any BitmapData.

eventHandler()method 
protected function eventHandler(event:Event):void

Handles events on the component.

Parameters

event:Event — the Event that triggered the handler

jumpToFrame()method 
public function jumpToFrame(frame:int = -1):void

Jump to the passed frame.

Parameters

frame:int (default = -1) — jump to passed frame; 0 based counting (the first frame is frame number 0)

nextFrame()method 
protected function nextFrame():void

Displays the next frame in the animation.

play()method 
public function play():void

Start the animation. Will have no effect if no "source" has not been set.

stop()method 
public function stop(endFrame:int = -1):void

Stop the animation.

Parameters

endFrame:int (default = -1) — jump to a particular frame after stopping the animation; (the first frame is frame number 0)