API Documentation for: 0.2.8
Show:

pixiflash.MovieClip Class

Extends PIXI.Container
Module: Pixi Flash

The class to emulate createjs.MovieClip, requires TweenJS

Methods

_addManagedChild

(
  • child
  • offset
)
private

Adds a child to the timeline, and sets it up as a managed child.

Parameters:

  • child MovieClip

    The child MovieClip to manage

  • offset Number

_goto

(
  • positionOrLabel
)
protected

Defined in _goto:481

Parameters:

  • positionOrLabel String | Number

    The animation name or frame number to go to.

_reset

() private

Defined in _reset:500

_setState

(
  • state
  • offset
)
protected

Defined in _setState:560

Parameters:

_tick

(
  • delta
)
protected

Defined in _tick:455

Parameters:

  • delta Number

    Time elapsed since the previous tick, in milliseconds. function.

_updateTimeline

() protected

Defined in _updateTimeline:510

advance

(
  • [time]
)

Defined in advance:415

Advances the playhead. This occurs automatically each tick by default.

Parameters:

  • [time] Number optional

    The amount of time in ms to advance by. Only applicable if framerate is set.

getCurrentLabel

() String deprecated

Defined in getCurrentLabel:300

Use the MovieClip/currentLabel:property property instead.

Returns:

getLabels

() Array deprecated

Defined in getLabels:290

Use the MovieClip/labels:property property instead.

Returns:

gotoAndPlay

(
  • positionOrLabel
)

Defined in gotoAndPlay:395

Advances this movie clip to the specified position or label and sets paused to false.

Parameters:

  • positionOrLabel String | Number

    The animation name or frame number to go to.

gotoAndStop

(
  • positionOrLabel
)

Defined in gotoAndStop:405

Advances this movie clip to the specified position or label and sets paused to true.

Parameters:

  • positionOrLabel String | Number

    The animation or frame name to go to.

play

()

Defined in play:379

Sets paused to false.

stop

()

Defined in stop:387

Sets paused to true.

Properties

_duration

Number private

Defined in _duration:191

When the MovieClip is framerate independent, this is the total time in seconds for the animation.

Default: 0

_framerate

Number

Defined in _framerate:181

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.

Default: 0

_managed

Object private

Defined in _managed:200

List of display objects that are actively being managed by the MovieClip.

_prevPos

Number private

Defined in _prevPos:155

Default: -1

_prevPosition

Number private

Defined in _prevPosition:163

Default: 0

_synchOffset

Number private

Defined in _synchOffset:147

Default: 0

_t

Number private

Defined in _t:171

Note - changed from default: When the MovieClip is framerate independent, this is the time elapsed from frame 0 in seconds.

Default: 0

actionsEnabled

Boolean

Defined in actionsEnabled:125

If true, actions in this MovieClip's tweens will be run when the playhead advances.

Default: true

autoReset

Boolean

Defined in autoReset:133

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.

Default: true

currentFrame

Number

Defined in currentFrame:82

The current frame of the movieclip.

Default: 0

currentLabel

String

Defined in currentLabel:319

Returns the name of the label on or immediately before the current frame. See TweenJS: Timeline.getCurrentLabel() for more information.

elapsedTime

Number public

Defined in elapsedTime:333

When the MovieClip is framerate independent, this is the time elapsed from frame 0 in seconds.

Default: 0

framerate

Number

Defined in framerate:349

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 will advance roughly one frame every 4 ticks. This will not be exact, because the time between each tick will vary slightly between frames.

This feature is dependent on the tick event object (or an object with an appropriate "delta" property) being passed into Stage/update.

Default: 0

INDEPENDENT

String static

Defined in INDEPENDENT:231

The MovieClip will advance independently of its parent, even if its parent is paused. This is the default mode.

Default: "independent"

labels

Array

Defined in labels:311

Returns an array of objects with label and position (aka frame) properties, sorted by position. Shortcut to TweenJS: Timeline.getLabels();

loop

Boolean

Defined in loop:74

Indicates whether this MovieClip should loop when it reaches the end of its timeline.

Default: true

mode

String

Defined in mode:57

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: null

paused

Boolean

Defined in paused:117

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

Default: false

SINGLE_FRAME

String static

Defined in SINGLE_FRAME:242

The MovieClip will only display a single frame (as determined by the startPosition property).

Default: "single"

startPosition

Number

Defined in startPosition:66

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

Default: 0

SYNCHED

String static

Defined in SYNCHED:252

The MovieClip will be advanced only when its parent advances and will be synched to the position of the parent MovieClip.

Default: "synched"

timeline

Timeline

Defined in timeline:91

The TweenJS Timeline that is associated with this MovieClip. This is created automatically when the MovieClip instance is initialized. Animations are created by adding TweenJS Tween instances to the timeline.

Example

 var tween = createjs.Tween.get(target).to({x:0}).to({x:100}, 30);
                     var mc = new createjs.MovieClip();
                     mc.timeline.addTween(tween);
                    

Elements can be added and removed from the timeline by toggling an "_off" property using the tweenInstance.to() method. Note that using Tween.set is not recommended to create MovieClip animations. The following example will toggle the target off on frame 0, and then back on for frame 1. You can use the "visible" property to achieve the same effect.

 var tween = createjs.Tween.get(target).to({_off:false})
                         .wait(1).to({_off:true})
                         .wait(1).to({_off:false});

Default: null