# MovieClip ActionScript Class

This class implements an MovieClip object.

## The Methods of the Class

attachAudio()

attachMovie()

beginFill([rgba])

- Set fill color for subsequent drawing. The value is interpreted as a 32bit integer composed of red (highest byte), green, blue and alpha (lowest byte). If first argument is missing the fill color will be black with alpha 255.

beginGradientFill()

clear()

- Clear all dynamic drawing on this MovieClip.

createEmptyMovieClip(name, depth)

- Create an empty movieclip and place it in this clip displaylist at the given depth. Return a reference to the created clip. If called with less the two arguments the method returns undefined and no action is taken. TOCHECK: what if a character with the given name already exist ? TOCHECK: what if a character at the given depth already exist ?

createTextField()

curveTo(cx, cy, ax, ay)

- Draw a quadratic bezier curve with current linestyle and current fill from current pen position to the anchor point ax,ay using control point cx, cy. If any argument is missing nothing is drawn. The function always returns undefined.

duplicateMovieClip(newname, newdepth, [initObject])

- Make a clone of this MovieClip and place it in this MovieClip parent's DisplayList. If given a third argument, it will be taken as an object to use for initializing properties of the clone. Return the cloned object. An absolute root movieclip (_levelx) can not be duplicated, if attempted, no action is taken and undefined is returned. TOCHECK: what if a character with the given name already exists in parent's display list ? TOCHECK: what if a character at the given depth already exists in parent's display list ? TODO: add info about what does it mean to 'clone' (what's cloned and what not).

endFill()

- Reset any fill information. Next drawing calls will not be filled. If a fill was in effect (see beginFill and beginGradientFill) the current path is closed so that last point equals the first point of the filled shape.

getBounds([target])

- Returns an object with members 'xMin', 'yMin', 'xMax' and 'yMax' representing the bounding box of this MovieClip. When called with no args the bounding box is in local coordinate space. When given an character as first argument, the bounding box is in the given character's coordinate space.

getBytesLoaded()

getBytesTotal()

getDepth()

- Return the depth on this character in its parent DisplayList. TOCHECK: what's returned when called against a character with no parent (_levelx) ?

getInstanceAtDepth()

getNextHighestDepth()

- Return the next available depth for placing a new character in this MovieClip displaylist. TOCHECK: if depths 1 and 3 are occupied, returns 4, not 2 , right ? NOTE: this function always return a number >= 0, negative depths are never returned.

getSWFVersion()

- TOCHECK : I don't think there's such a function ...

getTextSnapshot()

getURL()

globalToLocal(obj)

- Take members 'x', and 'y' in the object 'obj' and transform them from global to local coordinate space. If the parameter doesn't cast to an object, or the object doesn't contain both 'x' and 'y', the call is invalid and nothing is modified.

gotoAndPlay()

gotoAndStop()

hitTest(target)

hitTest(x,y)

hitTest(x,y,shapeFlag)

- In the first form, check for the bounding boxes of this and target characters to intersect. In the second and third form, check if the given point is inside the bounding box or the visible shape of this character; shapeFlag (false) in the 2 args version says wheter actual shape or just bounds has to be checked; coordinates values are in Stage coordinate space.

lineStyle()

lineStyle(thickness, [color])

- In the first form (no args) it will reset all line style info so that next drawing will have a transparent drawing. Note that by 'transparent' is not intended 0-alpha as no color transformation will be able to augment the alpha value. The line is simply always invisible instead.

  In the second form, set thickness and color of strokes for subsequent drawing. If color is omitted, it defaults to black with 255 alpha. If thickness is zero the line will always be an 'hariline', which is always displaied with the same width at any scale. Other thickness will be in pixels and scale togheter with the MovieClip itself.

lineTo(x, y)

- Draw a straight line from current position to point x,y using current styles.

loadMovie()

loadVariables()

localToGlobal(obj)

- Take members 'x', and 'y' in the object 'obj' and transform them from local to global coordinate space. If the parameter doesn't cast to an object, or the object doesn't contain both 'x' and 'y', the call is invalid and nothing is modified.

moveTo()

nextFrame()

play()

prevFrame()

removeMovieClip()

setMask()

startDrag()

stop()

stopDrag()

swapDepths()

unloadMovie()

## The Properties of the MovieClip Class

_alpha

_currentframe

_droptarget

enabled

focusEnabled

_focusrect

_framesloaded

_height

hitArea

_lockroot

menu

_name

