Skip to main content
Inspiring
July 15, 2008
Question

Actionscript compiler finds an error but doesn't say so!

  • July 15, 2008
  • 1 reply
  • 519 views
Hi! I just spent about an hour very frustrated, because suddenly Flash was ignoring 100% of my actionscript. At first I thought I was having a bug like these people, but I soon realised it would still show compiler errors if iI introduced any typos into my script...

Long story short, I discovered my code would still compile if I commented out some of my actionscript, and I tracked it down to a single line: I had accidentally written
var endPt:Point = new Point(curX+=xOff,curY+=yOff);
A silly mistake, I simply wasn't paying attention..

the problem is, neither was the compiler?? I received NO Compiler Error messages, Output window messages, absolutely no feedback from flash at all, just a complete absence of ActionScript in my SWF. It took me a while to realise it was an "invisible" compiler error that was giving me an SWF without actionscript in it. The debugger obviously wouldn't help me either since there was no AS to connect to.

Why was the compiler unable to tell me what line it found a problem on? Why would it not even tell me it had found a problem, just silently running my SWF instead?
This topic has been closed for replies.

1 reply

Inspiring
July 15, 2008
Out of curiosity I tried this too.
If I define curX, curY, xOff and yOff as numbers, there is no error. If I fail to define them I get a compiler error.
The only way I can avoid a compiler error with that is to switch off strict mode in the actionscript 3.0 publish settings for Flash, which I would not personally recommend doing (likewise for warnings). Beyond that I cannot replicate what you describe.
Inspiring
July 15, 2008
Unfortunately, I have to admit, you're right, I can't get it to happen in a fresh file either. But in my old file, commenting out that line made it work fine, and leaving that line uncommented would mean the debugger would tell me "You cannot debug this SWF because it does not contain ActionScript."

So if the line isn't an error, why was it causing the compiler to abandon all actionscript in the file..?