to save typing, merely hit control - enter when you start instantiating, and
code completion will enter the import for you, such as:
var c:DisplayOb...(ctrl-entr)...
-Scott
On Jan 15, 2008 3:42 PM, Merrill, Jason [EMAIL PROTECTED]
wrote:
2) It makes it much easier to tell, at a glance, what a
Yep we got that ;)
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven
Sacks
Sent: 15 January 2008 00:55
To: Flash Coders List
Subject: Re: [Flashcoders] Classes added
And by that I mean that it's poorly written, hehe.
14.11 New expressions
A new
nothing will actually be added;
Sprite is an intrinsic class, importing it merely works as typing and as
a definition for compilation (the class is already in the player so
it's not added to the SWF).
So then it is safe to do
import flash.display.*;
and not to worry about bundling up the
Very good point Glen... Although this seems kind of redundant if you import
your classes and then use the qualified name to instantiate a specific
class. But I fully understand what you mean.
On 1/14/08, Glen Pike [EMAIL PROTECTED] wrote:
Hi,
As a quick note:
The reason for specifically
: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Juan
Pablo Califano
Sent: Monday, January 14, 2008 3:11 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Classes added
...
If I'm not mistaken, these are equivalent.
var mySprite:Sprite = new Sprite();
var mySprite:Sprite = new
So then it is safe to do
import flash.display.*;
Only if you're not going to run into any naming conflicts.
I generally find it's better to only import the classes you're going
to use, for a couple reasons.
1) It reduces the chance of naming conflicts (like two packages having
Button classes
2) It makes it much easier to tell, at a glance, what a class
depends on. This can be beneficial in many cases.
That's the main reason I do it, I like to see all dependancies, for my
own benefit and for others who will come after me. package.* always
seemed like a cop-out to me, even if it
Hi, helmut, only the referenced classed will make it to the swf bytecode.
So, if you have:
import somePackage.ClassA;
import somePackage.ClassB;
private var _objectA:ClassA;
Only the ClassA will be compiled. Of course, if you call the constructor,
it'll be compiled as well. That's a
For example in the following:
import flash.display.*;
var mySprite:Sprite = new Sprite();
Does that means that only the Sprite class will be added or will all the
classes under display will still be added?
Only what you *use* will be added. import doesn't include anything, it
merely states
Does that means that only the Sprite class will be added or will all the
classes under display will still be added?
All classes under display will be added if you wrote
import flash.display.Sprite;
then only the Sprite class would be imported..
Another basic question... could some one
Francis Cheng wrote:
See the money quote in the last line of the paragraph:
14.11 New expressions
A new expression results in the invocation of the intrinsic construct
method of the value computed by the expression that follows the new
keyword. Arguments, if specified, are passed to the
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Juan
Pablo Califano
Sent: Monday, January 14, 2008 3:11 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Classes added
...
If I'm not mistaken, these are equivalent.
var mySprite:Sprite = new Sprite();
var mySprite:Sprite
Hi,
As a quick note:
The reason for specifically listing all the classes you actually use,
rather than having wildcards means that you won't get clashes between
the same classnames that may appear in different packages, e.g.
//Button class in here
import mx.controls.*;
//Button in here too
And by that I mean that it's poorly written, hehe.
14.11 New expressions
A new expression results in the invocation of the intrinsic construct
method of the value computed by the expression that follows the new
keyword. Arguments, if specified, are passed to the construct method. If
no
14 matches
Mail list logo