- This is a read-write property of MovieClip objects. Changing the _name property of a MovieClip also changes it's _target and the _target of any child.

  Dynamically-created clips are always created with a name, while for statically defined one this is optional in the SWF, but will be syntetized by the player if missing. TODO: check if _name reflects the syntetized naming (_instancex). For the root movie syntetization doesn't happen and the _name property is the empty string for SWF6 and higher or null for SWF5 and lower.

  Valid values for _name are: ....

  NOTE: mm player7 and player9 differ on typeof(_root._name) on startup.

onData

onDragOut

onDragOver

onEnterFrame

onKeyDown

onKeyUp

onKillFocus

onLoad

onMouseDown

onMouseMove

onMouseUp

onPress

onRelease

onReleaseOutside

onRollOut

onRollOver

onSetFocus

onUnload

_parent

_quality

_rotation

_soundbuftime

tabChildren

tabEnabled

tabIndex

_target

_totalframes

trackAsMenu

_url

useHandCursor

_visible

_width

_x

_xmouse

_xscale

_y

_ymouse

_yscale

## MovieClip Class Conformance

Class Name | Conformance
attachAudio() | This method has an unknown status.
attachMovie() | This method has an unknown status.
beginFill() | Implemented and tested.
beginGradientFill() | This method has an unknown status.
clear() | Implemented and tested.
createEmptyMovieClip() | Implemented and tested. Needs more tests for corner cases (ie: depth occupied or name existing).
createTextField() | This method has an unknown status.
curveTo() | Implemented and tested.
duplicateMovieClip() | Implemented and tested. Needs more testing.
endFill() | Implemented and tested.
getBounds() | Implemented and tested.
getBytesLoaded() | This method has an unknown status.
getBytesTotal() | This method has an unknown status.
getDepth() | Implemented and tested.
getInstanceAtDepth() | This method has an unknown status.
getNextHighestDepth() | Implemented and tested. Needs more tests.
getSWFVersion() | This method has an unknown status.
getTextSnapshot() | This method has an unknown status.
getURL() | This method has an unknown status.
globalToLocal() | Implemented and tested in Gnash.
gotoAndPlay() | This method has an unknown status.
gotoAndStop() | This method has an unknown status.
hitTest() | Implemented and tested in Gnash.
lineStyle() | Implemented and tested.
lineTo() | Implemented and tested.
loadMovie() | This method has an unknown status.
loadVariables() | This method has an unknown status.
localToGlobal() | Implemented and tested in Gnash.
moveTo() | This method has an unknown status.
nextFrame() | This method has an unknown status.
play() | This method has an unknown status.
prevFrame() | This method has an unknown status.
removeMovieClip() | This method has an unknown status.
setMask() | This method has an unknown status.
startDrag() | This method has an unknown status.
stop() | This method has an unknown status.
stopDrag() | This method has an unknown status.
swapDepths() | This method has an unknown status.
unloadMovie() | This method has an unknown status.
_alpha | This property has an unknown status.
_currentframe | This property has an unknown status.
_droptarget | This property has an unknown status.
enabled | This property has an unknown status.
focusEnabled | This property has an unknown status.
_focusrect | This property has an unknown status.
_framesloaded | This property has an unknown status.
_height | This property has an unknown status.
hitArea | This property has an unknown status.
_lockroot | This property has an unknown status.
menu | This property has an unknown status.
_name | This property has an unknown status.
onData | This property has an unknown status.
onDragOut | This property has an unknown status.
onDragOver | This property has an unknown status.
onEnterFrame | This property has an unknown status.
onKeyDown | This property has an unknown status.
onKeyUp | This property has an unknown status.
onKillFocus | This property has an unknown status.
onLoad | This property has an unknown status.
onMouseDown | This property has an unknown status.
onMouseMove | This property has an unknown status.
onMouseUp | This property has an unknown status.
onPress | This property has an unknown status.
onRelease | This property has an unknown status.
onReleaseOutside | This property has an unknown status.
onRollOut | This property has an unknown status.
onRollOver | This property has an unknown status.
onSetFocus | This property has an unknown status.
onUnload | This property has an unknown status.
_parent | This property has an unknown status.
_quality | This property has an unknown status.
_rotation | This property has an unknown status.
_soundbuftime | This property has an unknown status.
tabChildren | This property has an unknown status.
tabEnabled | This property has an unknown status.
tabIndex | This property has an unknown status.
_target | This property has an unknown status.
_totalframes | This property has an unknown status.
trackAsMenu | This property has an unknown status.
_url | This property has an unknown status.
useHandCursor | This property has an unknown status.
_visible | This property has an unknown status.
_width | This property has an unknown status.
_x | This property has an unknown status.
_xmouse | This property has an unknown status.
_xscale | This property has an unknown status.
_y | This property has an unknown status.
_ymouse | This property has an unknown status.
_yscale | This property has an unknown status.