Perfect, thanks heaps for that, that's certainly tidied up my Output Window a
bit - and now I can take my external .AS files into Flash and get it to tidy
them up for me ;>
Chris Hill wrote:
Yes, working with your AS in an external editor is much better than
having it haphazardly placed in a bunch of different clips. But if you
just want to place your internal code into an external file there are a
couple things to know:
If you just want to include your code into flash, you use the #include
directive like so:
#include "mycode.as"
BUT this won't necessarily work because AS2.0 code is put into
containers called 'classes'. Flash will look in the .fla's folder for
any class files, and make sure the syntax is correct. An unfortunate
side effect of this is that if you migrate all your internal code into
an external file _in the same folder_ flash will automatically assume
you are creating an AS2.0 class. In reality you're just using normal AS
externally. This is why you're getting the erroneous error "ActionScript
2.0 class scripts may only define class or interface constructs." Flash
thinks you're making a class but you're not, because the working folder
is part of AS2's 'classpath'.
So you can either place your code somewhere else like so:
#include "../src/mycode.as"
or go into Edit->Preferences->ActionScript->Actionscript2.0 Settings and
remove the entry in the list for the '.'
C
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders