views:

315

answers:

1

Hi,

I'm loading a few huge images on my flex/as3 app, but I can't manage to catch the error when the flash player runs out of memory.

Here is the what I was thinking might work (I use ???? because i dont know what to catch):

try{
    images = new Array(frames);
    for (var i:uint = 0; i < frames; i++){
         imagesBA[i] = new BitmapData(width, height, false, 0x000000FF);
    }
 }
catch(error:????){
     Alert.show("Out of memory!");
}

Any idea what ???? can be?

Or does anyone knows how to catch when there is no memory for a variable?

A: 

Have you tried flash.errors.MemoryError. I haven't check if it works, but the asdoc seems to say that's the way to go.

sharvey
No, that didn't catch it! :-/
StfnoPad