EaselJS

EaselJS  0.4.1

EaselJS > EaselJS > MovieClip
Search:
 
Filters

Class MovieClip - extends Container

The MovieClip class associates a TweenJS Timeline with an EaselJS Container. It allows you to create objects which encapsulate timeline animations, state changes, and synched actions. Due to the complexities inherent in correctly setting up a MovieClip, it is largely intended for tool output and is not included in the main EaselJS library.

Currently MovieClip only works properly if it is tick based (as opposed to time based) though some concessions have been made to support time based timelines in the future.

Constructor

MovieClip ( mode , startPosition , loop , labels )
Parameters:
mode <String> Initial value for the mode property. One of MovieClip.INDEPENDENT, MovieClip.SINGLE_FRAME, or MovieClip.SYNCHED.
startPosition <Number> Initial value for the startPosition property.
loop <Boolean> Initial value for the loop property.
labels <Object> A hash of labels to pass to the timeline instance associated with this MovieClip.

Properties

INDEPENDENT - static String

Read-only. The MovieClip will advance independently of its parent, even if its parent is paused. This is the default mode.
Default Value: "independent"

loop - Boolean

Indicates whether this MovieClip should loop when it reaches the end of its timeline.
Default Value: true

mode - String

Controls how this MovieClip advances its time. Must be one of 0 (INDEPENDENT), 1 (SINGLE_FRAME), or 2 (SYNCHED). See each constant for a description of the behaviour.
Default Value: null

paused - Boolean

If true, the MovieClip's position will not advance when ticked.

SINGLE_FRAME - static String

Read-only. The MovieClip will only display a single frame (as determined by the startPosition property).
Default Value: "single"

startPosition - Number

Specifies what the first frame to play in this movieclip, or the only frame to display if mode is SINGLE_FRAME.
Default Value: 0

SYNCHED - static String

Read-only. The MovieClip will be advanced only when it's parent advances and will be synched to the position of the parent MovieClip.
Default Value: "synched"

timeline - Timeline

The TweenJS Timeline that is associated with this MovieClip. This is created automatically when the MovieClip instance is initialized.

Methods

clone

void clone ( )
MovieClip instances cannot be cloned.
Returns: void

draw

void draw ( ctx , ignoreCache )
Draws the display object into the specified context ignoring it's visible, alpha, shadow, and transform. Returns true if the draw was handled (useful for overriding functionality). NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Parameters:
ctx <CanvasRenderingContext2D> The canvas 2D context object to draw into.
ignoreCache <Boolean> Indicates whether the draw operation should ignore any current cache. For example, used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).
Returns: void

gotoAndPlay

void gotoAndPlay ( positionOrLabel )
Advances this movie clip to the specified position or label and sets paused to false.
Parameters:
positionOrLabel <object>
Returns: void

gotoAndStop

void gotoAndStop ( positionOrLabel )
Advances this movie clip to the specified position or label and sets paused to true.
Parameters:
positionOrLabel <object>
Returns: void

initialize

protected void initialize ( )
Initialization method called by the constructor.
Returns: void

isVisible

Boolean isVisible ( )
Returns true or false indicating whether the display object would be visible if drawn to a canvas. This does not account for whether it would be visible within the boundaries of the stage. NOTE: This method is mainly for internal use, though it may be useful for advanced uses.
Returns: Boolean
Boolean indicating whether the display object would be visible if drawn to a canvas

play

void play ( )
Sets paused to false.
Returns: void

stop

void stop ( )
Sets paused to true.
Returns: void

toString

String toString ( )
Returns a string representation of this object.
Returns: String
a string representation of the instance.