Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Creating Components > Creating the ActionScript class file > Importing classes | |||
You can import class files so that you don't have to write fully qualified class names throughout your code. This can make code more concise and easier to read. To import a class, use the import statement at the top of the class file, as in the following:
import mx.core.UIObject;
import mx.core.ScrollView;
import mx.core.ext.UIObjectExtensions;
class MyComponent extends UIComponent{
You can also use the wildcard character (*) to import all the classes in a given package. For example, the following statement imports all classes in the mx.core package:
import mx.core.*;
If an imported class is not used in a script, the class is not included in the resulting SWF file's bytecode. As a result, importing an entire package with a wildcard does not create an unnecessarily large SWF file.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002491.html