Just wondering, is it possible to limit number of 'imports' in AS3 code by defining them in parent class or in any other way?
Thanks in advance
Just wondering, is it possible to limit number of 'imports' in AS3 code by defining them in parent class or in any other way?
Thanks in advance
I wouldn't recommend it but you can use #include
to include a standard set of imports (or any AS3 code).
Also you can use import com.whatever.*
to import by package instead of class.
I would say that you shouldn't worry about it! It doesn't matter how much import statements you have. If you need to use the classes, then you need to import them.
A good IDE (e.g. FlashDevelop) will manage your imports anyway, so you don't even need to think about it.
I personally think (and I am sure that a lot of programmers would agree) that you should hide/obscure how a system works from yourself. It should be obvious what is going on, and not "weird". Stick to the best practices, which is having your imports at the top of your class.