VerifyError: Error #1024: Stack underflow occurred

Wow – I’d never seen this one before. So I’m putting up here to remind me what to look for if I ever see it again!

Basically I had a SWF that ran fine in debug build mode in FlashDevelop but if I set it to compile as a release version this error soon appeared.
On closer inspection it turns out that in the line that was crashing (which was hard to find in itself) I was using a variable named “h” in a loop. The clue was that this var h:DisplayObject was coloured green by the compiler and therfore most likely an internal variable in a parent class. All I did was change it for something a bit more descriptive and unique and it all compiled. So lessons learnt – listen to the code highlighting hints and don’t be lazy and use short variable names!


A bit of searching also suggested that it may be a Flex 4.1 SDK related bug as I would have assumed that the compiler would give you a warning even when compiling a debug version. If anyone can shine any more light on this one please post.

William Hill Careers Papervision

Baldscone was involved in coding the 3D Flash component of this website. Making extensive use of Papervision 3D and XML to create a custom coded navigate-able panorama, it allows the user to navigate the 3D betting room. Content is all provided dynamically along with jobs ticker. Video, images and text are used in textures and are updated via XML. Hotspots are created using an authoring tool for generating 3D areas and coordinates.

Visit it at:

Using Property Lists

A simple way to get values or settings into a project without having to mess around too much! Just create a property list in xcode called Settings.plist for example and add any key values you need. Then when you instantiate your model load it in as an NSDictionary in and voila!

//Load in Settings
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *plistPath = [path stringByAppendingPathComponent:@"Settings.plist"];
NSDictionary *plistDictionary = [[NSDictionary dictionaryWithContentsOfFile:plistPath] retain];

//Now get out a value using the key name that we have entered in our pList in xcode
NSString *jsonStringURL =  [plistDictionary objectForKey:@"JSON_URL"];

//Show an alert with the value
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"pList Settings" message: jsonStringURL delegate: self cancelButtonTitle: @"OK" otherButtonTitles: nil];
[alert show];
[alert release];