FlashMX, PHP & MySql

This tutorial explains how to view php in a dynamic text box within a flash movie.

Steps
First we will deal with the php file. Flash uses variables to display information in text boxes.Once you have a grip on this concept then the rest should be very easy. Let's create a php file, open tag and place some php variable. So we will set up the page like the following.

<? php
$name = "mark"; // this is the name we wish to display in the text box
$vars = "thename="; // we use thename to pass the variable into flash
$vars. = $name;
print $vars ; // print the variable so flash can read it.
?>

Save your php file. Next we move to flash. Create a text box and assign the instance name vars. Convert it to a movie clip and assign the following actionscript.

onClipEvent (load) {
loader = new LoadVars() // this is the new FlashMX way to load variables
loader.path = _root.vars; // this is the level on which your movie is.
loader.onLoad = function(success) {
if(success) {
trace(this.thename) // as you can see we use thename to load the variable.
this.path.text = this.thename;
}
}
loader.load('http://localhost/test.php'); // this is the link to the php file, in this case i have mine on my local computer.
}

That's all, easy, wasn't it?. If you need more help please post inside the forums.