03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

#initclip<br />

...initialization actions go here...<br />

#endinitclip<br />

#include directive<br />

#include "[path]filename.as":String<br />

Includes the contents of the specified file, as if the comm<strong>and</strong>s in the file are part of the calling<br />

script. The #include directive is invoked at compile time. Therefore, if you make any<br />

changes to an external file, you must save the file <strong>and</strong> recompile any FLA files that use it.<br />

If you use the Check Syntax button for a script that contains #include statements, the syntax<br />

of the included files is also checked.<br />

You can use #include in FLA files <strong>and</strong> in external script files, but not in <strong>ActionScript</strong> <strong>2.0</strong><br />

class files.<br />

You can specify no path, a relative path, or an absolute path for the file to be included. If you<br />

don't specify a path, the AS file must be in one of the following locations:<br />

■ The same directory as the FLA file. The same directory as the script containing the<br />

#include statement<br />

■ The global Include directory, which is one of the following:<br />

--Windows 2000 or Windows XP: C:\Documents <strong>and</strong> Settings\user \Local Settings\<br />

Application Data\<strong>Adobe</strong>\Flash CS3\language\Configuration\Include<br />

--Macintosh OS X: Hard Drive/Users/Library/Application <strong>Support</strong>/<strong>Adobe</strong>/Flash CS3/<br />

language/Configuration/Include<br />

■ The Flash CS3 program\language\First Run\Include directory; if you save a file here, it is<br />

copied to the global Include directory the next time you start Flash.<br />

To specify a relative path for the AS file, use a single dot (.) to indicate the current directory,<br />

two dots (..) to indicate a parent directory, <strong>and</strong> forward slashes (/) to indicate subdirectories.<br />

See the following example section.<br />

To specify an absolute path for the AS file, use the format supported by your platform<br />

(Macintosh or Windows). See the following example section. (This usage is not<br />

recommended because it requires the directory structure to be the same on any computer that<br />

you use to compile the script.)<br />

34 <strong>ActionScript</strong> language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!