|
-
Intermediate Flash Programmer
Flash 9 compiling .as files, but syntax checker giving weird errors
Hey,
I just downloaded Flash 9, and I'm able to compile and run my .as files ... but the syntax checker spits errors at me as if it were checking AS2.
an example:
Code:
package
{
//
import flash.display.*;
import flash.text.TextField;
//
public class Main extends Sprite
{
public function Main ()
{
createWorldHolder();
}
private function createWorldHolder() {
var world = new MovieClip();
trace (world);
}
}
}
and the errors are:
**Error** C:\Documents and Settings\Admin\Desktop\Flares - AS3\Main.as: Line 7: Attribute used outside class.
public class Main extends Sprite
**Error** C:\Documents and Settings\Admin\Desktop\Flares - AS3\Main.as: Line 8: The class or interface 'Sprite' could not be loaded.
{
**Error** C:\Documents and Settings\Admin\Desktop\Flares - AS3\Main.as: Line 23: ActionScript 2.0 class scripts may only define class or interface constructs.
}
Total ActionScript Errors: 3 Reported Errors: 3
--
Now, that code works. I've tested a few different .as files, and they all compile fine (no error text in output box when I publish the swf) ... I just cant get the damn syntax checker to shutup about that stuff and give me a real report.
Anyone have any ideas on why this is happening?
--
Oh yea, also, if I put any code (even comments) in the main timeline in the .fla, then I get an error like:
ReferenceError: Error #1065: Variable addFrameScript is not defined.
at Main$iinit()
That was from putting the line "//te" in the main timeline.
I'm a bit confused. Sorry for all the questions. I tried searching, but I didnt get any hits that dealt with this ... if anyone has a link Id appreciate it.
Last edited by DGord; 08-04-2006 at 11:46 AM.
-
Senior Member
First of all, when you get a lot of errors use Delete aso before testing the movie.
ReferenceError: Error #1065: Variable addFrameScript is not defined.
at Main$iinit()
Change to extends MovieClip instead of Sprite.
- The right of the People to create Flash movies shall not be infringed. -
-
As stated changing it to "extends MovieClip" works and the reason is that in AS 3.0 the MovieClip class is very similar to the Sprite class but MovieClip works with the timeline whereas the Sprite class does not.
You must not have any code OR comments on the timeline to extend the Sprite class and that is the reason why extending MovieClip does work.
-
resolution?
did you ever resolve this issue? i'm seeing the exact same thing, where the compiler insists on using the AS2 compiler when you actually have AS3 code. i've seen it on my work computer, thought it was a flash problem, then installed flash on another system and am seeing the same thing. its very very frustrating how cryptic the error messages flash produces are.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|