2 Replies - 1794 Views - Last Post: 15 January 2010 - 12:10 PM

#1 selectaaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 09-January 10

show image in flash from a php file

Posted 09 January 2010 - 04:49 PM

hi all,

i have made a php file that is connected to mysql and shows the album cover of the current song of my radio station here is the php album cover php

i made other php pages that show info like last played artist

last played artists php

i dragged a listcomponent and add these actionscript code

var theXML:XML = new XML();
theXML.ignoreWhite = true;

theXML.onload = function() {
	var nodes = this.firstChild.childNodes;
	for(i=0;i<nodes.length;i++) {
		theList.addItem(nodes[i].firstChild.nodeValue,i);
	}
}

theXML.load("http://www.innababylon.com/products.php");


products.php shows the last played artists that works fine

only if i chainge the directory (http://www.innababylon.com/products.php")

into http://www.innababyl...Pweb/connec.php which have to show the current albumcover it doesnt work

can anyone plz help

thanks

i use macromedia flash 8 and actionscript 2

This post has been edited by selectaaa: 09 January 2010 - 06:01 PM


Is This A Good Question/Topic? 0
  • +

Replies To: show image in flash from a php file

#2 selectaaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 09-January 10

Re: show image in flash from a php file

Posted 15 January 2010 - 08:08 AM

ok..... i am new here but i see that this site is not helping much

so i have some new info

i finally could figure out how to make a new php file fo flash to read i found this code where you can make a xml out put

this is the code

 <?php

header("Content-type: text/xml");

$host = "localhost";
$user = "root";
$pass = "";
$database = "test";

$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");

$query = "SELECT * FROM blog ORDER BY date DESC";
$resultID = mysql_query($query, $linkID) or die("Data not found.");

$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<entries>\n";

for($x = 0; $x < mysql_num_rows($resultID); $x++){
	$row = mysql_fetch_assoc($resultID);
	$xml_output .= "\t<entry>\n";
	$xml_output .= "\t\t<image>" . $row['picture'] . "</image>\n";
		// Escaping illegal characters
		$row['text'] = str_replace("&", "&", $row['text']);
		$row['text'] = str_replace("<", "<", $row['text']);
		$row['text'] = str_replace(">", ">", $row['text']);
		$row['text'] = str_replace("\"", """, $row['text']);
	$xml_output .= "\t\t<text>" . $row['text'] . "</text>\n";
	$xml_output .= "\t</entry>\n";
}

$xml_output .= "</entries>";

echo $xml_output;

?>



that works fine now
i only need a actionscript code that can show the image in flash

and what component do i have to use?

thanks in advance
Was This Post Helpful? 0
  • +
  • -

#3 selectaaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 09-January 10

Re: show image in flash from a php file

Posted 15 January 2010 - 12:10 PM

i think i have it

it have something to do with
this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;


in actionscript
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1