SheetMovieClip

A display object that plays an animation by using a image sheet.

new SheetMovieClip(data, frameWidth, fps, shouldLoop, shouldHide)

Parameters:
Name Type Description
data Image A Image object of a image sheet
frameWidth Number A width for each frames
fps Number A FPS for the animation
shouldLoop Boolean If true the animation will be looped
shouldHide Boolean If true it will be hidden while the animation stops

Methods

addEventListener(type, callback)

Registers an event listener object to EventDispatcher object so that the listener receives the notification.

Parameters:
Name Type Description
type String The type of event.
callback Function The listener function.

dispatchEvent(Event)

Dispatches an event to the event flow.

Parameters:
Name Type Description
Event arc.Event object

getAlign() → {String}

Returns the align

Returns:
String A string of the align

getAlignX() → {Number}

Returns a horizontal position from the origin.

Returns:
Number A horizontal position from the origin

getAlignY() → {Number}

Returns a vartical position from the origin.

Returns:
Number A vartical position from the origin

getAlpha() → {Number}

Gets the alpha.

Returns:
Number An alpha

getHeight() → {Number}

Returns the height.

Returns:
Number A height

getParent() → {DisplayObject}

Returns the parent of this display object.

Returns:
DisplayObject The parent

getRotation() → {Number}

Returns the rotation.

Returns:
Number A rotation in degree

getScaleX() → {Number}

Returns the horizontal scale.

Returns:
Number A horizontal scale

getScaleY() → {Number}

Returns the vartical scale.

Returns:
Number A vartical scale

getStage()

Returns a Stage object.

getVisible() → {Boolean}

Returns the visibility.

Returns:
Boolean A visibility

getWidth() → {Number}

Returns the width.

Returns:
Number A width

getX() → {Number}

Returns the horizontal position.

Returns:
Number A horizontal position

getY() → {Number}

Returns the vartical position.

Returns:
Number A vartical position

globalToLocal(x, y) → {Array}

Converts global positions to local positions.

Parameters:
Name Type Description
x Number A global horizontal position
y Number A global vartical position
Returns:
Array An array that includes local positions of x and y in [x, y].

gotoAndPlay(index)

Plays the animation from the specified frame.

Parameters:
Name Type Description
index int A frame which the animation starts from

gotoAndStop(index)

Stops at the specified frame.

Parameters:
Name Type Description
index int A frame which the animation stops at

localToGlobal(x, y) → {Array}

Converts local positions to global positions.

Parameters:
Name Type Description
x Number A local horizontal position
y Number A local vartical position
Returns:
Array An array that includes global positions of x and y in [x, y].

play(shouldLoop)

Plays the animation.

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

removeEventListener(type, callback)

Removes a listener from the EventDispatcher object.

Parameters:
Name Type Description
type String The type of event.
callback Function The listener function.

setAlign(align)

Sets the align of the Image object.

Parameters:
Name Type Description
align String

setAlpha(An)

Sets an alpha.

Parameters:
Name Type Description
An Number alpha

setHeight(height)

Sets a height.

Parameters:
Name Type Description
height Number A height

setRotation(A)

Sets a rotation.

Parameters:
Name Type Description
A Number rotation in degree

setScaleY(scaleX)

Sets a vartical scale.

Parameters:
Name Type Description
scaleX Number A vartical scale

setVisible(A)

Sets a visibility.

Parameters:
Name Type Description
A Boolean visibility

setX(x)

Sets a horizontal position.

Parameters:
Name Type Description
x Number A horizontal position

setY(y)

Sets a vartical position.

Parameters:
Name Type Description
y Number A vartical position

stop()

Stops the animation.