
419
USING FLASH CS4 PROFESSIONAL
Best practices
Using scenes
Using scenes is similar to using several SWF files 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.
•
Scenes force users to progressively download the entire SWF 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. 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.
If you create lengthy animations, you might find it advantageous to use scenes. If disadvantages apply to your
document, consider using multiple FLA files, or movie clips to build an animation instead of using scenes.
Saving files and version control
When you save your FLA files, use a consistent naming scheme for your documents. This is particularly important if
you save multiple versions of a single project.
Some problems might occur if you only work with one FLA file and do not save versions when you create the file. Files
might become larger because of the history that’s saved in the FLA file, or become corrupt (as with any software you
use) while you are working on the file.
If you save multiple versions while developing, you have an earlier version available if you need to revert.
Use intuitive names for your files that are easy to read, not cryptic, and work well online:
•
Do not use spaces, capitalization, or special characters.
•
Only use letters, numbers, dashes, and underscores.
•
If you save multiple versions of the same file, devise a consistent numbering system such as menu01.swf,
menu02.swf and so on.
•
Consider using all lowercase characters in your naming schemes, because some server software is case sensitive.
•
Consider a naming system that uses a noun-verb or adjective-noun combination for naming files, for instance,
classplanning.swf and myproject.swf.
Use the following methods to save new versions of a FLA file when you build an extensive project:
•
Select File
> Save As, and save a new version of your document.
•
Use version control software or the Project panel to control your Flash documents.
You can use several options to save a file: Save, Save As, and Save and Compact. When you save a file, Flash does
not analyze all the data before creating an optimized version of the document. Instead, the changes you make to the
document are appended to the end of the FLA file’s data, which shortens the time it takes to save the document.
When you Save As, Flash writes a new and optimized version of the file, which results in a smaller file size. When
you Save and Compact, Flash creates a new optimized file (removing the undo history) and deletes the original file.
Updated 5 March 2009