• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part: VII Appendixes > The MovieClip Class

The MovieClip Class

Table A.4. MovieClip Methods
MethodFormatDescription
attachMoviemyClip.attachMovie(idName, newName, depth [, initObject] )Attaches a movie in the Library to myClip, with the specified depth. The attached movie has all the local properties of the init object. Returns a reference to the attached movie.
createEmptyMovieClipmyClip.createEmptyMovieClip (instanceName, depth)Creates an empty movie clip as a child of myClip, with the specified depth.
createTextFieldmyClip.createTextField (instanceName, depth, x, y, width, height)Creates an empty text field, with the specified instance name, depth, x and y coordinates, width, and height.
duplicateMovieClipmyClip.duplicateMovieClip(newName, depth [,initObject])Duplicates myClip, creating a sibling at the specified depth. The new movie has all the local properties of the init object.
getBoundsmyClip.getBounds (targetCoordinateSpace)Returns the minimum and maximum x and y coordinates of myClip in relation to a specified coordinate space.
getBytesLoadedmyClip.getBytesLoaded()Returns the number of bytes loaded for myClip.
getBytesTotalmyClip.getBytesTotal()Returns the size of myClip in bytes.
getDepthmyClip.getDepth()Returns the depth number of myClip
getInstanceAtDepthmyClip.getInstanceAtDepth(depth)Returns the name of the child clip of myClip located at the depth number specified by the depth parameter. If there is no child movie clip at that depth, returns undefined. FP7 only.
getNextHighestDepthmyClip.getNextHighest Depth()Returns a number equal to the highest depth number plus one for children of myClip. This is the depth number you need to use to create new child content that will render on top of all existing child content. FP7 only.
getSWFVersionmyClip.getSWFVersion()Returns an integer specifying the targeted Flash Player version of the SWF loaded into myClip. Returns a -1 error if a JPEG was loaded into myClip. FP7 only.
getTextSnapshotmyClip.getTextSnapshot()Returns a TextSnapShot object containing the static text from myClip, or an empty string if myClip contains no static text. Works in FP7 only, but myClip can be targeted for FP6 or FP7.
getURL(URL [,window, variables])myClip.getURL("http://www.myDomain.com")_Loads a document into a browser window from the specified URL, sending all the variables from the root of myClip using GET or POST, as specified in the variables string.
globalToLocalmyClip.globalToLocal(point)Converts the point object from main movie Stage coordinates to the local coordinates of myClip
gotoAndPlaymyClip.gotoAndPlay(frame)Sends the playhead to a specific frame in myClip and then starts playing the movie.
gotoAndStopmyClip.gotoAndStop(frame)Sends the playhead to a specific frame in myClip and then stops the movie.
hitTestmyClip.hitTest(x, y, shapeFlag)Returns true if myClip's bounding box overlaps the point specified by the x and y coordinates. shapeFlag is a Boolean value that determines whether the entire shape of myClip is evaluated (true), or just myClip's bounding box (false).
myClip.hitTest(target)Returns true if myClip's bounding box intersects the bounding box of the target movie clip.
loadMoviemyClip.loadMovie("url" [,variables])Loads the movie or JPEG specified in "url" into myClip, using GET or POST, as specified in the variables string. If targeting FP7, use MovieClipLoader instead of this.
loadVariablesmyClip.loadVariables("url", variables)Loads variables from a URL or other location into myClip.
localToGlobalmyClip.localToGlobal(point)Converts a point object from the local coordinates of myClip to the global Stage coordinates.
nextFramemyClip.nextFrame() frame of myClip.Sends the playhead to the next
playmyClip.play()Plays myClip
prevFramemyClip.prevFrame()Sends the playhead to the previous frame of myClip.
removeMovieClipmyClip.removeMovieClip()Removes myClip from the Timeline if it was created through the use of attachMovie(), duplicateMovieClip(), or createEmptyMovieClip().
setMaskmyClip.setMask (maskMovieClip)Specifies a movie clip as a mask for myClip.
startDragmyClip.startDrag([lock, [left, top, right, bottom]])Makes myClip draggable and begins dragging myClip. If the value of lock is true, the mouse pointer remains centered on myClip's registration point. The left, top, right, and bottom values specify coordinates beyond which myClip cannot be dragged.
stopmyClip.stop()Pauses myClip.
stopDragmyClip.stopDrag()Stops the dragging of any clip that is being dragged (not just myClip). Exact equivalent of global function stopDrag().
swapDepthsmyClip.swapDepths(depth)Puts myClip at the specified depth. If there is a movie clip at that depth, it is moved to myClip's former depth level.
myClip.swapDepths(target)Swaps the depth levels of myClip and the target movie clip.
unloadMoviemyClip.unloadMovie()Removes myClip if it was loaded with loadMovie(). Also works for JPEGs loaded with loadMovie().
Legend: (na) not available (undocumented method)


Table A.5. MovieClip Attributes
AttributeDescription
_alphaTransparency/opacity, an integer from 0–100.
_currentframeCurrent frame number, an integer, read-only.
_droptarget A read-only string containing the absolute path in slash syntax notation of the movie clip instance on which a draggable movie clip was dropped.
enabledA Boolean that determines whether a button movie clip is enabled.
focusEnabledA Boolean that determines whether a movie clip can receive focus.
_focusrectA Boolean that determines whether a focused movie clip has a yellow rectangle around it.
_framesloadedAn integer; the number of frames that have been loaded into memory, read-only.
_heightThe height of a movie clip instance, in pixels; a floating-point number.
hitAreaThe movie clip that defines the hit area for a button movie clip.
_lockroot“Locks” the reference of _root in an SWF, so it doesn't change when the SWF is loaded into another movie clip.
_qualityA string that determines rendering quality: LOW, MEDIUM, HIGH, BEST.
menuWorks with the new ContextMenu and ContextMenuItem classes to let you create a new context menu for a MovieClip.
_nameThe instance name, a string.
_parentA reference to the movie clip's parent clip.
_rotationA floating-point number; the number of degrees of rotation from the clip's original orientation.
_soundbuftimeAn integer; the number of seconds of sound to prebuffer before starting to play the sound.
tabChildrenA Boolean; determines whether the children of a movie clip are included in automatic tab ordering.
tabEnabledA Boolean; determines whether a movie clip is included in tab ordering.
tabIndexDetermines the tab order of the clip.
_targetThe target path of the clip.
_totalframesThe total number of frames in the clip.
trackAsMenuA Boolean that determines whether, if the user presses the mouse button over this button movie clip (or button) and releases it over a different one, the second one receives a release event.
_urlA read-only string; the location of the SWF file from which the clip was downloaded.
useHandCursorA Boolean that enables and disables the display of the hand cursor for a button movie clip.
_visibleA Boolean value that determines whether a clip instance is hidden or visible.
_widthThe width of a movie clip instance, in pixels; a floating-point number.
_xThe x coordinate of a clip instance; a floating-point number.
_xmouseThe x coordinate of the mouse cursor within a clip instance; a floating-point number.
_xscaleA floating-point number specifying a percentage for horizontally scaling a clip instance.
_yThe y coordinate of a clip instance; a floating-point number.
_ymouseThe y coordinate of the cursor within a clip instance; a floating-point number.
_yscaleA floating-point number specifying a percentage for vertically scaling a clip instance.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint