Friday, September 7, 2012

AS3.0 VerifyError: Error #1024: Stack underflow occurred.

Problem:
I recently was publishing an AS3.0 project which was working fine during development testing. Once I published it and loaded in in the browser, the SWF file failed to load properly.

Solution:
First I had to install the debug version of Flash Player so I would be able to see errors that occurred.
Once I had installed this, I was able to see the problem:

VerifyError: Error #1024: Stack underflow occurred.
This can happen for a number or reasons, but my problem happened to be caused by what I call an noncaptured boolean expression.  Basically, it happened because I had this in my code:
DEBUG && trace('[ MainControlMenu ] resolveActionSelection');
The DEBUG variable is a constant that I can set in either the class scope or the project scope and allow me to only trace out certain parts of the application that I was actually working on. This allowed my console to not get cluttered with things that were important just not at this moment in my development.

Ultimately commenting these out or removing them will solve the problem.

No comments: