load an external file with urlloader doesn't work in AIR


had few problems loading external xml file urloader. read somewhere use

file.applicationdirectory.resolvepath('examplefileurl.xml');

is normal way load external xml files or indeed files swfs etc... , regards mobile way?

not exactly.

 

1. applicationdirectory static property of file class. 

2. don't want use applicationdirectory ,

3. should use filesystem class load files local file system:

 

var file:file = file.applicationstoragedirectory.resolvepath('examplefileurl.xml');

var fs:filesystem=new filesystem();

fs.open(file, filemode.read);

var xml:xml = xml(fs.readutfbytes(fs.bytesavailable));

fs.close();

 

trace(xml.toxmlstring());



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues