#include
Availability
Flash Player 4.
Usage
#include "[path] filename.as"
Note: Do not place a semicolon (;) at the end of the line that contains the #include statement.
Parameters
[path] filename.as
script; .as is the recommended filename extension.
Returns
Nothing.
Description
Compiler directive: includes the contents of the specified file, as if the commands in the file are
part of the calling script. The
make any changes to an external file, you must save the file and recompile any FLA files that use
it.
You can use
#include
You can specify no path, a relative path, or an absolute path for the file to be included. If you
don't specify a path, the AS file must be in the same directory as the script containing the
statement.
#include
To specify a relative path for the AS file, use a single dot (.) to indicate the current directory, two
dots (
) to indicate a parent directory, and forward slashes (
..
following example section.
To specify an absolute path for the AS file, use the format supported by your platform (Macintosh
or Windows). See the following example section. (This usage is not recommended because it
requires the directory structure to be the same on any computer that you use to compile
the script.)
Example
The following examples show various ways of specifying a path for a file to be included in
your script:
// Note that #include statements do not end with a semicolon (;)
// AS file is in same directory as script
#include "init_script.as"
// AS file is in a subdirectory of the script file directory
// The subdirectory is named "SCRIPT_includes"
#include "SCRIPT_includes/init_script.as"
ActionScript Core Language Elements
The filename and optional path for the script to add to the current
directive is invoked at compile time. Therefore, if you
#include
in script files, but not in class files.
CHAPTER 5
) to indicate subdirectories. See the
/
#include
175
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?