Name | Type | Attributes | Description |
---|---|---|---|
options |
MovieClipOptions | number |
<optional> |
The options object |
Extends
Members
The default framerate if none is specified or there's not parent clip with a framerate.
- Default Value:
- 24
The MovieClip will advance independently of its parent, even if its parent is paused. This is the default mode.
- Default Value:
- 0
The MovieClip will only display a single frame (as determined by the startPosition property).
- Default Value:
- 1
The MovieClip will be advanced only when its parent advances and will be synched to the position of the parent MovieClip.
- Default Value:
- 2
Short cut for addAction
If true, actions in this MovieClip's tweens will be run when the playhead advances.
Shortcut alias for addTimedMask
Alias for method addTimedChild
If true, the MovieClip will automatically be reset to its first frame whenever the timeline adds
it back onto the display list. This only applies to MovieClip instances with mode=INDEPENDENT.
For example, if you had a character animation with a 'body' child MovieClip instance
with different costumes on each frame, you could set body.autoReset = false, so that
you can manually change the frame it is on, without worrying that it will be reset
automatically.
The current frame of the movieclip.
Returns the name of the label on or immediately before the current frame.
When the MovieClip is framerate independent, this is the time elapsed from frame 0 in seconds.
By default MovieClip instances advance one frame per tick. Specifying a framerate for the MovieClip will cause it to advance based on elapsed time between ticks as appropriate to maintain the target framerate.
For example, if a MovieClip with a framerate of 10 is placed on a Stage being updated at 40fps, then the MovieClip advance roughly one frame every 4 ticks. This will not be exact, because the time between each tick vary slightly between frames.
This feature is dependent on the tick event object (or an object with an appropriate 'delta' property) being passed into {{#crossLink 'Stage/update'}}{{/crossLink}}.
Fast way of checking if a movie clip is actually a movie clip. Prevents circular references and is faster than instanceof.
- Default Value:
- true
Returns an array of objects with label and position (aka frame) properties, sorted by position.
Returns a dictionary of labels where key is the label and value is the frame.
Indicates whether this MovieClip should loop when it reaches the end of its timeline.
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.
Get the close parent with a valid framerate. If no parent, returns the default framerate.
If true, the MovieClip's position will not advance when ticked.
Short cut for playSound
If true, this movieclip will animate automatically whenever it is on the stage.
Specifies what the first frame to play in this movieclip, or the only frame to display if mode is SINGLE_FRAME.
Get the total number of frames (duration) of this MovieClip
Shortcut alias for addTween
Array of frame scripts, indexed by frame.
Array to depth sort timed children
By default MovieClip instances advance one frame per tick. Specifying a framerate for the MovieClip will cause it to advance based on elapsed time between ticks as appropriate to maintain the target framerate.
_timelines Timeline[] protected
Standard tween timelines for all objects. Each element in the _timelines array is a Timeline object - an array of tweens for one target, in order of occurrence.
Methods
Handle frame actions, callback is bound to the instance of the MovieClip.
Name | Type | Description |
---|---|---|
callback |
FrameAction |
The clip call on a certain frame |
startFrame |
number | string |
The starting frame index or label |
Returns:
Type | Description |
---|---|
this |
Add a tween to the clip
Name | Type | Description |
---|---|---|
instance |
AnimateDisplayObject |
The clip to tween |
properties |
KeyframeData |
The property or property to tween |
startFrame |
number |
The frame to start tweening |
Returns:
Type | Description |
---|---|
this |
Add a child to show for a certain number of frames before automatic removal.
Name | Type | Attributes | Description |
---|---|---|---|
instance |
AnimateDisplayObject |
The clip to show |
|
startFrame |
number |
The starting frame |
|
duration |
number |
<optional> |
The number of frames to display the child before removing it. |
keyframes |
string | { [frame: number]: KeyframeData } |
<optional> |
The collection of static keyframes to add |
Returns:
Type | Description |
---|---|
this |
Add mask or masks
Name | Type | Description |
---|---|---|
instance |
AnimateDisplayObject | |
keyframes |
{ [frame: number]: Graphics | Sprite } |
Returns:
Type | Description |
---|---|
this |
Add a tween to the clip
Name | Type | Attributes | Description |
---|---|---|---|
instance |
AnimateDisplayObject |
The clip to tween |
|
properties |
TweenProps |
The property or property to tween |
|
startFrame |
number |
The frame to start tweening |
|
duration |
number |
<optional> |
Number of frames to tween. If 0, then the properties are set with no tweening. |
ease |
EaseMethod |
<optional> |
An optional easing function that takes the tween time from 0-1. |
Returns:
Type | Description |
---|---|
this |
Advances the playhead. This occurs automatically each tick by default.
Name | Type | Attributes | Description |
---|---|---|---|
time |
number |
<optional> |
The amount of time in seconds to advance by. Only applicable if framerate is set. |
Advances this movie clip to the specified position or label and sets paused to false.
Name | Type | Description |
---|---|---|
positionOrLabel |
string | number |
The animation name or frame number to go to. |
Advances this movie clip to the specified position or label and sets paused to true.
Name | Type | Description |
---|---|---|
positionOrLabel |
string | number |
The animation or frame name to go to. |
Sets paused to false.
Handle sounds.
Name | Type | Attributes | Description |
---|---|---|---|
alias |
string |
The name of the Sound |
|
loop |
boolean |
<optional> |
The loop property of the sound |
Returns:
Type | Description |
---|---|
this |
Sets paused to true.
Name | Type | Description |
---|---|---|
positionOrLabel |
string | number |
The animation name or frame number to go to. |
Set the timeline position
Name | Type | Description |
---|---|---|
startFrame |
number | |
currentFrame |
number | |
doActions |
boolean |
Inherited Properties
From class AnimateContainer
Shortcut for setAlpha
.
ac inherited
Shortcut for addChild
.
Shortcut for setColor
.
colorTransformFilter ColorMatrixFilter inherited
The current default color transforming filters
Shortcut for setTint
.
ma inherited
Shortcut for setMask
.
re inherited
Shortcut for setRenderable
.
Shortcut for setTransform
.
Inherited Methods
From class AnimateContainer
setAlpha (alpha) this inherited
Chainable setter for alpha
Name | Type | Description |
---|---|---|
alpha |
number |
The alpha amount to use, from 0 to 1 |
Returns:
Type | Description |
---|---|
this | Instance for chaining |
setColorTransform (r, rA, g, gA, b, bA) this inherited
Set additive and multiply color, tinting
Name | Type | Description |
---|---|---|
r |
number |
The multiply red value |
rA |
number |
The additive red value |
g |
number |
The multiply green value |
gA |
number |
The additive green value |
b |
number |
The multiply blue value |
bA |
number |
The additive blue value |
Returns:
Type | Description |
---|---|
this | Object for chaining |
setMask (mask) this inherited
Setter for mask to be able to chain.
Name | Type | Description |
---|---|---|
mask |
Graphics | Sprite |
The mask shape to use |
Returns:
Type | Description |
---|---|
this | Instance for chaining |
setRenderable (renderable) this inherited
Function to set if this is renderable or not. Useful for setting masks.
Name | Type | Attributes | Description |
---|---|---|---|
renderable |
boolean |
<optional> |
Make renderable. Defaults to false. |
Returns:
Type | Description |
---|---|
this | This instance, for chaining. |
setTint (tint) this inherited
Set the tint values by color.
Name | Type | Description |
---|---|---|
tint |
string | number |
The color value to tint |
Returns:
Type | Description |
---|---|
this | Object for chaining |