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

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

When you import class files, the following rules apply:
The
statements can exist in the following locations:
import
Anywhere before the class definition in class files
Anywhere in frame or object scripts
Anywhere in ActionScript files that you include in an application (using the
statement).
You import individual, packaged definitions using this syntax:
import flash.display.BitmapData;
You can import entire packages using the wildcard syntax:
import flash.display.*;
You can also include ActionScript code in a Flash document (FLA) file using an
statement. The following rules apply to the
statements are essentially a copy and paste of the content inside the included
include
ActionScript file.
statements inside ActionScript class files are relative to the subdirectory that
include
contains the file.
An
statement in a FLA file can only bring in code that is valid inside FLA files,
include
and the same goes for other places that
have an
include
can exist in the included ActionScript file:
// Foo.as
class Foo {
#include "FooDef.as"
}
// FooDef.as:
var fooProp;
function fooMethod() {}
trace("Foo"); // This statement is not permitted in a class definition.
For more information on the
ActionScript 2.0 Language Reference. For more information on classpaths, see
and modifying the classpath" on page
About setting and modifying the classpath
In order to use a class or interface that you've defined, Flash must locate the external
ActionScript files that contain the class or interface definition. The list of directories in which
Flash searches for class and interface definitions is called the classpath.
240
Classes
statement inside a class definition, only property and method definitions
statement, see #include directive in the
include
240.
statement:
include
statements can live. For example, if you
include
#include
include
"About setting

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?

This manual is also suitable for:

Flash 8

Table of Contents