
About using ActionScript with screens (Flash Professional only)
359
How screens interact with ActionScript (Flash
Professional only)
Screens are similar to nested movie clips in the way that they interact with ActionScript. (For
more information, see
“About nested movie clips” on page 37
.) However, there are some
differences.
Remember the following guidelines when you use 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). It’s usually best to 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 have written.
■
If you want to add a frame action to the Timeline for a screen, you must select the screen,
expand the Timeline (collapsed by default), and select the first frame in the Timeline.
However, it’s usually best to 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
_root
in a target path.
■
Each screen is automatically associated with ActionScript, based on its class. (For more
information, see
“Slide screens and form screens (Flash Professional only)” on page 339
.)
You can change the class to which that screen is assigned, and you can set some parameters
for a screen in the Property inspector. For more information, see
“Setting properties and
parameters for a screen (Flash Professional only)” on page 347
.
■
Use the Screen class, Slide class, and Form class to control screens with ActionScript.
■
Use components whenever possible to create interactivity. Put no more than 125 total
component instances in a single FLA file.
■
To create navigation between slides, use
rootSlide
. For example, to get the current slide,
use
rootSlide.currentSlide
.
■
Do not try to do slide navigation inside of
on(reveal)
or
on(hide)
handlers.
■
Do not add an
on(keydown)
or
on(keyup)
event to ActionScript code controlling a
screen.
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...