hello, I work normally only with Dreamweaver and Database, I now want to work
with a flash-movie integrated into my php-site. The flash movie gets data from
a xml-file "index.xml". . I managed to make a php-file which becomes a xml-file
(if I understood right..?) and called it "index.php". But the Flash-file does
not find that.
I wonder what I have to change. In the Flash-file or in the PHP?
<?php
header("Content-type: text/xml");
$host = "localhost";
$user = "username";
$pass = "password";
$database = "db";
$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 home LIMIT 0, 9";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
$xml_output = "<?xml version=\"1.0\"?>\n";
$xml_output .= "<item>\n";
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<item>\n";
$xml_output .= "\t\t<idder>" . $row['id'] . "</idder>\n";
$xml_output .= "\t\t<title>" . $row['title'] . "</title>\n";
$xml_output .= "\t\t<link>http://www.content.php?id=" . $row['link'] .
"\t?expandable=" . $row['menuLink'] . "</link>\n";
$xml_output .= "\t\t<enclosure url='images/" . $row['doc'] . "' type='" .
$row['ext'] . "'/>\n";
$xml_output .= "\t</item>\n";
}
$xml_output .= "</item>";
echo $xml_output;
?>
The Feldkircher - 18 Apr 2008 07:49 GMT
Hi
There is a tutorial http://www.gotoandlearn.com that will show you how to do it.
Its called PHP, MySQL and Flash.
Hope it helps
Ulitasch - 18 Apr 2008 22:42 GMT
Thanks a lot!!!:)
This helps to understand the integration..
But I got a Flash-file (with many actionscripts) where I just would need to
change the XML-file to be filled with database-data. Do I really have to go
deep into the actionscripts to make changes or is there a way to just change
the existing XML-file?
The Feldkircher - 20 Apr 2008 22:25 GMT
Hi
All you have to do is for example myXML.load("index.php")
Flash doesn't car its a php file, it thinks its just a regular xml file.
Once loaded, then you can pull the data from each node however you like.
Hope it helps