A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Combo boxes

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    19
    How do you assign a url to the dropdown options in a combo box?

  2. #2
    Hi,

    labelarray=new Array("name1","name2","name3",etc);
    dataarray=new Array("url1","url2","url3",etc);
    for (i=0; i<numberofitems; i++) {
    ComboBoxName.addItem(labelarray[i],dataarray[i]);
    }

    ComboBoxName.setChangeHandler("myHandler");
    function myHandler(component) {
    chosen = ComboBoxName.getSelectedItem().data;
    getUrl(chosen,"",_POST);
    }

    Comboboxes use label,data to set.
    label is the name that is shown in the combobox,
    data is any further information.
    SetChangeHandler uses the data assigned to a special label to work with.

    Hope that helps!

    manuel

  3. #3
    for (i=0; i "smaller than" numberofItems; i++) {
    ComboBoxName.addItem(labelarray,dataarray);
    }

    just to correct the code above...

    Cause the display here makes errors, change "smaller than" with the sign that is correct, u know?


    ok!


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