Using PHPObject to Save and Retrieve Simple Game Levels
[ May 27, 2004 ] by Tor de Vries
Using a simple video game level editor in Flash as a foundation, this whitepaper/tutorial explains how to use ActionScript, PHP, and the PHPObject "Flash remoting" libraries to save and retrieve data to/from a server in XML format.


That's a Wrap!

The ActionScript code in leditor.swf, and the PHP code in Leditor.php, contain a lot of comments. These make the code easy to read, even if you are unfamiliar with some of the ActionScript or PHP commands. By reading this tutorial, following the flowchart, and looking at the comments in the source code, you will see how the ActionScript and PHP work together.

There is a lot more than can be done with PHPObject. This tutorial only scratches the surface. Take a look at the official PHPObject documentation and the PHPObject/MySQL tutorials listed below, and explore!


Useful Books

Macromedia Flash MX 2004 Game Design Demystified, by Jobe Makar and Ben Winiarczyk. This is an exceptionally useful book for Flash game developers, particularly in its review of tile-based games and coordinate geometry.

Macromedia Flash MX 2004 ActionScript 2.0 Dictionary, by Macromedia, Inc. This is a must-have reference book for Flash programmers, though at over 1000 pages, it's not exactly portable.

ActionScript for Flash MX Pocket Reference, by Colin Moock. Though slightly outdated for MX 2004 users, this is still a handy reference.


Useful Web Sites

PHPObject's Home Page, Documentation, and Forums are all useful sources of PHPObject information, from its developers.

ActionScript.org's PHPObject tutorial and FlashKit's PHPObject tutorial explain how to use PHPObject to make Flash communicate with a MySQL server.

ActionScript.org's XML tutorial also explains how to handle XML data in Flash, though you may find Macromedia's XML tutorial more understandable.

Macromedia's Flash Remoting Page has generic information on Flash remoting topics, although most of it is oriented toward AMFPHP (another way of doing what PHPObject does). Macromedia also has a page on PHPObject, though it doesn't say any more than PHPObject's home page.

The PHP.net reference manual is a great resource for everything you wanted to know about PHP (and then some!).


   
 
 
Name: Tor de Vries
Location: New York
Age: 30
Flash experience: I first began toying with it back when it was called "FutureSplash" and wasn't owned by Macromedia, if anyone else remembers that. Since then it has been a favorite tool alongside DHTML, JavaScript, PHP, Perl, XML and other buzzwords.
Job: Digital Designer
Website: http://www.tordevries.com/
 
 
| Homepage | News | Games | Articles | Multiplayer Central | Reviews | Spotlight | Forums | Info | Links | Contact us | Advertise | Credits |

| www.smartfoxserver.com | www.gotoandplay.biz | www.openspace-engine.com |

gotoAndPlay() v 3.0.0 -- (c)2003-2008 gotoAndPlay() Team -- P.IVA 03121770048