import statement helps you to import a class into Flash so that you do not need to type the full path to reference to a class.
Taking the new
Matrix class as an example:
mat = new Matrix();
can be written as:
mat = new flash.geom.Matrix();
import statement only import classes into the current frame or object. Therefore, for another frame or object, you will need to import again or type the full path to access the class.
2> if an imported class is not used, it will not be exported in the swf, which means the file size will not be affected.
import statement is only needed when you want to make a new instance (using the constructor e.g.
new Matrix()) of that class. In the following example, we do not need to import anything as the matrix object is copied from an existing matrix:
mat = mc.transform.matrix;
mc.transform.matrix = mat;
We can access all the matrix methods and properties of
mat without importing anything.