Screens Conventions - MACROMEDIA FLASH MX 2004-USING ACTIONSCRIPT IN FLASH Use Manual

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

Advertisement

Being consistent
There are some guidelines for using behaviors; the main thing is consistency. If you add
ActionScript to a FLA file, put code in the same locations where behaviors are added, and
document how and where you add code.
Note: If you are using a screen-based FLA file, see
information on best practices and screens.
For example, if you place code on instances on the Stage, on the main Timeline, and in class files,
you should examine your file structure. Your project will be difficult to manage, because the code
placement is inconsistent. However, if you logically use behaviors and structure your code to work
in a particular way surrounding those behaviors (place everything on object instances), your
workflow is logical and consistent. The document will be easier to modify later.
Being courteous
If you plan to share your FLA file with other users and you use ActionScript placed on or inside
objects (such as movie clips), it can be difficult for those users to find your code's location, even
when they use the Movie Explorer to search through the document.
If you are creating a FLA file that has spaghetti code (code placed in many locations throughout
the document) and plan to share the file, it is courteous to notify other users that you are using
ActionScript that is placed in or on objects. This courtesy ensures that other users immediately
understand the structure of the file. Leave a comment on Frame 1 on the main Timeline to tell
users where to find the code and how the file is structured. The following example shows a
comment that tells users the location of the ActionScript:
/*
On Frame 1 of main Timeline.
ActionScript placed on component instances and inside movie clips using
behaviors.
Use Movie Explorer to locate ActionScript
*/
Note: It is not necessary to use this technique if your code is easy to find, the document is not shared,
or all of your code is placed on frames of the main Timeline.
Clearly document the use of behaviors if you are working with a complex document. If you keep
track of where you use behaviors, you might have fewer headaches in the long run. Perhaps you
can create a flow chart or list, or use good documentation comments in a central location on the
main Timeline.

Screens conventions

Screens introduce a new way to develop applications by organizing assets, which can dramatically
reduce the time to write an application. You can use screens with or without using the Timeline.
The process that's used to organize documents might seem logical to some developers, or make
more sense for certain screen-based projects; for example, if you have to create an application that
follows a linear process or has multiple states, such as one that requires server validation or
multipart forms that a user must fill out and send to a database. You can also use classes that are
built into screens to quickly and easily add additional functionality to your application.
"Screens conventions" on page 107
for more
Screens conventions
107

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