Package | ardisia.components.animatedImage |
Class | public class AnimatedImage |
Inheritance | AnimatedImage ![]() |
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.
Property | Defined 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 |
Method | Defined 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 |
Method | Defined By | ||
---|---|---|---|
displayCurrentFrame():void
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 |
currentFrame | property |
currentFrame:int
[read-only] The currently displayed frame.
The default value is 0
.
public function get currentFrame():int
framesLastRow | property |
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
.
public function get framesLastRow():Number
public function set framesLastRow(value:Number):void
framesPerRow | property |
framesPerRow:Number
The total number of frames per row in the spritesheet.
Must be at least 1.
The default value is 1
.
public function get framesPerRow():Number
public function set framesPerRow(value:Number):void
framesPerSecond | property |
framesPerSecond:int
The number of frames to display per second.
The default value is 3
.
public function get framesPerSecond():int
public function set framesPerSecond(value:int):void
isPlaying | property |
isPlaying:Boolean
[read-only] True if the animation is playing.
The default value is false
.
public function get isPlaying():Boolean
rows | property |
rows:Number
The number of rows of frames in the spritesheet.
The default value is 1
.
public function get rows():Number
public function set rows(value:Number):void
source | property |
source:Object
[write-only] [override] Set the spritesheet bitmapdata here.
public function set source(value:Object):void
AnimatedImage | () | Constructor |
public function AnimatedImage()
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)
|