Packagenet.flashpunk.graphics
Classpublic class Anim
InheritanceAnim Inheritance Object

Template used by Spritemap to define animations. Don't create these yourself, instead you can fetch them with Spritemap's add().



Public Properties
 PropertyDefined By
  frameCount : uint
[read-only] Amount of frames in the animation.
Anim
  frameRate : Number
[read-only] Animation speed.
Anim
  frames : Array
[read-only] Array of frame indices to animate.
Anim
  loop : Boolean
[read-only] If the animation loops.
Anim
  name : String
[read-only] Name of the animation.
Anim
Public Methods
 MethodDefined By
  
Anim(name:String, frames:Array, frameRate:Number = 0, loop:Boolean = true)
Constructor.
Anim
  
play(reset:Boolean = false):void
Plays the animation.
Anim
Property Detail
frameCountproperty
frameCount:uint  [read-only]

Amount of frames in the animation.


Implementation
    public function get frameCount():uint
frameRateproperty 
frameRate:Number  [read-only]

Animation speed.


Implementation
    public function get frameRate():Number
framesproperty 
frames:Array  [read-only]

Array of frame indices to animate.


Implementation
    public function get frames():Array
loopproperty 
loop:Boolean  [read-only]

If the animation loops.


Implementation
    public function get loop():Boolean
nameproperty 
name:String  [read-only]

Name of the animation.


Implementation
    public function get name():String
Constructor Detail
Anim()Constructor
public function Anim(name:String, frames:Array, frameRate:Number = 0, loop:Boolean = true)

Constructor.

Parameters
name:String — Animation name.
 
frames:Array — Array of frame indices to animate.
 
frameRate:Number (default = 0) — Animation speed.
 
loop:Boolean (default = true) — If the animation should loop.
Method Detail
play()method
public function play(reset:Boolean = false):void

Plays the animation.

Parameters

reset:Boolean (default = false) — If the animation should force-restart if it is already playing.