开发者

Not sure where these syntax errors are coming from

I'm making a game using ActionScript 3.0 and the 2D game library FlashPunk.

I can't compile my program without getting these errors:

1086 Syntax Error: expecting semicolon before name.
1093 Syntax Error
1093 Syntax Error
1093 Syntax Error

Here's a screenshot showing them in Flash Builder:

Not sure where these syntax errors are coming from

All the files check out OK. None of them have little red X's to imply that's where the error is coming from. I really don't know where these errors are or how to debug them.

Anyone know how to debug this? Thanks in a开发者_开发百科dvance.


It doesn't look like you have any syntax errors in your code.

But: If you copied and pasted any code from the internet, or from a Word document, or from a TextField in the Flash IDE, or if this class was written on a Windows system and you're editing on the Mac, or if anything similar is true, you might have problems with invisible null characters. Try to search for \x00 (check regular expressions) and replace-all with an empty string.

If nothing else helps, re-type your entire class from scratch - invisible stuff might still be in there.

Edit:

To clarify: The invisible null character is read as an EOF (end-of-file) and this causes your compilation to fail. This is also why the error codes seem to make no sense.

I get these errors every time I paste text copied from TextFields in the Flash IDE, no matter what the text and/or font formatting is.


Don't you need to give the package a name?

e.g.

package asdata {
 .. your code...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