Monday, April 14, 2008

Problems loading a local XML file in AIR on a Mac

I would never believe that I would curse a Mac -- and it's really not Macs fault! In order to let a user save the photos on this DVD project, I'm trying to build it with AIR and then port to Shu -- but for some reason I am unable to get an AIR file to access a local xml file from the same directory. Here is how I've been trying to do it:

var xmlLoader:URLLoader = new URLLoader();

var file:File = flash.filesystem.File.applicationDirectory;

file = file.resolvePath("my.xml");

var xmlPath:URLRequest = new URLRequest(file.url);

try {
xmlLoader.load(xmlPath);
} catch (error:Error) {
trace("Unable to load requested document.");
}


Works perfectly on Windows but I get the #2032 error on Mac. If I can't get this fixed today then I'll probably be forced to use Zinc instead...

No comments: