Tuesday, September 8, 2009

AS3: "include" directive to include code

The "include" directive is useful for organising code. This directive does not work like c/c++ directive, in flash it is used to inline code. So any code in the file included will be inlined where ever you specify it.

For example if you have a file constants.as residing in the same directory as your code, then the code would look like this:

Some as3 code;
include "constants.as" // Code from constants.as is inlined here.
Some more as3 code;

No comments:

Post a Comment