artvolk
artvolk

Reputation: 9518

Minimize number of imports in AS3

Just wondering, is it possible to limit number of 'imports' in AS3 code by defining them in parent class or in any other way?

Upvotes: 0

Views: 187

Answers (2)

Adam Harte
Adam Harte

Reputation: 10510

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.

Upvotes: 1

Samuel Neff
Samuel Neff

Reputation: 74909

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.

Upvotes: 1

Related Questions