PDA

View Full Version : Why import classes?



wvoets
August 1st, 2007, 02:08 PM
This might be a stupid question... but why do you have to import classes?
For instance:


import flash.display.StageScaleMode;
stage.scaleMode = StageScaleMode.NO_SCALE;

But if you leave out "import flash.display.StageScaleMode;" it still works.
I can understand it wouldn't work with custom classes.

Anyone any idea?
Thanks & Cheers, Wim

senocular
August 1st, 2007, 02:25 PM
Flash CS3 will automatically import all the classes in the flash package to prevent that need. If you're not writing code within Flash, though, you will need to be sure to import your classes so their references can be correctly resolved.

wvoets
August 1st, 2007, 03:53 PM
Thanks for the reply senocular!