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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute php inside flash and recive data

Status
Not open for further replies.

DavidPlus

Programmer
Feb 20, 2007
38
NL
Hi all. could any one show me how i can execute php script inside flash and recive its data. As you see the php code
has 3 verialbes $artist, $song, $imageurl and i want to refrence those inside flash. could any one tell me how to execute php and refrece those varibles inside flash.thanks


Code:
<?php

header("Cache-Control: no-cache, must-revalidate");
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  	header ("Content-type: image/png");


$xml = file_get_contents("[URL unfurl="true"]http://www.somesite.com/rss.php?xml=true");[/URL]

preg_match_all('/<(artist|song|image)>([^<]+)<\/\\1>/i', $xml, $matches);

list($artist, $song, $imageurl) = $matches[2];

//echo $image url;

?>
 
you cannot execute PHP inside flash :)
you can load variables returned from php by calling the php file on the server, or you can have flash embedded in your php-generated html page, with FlashVars parameters in the object and embed tags.

If you just want to bring RSS feeds into flash, several people have written flash applications to do just that:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top