I call a php program from my Flash AS3 movie. So long as I use a relative path it works fine. If I change it to an absolute path, it breaks. This Flash file is destined to be an app, so I know have to use an absolute path. Any thoughts? Here's my code, below with the relative path shown in red. If I change that to a full path it breaks. Full path is http://www.parallaxdesigngroup.com/gg/dictTestDropDown/php/controlpane l.php
function processLogin ():void
{
var phpVars:URLVariables = new URLVariables();
var phpFileRequest:URLRequest = new URLRequest("php/controlpanel.php");
phpFileRequest.method = URLRequestMethod.POST;
phpFileRequest.data = phpVars;
var phpLoader:URLLoader = new URLLoader();
phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
phpLoader.addEventListener(Event.COMPLETE, showResult);
phpVars.systemCall = "checkLogin";
phpVars.term = term.text;
phpLoader.load(phpFileRequest);
}
Thanks. Fiddler is great, I didn't know about it. With the relative path I can see the proper data in textview being passed back to Flash from PHP. But with the full path, Fiddler labels the session URL as /crossdomain.xml and in the response textview I can see file not found type of info:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://parallaxdesigngroup.com/pageNotFound.html">here</a>.</p>
</body></html>
Weird that a full path would fail.Here is my full path copied and pasted out of Flash, and if you put it in the browser you can see it doesn't give you file not found. It doesn't do anything in the browser because its purpose in life is just to pass stuff back to Flash.
http://www.parallaxdesigngroup.com/gg/dictTestDropDown/php/controlpane l.php
So I now know what is happening, but am not sure what to do to make the full path work. Any further thoughts greatly appreciated!
I just read up on crossdomain files and added this crossdomain.xml to my root folder.
<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
Now everything seems to work fine.
THanks so much for pointing me to Fiddler, will save many hours in the future, I'm sure.
mh
North America
Europe, Middle East and Africa
Asia Pacific