Hello everyone.  I am trying to select an item in a combobox component based on
its data value.  I found this solution (which works) but I have multiple
comboboxes placed in many different spots in my movie that need this same
functionality.  Can anyone suggest a way to reuse this for multiple comboboxes
or possibly a better solution altogether? cheers!

CODE:::

function selectByData(selData:String):Number {
        var index:Number = -1;
        for (var i = 0; i<=ambient_temp_cb.length; i++) {
                if (ambient_temp_cb.getItemAt(i).data eq selData) {
                        index = i;
                        break;
                }
        }
        return index;
}
ambient_temp_cb.selectedIndex = selectByData(
_root.Environment.ambient_temp_units );


Mike
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to