MovieClip

A movie clip. Analog to the AS2 MovieClip class.

Properties:
Name Type Description
_alpha number

The opacity of this movie clip.

_currentframe number

The frame currently being displayed.

_height number

The height of this movie clip, in pixels.

_name string

The name of this movie clip.

onClick function

A callback to call when this movie clip is clicked.

onEnterFrame function

A callback to call every frame.

onMouseDown function

A callback to call when the mouse is pressed over this movie clip.

onMouseMove function

A callback to call when the mouse is moved over this movie clip.

onMouseUp function

A callback to call when the mouse is released over this movie clip.

onPress function

A callback to call when the mouse is pressed over this movie clip.

onRelease function

A callback to call when the mouse is released over this movie clip.

onRollOut function

A callback to call when the mouse is moved over this movie clip.

onRollOver function

A callback to call when the mouse is moved out of this movie clip.

_parent MovieClip

The movie clip that contains this one.

_root Object

The window object. Use root to get the top-level movie clip.

_rotation number

Rotation angle, in degrees clockwise.

_totalframes number

The number of frames in this movie clip.

_visible boolean

Whether this movie clip is visible.

_width number

The width of this movie clip, in pixels.

_x number

The x position, in pixels.

_xmouse number

The x position of the mouse relative to this movie clip.

_xscale number

Horizontal scale factor.

_y number

The y position, in pixels.

_ymouse number

The y position of the mouse relative to this movie clip.

_yscale number

Vertical scale factor.

Example
// Setup a button that opens a new window when clicked using a global "clickTag" variable
button.onRelease = function () {
    var url = _root.clickTag || "http://google.com";
    getURL(url);
});

Methods

gotoAndPlay(position)

Moves the playhead to a position and resumes the movie clip playback.

Parameters:
Name Type Description
position number | string

The position to move the playhead to. Can be either a frame number or frame label.

Example
// Go back to the first frame
gotoAndPlay(1);

gotoAndStop(position)

Moves the playhead to a position and stops the movie clip playback.

Parameters:
Name Type Description
position number | string

The position to move the playhead to. Can be either a frame number or frame label.

Example
// Go back to the first frame
gotoAndStop(1);

nextFrame()

Moves the playhead to the next frame and stops it.

play()

Resumes the movie clip playback, if it was currently stopped.

prevFrame()

Moves the playhead to the previous frame and stops it.

stop()

Stops the movie clip playback, if it was currently playing.