This content has been marked as final. Show 7 replies
Yes! It seemed to me at the beginning to be a path problem too but notice this:
I thought it could be a problem with some relative paths. But I found out that while the project is working when I run it from pojectFolder/bin/main.html, it is not working if I remove it from Flex Builder (without removing the project files) and run it from the same main.html file.
I have the project folder on my hard drive. The project also appears in the Flex Builder's Navigator panel. In this case it's working. When however I remove the project from the list of projects in Flex Builder it can't get the data from the server. The project files are not moved. They are in the same directory. The same path. The only difference is the project is not listed in Flex Builder.
ok so are you trying to retrieve data that is located on an external server or a server running on your own machine?
First - thank You for the interest!
The server is external.
I made a simple project with several lines of code that requests data from the server trying to isolate the problem. I'd be very thankful if You can test it too.
Here is the archive.
And here is the XML file it's requesting.
You can use File -> Import -> Archive File to import it in Flex Builder then open main.mxml and run the application in order to see how it's working.
Then to see how it's not working just delete the project from Flex Builder's Navigator panel and run it from pojectFolder/bin/main.html or move the project folder somewhere and run it from the same file.
So just to further clarify, this app will run on a different server then where the data is hosted and it cant receive the data after you move it outside of the project? Do you have permission to receive content from the server in the form of a crossdomain.xml?
What you have encounted sounds like a Security sandbox issue. When you develop a SWF using either Flex Builder or the Flash IDE, the SWF is placed into a security sandbox set to "local trusted". This means that it can access any resource which is handy for development. But when you move the swf to a server, the SWF will have a security sandbox of "remote" and then different security rules apply. Using a crossdomain.xml file on the remote resource should solve the problem.
You should see the security error when you make the request. Here's a link to more details:
You are right! I uploaded the project on the server where the php files are and it works! That's great! :) I should try adding a crossdomain.xml when trying to use it on different domains. Thank you very much both of you!