holliebelle
10-25-2009, 06:48 AM
I have a combobox with the following code below.
If I have an incoming variable periodicValue via a queary string in the url,
how do I get the combobox to go to the relevant item...
so for instance if the value of the variable is 12, the combobox will display "Monthly"
var periodItems:Array = [
{label:"Weekly", value:52},
{label:"Fortnightly", value:26},
{label:"Monthly", value:12},
{label:"Quarterly", value:4},
{label:"Yearly", value:1}
];
var periodCombo:SimpleComboBox = new SimpleComboBox(combo3, periodItems, "Select");
//You can listen to chage events like this:
periodCombo.onChange = function():Void{
periodicValue = periodCombo.selectedValue;
trace("changed" + periodCombo.selectedValue);
}
If I have an incoming variable periodicValue via a queary string in the url,
how do I get the combobox to go to the relevant item...
so for instance if the value of the variable is 12, the combobox will display "Monthly"
var periodItems:Array = [
{label:"Weekly", value:52},
{label:"Fortnightly", value:26},
{label:"Monthly", value:12},
{label:"Quarterly", value:4},
{label:"Yearly", value:1}
];
var periodCombo:SimpleComboBox = new SimpleComboBox(combo3, periodItems, "Select");
//You can listen to chage events like this:
periodCombo.onChange = function():Void{
periodicValue = periodCombo.selectedValue;
trace("changed" + periodCombo.selectedValue);
}