PDA

View Full Version : how do i get php varable in flash?


smartie_on_computer
04-26-2006, 06:02 AM
how do i get php varable in flash?

Cota
04-26-2006, 07:57 AM
Using loadvars(), call the PHP file, and in the PHP file,

echo "&VarName=".aPHPvar;
//or
echo "&VarName=4";

the loadvars() object in Flash will be looking for a variable called VarName.

goliatone
04-26-2006, 10:51 AM
hey smartie, seems like you already are playing 'round with awardspace!!
;)

smartie_on_computer
04-26-2006, 11:17 AM
yea i set up a simple frameset to redirect to my comupter, but will not be able to access when i turn it off :), a simple programe will capture my ip address and save to ip.txt, then from there, index.php will open it and tell the frameset to goto 222.154.7.41 (or what ever the router set the ip to).

also when you talk about 'echo' where do i put it so it can be a variable?

goliatone
04-26-2006, 11:40 AM
echo is like the return in flahs functions, its the output of the php file...if you call the php file from flash with a send("phpscript.php","_blank","P/G") it will print whatever you echo in a new html page...if you do a sendAndLoad you will have acces to what you echo inside your loadVars object that you set up to recieve...

Cota
04-26-2006, 06:40 PM
PHP has echo, ASP has Response.Write....so on and so forth. But remember, variables names must start with "&" or Flash will usually ignore them.

smartie_on_computer
04-26-2006, 10:10 PM
yea but were do i put the echo "&var='test'";???