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
import com.glenpike.*;


//create a glenpike button.
var btn:Button = new Button(); //won't work or will produce bizarre results, you may need to use...

//...fully qualified classnames
var btn:com.glenpike.Button = new com.glenpike.Button

The wildcard could be problematic if you use lots of libraries or have a big project and someone pointed out it was best practice to fully list all your imported classes...

HTH

Glen

Dwayne Neckles wrote:
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 point me to a resource to
understand the difference between

var mySprite:Sprite = new Sprite;

and

//notice the end ()
var mySprite:Sprite = new Sprite();

Dude good question.. I dont think there is a diference.. cause both works...
and never feel hesitant to ask newbie questions..



Date: Mon, 14 Jan 2008 16:26:37 -0600
From: [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Classes added

I remember reading in a book/article that you can import all the classes you
need and only the ones used by the application will be actually added....
this thought has been bother me because my logic says... "Import all classes
since only the ones used will be added it doesnt matter what classes you
import"

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?

//Another basic question... could some one point me to a resource to
understand the difference between

var mySprite:Sprite = new Sprite;

and

//notice the end ()
var mySprite:Sprite = new Sprite();

I tried to google it but didnt know exactly how to find it..

Thanks for your input...

--
...helmut
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_________________________________________________________________
Make distant family not so distant with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/digitallife/keepintouch.mspx?ocid=TXT_TAGLM_CPC_VideoChat_distantfamily_012008_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to