User Guide

660 Chapter 6: Components Dictionary
screen2
subscreen1_2
If myUIButton has focus, the leafmost screen containing the focus is subscreen1_1, which is
what
currentFocusedScreen would return. In this case, presentation, screen1, and
subscreen1_1 all contain the focus but the one that is closest” (in the screen hierarchy) to the
leaves of the tree (that is, farthest away from the root) is
subscreen1_1.
Example
The following example displays the name of the currently focused screen in the Output panel.
var currentFocus:mx.screens.Screen = mx.screens.Screen.currentFocusedScreen;
trace("Current screen is: " + currentFocus._name);
Screen.getChildScreen()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myScreen.getChildScreen(childIndex)
Parameters
childIndex
A number that indicates the zero-based index of the child screen to return.
Returns
A Screen object.
Description
Method; returns the child screen of myScreen whose index is childIndex.
Example
The following example sends the names of all the child screens belonging to the root screen
named
Presentation to the Output panel.
for (var i:Number = 0; i < _root.Presentation.numChildScreens; i++) {
var childScreen:mx.screens.Screen = _root.Presentation.getChildScreen(i);
trace(childScreen._name);
}