Screen object

 < Day Day Up > 

Availability

Flash MX 2004.

Description

The Screen object represents a single screen in a slide or form document. This object contains properties related to the slide or form. For access to the array of all Screen objects in the document, use the following code:

fl.getDocumentDOM().screenOutline.screens

Property summary for the Screen object

The Screen object has the following properties:

Properties

Description

screen.accName

A string that is equivalent to the Name field in the Accessibility panel.

screen.childScreens

Read-only; the array of child screens for this screen. The array is empty if there are no child screens.

screen.description

A string that is equivalent to the Description field in the Accessibility panel.

screen.forceSimple

A Boolean value that enables and disables accessibility for the object's children.

screen.hidden

A Boolean value that specifies whether a screen is visible.

screen.instanceName

Read-only; a string that represents the instance name used to access the object from ActionScript.

screen.name

Read-only; a string that represents the name of the screen.

screen.nextScreen

Read-only; an object that represents the next peer screen in the parent's childScreens array.

screen.parameters

Read-only; an array of ActionScript 2.0 properties that are accessible from the screen Property inspector.

screen.parentScreen

Read-only; an object that represents the parent screen.

screen.prevScreen

Read-only; an object that represents the previous peer screen in the parent's childScreens array.

screen.silent

A Boolean value that specifies whether the object is accessible.

screen.tabIndex

Property; equivalent to the Tab Index field in the Accessibility panel.

screen.timeline

Read-only; the Timeline object for the screen. See Timeline object.


screen.accName

Availability

Flash MX 2004.

Usage

screen.accName

Description

Property; a string that is equivalent to the Name field in the Accessibility panel. Screen readers identify objects by reading the name aloud.

Example

The following example stores the value of the name of the object in the theName variable:

var theName = fl.getDocumentDOM().screenOutline.screens[1].accName;

The following example sets the name of the object to "Home Button":

fl.getDocumentDOM().screenOutline.screens[1].accName = 'Home Button';

screen.childScreens

Availability

Flash MX 2004.

Usage

screen.childScreens

Description

Read-only property; the array of child screens for this screen. The array is empty if there are no child screens.

Example

The following example checks to see if the current document is a slide or form, and if it is, stores the array of child screens in the myChildren variable and displays their names in the Output panel:

var myChildren = new Array(); if(fl.getDocumentDOM().allowScreens) {   var myParent = fl.getDocumentDOM().screenOutline.rootScreen.name   for (i in fl.getDocumentDOM().screenOutline.rootScreen.childScreens) {     myChildren.push("   "+fl.getDocumentDOM().screenOutline.rootScreen.childScreens[i].name);   }   fl.trace(" The child screens of "+myParent+" are "+myChildren+". "); }

screen.description

Availability

Flash MX 2004.

Usage

screen.description

Description

Property; a string that is equivalent to the Description field in the Accessibility panel. The description is read by the screen reader.

Example

The following example gets the description of the object and stores it in the theDescription variable:

var theDescription =   fl.getDocumentDOM().screenOutline.screens[1].description;

The following example sets the description of the object to "This is Screen 1":

fl.getDocumentDOM().screenOutline.screens[1].description = "This is Screen   1"

screen.forceSimple

Availability

Flash MX 2004.

Usage

screen.forceSimple

Description

Property; a Boolean value that enables or disables accessibility for the object's children. This is equivalent to the inverse logic of the Make Child Objects Accessible setting in the Accessibility panel. That is, if forceSimple is TRue, it is the same as the Make Child Object Accessible option being deselected. If forceSimple is false, it is the same as the Make Child Object Accessible option being selected.

Example

The following example stores the value of forceSimple in the areChildrenAccessible variable (a value of false means the children of the object are accessible):

var areChildrenAccessible =   fl.getDocumentDOM().screenOutline.screens[1].forceSimple

The following example makes the children of the object accessible:

fl.getDocumentDOM().screenOutline.screens[1].forceSimple = false;

screen.hidden

Availability

Flash MX 2004.

Usage

screen.hidden

Description

Property; a Boolean value that specifies whether the screen is visible. A screen with the hidden property set to true is not visible in any other screen.

Example

The following example checks to see if the first screen in the outline is hidden and changes the visibility of the screen accordingly. Then, a message in the Output panel shows what the visibility of the screen was before the change:

if (fl.getDocumentDOM().screenOutline.screens[0].hidden) {   fl.getDocumentDOM().screenOutline.setScreenProperty("hidden", false);   fl.trace(fl.getDocumentDOM().screenOutline.screens[0].name+" had its   'hidden' property set to 'false'"); } else {   fl.getDocumentDOM().screenOutline.setScreenProperty("hidden", true);   fl.trace(fl.getDocumentDOM().screenOutline.screens[0].name+" had its   'hidden' property set to 'true'"); }

screen.instanceName

Availability

Flash MX 2004.

Usage

screen.instanceName

Description

Read-only property; a string that represents the instance name used to access the object from ActionScript.

Example

The following example checks to see if the current document allows screens (because it is a slide or form). Then, it assigns the instanceName value of the first child screen in the array to the myInstanceName variable and opens the Output panel to show the instance name of the screen:

