Skip to main content
Known Participant
August 11, 2011
Question

Flex Mobile: Loading local XML outside of application folder

  • August 11, 2011
  • 1 reply
  • 1446 views

Hello everbody,

we created a new mobile project with flex 4.5 with a blank template.

Now we would like to load local xml files outside of our default application folder (deploy/global/bin-debug)

We created a new folder within the project for our xml's e.g. "deploy/global/xml".

Now we would like to access these xml's via:

var url:URLRequest =  new URLRequest("../xml/InitialContent.xml");

myURLLoader.load( url );

Unfortunetely we get an Error:

Error #2032: Stream Error. URL: app:/xml/InitialContent.xml

If we created a normal web project everything works as expected.

If we put our xmls in "deploy/global/bin-debug" xml loading is not failing.

Any suggestions?

Regards,

Jan

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
August 11, 2011

The "../" part of your URL takes you up one level in the file structure, and you can't do that on mobile. Can't the xml be at the root level of the app, or in a folder?

wManAuthor
Known Participant
August 11, 2011

Hello Collin,

we can put the xml's in the root folder of our app, e.g. global/deploy/bin-debug and thats what we actually do for now as a workaround,

but the bin-debug folder by default is not under svn-version control and we can't commit changes to these files.

Thats why we would like to put these files in another folder outside of the application root folder.

Colin Holgate
Inspiring
August 11, 2011

You say "by default", could you add it to svn? You're only wasting a tiny bit of svn time by having it also handle the swf too.