Featured FLA
» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe
Featured Site
» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash
Loading XML information into the ComboBox component
Drag an instance of the ComboBox component onto the stage and name it
CBOLoadSites.
Add the following function to the actions layer, immediately above the
stop action. The function tests that the XML file loaded successfully,
loads the sites and URLs into arrays, creates a default item
and adds the sites and URLs to the ComboBox
component.
function LoadCombo(success) {
if (success) {
//set variables
var BaseNode=thisXML.childNodes[0];
var ComboSites = new Array();
var ComboURLs = new Array();
var ThisNode;
//add a default item to the combo box
CBOLoadSites.addItem("-- select site --");
//get sites information
for (i=0; i
ThisNode = BaseNode.childNodes[i];
ComboSites[i] = ThisNode.attributes["siteName"];
ComboURLs[i] = ThisNode.attributes["siteURL"];
//add to combo box
CBOLoadSites.addItem(ComboSites[i],ComboURLs[i]);
}
}
}
You add a change handler as shown previously in the Adding a change handler
section.