flash drop down menu

I have a website with a cms
In the CMS i can create types( a, b, c)
these types are saved on sql and information can be inserted in each.
a(1, 2, 3)
b(1, 2, 3)
c(1, 2, 3)

in my flash header i have a drop down menu thats supposed to read these types that were created in sql through the cms
I cant creat the drop down menu in advance because my client might add a new type and it has to appear in the menu along side the others that were created so far

n e one?
LVL 1
zahimezherAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

moagriusCommented:
you'll probably want to use PHP to grab the contents of the SQL table, then echo or print that out as XML, then load that into Flash using a URLLoader object, then dynamically populate your dropdown.

e.g.,

// php file
<?php
// connect to your server, pick the database
$xml = "<?xml version='1.0' ?>";
$result = mysql_query("select * from table");
while($row = mysql_fetch_assoc($result)){
  $xml .= "<somenode>" . $row["someprop"] . "</somenode>";
  // etc..
}

// actionscript
var loader:URLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(new URLRequest("that-php-file.php"));
function onLoaded(event:Event):void{
  var xml:XML = new XML(event.target.data);
  foreach(var node:XML in xml){
    // do stuff...
  }
}
zahimezherAuthor Commented:
do u have an example file or a link to a tutorial or something.
I have no idea how this works and cant make anything of what ...
thanx alot though. sry!
moagriusCommented:
here's using PHP to translate MySQL data to XML: http://www.kirupa.com/web/mysql_xml_php.htm
and here's using XML in AS3: http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm

hth, gl

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zahimezherAuthor Commented:
;) thanx for the help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.