MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 265

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

This code declares the same variable inside an inner block.
Do not assign many variables to a single value in a statement, because it is difficult to read,
as you can see in the following ActionScript code samples:
// bad form
xPos = yPos = 15;
or
// bad form
class User {
private var m_username:String, m_password:String;
}
Have a good reason for making public instance variables, or public static, class, or member
variables. Make sure that these variables are explicitly public before you create them
this way.
Set most member variables to private unless there is a good reason to make them public. It
is much better from a design standpoint to make member variables private and allow
access only to those variables through a small group of getter and setter functions.
About naming class files
Class names must be identifiers—that is, the first character must be a letter, underscore (
dollar sign (
), and each subsequent character must be a letter, number, underscore, or dollar
$
sign. As a preferred practice, try to always limit class names to letters.
The class name must exactly match the name of the ActionScript file that contains it,
including capitalization. In the following example, if you create a class called Rock, the
ActionScript file that contains the class definition must be named Rock.as:
// In file Rock.as
class Rock {
// Rock class body
}
You name and create a class definition in the following section. See the section
packaging your class files" on page 266
information on naming class files, see
to create, name, and package the class files. For more
"Naming classes and objects" on page
Example: Writing custom classes
), or
_
"Creating and
739.
265

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents