Adobe 65018518 - Flash CS4 Professional Using Manual page 333

User guide
Table of Contents

Advertisement

Screen instance names, class names, and registration points
The screen name automatically generates the instance name and class name of the screen. You need these identifying
labels when you manipulate screens with ActionScript in various ways. To adjust how the screen behaves, change a
screen's registration point. You can work with these features in the following ways:
The instance name is a unique name assigned to a screen, used when you target the screen in ActionScript. Change
the instance name in the Property inspector. The instance name is identical to the screen name in the Screen
Outline pane and the linkage identifier for the screen. If you update the instance name, the screen name and the
linkage identifier also update.
Note: Symbol instances, including movie clips, buttons, and graphics, also have instance names.
The class name identifies the ActionScript class to which the screen is assigned. By default, a slide screen is assigned
to the
.
mx.screens
Slide
methods and properties that are available for the screen, assign the screen to a different class. For more information
on ActionScript classes, see Classes
The Property inspector indicates the registration point in the x and y coordinate fields and in the registration grid.
You might want to move the registration point for greater control in manipulating screen content. For example, to
create a spinning shape in the center of a screen, reposition the screen registration point at the center of the screen
and rotate the screen around its registration point.
See also
"Symbols, instances, and library
How screens interact with ActionScript
Screens are similar to nested movie clips in the way that they interact with ActionScript. However, some differences
exist.
Use the following guidelines for ActionScript with screens:
When you select a screen in the Screen Outline pane and add ActionScript, the script is added directly to the screen
as an object action (much as ActionScript is added directly to a movie clip). Use object actions for simple code (such
as creating navigation between screens) and external ActionScript files for more complex code.
For best results, organize the document structure and finalize screen names before adding ActionScript. If you
rename a screen, the instance name is automatically changed, and you must update the instance names in any
ActionScript code you write.
To add a frame action to the Timeline for a screen, select the screen, open the Timeline (Window > Timeline), and
select the first frame in the Timeline. Use an external ActionScript file, rather than a frame action, for complex code
on a screen.
You cannot view or manipulate the main Timeline for a screen-based document. However, you can target the main
Timeline using
in a target path.
_root
Each screen is automatically associated with ActionScript, based on its class. You can change the class to which that
screen is assigned, and you can set some parameters for a screen in the Property inspector.
To control screens with ActionScript, use the Screen class, Slide class, and Form class.
To create interactivity, use components whenever possible. Put no more than 125 total component instances in a
single FLA file.
To create navigation between slides, use
rootSlide.currentSlide
class, and a form screen is assigned to the
Learning ActionScript 2.0 in Adobe
assets" on page 147
. For example, to get the current slide, use
rootSlide
.
Updated 5 March 2009
USING FLASH CS4 PROFESSIONAL
Working with screens
.
class. To modify the
mx.screens
Form
Flash.
328

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash cs4 professional

Table of Contents