dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: help! xml combobox

Threaded View

  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    84

    help! xml combobox

    I have a combobox
    The xml file is already loaded and I can target the node, but I cannot get the child nodes to add in combobox.

    Code:
    _root.sliderthree.ChooseSize.addItem([+sizes]);
    Code:
    +sizes = _root.xmlList.firstChild.childNodes[i].childNodes[j+18].firstChild;
    Below is my xml file

    Code:
    <products>
    	<list no="1">
    		<title>Bag One</title>
    		<font color="#663300">Bag One</font>
    		<txt>If you love baby pink and looking ultra feminine and sophisticated then our pink clutch bag is perfect and practical for holding all your evening essentials bl bl bllll</txt>
    		<image>thumbnails/img01ex.jpg</image>
    		<link>bag1.html</link>
    		<cost>10.95</cost>
    		<description>Very nice bage with great ect</description>
    		<dimensions>W 120 mm  x  H 234 mm  x  D 102 mm</dimensions>
    		<availability>IN STOCK</availability>
    		<image2>photos/img01.jpg</image2>
    		<weight>Weight 500g</weight>
    		<AllSizes>
    			<shoesize shoesizeName="UK - Size 6" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 7" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 8" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 9" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 10" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 11" siteURL="http://www.macromedia.com"></shoesize>
    			<shoesize shoesizeName="UK - Size 12" siteURL="http://www.macromedia.com"></shoesize>
    		</AllSizes>
    	</list>
    </products>
    I also found this but still had problems when I changed thisXML

    Code:
    function LoadCombo(success) {
     if (success) {
    		//set variables
    		var BaseNode=thisXML.childNodes[0];
    		var ComboSizes = new Array();
    		var ComboURLs = new Array();
    		var ThisNode;
    		
    		//get sites information
    		for (i=0; i < BaseNode.childNodes.length; i++) {
    			ThisNode = BaseNode.childNodes[i];
    			ComboSizes[i] = ThisNode.attributes["shoesizeName"];
    			ComboURLs[i] = ThisNode.attributes["shoesizeURL"];
    		//add to combo box
    		ChooseSize.addItem(ComboSizes[i],ComboURLs[i]);
    		ChooseSize.text="Select Size";
    		}
    	}
    }
    I have been working on this for 4 days with no luck can someone please help me out. Thanks
    Last edited by shaunfreeman; 03-01-2008 at 11:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center