Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load php echo text into a flash text box

Status
Not open for further replies.

martinb7

Programmer
Joined
Jan 5, 2003
Messages
235
Location
GB
Hi, i was wondering how do you make a php page with a echo(); command load into a flash dynamic textbox.

e.g

//php page//
$fred = "test";

echo($fred);

how would i load the output of the echo into a flash textbox??

Help!!

Thanx

Martin

affiliates.gif
 
lv = new LoadVars();
lv.onLoad = function(){
mytextbox.text = lv.fred;
)
lv.sendAndLoad("my.php",lv,"GET");
 
i cant get it working!!

please help!!

btw your code comes up with an error:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 4: Unexpected ')' encountered
)

could you give me a .fla and a .php page in a .zip please??

thanx

Martin
 
You can't directly pick up an echoed value from PHP - you have to set it up as a variable/value pair like this:

&myVariable=value

formated like this in your PHP script:

$fred="test";
echo "&fred=".$fred;

Then (using the loadVars object as Bill has already shown you) in Flash you have:

lv = new LoadVars();
lv.onLoad = function(){
mytextbox.text = lv.fred;
}
lv.sendAndLoad("my.php",lv,"GET");

...stick a dynamic textbox on the stage with instance name 'mytextbox' and the value of your 'fred' variable will show up in it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top