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


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

output.text = lvIn.returnVal;

output.text = "fail";

myBtn.onRelease = function(){

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

lvOut.sendAndLoad("", 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

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

Post 3+ Months Ago

Ok, its easy, you have two ways.

Change your code,
lvOut.sendAndLoad("", 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 "">
    <allow-access-from domain="*" />
  1. <?xml version="1.0"?>
  2. <!DOCTYPE cross-domain-policy SYSTEM "">
  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 7 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-2017. Ozzu® is a registered trademark of Unmelted, LLC.