strange sendAndLoad problem

  • gamemaker
  • Born
  • Born
  • gamemaker
  • Posts: 1

Post 3+ Months Ago

ok I am experiencing a strange and frustrating problem with sendAndLoad()

when I publish the movie and test it on my computer everything works fine.but when I upload the movie to the server and tried there it fails. both the receiving PHP file and the flash movie are located in the same domain

here's my actionscript

stop();

lvOut = new LoadVars();
lvIn = new LoadVars();
lvIn.onLoad = function (success) {
if(success){

output.text = lvIn.returnVal;
}else{

output.text = "fail";
}
}

myBtn.onRelease = function(){

lvOut.gamescore = int(Math.random()*1000);
years.text = lvOut.gamescore;
lvOut.gameid = 1111111;
lvOut.username = "test";

lvOut.sendAndLoad("http://playwithyourmind.com/recordscore.php", lvIn, "POST");
};

to make the matter even more frustrating, it was working fine on the server and now it does not. This is causing me quite a headache and I would be very grateful for anyone who could shed some light on the situation

thanks,
Alex
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Dano
  • Novice
  • Novice
  • User avatar
  • Posts: 22

Post 3+ Months Ago

Ok, its easy, you have two ways.

First:
Change your code,
lvOut.sendAndLoad("http://playwithyourmind.com/recordscore.php", lvIn, "POST");
for it:
lvOut.sendAndLoad("/recordscore.php", lvIn, "POST");

When you test local, its not work, but when you test in your server, its works fine.

The second way, is:

Put in the root carpet of you Webserver, a file named, "crossdomain.xml" and the content of the file must be:

Code: [ Select ]
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <allow-access-from domain="*" />
</cross-domain-policy>
  1. <?xml version="1.0"?>
  2. <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
  3. <cross-domain-policy>
  4.     <allow-access-from domain="*" />
  5. </cross-domain-policy>


Bytes! :)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.