Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Fumio Nonaka
I nailed down this issue. If a class is imported in the timeline, its super class will be embedded. // Class definitions: class Test extends Super {} class Super {} // Timeline: _root import Test; // Test; trace(_global['Super']); // Output: [type Function] trace(_global['Test']); // Output:

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Fumio Nonaka
It is a very interesting find, Derek. I haven't noticed that. _ Derek Vadneau wrote: Now the docs say that import by itself doesn't include the classes, but I used this code: import mx.controls.Button; import mx.controls.List; import mx.controls.Tree; import mx.controls.DataGrid; import mx

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread James Booth
Sent: Thursday, May 25, 2006 4:27 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] OOP 101: Is import really necessary? > Then how do you explain my results? > Because some of those classes instantiate other classes (in the UIObject hierarchy), so those classes are compile

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread ryanm
Then how do you explain my results? Because some of those classes instantiate other classes (in the UIObject hierarchy), so those classes are compiled even though you didn't instantiate the first class. Importing *any* of the MM UI components will instantiate all kinds of lower-level classe

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Rifled Cloaca
inal Message - From: "Ian Thomas" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, May 25, 2006 3:47 PM Subject: Re: [Flashcoders] OOP 101: Is import really necessary? Hi Derek, That's really interesting - and goes against everything I'd expec

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Derek Vadneau
ing. Derek Vadneau - Original Message - From: "Ian Thomas" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, May 25, 2006 3:47 PM Subject: Re: [Flashcoders] OOP 101: Is import really necessary? Hi Derek, That's really interesting - and goes ag

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Hi Derek, That's really interesting - and goes against everything I'd expect. Particularly when your other results have kind of proved the opposite (and I've certainly proved the opposite before with ClassFinder situations). A couple of other tests might prove illuminating... - Is the same true

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Yep - just to reiterate (and hopefully make it more clear): The line: import com.fred.MyClass; Is _not enough_ to get Flash to compile MyClass into your .swf file. You need to actually _reference_ MyClass for it to be included. e.g. var a:MyClass=new MyClass(); In fact, import is _nothing to d

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread James Booth
James Booth Sent: Thursday, May 25, 2006 3:17 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] OOP 101: Is import really necessary? There is a bit of an anomaly with importing classes... For example you have 3 classes. Let's call them FirstClass, SecondClass and ThirdClass

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Rifled Cloaca
Derek, Where did you place those imports? On the timeline, or in an external AS class file? Would it make a difference? -g ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/m

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Derek Vadneau
ailing list" Sent: Thursday, May 25, 2006 2:54 PM Subject: Re: [Flashcoders] OOP 101: Is import really necessary? The import statements tell the compiler where to find the classes your going to use, it compiles into the byte code only the classes you use. You could also do it by giving the fu

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread James Booth
AIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geoff Stearns Sent: Thursday, May 25, 2006 2:36 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] OOP 101: Is import really necessary? import in flash is only used to save you some typing. when you use import com.package.Class; the c

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Weldon MacDonald
ed. However, someone could prove me wrong. Incidentally, the file size was 42.5 KB ... so, trim the fat and use [] notation! Derek Vadneau - Original Message - From: "Merrill, Jason" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, May 25, 2006

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Steven Sacks
Also interesting to note here. If you make two layers in the timeline and in the top layer you put x = 10; And the bottom layer you put trace(x); you'll get 10. However, if in the top layer you put import SomeStaticClass; And in the bottom layer you put SomeStaticClass.someMethod(); It d

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Geoff Stearns
ay 25, 2006 7:25 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] OOP 101: Is import really necessary? The 'import' statement doesn't actually embed a class into the .swf. All it does is tell the compiler that when you type (for example) MyClass, you are actually referring

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Derek Vadneau
as 42.5 KB ... so, trim the fat and use [] notation! Derek Vadneau - Original Message - From: "Merrill, Jason" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Thursday, May 25, 2006 1:24 PM Subject: RE: [Flashcoders] OOP 101: Is import really necessary?

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Merrill, Jason
hcoders mailing list >>Subject: Re: [Flashcoders] OOP 101: Is import really necessary? >> >>I think what he is saying is that if you had a dozen imports or imported an >>entire package (*) it would not include the specific classes until you >>actually referenced the

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread j.c.wichman
ROTECTED] On Behalf > Of Merrill, Jason > Sent: Thursday, May 25, 2006 7:25 PM > To: Flashcoders mailing list > Subject: RE: [Flashcoders] OOP 101: Is import really necessary? > > >>The 'import' statement doesn't actually embed a class into the .swf. &g

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Jonathan Berry
e? Jason Merrill Bank of America Learning Technology Solutions >>-Original Message- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of Ian Thomas >>Sent: Thursday, May 25, 2006 12:27 PM >>To: Flashcoders mailing list &g

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Nick Weekes
what MyCoolClass is otherwise? Jason Merrill Bank of America Learning Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: Thursday, May 25, 2006 12:27 PM To: Flashcoders mailing list Subject:

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Merrill, Jason
sday, May 25, 2006 12:27 PM >>To: Flashcoders mailing list >>Subject: Re: [Flashcoders] OOP 101: Is import really necessary? >> >>Errm - actually that's not such a good reason. >> >>The 'import' statement doesn't actually embed a c

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Jonathan Berry
I think what he is asking is if this is the same as import: var myObj:mx.core.UIObject = new mx.core.UIObject; I think one of the answers is that it saves on typing out the class info for every reference. Any other benefits to import? On 5/25/06, Merrill, Jason <[EMAIL PROTECTED]> wrote: >>So

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Ian Thomas
Errm - actually that's not such a good reason. The 'import' statement doesn't actually embed a class into the .swf. All it does is tell the compiler that when you type (for example) MyClass, you are actually referring to com.fred.MyClass. You could just type com.fred.MyClass throughout the body

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Rich Rodecker
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 te

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Arul Prasad
import in AS2, is to help you avoid typing in the complete package name everytime u reference a class. The following code import mx.controls.Button; var playBtn:Button; ... var stopBtn:Button; var pauseBtn:Button; will look like this: var playBtn:mx.controls.Button; ... var st

RE: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Merrill, Jason
>>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 automa

Re: [Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread mike cann
If you are talking about flash, no i believe it doesnt automatically import your class for you. You may be getting confused with the new Flex Builder 2 which does infact import automatically for you. On 25/05/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote: Flashcoders, So this is one of those thi