03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Specifies that a class must define all the methods declared in the interface (or interfaces) being<br />

implemented.<br />

Example<br />

See interface.<br />

See also<br />

class statement<br />

import statement<br />

import className import packageName.*<br />

Note: To use this keyword, you must specify ActionScript 2.0 <strong>and</strong> Flash Player 6 or later in<br />

the Flash tab of your FLA file's Publish Settings dialog box. This statement is supported in the<br />

Actions panel as well as in external class files.<br />

Lets you access classes without specifying their fully qualified names. For example, if you want<br />

to use a custom class macr.util.users.UserClass in a script, you must refer to it by its fully<br />

qualified name or import it; if you import it, you can refer to it by the class name:<br />

// before importing<br />

var myUser:macr.util.users.UserClass = new macr.util.users.UserClass();<br />

// after importing<br />

import macr.util.users.UserClass;<br />

var myUser:UserClass = new UserClass();<br />

If there are several class files in the package (working_directory/macr/utils/users) that<br />

you want to access, you can import them all in a single statement, as shown in the following<br />

example:<br />

import macr.util.users.*;<br />

You must issue the import statement before you try to access the imported class without fully<br />

specifying its name.<br />

If you import a class but don't use it in your script, the class isn't exported as part of the SWF<br />

file. This means you can import large packages without being concerned about the size of the<br />

SWF file; the bytecode associated with a class is included in a SWF file only if that class is<br />

actually used.<br />

The import statement applies only to the current script (frame or object) in which it's called.<br />

For example, suppose on Frame 1 of a Flash document you import all the classes in the<br />

macr.util package. On that frame, you can reference classes in that package by their simple<br />

names:<br />

// On Frame 1 of a FLA:<br />

188 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!