1. Create 1-10 Username and Score Dynamic Texts Make each variable in each one user1 and score1 and so on...
2. Convert all of the Dynamic Texts to a MovieClip Make sure you change the to scoretable
3. Add actionscript to the frame Add the following actionscript to the frame
scoretable.loadVariables("scores.php");
stop();
4. Create a MySQL Table with 3 columns You need an id, user, and score column. This should be as simple as going to your PHPMyAdmin and adding a table. Make sure the id is the primary key and set to auto_increment.
5. Insert 10 scores into the table Click insert in PhpMyAdmin to insert 10 or more rows into the table. This will give you some test data to work with.
6. Write the php page that will post the results Flash reads variables from a page like so: &variable=10&variable2=11. So we need to grab the data from the table and post it in that form. Remember that the flash variables earlier are user1-user10 and score1-score10.
7. Save this php code to your page It is also located in the files for download. Do not forget to add the php tags.
$query = "SELECT * FROM highscores
ORDER BY score DESC";
$results = mysql_query($query);
for($i = 1; $i <= 10; $i++) {
if($line = mysql_fetch_assoc($results)){
echo "&user".$i."=".$line["username"].
"&score".$i."=".$line["score"];
}
}
8. Everything should now be working successfully If you have any questions or comments, post them below. You can also download the source files to get a better view of what you have to do, or watch the video above.
projectfinale (4 Months ago)
I understand that the instructions can be seen as a little confusing. I recommend downloading the source files to help you or watching the video (with the sound on, because I explain it).
DarkShadow (2 Months ago)
How i can put this high score table in my flash game in the the player dies?
projectfinale (2 Months ago)
Im not sure what exactly your question is asking. If you want you can copy and paste the code into your own game. Or you can follow the video and just apply it to your own.