Friday, June 05, 2020
Text Size

How To Create A Flash Game High Score Database


I found  these  Flash games on the web a few years back. They were all over the internet, especially Pac-Man, except most sites didn't know how to configure the high score database that the author had written into the source for each game, and the ones that did weren't saying how they did it. The author, by the way, is  Paul Neave. Slowly but surely I figured out how to piece it all together and got it working.

Here is how you do it:

Step 1:  Download and unzip this file into a folder on your desktop.

Step 2:  Create a .swf (shockwave flash) file for each game with your website information embedded in the source.

-Click on the .ttf files in each game folder and install the fonts (some have multiple font files).

-Download Adobe Flash CS4 and install the 30 day free trial. If you're having trouble with this one, research "bit torrents" and download from here:

-Open the .fla file in each game folder with Adobe Flash CS4.

-Go to "Window" and click "Movie Explorer".


-Expand "Actions for Frame 1" (or Frame 2 depending on the game).


-Find the green text down a little ways that says:  ""  And double click on it.
A script editor will open up.


-Change "" to your website URL and ensure that the path to the highscore.php file for that particular Flash game is correct.

-Click "File" and save the .fla.

-Finally, click on "File" and then "Publish" to create the .swf file that you will upload to your website and embed into your webpage. Make sure that you adhere to the same file naming format that each .fla uses. (ie. neave_pacman.swf)

Step 3:  Create a SQL database using phpMyAdmin for your web server.

-Login to your database using phpMyAdmin: Open up a browser on your web server and go to http://localhost/phpmyadmin. Login as "root" and click on "Databases".


-Name your highscore database: games_highscore, and click "Create".

-Click on the newly created "games_highscore" database in the list.

-Now, you can either click "Import" in the phpMyAdmin toolbar and import the games_highscore.sql file from the zip file that you downloaded earlier, and be finished in one step, or you can click on "SQL" in the phpMyAdmin toolbar and then open the games_highscore.sql file in a text editor and copy / paste the code from each table into the empty box on phpMyAdmin. Create only one table at a time. Hit the "Go" button in the bottom right corner to create each table.

-If you get syntax errors don't worry, it should still work (different versions of MySQL have different syntax requirements).


-Make sure that each table from the games_highscore.sql file is now displayed under the games_highscore database in phpmyadmin.


Finally, create a user account for yourself: Click on "Privileges" and "add a new user".
Type a username
Host is: localhost
Type a password


You won't need a database for the user.
Click on "Check All" for privileges (or pick and choose).
This user needs to be able to write to and display results from the games_highscore database. When you're done, click on "Create User".


Step 4:  Edit all of your highscore.php files:

$db_name = 'games_highscore';
$db_username = 'databaseusername';
$db_password = 'password';
$db_hostname = 'localhost';
with the credentials from the user that you just created in phpmyadmin.

Step 5:  All that you have to do now is upload the highscore.php files, along with the .swf Flash game files that your created eariler, to their respective directories on your web server, and embed the .swf Flash games into a web page.

Let me know if you're having trouble making it work. I'll try to help.

blog comments powered by Disqus

Login Form