Abdulla
Abdulla

Reputation: 1127

"Include" external .as files in AS3

I want to include external code without importing a custom class in AS3. My code is getting too long and I need to find a way to segment it into logical groups of functions located in separate ActionScript files. Is this possible?

Upvotes: 4

Views: 20990

Answers (1)

Juan Pablo Califano
Juan Pablo Califano

Reputation: 12333

ActionScript provides the include directive to include the source of one file inside another:

include "[path]filename.as"

Includes the contents of the specified file, as if the commands in the file are part of the calling script.

(You may also see this used as #include, but the # hasn't been required since ActionScript 2.)

Upvotes: 18

Related Questions