Help: Php Highscore On Ng
- H3
-
H3
- Member since: Dec. 18, 2000
- Offline.
-
- Forum Stats
- Member
- Level 21
- Blank Slate
hi
I am trying to implement a high score feature, but am having difficulties getting it to work when uploaded to newgrounds. I'm sure it has something to do with the cross-domain policy thing. The highscore system is done with just php.
Should I be using
System.security.allowDomain("www.my_domain
.com");
or
System.security.LoadPolicyFile("www.my_dom
ain.com/crossdomain.xml");
and the crossdomain.xml file with
<?xml version="1.0"?>
<!-- http://www.my_domain.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="http://uploads.ungrounded.net" />
</cross-domain-policy>
What am I doing wrong?
I followed the Flash/PHP scoreboard and Cross-Domain Policies from AS:main
- Shaun
-
Shaun
- Member since: Jan. 1, 2002
- Offline.
-
- Send Private Message
- Browse All Posts (16,518)
- Block
-
- Forum Stats
- Member
- Level 42
- Blank Slate
Flash Forum
however, most people just say use version on other site for highscores..
i dont know if it is possible with newgrounds.
flash forum would be the place to ask however.
- NinoGrounds
-
NinoGrounds
- Member since: Nov. 28, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
I think you have got a few sites ready for putting a scoreboard.
- H3
-
H3
- Member since: Dec. 18, 2000
- Offline.
-
- Forum Stats
- Member
- Level 21
- Blank Slate
flash forum directed me here~
So it's not possible for highscore feature on NG?
I remember NG used to have a highscore page for some of its games
- Craige
-
Craige
- Member since: Jul. 17, 2004
- Offline.
-
- Forum Stats
- Member
- Level 08
- Blank Slate
At 7/10/06 02:38 PM, H3 wrote: flash forum directed me here~
So it's not possible for highscore feature on NG?
I remember NG used to have a highscore page for some of its games
The only time it would go here is when you are writing the PHP, but this is an AS question.
// MustyWindows - Jump Through The Windows
// AmpFusion - Where Underground Becomes Mainstream
Neo Enterprise Technologies Coming soon.
- DearonElensar
-
DearonElensar
- Member since: Jun. 10, 2002
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
Well it's about xml which is a programming thing so... and sorry i have no clue
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
Make sure in your public_html folder you have a file called crossdomain.xml
This should be the contents:
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
You do NOT need either of these:
System.security.allowDomain("www.my_domain
.com");
or
System.security.LoadPolicyFile("www.my_dom
ain.com/crossdomain.xml");
- JeremysFilms
-
JeremysFilms
- Member since: Feb. 18, 2005
- Offline.
-
- Forum Stats
- Member
- Level 18
- Blank Slate
At 7/10/06 02:38 PM, H3 wrote: flash forum directed me here~
So it's not possible for highscore feature on NG?
I remember NG used to have a highscore page for some of its games
This belongs in the flash forum, yet I'll still answer you.
I don't understand why people are stating taht highscore boards can't work on NG when there are clearly many games that use this feature.
You just need to put the cross-domain xml policy in the root directory of your site that allows uploads.ungrounded.net. Then you need to put the System.security.allowDomain function in the flash file marked to allow the site that the php file to be connected to are hosted.
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
Oh yeah, guys, this DOES belong in the programming forum.
The problem lied within his XML file.
- H3
-
H3
- Member since: Dec. 18, 2000
- Offline.
-
- Forum Stats
- Member
- Level 21
- Blank Slate
Thanks GamesCool!! that worked
oh and....
Not a shameless plug but check out the dice game I made - "BS: Dice Game". Had a blast implementing the AI but it's still pretty weak. I welcome any tips on improving it.
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
At 7/11/06 01:06 AM, H3 wrote: Thanks GamesCool!! that worked
oh and....
Not a shameless plug but check out the dice game I made - "BS: Dice Game". Had a blast implementing the AI but it's still pretty weak. I welcome any tips on improving it.
You're welcome!
Hey, I happend to see that game in the portal when is was under judgement (I didn't put two and two together from this topic though)
It looks very cool. I think it deserved a much better score.
But if I've learned one thing from my games, you CANNOT go by Newgrounds for how good your game is :)
- H3
-
H3
- Member since: Dec. 18, 2000
- Offline.
-
- Forum Stats
- Member
- Level 21
- Blank Slate
One more question real quick.
I have a frame that loads the high score data.
With Mozilla Firefox, everything reloads everytime that frame is returned to and works fine
BUT In MSIE, it only loads the first time. It doesn't update everytime the frame is returned to.
Know what's the deal?
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
At 7/11/06 05:14 PM, H3 wrote: One more question real quick.
I have a frame that loads the high score data.
With Mozilla Firefox, everything reloads everytime that frame is returned to and works fine
BUT In MSIE, it only loads the first time. It doesn't update everytime the frame is returned to.
Know what's the deal?
I'm going to assume you mean within your Flash, when you go to the frame where it pulls the high scores, you arent getting the new scores in IE. I had this exact problem when I first started.
The solution is simple. When you use loadvars, you just need to use a cachebuster.
So, lets say the url you were loading from was like this:
url = "http://www.mysite.com/getscores.php";
you want that to become:
url = "http://www.mysite.com/getscores.php?cache
buster=" + new Date().getTime();
That should work.
- H3
-
H3
- Member since: Dec. 18, 2000
- Offline.
-
- Forum Stats
- Member
- Level 21
- Blank Slate
- henke37
-
henke37
- Member since: Sep. 10, 2004
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
--coolpoints for useing that hack to get around caches.
Just send the proper cache controll headers.
Use the header function. One of the example shows how to fix your problem and restore your coolpoints.
And please do not ask about any errors about headers alredy sent if you care about cool points. That issue is very widely known, so search instead of posting.
Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.



