• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

URLLoader breaks with an absolute path

New Here ,
Jun 28, 2012 Jun 28, 2012

Copy link to clipboard

Copied

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/controlpanel.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);

}

TOPICS
ActionScript

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

Use Charles, or Fiddler to see what's going on when the request is made. If relative works then you're testing that on the server...are you testing the absolute path on the server too? Crossdomain issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

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/controlpanel.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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

Great - glad you got it working. Please mark the thread as answered if you can. Also - lingogirl - interesting name, are you a Director user? I was a Director guy for a long time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

Yes, I was a Director user for a long time, hence the name. It was painful to switch to Flash, but I got to like it eventually. Thanks a million for you very kind help. How do I mark my thread as "answered?"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

network only.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

This looks good.

Can you explain a little to me about what it does?
Thanks very much for your reply.

MH

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

This means you get your resources just to get the same domain or only resources in other domains. I imagine that there as a security measure to build applications that are not stealing resources from other domains.

And should be based on the logic that if you work only locally, you would not have to use absolute paths but if you do a RIA, you only get information from internet, yes you would have to use absolute paths

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 29, 2012 Jun 29, 2012

Copy link to clipboard

Copied

LATEST

Thanks! I will do that. I very much appreciate your explanation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines