PDA

View Full Version : PHP var into Flash - it works, but it doesn't



Freddythunder
July 16th, 2003, 09:29 PM
Hey all again,

I'm still dealing with that same stupid Login thing, but it's a little different this time. When I got it to work, one of the variables 'status' is a textbox that say's whether or not 'you're in' or 'no soup for you'.

Now all I want to do is xfer a variable that I can use in a gotoAndPlay thing. I've tried a thousand times and have searched through the forums here. I tried Ahmed's script that starts with lv=new LoadVars(); That didn't work either. I hope it's something dumb!!!
Here's my stuff:


//last lines
if ( $numRow ){
$auth = 1;
print "_root.container.checklog=1&_root.container.status=You're in!!";

} else {
$auth = 0;
print "_root.container.checklog=0&_root.container.status=You're out!!";

}
}
?>


status = "receiving variables";
loadVariables("htmllogintext.php", this, "POST");
if(checklog = "1"){
gotoAndStop(62);
}
if(checklog = "0"){
gotoAndStop(61);
}

Can you not use varibles in this way? The script works because the textBox 'status' displays what it is supposed to.
Thank you anyone!!

Jubba
July 16th, 2003, 10:52 PM
take the "_root.container." out

php should look like this:



if ( $numRow ){
$auth = 1;
print "checklog=1&_root.container.status=You're in!!";

} else {
$auth = 0;
print "checklog=0&_root.container.status=You're out!!";

}
}
?>

that should work...

Freddythunder
July 16th, 2003, 11:58 PM
That didn't do it. Would there be a prob because the movie that's calling the vars is a movie loaded into a movie?

I also made a textbox with the var 'checklog' to see if it's working and it stays blank. Is the path messed up?

eyezberg
July 17th, 2003, 04:08 AM
Post your fla

Freddythunder
July 17th, 2003, 06:48 PM
Files - thanks Eyez

Freddythunder
July 17th, 2003, 06:51 PM
...And here's the PHP script - just in case anyone wants to see it. I really don't think that's the problem.

Freddythunder
July 19th, 2003, 04:13 PM
Bump???

eyezberg
July 19th, 2003, 05:26 PM
in your PHP:
$numRow = mysql_numrows( $result );
should be
$numRow = mysql_num_rows( $result );
and
print "checklog=1&_root.container.status=You're in!!";
should be
print "&checklog=1&status=You're in!!";
(there's no "container" in that fla, and status being on the _root, that's all you should need..

Freddythunder
July 19th, 2003, 10:34 PM
I'll try the ampersand in front of the var checklog. That fla is actually loaded into a different swf called ucs. Will I need to target the variable when it's loaded into another movie like the status textbox needs to be?

Freddythunder
July 21st, 2003, 09:56 PM
I tried the changes as you suggested and it still does the same thing. The status text box still changes the way it's supposed to but the gotoAndPlay(5); still doesn't work. Was that the only idea you had? I'm lost..:*(

I'll post the fla again becuase it has changed a few hundred times. Thanks for any help!!