The "import <class>;" is what creates the instance?  So in other words, if I 
use the import <thisfile.mxml> in each of my other files, each one is creating 
another instance of the <thisfile.mxml>?

________________________________

From: [email protected] on behalf of Michael VanDaniker
Sent: Tue 7/29/2008 10:30 AM
To: [email protected]
Subject: {Disarmed} Re: {Disarmed} RE: [flexcoders] mxml components



> Are these the same instance or unique instances with in each of the
> class instances themselves (mainclass/class3)?
> 
> 
> 
> MainClass.mxml:
> 
> 
> 
> <mx:script>
> 
> <![CDATA{
> 
> Import com.myapp.models.LoginClass;
> 
> ...
> 
> ..
> 
> 
> 
> And
> 
> 
> 
> Class3.mxml
> 
> <mx:script>
> 
> <![CDATA{
> 
> Import com.myapp.models.LoginClass;
> 
> ...
> 
> ..

These are not instances. You create instances by either declaring
them in MXML or using the new operator in script. The import
statements make LoginClass available to MainClass and Class3 so you
can create instances of LoginClass from within each of those
components. You don't need an import statement if the class you
reference is in the same package you are referencing it from.



 

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is 
believed to be clean. 

<<winmail.dat>>

Reply via email to