Skip to main content
Inspiring
October 19, 2012
Question

Use of wildcard(*) in import statement

  • October 19, 2012
  • 2 replies
  • 576 views

I am a bit new in Actionscript 3.0 and I love to learn it.

I saw the following two import statements in an actionscript 3.0 code.

import flash.display.MovieClip;

import flash.display.SimpleButton;

In this case, can I use just juse * sign as in import.flash.display.*; ???

Is this change would cause any problem?

Sami

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
October 19, 2012

There are cases when it works and cases when it doesn't, and I don't know if there is a reason.  You can try and see if it makes a difference, and if you get error regarding lack of definition you can hopefully determine that you need to explicitly name the class.

Also, it partly depends on where you are implementing the code.  Usually when coding in the Actions panel you do not need to import most classes at all.  But when you are working with class files you normally have to import any that are not top-level, such as the two you identified.

kglad
Community Expert
Community Expert
October 19, 2012

it won't cause a problem but you will probably be importing a lot of classes (and code) that you won't be using.  so, it's not a minimalist solution.