I am trying to creat an air app in flex 4. I have an XML file and saved it in the same directory as my compiled air file is. ( c:\programfiles\myApp)
the application should use the xml file to set some of my vars.
the xml format is like this:
<numberOfImages> 20 </ numberOfImages>
and in the main mxml file sould use that xml file and show 20 images per page. and the user just change the xml file and it will change the number of images with out having to know any thing about flex or compiling the app one more time.
the problem is that my app is not loading the xml file.
and the cod looks like this:
var request:URLRequest = new URLRequest("app:/myConfig.xml");
var loader:URLLoader = new URLLoader();
i dont want to give it absolute path like c:\program files\my app. the app will save the xml file in the same directory of the executable file.
can anybody tell my what I am doing wrong?
the following works fine
<?xml version="1.0" encoding="utf-8"?>
<!-- Place non-visual elements (e.g., services, value objects) here -->
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
var loader:URLLoader = new URLLoader(new URLRequest("config.xml"));
private function onComplete(event:Event):void
On another note have you considered using sharedobjects for configuration, this is a great way of having 'local' configuration settings for both AIR and web based Flex applications.