Trying to refresh a high score list
So, I have 2 swf's embedded in an html page. One is a game window and the other is a high score table. I have the game writing high score data to my server. And I have a refresh button on the high score table swf that fetches the data from the server.
The problem is that I can't seem to get the high score swf to refresh when I press its "refresh" button. It is definitely trying to fetch the data, but when I post a new high score, I would expect to be able to refresh the list within 10 seconds of posting. The weird thing is if I run the swf as an exe, it retreives the data instantly after posting. It is just the swf embedded in the page that seems to not work correctly.
Any idea what might be happening?
Re: Trying to refresh a high score list
Do the highscores work (without refreshing)?
I'm assuming there's a problem converting to flash - I'm also assuming you're using the get object. Do you have a crossdomain.xml file?
Re: Trying to refresh a high score list
First off, the high score swf does retrieve the high scores when it is first loaded. And the game swf does upload new scores to the server through a php script (from Jeff's tutorial). Both use the Get object. The problem comes from trying to get and display any new scores that are uploaded to the server after the initial get. But like I said, I can run a debug or exe version of the high score table and it will receive scores from the server if I have them running while playing the game in a browser. Only the high score table IN the browser is having issues. :(
As for xml, this is a simple html page that has 2 swf's embedded in it. Nothing fancier than that.
Re: Trying to refresh a high score list
You may need a crossdomain.xml
Re: Trying to refresh a high score list
What does that mean exactly? I have never worked with xml before.
Re: Trying to refresh a high score list
http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
http://stackoverflow.com/questions/213251/can-someone-post-a-well-formed-crossdomain-xml-sample
Those should help.
Re: Trying to refresh a high score list
Thanks RickyRombo. I'll see if this is the issue. Although I don't think this is it, since everything exists on a single website in a single directory. IE, both swf's sit in the same directory as the php script.
Re: Trying to refresh a high score list
After looking into this a little, I can see it is all way over my head. It is funny that no one else seems to have posted any issues when dealing with Flash and high score tables.
Any chance anyone can provide an example xml file that would make this as painless as possible? Or simply explain what is going wrong with the get object and the db?
Re: Trying to refresh a high score list
If they're in the same directory, the xml won't help. This is strange...
If you want, shoot me a pm with the mfa and I can try and isolate it, it may be a bug!
Re: Trying to refresh a high score list
Seems it ended up being human error on my part. I defined the swf incorrectly in the hmtl I embed it in. Seems to work like a charm. Thanks for the help RickyRombo. :)