simple question for as developer

hello everyone, I know this is may be a stupid question, but I just started to code in AS few weeks ago. Instead of having the whole long confusing piece of code in one file, can I "scatter" the different classes in different files?
thanks k
kugoAsked:
Who is Participating?
 
blue-genieCommented:
are you using AS2.0 or AS1.0?
if you're using as2.0 each class needs to be in a separate class file, your class files can be located anywhere though would be most wise to set in one location so you can set your class path.
also, in AS2.0 you wouldn't use include but rather import.

in as1.0 you can do it as roonaan says.
0
 
RoonaanCommented:
You can use the #include 'myfile.as' statement (don't add a semicolon to the end).

The path to the as file is calculated from the base of your .fla file.

so when you have below filestructure and want to include as2.as from as1.as.
myfla.fla
as/as1.as
as/as2.as

Then you would still have to use:
#include 'as/as2.as'

-r-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.