KeyFrameAnimation

A class that manages an key frame animation by specifying Timeline objects.

new KeyFrameAnimation(fps, totalFrame, timeLineArr)

Parameters:
Name Type Description
fps Number FPS
totalFrame int A number of total frames
timeLineArr Array An array of Timeline objects
  • Deprecated Prefered to use MovieClip
Example
 var keyFrame = new arc.anim.KeyFrameAnimation(12, 5, [
				new arc.anim.Timeline(this._yellowImg, {
					1 : {visible:true},
					3 : {visible:false}
				}),
				new arc.anim.Timeline(this._orangeImg, {
					1 : {visible:true},
					5 : {visible:false}
				}),
				new arc.anim.Timeline(this, {
					1 : {scaleX:0.5, scaleY:0.5, transition:arc.anim.Transition.SINE_OUT},
					5 : {scaleX:3, scaleY:3}
				})
			]);

Methods

addTimeline(timeline)

Adds Timeline object.

Parameters:
Name Type Description
timeline Timeline A Timeline object that is added

getCurrentFrame() → {int}

Returns the current frame index.

Returns:
int The current frame index

getTotalFrame() → {int}

Returns a number of total frames.

Returns:
int A number of total frames

gotoAndPlay(index, shouldLoop)

Plays the animation from the specified frame.

Parameters:
Name Type Description
index int A frame which the animation starts from
shouldLoop Boolean If true the animation will be looped

play(shouldLoop)

Plays the animation.

Parameters:
Name Type Description
shouldLoop Boolean If true the animation will be looped

stop()

Stops the animation.