flash and PHP.. somebody please help
Hi,
After getting to grips with programming in php,mysql and combining it with html, i am now having a little difficulty in grasping, how flash works with php.. I have followed many tutorials and books, but still i cannot understand how php send data back to flash
Here is my code:
in flash
_root.loggedIn=false;
sym.onEnterFrame=function()
{
_root.LoginApplication.Login.submit.onPress = function()
{
//connect to database
var ab = new LoadVars ();
ab.username = this._parent.username.text;
ab.pass = this._parent.pass.text;
ab.onLoad= validate;
ab.sendAndLoad ('http://www.jsten.com/flash_login.php', ab, "POST");
function validate()
{
if(this.output=='success')
{
trace("success");
sym._alpha=0;
}
if (this.output=="fail")
{
sym._alpha=0;
}
}
}
}
and simply in the flash_login.php file is one line for now:
echo("output=success");
From what i understand, the flash file should simply access this php file on submit button press, and then the 'output=success' returned, whereby flash then prints a trace to the screen, for my benefit, to say that it has worked.
Except it doesnt.....
Please can someone explain what im doing wrong
Thanks
Steve
|