Hi. I need some help, please.
May I know if there is a way to compare the variables from php so that I could check the user's logged in status in flash?
My php echos:
<?php
$logStatus="0"; //if user is logging in
$logStatus="1"; //if user is not logging in
echo "&status=".$logStatus;
?>
I had used LoadVars object (which is executed in a button) to received the variables from php.
My actionscript 2.0:
Firstly, I would like to trace the loaded variable from php, and it works.
on(Press){
myVar = new LoadVars();
myVar.load ("user.php");
myVar.onLoad = function (success)
{
if (success)
{
output.text = myVar.status; //the output show 0 if I did log in the account
}
};
}
But once I changed it to compare the variable that I had received, it didn't work at all.
on(Press){
myVar = new LoadVars();
myVar.load ("user.php");
myVar.onLoad = function (success)
{
if (success)
{
if(myVar.status == "0")
{
nextFrame(); //so that user who logged in can continue to the swf, but it didn't work
}
else
{
gotoAndStop(15); //restrict the user to continue and stop at the last frame
}
}
};
}
It will gotoAndStop at frame 15 no matter what status that I have received. The if condition seems like doesn't take action.
Am I wrong in coding the if condition? Can someone explain and give me some advices?