PDA

View Full Version : AS2.0 help with Include



Snake Steel
January 24th, 2005, 02:47 PM
I'm working on some classes in Flash Mx 2004 Pro, but I cannot seem to get the #include to work.

This is the error msg Flash gives me:

**Error** myClass.as: Line 1: Classes may only be defined in external ActionScript 2.0 class scripts.
class myClass {

Total ActionScript Errors: 1 Reported Errors: 1

This is my approach, maybe I'm doing something wrong...

1. I have an external AS file called myClass.as, which resides in the same directory as my Class.FLA

2. I have a constructor function in my class called myClass:

class myClass{
public function myClass(){
}
}

What am I doing wrong? :look:

Best regards

senocular
January 24th, 2005, 02:56 PM
what else do you have?

Snake Steel
January 24th, 2005, 03:01 PM
what else do you have?

Hi Senocular, thanks for replying.
I started out by making a menu class, but i still got the same error as the one descirbed above. So right now I don't have anything else. I thought I should get it to work before I spend any more time on something else.

The FLA only contains the Include and a stop action

senocular
January 24th, 2005, 03:08 PM
The FLA only contains the Include and a stop action

THAT is what else. You don't use include with AS 2.0 class files. They are added automatically if used.

Snake Steel
January 24th, 2005, 03:11 PM
THAT is what else. You don't use include with AS 2.0 class files. They are added automatically if used.


Haha...there you go. Thanks heaps. :be:

... "one day I will learn"

senocular
January 24th, 2005, 03:18 PM
;)