Merge pull request #866 from LLK/fix_empty_png

Don't thrown an exception when loadBytes fails.
This commit is contained in:
Shane M. Clements 2015-07-23 15:22:08 -04:00
commit 20902bf8a1

View file

@ -547,7 +547,11 @@ spriteFeaturesFilter.visible = false; // disable features filter for now
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageDecoded);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event):void { decodeError(); });
loader.loadBytes(data);
try {
loader.loadBytes(data);
} catch(e:*) {
decodeError();
}
} else if (fExt == '.gif') {
try {
importGIF(fName, data);