Search Tutorials
Adding ScoresNow, what we want to do next is see how a new score and name are added to the score table. What we want to do is pass a name and a score to the call command. So, we do just that: we add two new variables to the call: winname and winscore. Take a look at the following: http://www.myscore.com/scores.php?filename=scores/score.sco&scoresize=10&action=INSERT&winname=Joe&winscore=1211&viewtype=FLASH What we're doing here is submitting Joe to the high score list, with a fantastic score of 1211. If Joe's score is high enough, he will be added to the appropriate position / rank on the list. If Joe's score is not higher than the lowest score on the list, then Joe's name will not be added. On the other hand, if Joe's score was the best score ever, then he would be added as #1, and the lowest score would be booted off the list. I'm not going to go into the details of the PHP. This is a Flash tutorial,
and if you want, you can look at the PHP yourself as it is included with this
tutorial. PHP itself is quite similar in syntax to Flash, with a few differences.
For example, variables in PHP all begin with "$" so name in
Flash is $name in PHP. Take a look at the file scores.php.
That's it! Operating our score tables is that simple.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|