Parent (Button._Parent Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Example
The following example demonstrates how you can execute statements when the user of a SWF
file moves focus from one button to another. Create two buttons,
and enter the following ActionScript in Frame 1 of the Timeline:
Selection.setFocus(btn1_btn);
trace(Selection.getFocus());
btn2_btn.onSetFocus = function(oldFocus) {
trace(oldFocus._name + "lost focus");
};
Test the SWF file by pressing Control+Enter. Make sure you select Control > Disable
Keyboard Shortcuts if it is not already selected. Focus is set on
loses focus and
btn2_btn

_parent (Button._parent property)

public _parent :
A reference to the movie clip or object that contains the current movie clip or object. The
current object is the one containing the ActionScript code that references
Use
to specify a relative path to movie clips or objects that are above the current
_parent
movie clip or object. You can use
the following:
this._parent._parent._alpha = 20;
Availability: ActionScript 1.0; Flash Lite 2.0
Example
In the following example, a button named
The following code shows how to use the
clip
:
my_mc
trace(my_mc.my_btn._parent);
The Output panel displays the following:
_level0.my_mc
See also
_parent (MovieClip._parent property)
_root property
286
ActionScript classes
gains focus, information is displayed in the Output panel.
MovieClip
_parent
btn1_btn
to move up multiple levels in the display list as in
is placed inside a movie clip called
my_btn
property to get a reference to the movie
_parent
,
_target (MovieClip._target property)
and
btn1_btn
btn2_btn
. When
btn1_btn
.
_parent
my_mc
,
.
,

Advertisement

Table of Contents
loading

Table of Contents