Search  

READING PHP FROM FLASH

HomeForumsFlash DiscussionReading PHP from Flash
41382 Nythe
121 posts
Sold between 100 and 1 000 dollars

I have a very simple PHP script which is as follows:

<?
echo "&returnVal=Hello";
?>

I want to be able to read and display the value of returnVal in Flash. Currently, I used a LoadVars object to open the PHP script using sendAndLoad. The data is returned to another LoadVars object “dataRec”. I did the following code:

output.text = dataRec.returnVal

The textfield displays “Hello” but it also displays a long string of HTML code from the website. Can anyone tell me why the “returnVal” variable also contains this HTML code?

Posted 2 months ago
54138 Pdesignx
445 posts
Exclusive author Author was featured Referred at least one person Sold between 1 000 and 5 000 dollars Bought between 1 and 9 items

in your php file you should only include the values that you want to be shown in flash…

that’s what i mean, your PHP file just have to include the part you wrote…
not any other html like this…

<?

echo "&returnVal=Hello";

?>
<html>
<head>
...

or if you will… just put a & at the end of your variable like this..
<?

echo "&returnVal=Hello&";

?>

hope this helps…

Posted 2 months ago
41382 Nythe
121 posts
Sold between 100 and 1 000 dollars

PDesign

I found my mistake. I needed to end the variable with “&”. Your reply was very useful. Thanks!

Posted 2 months ago