MACROMEDIA FLASH MX 2004-USING ACTIONSCRIPT IN FLASH Use Manual page 67

Using actionscript in flash
Hide thumbs Also See for FLASH MX 2004-USING ACTIONSCRIPT IN FLASH:
Table of Contents

Advertisement

Clearly describe the purpose or content of each layer or folder when you name them in a FLA
file. This helps users to quickly understand where particular assets are found in layers or
folders. It is a good and common practice to name the layer that contains your ActionScript
actions and to use layer folders to organize similar layers.
If applicable, place your layers that include ActionScript and a layer for frame labels at the top
of the layer stack in the Timeline. This makes it easy to locate the layers that include code and
labels.
Add frame labels in a FLA file instead of using frame numbers in your ActionScript to
reference points on the Timeline. This is important and useful if you reference frames in your
ActionScript and those frames change later when you edit the Timeline. If you use frame labels
and move them on the Timeline, you do not have to change any references in your code.
Lock your ActionScript layer immediately so that symbol instances or media assets are not
placed on that layer. Never put any instances or assets on a layer that includes ActionScript,
which can potentially cause conflicts between assets on the Stage and ActionScript that
references them.
Lock layers that you are not using or do not want to modify.
Use folders in the library to organize similar elements (such as symbols and media assets) in a
FLA file. If you name library folders consistently each time you create a file, it is much easier to
remember where you put assets. Commonly used folder names are Buttons, MovieClips,
Graphics, Assets, Components, and, sometimes, Classes.
Using scenes
Using scenes is similar to using several SWF files together to create a larger presentation. Each
scene has a Timeline. When the playhead reaches the final frame of a scene, the playhead
progresses to the next scene. When you publish a SWF file, the Timeline of each scene combines
into a single Timeline in the SWF file. After the SWF file compiles, it behaves as if you created
the FLA file using one scene. Because of this behavior, avoid using scenes for the following
reasons:
Scenes can make documents confusing to edit, particularly in multiauthor environments.
Anyone using the FLA document might have to search several scenes within a FLA file to
locate code and assets. Consider loading content or using movie clips instead.
Scenes often result in large SWF files. Using scenes encourages you to place more content in a
single FLA file and hence, larger documents to work with and larger SWF files.
Scenes force users to progressively download the entire SWF file, even if they do not plan or
want to watch all of it. Your user progressively downloads the entire file, instead of loading the
assets they actually want to see or use. If you avoid scenes, the user can control what content
they download as they progress through your SWF file. This means that the user has more
control over how much content they download, which is better for bandwidth management.
One drawback is the requirement for managing a greater number of FLA documents.
Scenes combined with ActionScript might produce unexpected results. Because each scene
Timeline is compressed onto a single Timeline, you might encounter errors involving your
ActionScript and scenes, which typically requires extra, complicated debugging.
Working with FLA files
67

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents