Jun 20, 2003 #1 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
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
Jun 20, 2003 #2 billwatson Instructor Joined Dec 18, 2002 Messages 2,312 Location CA lv = new LoadVars(); lv.onLoad = function(){ mytextbox.text = lv.fred; ) lv.sendAndLoad("my.php",lv,"GET" Upvote 0 Downvote
lv = new LoadVars(); lv.onLoad = function(){ mytextbox.text = lv.fred; ) lv.sendAndLoad("my.php",lv,"GET"
Jun 20, 2003 Thread starter #3 martinb7 Programmer Joined Jan 5, 2003 Messages 235 Location GB 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 Upvote 0 Downvote
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
Jun 21, 2003 #4 wangbar Programmer Joined Jul 23, 2001 Messages 1,906 Location GB 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. Upvote 0 Downvote
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.