This content has been marked as final. Show 24 replies
Where is the data being pulled from? If it's an xml file, make sure it is also deployed on the server whwre the app is run from.
Thanks for the reply.
Data returned is a XML file. Its another server in the company and application will run on our intranet only.
I was able to sovle this problem partly. I copied the bin-release folder to my desktop. Tried executing app, it didnt wrk. Then I added this folder on my desktop as a secure folder in flash global settings and now it works from my desktop.
So basically it is the security setting of the flash player.
How do I code this part or what is the workaround for this problem
Flex needs a web server for its application to run. All files must be on a web server.
If you want to build a desktop application, you'll need to make it an AIR application, not Flex.
Happy Flex Year!
Regardless the application should run from local machine as well as server and not just from the default bin-debug folder
Your Flex application cannot be deployed as you intend. The Flash Player's security settings do not allow deployment on an intranet.
What are you trying to do exactly?
Its a report, source server outputs a XML file.
The Flex application (to be hosted on our web-server) will read this XML data and display data in a table.
I don't see a reason why this cannot be done.
"chintan741" <email@example.com> wrote in message
> Its a report, source server outputs a XML file.
> The Flex application (to be hosted on our web-server) will read this XML
> and display data in a table.
> I don't see a reason why this cannot be done.
Have you put a crossdomain.xml folder on the server with the xml to allow
access from the other server?
Let me try again....
The Flex application AND the xml data file (or any data accessed by your application) must be located on the same web server.
If your data are on a different web server, then you must install a cross-domain policy file in the root of the web server which hosts the Flex application.
Thanks for the reply you gt it now.
I tried this in my code:
but this didnt work.
Next I created a crossdomain policy file with:
<allow-access-from domain="*" />
Even this didnt worked, i copied this policy file in alll possible folders on server. Also tried to load it in the code.
Further searching I came across below url which suggests to add a script php or java servlet on the server and read and save file on the server. Now flex reads local xml file saved on the server.
Is there any better way,
thank for all your help,
Can you tell us:
1) Where is the data xml file located (full path)?
2) Where is your flex application located(full path)?
3) Post your HTTPService code for us to see.
I think we'll be able to answer your question then. So far I still haven't figured out where your xml data file is in relation to the Flex application.
First of all thanks for taking time to reply my query.
I have ServerA which hosts our transactional system.
ServerB hosts the flex application.
Flex application makes a call to XML file on server and displays results in table.
The parameters entered by user in the flex application are added as get parameters while making http call to the Server A.
This how my code looks like:
Let me know if you need more info.
The link you posted is way out of date (2005).
You must put a cross-domain policy file in the root of "SERVER A".
Also, your HTTPService is very complex, so you should be absolutely positive it is working correctly.
Use the HTTPService's "result" and "fault" handlers to see what is getting returned, and if not, what the server error was.
I have prepared a crossdomain file:
<!DOCTYPE cross-domain-policy SYSTEM " http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<allow-access-from domain="*" />
If I place this file in the same folder as the flex files and then use the following statement in flex code:
Shouldnt this work?
HTTP service is working perfect.
Also I have event handlers in the flex code.
Just not able to figure out about the policy file..
See my last two comments...
Your policy file is on the wrong server.
This is what I tried:
With Flash version after 8, policy file can be loaded from any other location using this command. It no longer needs to be in the root dir of the other domain
Still this is not working.
Stubborn, aren't we? Ok, let me try again:
You only use "loadPolicyFile" to load a non-default policy file. remove that line from your code.
Also you do not need this line:
...in your code. Remove it. This is used when you have two SWFs on two different servers. You do not.
Again, read this page:
Your answer is there.
Hint: all you need is to *properly* deploy a cross-domain policy file. Really. I'm being very honest here. Have I ever lied to you before? No, I haven't. So you're buying the first round tonight after work, ok?
In my case getting access to the root dir of the serverB is quite tough or even copying crossdomain.xml
Is there anyother option I can try.
I know of no other way. You cannot circumvent the Flash Player security. Your only other option is to put the Flex application on the same server as the data, "Server A".
Thanks for all you reply,
One last question,
My XML source is:
If I put crossdomain.xml at the same level:
Then can I use:
Or still this is wrong.
"rtalton" <firstname.lastname@example.org> wrote in message
> Stubborn, aren't we? Ok, let me try again:
> You only use "loadPolicyFile" to load a non-default policy file. remove
> line from your code.
> Also you do not need this line:
> ...in your code. Remove it. This is used when you have two SWFs on two
> different servers. You do not.
> Again, read this page:
> Your answer is there.
> Hint: all you need is to *properly* deploy a cross-domain policy file.
> I'm being very honest here. Have I ever lied to you before? No, I haven't.
> you're buying the first round tonight after work, ok?
Some people will do anything for a date ;-)
The best long-term, once-and-for-all solution is to proxy the call through a server.
Yes, the simple solution is to set up a proxy script (PHP, Python, or whatever) on your Server A where your Flex app is. The script should simply load and pass on this other XML, which can be anywhere on the planet - intranet or extranet.