1- Create Database 'mydb' in phpmyadmin and then create table 'students'
Table Fields:
- studentid
- fullname
2- Create file student.php in XAMPP ('C:\xampp\htdocs\phpflash')
<?php
$link = mysql_connect("localhost", "root", "");
mysql_select_db("mydb");
$query = "select * from students";
$results = mysql_query($query);
echo "<?xml version=\"1.0\"?>\n";
echo "<students>\n";
while($line = mysql_fetch_array($results)){
echo "<name>" . $line["fullname"] . "</name>\n";
}
echo "</students>\n";
mysql_close($link);
?>
3- Create flash project "student.fla"
Insert list from Components
Write codes in Actions - Frame
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://localhost/phpflash/student.php");
4- demo
http://downloads.ziddu.com/download/24366143/phpflash.zip.html
Read more blog:
http://video-tutorial-from-youtube.blogspot.com/
Follow Us with Facebook
https://www.facebook.com/pages/PHP-Tutorial/782239958529506
