Caution: When you select Save and Compact, you cannot undo any changes you made before you
saved the file. If you select Save when working with a document, you can undo prior to that save
point. Because Save and Compact deletes the earlier version of the file and replaces it with the
optimized version, you cannot undo earlier changes.
Remember to frequently use Save As and type a new file name for your document after every
milestone in your project if you are not using version control software to create backups of your
FLA file. If you encounter major problems while working on the document, you have an earlier
version to use instead of losing everything.
There are many software packages that allow users to use version control with their files, which
enables teams to work efficiently and reduce errors (such as overwriting files or working on old
versions of a document). Popular version control software programs include CVS, Subversion,
and SourceSafe. As with other documents, you can use these programs to organize the Flash
documents outside Flash.
General coding conventions
Typically, 80% of your development time is spent debugging, troubleshooting, and practicing
general maintenance, especially on larger projects. Even when you work on small projects, a
significant amount of time is usually spent analyzing and fixing code. When you are working on
large-scale projects, you might work with a team. The readability of your code is important for
your benefit and the benefit of your team members. When following conventions, you increase
readability, which increases workflow and helps find and fix any errors in your code, and all
programmers follow a standardized way of writing code, which improves the project in many
ways.
The following sections contain several suggestions and guidelines for general coding practices that
help improve your workflow and help teams working on a project. This section describes general
coding conventions that are true for many programming languages;
standards" on page 82
Note: Flash Player 7 closely follows the ECMA-262 Edition 4 proposal. It is useful to see this
proposal for information on how the language works. (See
www.mozilla.org/js/language/es4/index.html.)
General naming guidelines
This section covers naming guidelines for ActionScript and classes. The naming guidelines are
detrimental to creating logical code: the primary purpose is to improve readability of your
ActionScript. How you name a file can describe the item or process but not refer to its
implementation. Avoid using nondescriptive names for methods or variables. For example, if you
retrieve a piece of data that is the visitor's username, you might use
less descriptive
getData()
accomplish it. It is also a good idea to keep all names as short as possible.
Note: All variables must have unique names. Although names are case-sensitive in Flash MX 2004,
do not use the same name with a different case because this can be confusing to programmers
reading your code and cause problems in earlier versions of Flash that do not force case sensitivity.
discusses conventions that are specific to ActionScript.
. This example expresses what is happening rather than how you
"ActionScript coding
instead of the
getUserName()
General coding conventions
69
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