Object | +-MovieClip public dynamic class MovieClip extends Object
The methods for the MovieClip class provide the same functionality as actions that target movie clips. Some additional methods do not have equivalent actions in the Actions toolbox in the Actions panel.
You do not use a constructor method to create a new movie clip. You can choose from among three methods to create new movie clip instances:
To call the methods of the MovieClip class you reference movie clip instances by name, using the following syntax, where my_mc is a movie clip instance:
my_mc.play(); my_mc.gotoAndPlay(3);
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
The alpha transparency value of the movie clip. |
|
|
|
_currentframe:Number [read-only] |
Returns the number of the frame in which the playhead is located in the movie clip's Timeline. |
|
|
_droptarget:String [read-only] |
Returns the absolute path in slash-syntax notation of the movie clip instance on which this movie clip was dropped. |
|
|
A Boolean value that indicates whether a movie clip is enabled. |
|
|
|
If the value is undefined or false, a movie clip cannot receive input focus unless it is a button. |
|
|
|
A Boolean value that specifies whether a movie clip has a yellow rectangle around it when it has input focus. |
|
|
|
_framesloaded:Number [read-only] |
The number of frames that are loaded from a streaming SWF file. |
|
|
The height of the movie clip, in pixels. |
|
|
|
Deprecated since Flash Player 7. This property was deprecated in favor of MovieClip._quality. Specifies the level of anti-aliasing applied to the current SWF file. |
|
|
|
Designates another movie clip to serve as the hit area for a movie clip. |
|
|
|
A Boolean value that specifies what _root refers to when a SWF file is loaded into a movie clip. |
|
|
|
The instance name of the movie clip. |
|
|
|
A reference to the movie clip or object that contains the current movie clip or object. |
|
|
|
Sets or retrieves the rendering quality used for a SWF file. |
|
|
|
Specifies the rotation of the movie clip, in degrees, from its original orientation. |
|
|
|
Specifies the number of seconds a sound prebuffers before it starts to stream. |
|
|
|
Determines whether the children of a movie clip are included in the automatic tab ordering. |
|
|
|
Specifies whether the movie clip is included in automatic tab ordering. |
|
|
|
Lets you customize the tab ordering of objects in a movie. |
|
|
|
Returns the target path of the movie clip instance, in slash notation. |
|
|
|
_totalframes:Number [read-only] |
Returns the total number of frames in the movie clip instance specified in the MovieClip parameter. |
|
|
A Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus. |
|
|
|
Retrieves the URL of the SWF, JPEG, GIF, or PNG file from which the movie clip was downloaded. |
|
|
|
A Boolean value that indicates whether the movie clip is visible. |
|
|
|
The width of the movie clip, in pixels. |
|
|
|
An integer that sets the x coordinate of a movie clip relative to the local coordinates of the parent movie clip. |
|
|
|
Returns the x coordinate of the mouse position. |
|
|
|
Sets the horizontal scale (percentage) of the movie clip as applied from the registration point of the movie clip. |
|
|
|
Sets the y coordinate of a movie clip relative to the local coordinates of the parent movie clip. |
|
|
|
Indicates the y coordinate of the mouse position. |
|
|
|
Sets the vertical scale (percentage) of the movie clip as applied from the registration point of the movie clip. |
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
onData = function() {} |
Invoked when a movie clip receives data from a MovieClip.loadVariables() or MovieClip.loadMovie() call. |
|
onDragOut = function() {} |
Invoked when the mouse button is pressed and the pointer rolls outside the object. |
|
onDragOver = function() {} |
Invoked when the pointer is dragged outside and then over the movie clip. |
|
onEnterFrame = function() {} |
Invoked repeatedly at the frame rate of the SWF file. |
|
onKeyDown = function() {} |
Invoked when a movie clip has input focus and a key is pressed. |
|
onKeyUp = function() {} |
Invoked when a key is released. |
|
onKillFocus = function(newFocus:Object) {} |
Invoked when a movie clip loses input focus. |
|
onLoad = function() {} |
Invoked when the movie clip is instantiated and appears in the Timeline. |
|
onMouseDown = function() {} |
Invoked when the mouse button is pressed. |
|
onMouseMove = function() {} |
Invoked when the mouse moves. |
|
onMouseUp = function() {} |
Invoked when the mouse button is released. |
|
onPress = function() {} |
Invoked when the user clicks the mouse while the pointer is over a movie clip. |
|
onRelease = function() {} |
Invoked when the mouse button is released over a movie clip. |
|
onReleaseOutside = function() {} |
Invoked when the mouse button is pressed inside the movie clip area and then released outside the movie clip area. |
|
onRollOut = function() {} |
Invoked when the pointer moves outside a movie clip area. |
|
onRollOver = function() {} |
Invoked when the pointer moves over a movie clip area. |
|
onSetFocus = function(oldFocus:Object) {} |
Invoked when a movie clip receives input focus. |
|
onUnload = function() {} |
Invoked in the first frame after the movie clip is removed from the Timeline. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
attachMovie(id:String, name:String, depth:Number, [initObject:Object]) : MovieClip |
Takes a symbol from the library and attaches it to the movie clip. |
|
|
Indicates the beginning of a new drawing path. |
|
|
|
beginGradientFill(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Object) : Void |
Indicates the beginning of a new drawing path. |
|
|
clear() : Void |
Removes all the graphics created during runtime by using the movie clip draw methods, including line styles specified with MovieClip.lineStyle(). |
|
|
createEmptyMovieClip(name:String, depth:Number) : MovieClip |
Creates an empty movie clip as a child of an existing movie clip. |
|
|
createTextField(instanceName:String, depth:Number, x:Number, y:Number, width:Number, height:Number) : TextField |
Creates a new, empty text field as a child of the movie clip on which you call this method. |
|
|
curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : Void |
Draws a curve using the current line style from the current drawing position to (anchorX, anchorY) using the control point that (controlX, controlY) specifies. |
|
|
duplicateMovieClip(name:String, depth:Number, [initObject:Object]) : MovieClip |
Creates an instance of the specified movie clip while the SWF file is playing. |
|
|
endFill() : Void |
Applies a fill to the lines and curves added since the last call to beginFill() or beginGradientFill(). |
|
|
Returns properties that are the minimum and maximum x and y coordinate values of the movie clip, based on the bounds parameter. |
|
|
|
getBytesLoaded() : Number |
Returns the number of bytes that have already loaded (streamed) for the movie clip. |
|
|
getBytesTotal() : Number |
Returns the size, in bytes, of the movie clip. |
|
|
Returns the depth of the movie clip instance. |
|
|
|
getInstanceAtDepth(depth:Number) : MovieClip |
Determines if a particular depth is already occupied by a movie clip. |
|
|
Determines a depth value that you can pass to MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or MovieClip.createEmptyMovieClip() to ensure that Flash renders the movie clip in front of all other objects on the same level and layer in the current movie clip. |
|
|
|
getSWFVersion() : Number |
Returns an integer that indicates the Flash Player version for the movie clip was published. |
|
|
Loads a document from the specified URL into the specified window. |
|
|
|
globalToLocal(pt:Object) : Void |
Converts the pt object from Stage (global) coordinates to the movie clip's (local) coordinates. |
|
|
gotoAndPlay(frame:Object) : Void |
Starts playing the SWF file at the specified frame. |
|
|
gotoAndStop(frame:Object) : Void |
Brings the playhead to the specified frame of the movie clip and stops it there. |
|
|
Evaluates the movie clip to see if it overlaps or intersects with the hit area that the target or x and y coordinate parameters identify. |
|
|
|
lineStyle(thickness:Number, rgb:Number, alpha:Number, pixelHinting:Boolean, noScale:String, capsStyle:String, jointStyle:String, miterLimit:Number) : Void |
Specifies a line style that Flash uses for subsequent calls to lineTo() and curveTo() until you call lineStyle() with different parameters. |
|
|
Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y). |
|
|
|
Loads SWF or JPEG files into a movie clip in Flash Player while the original SWF file is playing. |
|
|
|
loadVariables(url:String, [method:String]) : Void |
Reads data from an external file and sets the values for variables in the movie clip. |
|
|
localToGlobal(pt:Object) : Void |
Converts the pt object from the movie clip's (local) coordinates to the Stage (global) coordinates. |
|
|
Moves the current drawing position to (x, y). |
|
|
|
nextFrame() : Void |
Sends the playhead to the next frame and stops it. |
|
|
play() : Void |
Moves the playhead in the Timeline of the movie clip. |
|
|
prevFrame() : Void |
Sends the playhead to the previous frame and stops it. |
|
|
removeMovieClip() : Void |
Removes a movie clip instance created with duplicateMovieClip(), MovieClip.duplicateMovieClip(), MovieClip.createEmptyMovieClip(), or MovieClip.attachMovie(). |
|
|
Makes the movie clip in the parameter mc a mask that reveals the calling movie clip. |
|
|
|
startDrag([lockCenter:Boolean], [left:Number], [top:Number], [right:Number], [bottom:Number]) : Void |
Lets the user drag the specified movie clip. |
|
|
stop() : Void |
Stops the movie clip currently playing. |
|
|
stopDrag() : Void |
Ends a MovieClip.startDrag() method. |
|
|
swapDepths(target:Object) : Void |
Swaps the stacking, or depth level (z-order), of this movie clip with the movie clip specified by the target parameter, or with the movie clip that currently occupies the depth level specified in the target parameter. |
|
|
unloadMovie() : Void |
Removes the contents of a movie clip instance. |
Methods inherited from class Object