Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 19th, 2004, 06:55 AM
gat gat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: London, UK
Posts: 122 gat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 16 m 33 sec
Reputation Power: 5
Populate combo box with XML

if i have this XML..

<?xml version="1.0"?>
<creature>
<category id="mammal" has="hairy_skin,mouth,warm_blood">
<species id="cat" has="fur,tail,whiskers">
<breed id="tiger" has="stripey_fur"/>
<breed id="lion" has="brown_fur,mane"/>
<breed id="panther" has="black_fur"/>
</species>
<species id="dog" has="hair,tail,wet_nose">
<breed id="labrador" has="soft_hair"/>
</species>
<species id="pig" has="snout,trotters"/>
<species id="cow" has="nose,hooves"/>
</category>
<category id="reptile" has="scaly_skin,mouth,cold_blood">
<species id="lizard" has="tail,legs">
<breed id="iguana" has=""/>
</species>
<species id="snake" has="tail,no_legs,forked_tongue">
<breed id="cobra" has="hooded_head">
<subbreed id="greatcobra" has="big_hood"/>
</breed>
</species>
</category>
<category id="bird" has="feathers,beak,wings,warm_blood" />
<category id="fish" has="scales,mouth,cold_blood">
<species id="mullet" has="thick_lips"/>
<species id="pike" has="sharp_teeth"/>
</category>
</creature>

is there any standard code that i could use to fill up a combo/pull down menu with this information?

many thanks

Reply With Quote
  #2  
Old January 19th, 2004, 05:42 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 42 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, don't know what you mean by standard code but you should take a look at the flash xml object. You use it like this:
Code:
comboXml = new XML();
comboXml.ignoreWhite = true;
comboXml.onLoad = function(success) {
	if (success) {
		populateCombo();
	}
};
comboXml.load("combodata.xml");

function populateCombo()
   {
       comboData = _root.comboXml.firstChild.childNodes;
       // Now parse it all here
   }

The above loads the specified xml file, checks it is all loaded and then calls a function that will parse the data. If your going to be using large amounts of data from xml then you might want to parse the data on the server say with php and then pass the already parsed data into flash. That's because flash tends to pause when reading xml data so if there's alot then you can expect a long pause...
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Populate combo box with XML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway