Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > MovieClip > _parent (MovieClip._parent property) | |||
public _parent : MovieClip
A reference to the movie clip or object that contains the current movie clip or object. The current object is the object that references the _parent property. Use the _parent property to specify a relative path to movie clips or objects that are above the current movie clip or object.
You can use _parent to move up multiple levels in the display list, as in the following code:
this._parent._parent._alpha = 20;
Availability: ActionScript 1.0; Flash Player 5
The following example traces the reference to a movie clip and its parent timeline. Create a movie clip with the instance name my_mc, and add it to the main timeline. Add the following ActionScript to your FLA or AS file:
my_mc.onRelease = function() {
trace("You clicked the movie clip: "+this);
trace("The parent of "+this._name+" is: "+this._parent);
}
When you click the movie clip, the following information appears in the Output panel:
You clicked the movie clip: _level0.my_mc The parent of my_mc is: _level0
_parent (Button._parent property), _root property, targetPath function, _parent (TextField._parent property)
Flash CS3