03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

my_mc.onUnload = function () {<br />

trace ("onUnload called");<br />

}<br />

_parent (MovieClip._parent property)<br />

public _parent : MovieClip<br />

A reference to the movie clip or object that contains the current movie clip or object. The<br />

current object is the object that references the _parent property. Use the _parent property to<br />

specify a relative path to movie clips or objects that are above the current movie clip or object.<br />

You can use _parent to move up multiple levels in the display list as in the following:<br />

this._parent._parent._alpha = 20;<br />

Example<br />

The following example traces the reference to a movie clip <strong>and</strong> its relationship to the main<br />

Timeline. Create a movie clip with the instance name my_mc, <strong>and</strong> add it to the main Timeline.<br />

Add the following ActionScript to your FLA or AS file:<br />

my_mc.onRelease = function() {<br />

trace("You clicked the movie clip: "+this);<br />

trace("The parent of "+this._name+" is: "+this._parent);<br />

}<br />

When you click the movie clip, the following information appears in the Output panel:<br />

You clicked the movie clip: _level0.my_mc<br />

The parent of my_mc is: _level0<br />

See also<br />

_parent (Button._parent property), _root property, targetPath function,<br />

_parent (TextField._parent property)<br />

play (MovieClip.play method)<br />

public play() : Void<br />

Moves the playhead in the Timeline of the movie clip.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Example<br />

Use the following ActionScript to play the main Timeline of a SWF file. This ActionScript is<br />

for a movie clip button called my_mc on the main Timeline:<br />

stop();<br />

my_mc.onRelease = function() {<br />

MovieClip 461

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!