A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Setting Selection of a Combobox?

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    16

    [F8] Setting Selection of a Combobox?

    Is it possible to use AS2 to dynamically set the current state of a ComboBox?

    I'm loading variables from an external file, and I need the ComboBoxes to reflect the selection that comes in.

  2. #2
    Senior Member Robb@exo's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    1,540
    Try something like this, where your cb instance name is myList.
    PHP Code:
    xml = new XML();
    xml.ignoreWhite true;
    function 
    myXML(success) {
        if (
    success) {
            
    defaultNames this.firstChild.childNodes;
            for (
    i=0i<defaultNames.lengthi++) {
                
    listName defaultNames[i].childNodes[0].childNodes[0].nodeValue;
                
    pos.text += listName+"\n";
                
    myList.addItem(listName)
            }
        }
    }
    xml.onLoad myXML;
    xml.load("fileName.xml"); 
    HTH.
    Wile E. Coyote - "Clear as mud?"

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