PDA

View Full Version : LoadVars works fine on own computer, breaks online


Umbrascitor
02-27-2009, 02:13 AM
I'm making a game with a high-score table of sorts. The swf uses loadvars to write and read data from a text file via PHP. Trouble is, my test swf works perfectly when I work it from my own computer; however, once I put the swf on the web server it breaks.

Feel free to grab my test project, PHP file, and text file (attached) and let me know what's going wrong. You can also view the swf in action (if you can call it that) online at http://banana-ninja.com/Games/TestGame.html.

Thanks in advance!

bluemagica
02-27-2009, 02:35 AM
you havent attached anything....

and make sure you CHMOD your text file to 0777 on your server

Umbrascitor
02-27-2009, 05:36 AM
Judging by the timing, you seem to have caught that during the short time that I was switching out the attachments (I had put in the .swf instead of the .fla, and now they're both in there).

Anyway, I followed the advice and turned on all the permissions, and still I get nothing. Besides, it worked fine when I accessed the file from my own computer.

When I preview the swf from inside Flash, or run the swf from my computer, it works. When I upload to the server, it stops working. It won't write to the text file or even read it. In both cases the php and text files are sitting on the server; the only difference is where the swf is sitting.

Thanks for the suggestion; it sounded really promising but unfortunately nothing changed. Any other suggestions would be very well appreciated.

rrh
02-27-2009, 05:02 PM
One potential problem is if your link says "banana-ninja.com" while your actionscript says "www.banana-ninja.com" which are treated as different domains for security.

Go here:
http://www.banana-ninja.com/Games/TestGame.html
And it works for me.

Umbrascitor
02-28-2009, 12:34 AM
Well, that's interesting. I figured it would have to be something that simple. Thanks, mate.