EDIT: In addition to Nambew's answer, make sure that the default program which opens .as files is set to Flash rather than anything else (my default program was set to Dreamweaver which might've also been causing problems as well.
I am using flash CS5 and went to
File -> Publish settings
to pick the Document class. My flash file is called
CircleExample.fla
and is in a folder called
CircleExample
. In the same folder and same directory as the flash file, I have my actionscript file which is called
CircleExample.as
which is just this:
package {
import flash.display.MovieClip;
public class CircleExample extends MovieClip {
public function CircleExample() {
// constructor code
var red:Shape = createCircle( 0xFF0000, 10 );
red.x = 10;
red.y = 20;
}
}
}
Now, for some reason, when I make
CircleExample.as
my document class and click "validate class definition" it says
A definition for the document class could not be found in the classpath, so one will be
automatically generated in the SWF file upon export.