var myChildren = new Array(); if(fl.getDocumentDOM().allowScreens) {   var myInstanceName =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[0].instanceNam   e;   fl.trace(" The instanceName is "+myInstanceName+". "); }

screen.name

Availability

Flash MX 2004.

Usage

screen.name

Description

Read-only property; a string that represents the name of the screen.

Example

The following example checks to see if the current document allows screens (because it is a slide or form document). Then, it assigns the name value of the first child screen in the array to the myName variable and opens the Output panel to show the name of the screen:

var myChildren = new Array(); if(fl.getDocumentDOM().allowScreens) {   var myName =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[0].name;   fl.trace("The name of the screen is "+myName+". "); }

screen.nextScreen

Availability

Flash MX 2004.

Usage

screen.nextScreen

Description

Read-only property; an object that represents the next peer screen in the parent's childScreens array. That is, screen.NextScreen is found by moving down an array of child screens to the next screen in the array. See screen.prevScreen.

If there isn't a peer screen, the value is null.

Example

The following example first checks to see if the current document is a slide or form, and if it is, retrieves and shows the sequence of screens in the Output panel:

if(fl.getDocumentDOM().allowScreens) {   var myCurrent =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[0].name;   var myNext =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[0].nextScreen.   name;   fl.trace(" The next screen to "+myCurrent+" is "+myNext+". "); }

screen.parameters

Availability

Flash MX 2004.

Usage

screen.parameters

Description

Read-only property; an array of ActionScript 2.0 properties that are accessible from the screen Property inspector.

Example

The following example stores the parameters for the second screen in the outline to the parms variable and then assigns the "some value" value to the first property:

var parms = fl.getDocumentDOM().screenOutline.screens[1].parameters; parms[0].value = "some value";

See also

Parameter object

screen.parentScreen

Availability

Flash MX 2004.

Usage

screen.parentScreen

Description

Read-only property; an object that represents the parent screen. If parentScreen is null, the screen is a top-level screen.

Example

The following example stores the values for the childScreens and parentScreen properties in variables and then shows those values and their parent/child relationship in the Output panel:

if(fl.getDocumentDOM().allowScreens) {   var myCurrent =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[1].name;   var myParent =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[1].parentScree   n.name;   fl.trace(" The parent screen to "+myCurrent+" is "+myParent+". "); }

screen.prevScreen

Availability

Flash MX 2004.

Usage

screen.prevScreen

Description

Read-only property; an object that represents the previous peer screen in the parent's childScreens array. If there isn't a peer screen, the value is null. See also screen.nextScreen.

Example

The following example checks to see if the current document is a slide or form, and if it is, retrieves and shows the sequence of screens in the Output panel:

if(fl.getDocumentDOM().allowScreens) {   var myCurrent =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[1].name;   var myNext =   fl.getDocumentDOM().screenOutline.rootScreen.childScreens[1].prevScreen.   name;   fl.trace(" The previous screen to "+myCurrent+" is "+myNext+". "); }

screen.silent

Availability

Flash MX 2004.

Usage

screen.silent

Description

Property; a Boolean value that specifies whether the object is accessible. This is equivalent to the inverse logic of the Make Object Accessible setting in the Accessibility panel. That is, if silent is true, it is the same as having the Make Object Accessible option deselected in the Accessibility panel. If silent is false, it is the same as having the Make Object Accessible option selected in the Accessibility panel.

Example

The following example retrieves the silent value of the object (a value of false means the object is accessible):

var isSilent = fl.getDocumentDOM().screenOutline.screens[1].silent;

The following example sets the object to be accessible:

fl.getDocumentDOM().screenOutline.screens[1].silent = false;

screen.tabIndex

Availability

Flash MX 2004.

Usage

screen.tabIndex

Description

Property; equivalent to the Tab Index field in the Accessibility panel. This value lets you determine the order in which objects are accessed when the user presses the Tab key.

Example

The following example gets the tab index of the object:

var theTabIndex = fl.getDocumentDOM().screenOutline.screens[1].tabIndex;

The following example sets the tab index of the object to 1:

fl.getDocumentDOM().screenOutline.screens[1].tabIndex = 1;

screen.timeline

Availability

Flash MX 2004.

Usage

screen.timeline

Description

Read-only property; the Timeline object for the screen.

Example

The following example gets the screenOutline property of the current slide document, assigns the array of timeline properties for the first screen to myArray, and displays those properties in the Output panel:

myArray = new Array(); if(fl.getDocumentDOM().screenOutline) {   for(i in fl.getDocumentDOM().screenOutline.screens[0].timeline) {   myArray.push(" "+i+" :   "+fl.getDocumentDOM().screenOutline.screens[0].timeline[i]+" ") ;   }   fl.trace("Here are the properties of the screen named "+   fl.getDocumentDOM().screenOutline.screens[0].name+": "+myArray); }

     < Day Day Up > 


    Developing Extensions for Macromedia Flash 8
    Developing Extensions for Macromedia Flash 8
    ISBN: 032139416X
    EAN: 2147483647
    Year: 2005
    Pages: 81

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net