[Flashcoders] OOP 101: Is import really necessary?

2006-05-25 Thread Rifled Cloaca
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

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

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

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

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

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

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

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 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 Merrill, Jason
101: Is import really necessary? 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

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

2006-05-25 Thread Nick Weekes
? 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

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

2006-05-25 Thread Jonathan Berry
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? Errm - actually that's not such a good reason

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

2006-05-25 Thread j.c.wichman
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. All it does is tell the compiler that when you type (for example) MyClass

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

2006-05-25 Thread Merrill, Jason
: [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 them. On 5/25/06, Merrill, Jason [EMAIL PROTECTED] wrote: The 'import' statement

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

2006-05-25 Thread Derek Vadneau
- From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, May 25, 2006 1:24 PM 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

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

2006-05-25 Thread Geoff Stearns
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 to com.fred.MyClass. Err...that has not been my

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

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

2006-05-25 Thread Weldon MacDonald
[] notation! Derek Vadneau - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, May 25, 2006 1:24 PM Subject: RE: [Flashcoders] OOP 101: Is import really necessary? The 'import' statement doesn't

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

2006-05-25 Thread James Booth
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 class is *not* included in the swf until you

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

2006-05-25 Thread Derek Vadneau
@chattyfig.figleaf.com 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 full

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:

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

2006-05-25 Thread James Booth
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. Within FirstClass

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

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 Derek Vadneau
- Original Message - From: Ian Thomas [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com 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

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

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 compiled even though

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

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']); //