This content has been marked as final. Show 7 replies
You can use relative urls. Say for example your xml file was in a folder named assets, you could do:
Hi, The problem is not relative paths, it is loading from the base location that appears to be the problem.
The problem I have is that if I have all my files in the \bin directory that eclipse places them in (including the xml file I need to load using HTTPService) then everything works fine.
If I then create another directory (eg. c:\myFlexExample) and copy all the files from the bin directory (including any sub-directories), when I then start the swf in c:\myFlexExample the HTTPService fails to load the xml file (and the only thing I have specified in the HTTPService URL is the name of the xml file (eg. url="test.xml")?
Any help appreciated, currently stumped on this
Is it possible for you to post a simple example of your mxml code along with the structure of you xml file, and just to make sure, you xml file is static correct?
The code is fairly simple, as an example:
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
<mx:HTTPService id="xmlFile" url="test.xml"
private function applicationStart():void
private function loadXML():void
private function handleLoad():void
// make the application visible to the user
programBox.visible = true; // this just makes the main panel visible
pnlData.setXML(xmlFile); // this just passes the information to a component
private function handleFail():void
// failed to load xml file
programBox.enabled = false; // deliberately disable program
The format of the xml file is simple also, just:
<?xml version="1.0" encoding="UTF-8" ?>
<name>test product 1</name>
(and just further product names which are the first things I use when loading the xml information)
Could it be there is some sort of configuration file/setting I am missing?
Anybody knows the answer to this issue?
I"m having the same issue.
Make sure use-network compile option is set to false (all compile options can be found here http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001500.html ).
Thanks, that solved the problem