Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The only hit should be compile time, but <strong>rday</strong> writes that there is apperently a small hit. But that should be something that Adobe will fix in the future.</p> <p>The import statements should not really be looked on as actual imports, it is merely a way for the compiler to know which classes you are refering to.</p> <p>eg. If you made you own <code>Point</code> class and it was being used in another package, the compiler needs to know if you are refering to your own <code>Point</code> class or the Adobe <code>Point</code> class.</p> <p>The alternative would be to write the fully qualified name evertime you refered to a class.</p> <p>eg. <code>var mySprite:flash.display.Sprite = new flash.display.Sprite();</code></p> <p>As pointed out by <strong>Juan Pablo Califano</strong> in the comment, this does not actually work with the compiler (though I think it might work with AS2). I merely meant to point out why we have import statement to begin with.</p> <p>In any case it should not effect the compiled file if you import a whole package (though it apperently does). It will how ever effect compile time, since you are giving the compiler more stuff it needs to look through.</p> <p>As for "importing" the same class more than once. It will not make a difference. The compiler will only include the same class once. Else the compiled file size would quickly spin out of control, since most classes refer to many classes which again refer to others etc. But again, Adobe might have optimizing to do there.</p> <p>Bottom line is you should only import the stuff you need, there is no real advantage to importing a whole package. Just use a proper coding tool like <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page" rel="noreferrer">FlashDevelop</a> (it is free) and you do not even have to write the import statements yourself.</p> <p>On a side note, if you are compiling a library (where a class not refered to are also included), im not sure if importing a external package might include that in you compiled file. That might have an actual impact; though hopefully Adobe did not screw up there ;)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload