ok its early for me but I think you dont actually need to import if
you provide the full classpath for your datatypes:

private var myVar:com.blah.MyDataType

will work just fine, without an import, i beleive.  however, if you
wanted to do:

private var myVar:MyDataType;

then you would need to tell flash which class you were referring to,
by importing the pakcage/class info.

import com.blah.MyDataType;


basically, 'import' is almost like setting a shortcut to refer to a
particular class without using its full package name.




On 5/25/06, Merrill, Jason <[EMAIL PROTECTED]> wrote:
>>So this is one of those things I wonder about.  If I type a
>>var to a custom type, doesn't the compiler automatically
>>import the associated class files?
>>When or why would I need to explicitly need to use the import
>>directive?

Because if Flash imported every class available to it automatically,
then your .swf files would be huge and unnecessarily bloated.  Do you
really want the code to all the Remoting classes imported into your .swf
if you're not using them? When you include, the actionscript cotained in
the class is embedded in the .swf.

Jason Merrill
Bank of America
Learning Technology Solutions








>>-----Original Message-----
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Rifled Cloaca
>>Sent: Thursday, May 25, 2006 11:23 AM
>>To: Flashcoders mailing list
>>Subject: [Flashcoders] OOP 101: Is import really necessary?
>>
>>Flashcoders,
>>
>>So this is one of those things I wonder about.  If I type a
>>var to a custom type, doesn't the compiler automatically
>>import the associated class files?
>>When or why would I need to explicitly need to use the import
>>directive?
>>
>>Thanks in advance!
>>-g
>>_______________________________________________
>>Flashcoders@chattyfig.figleaf.com
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com http://training.figleaf.com
>>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to