jarmanje
09-26-2008, 01:02 PM
Hello.
How can i fill a combobox based on the value of a var.
This is what i'm trying to do, but this code is all wrong:
<mx:ComboBox editable="false" enabled="true"><mx:ArrayCollection>
<mx:Object label="Main stage" data="stage1"/>
<mx:Object label="2nd stage" data="stage2"/>
<mx:Object label="3rd stage" data="stage3"/>
</mx:ArrayCollection>
Currenctlyselected value of combox = callfunctioninas3();
</mx:ComboBox>
//code in <!CDATA{
private function callfunctioninas3():void
{
if (currentOrder.order=="stage1") {
//set value of combox to "Main stage"
} else if (currentOrder.order=="stage2") {
//set value of combox to "2nd stage"
} else if (currentOrder.order=="stage3") {
//set value of combox to "3rd stage"
} else {
//set the combox to nothing
}
}
Sorry for my amateur coding, but it shows how i'd like to do it!
Thanks a lot for any help
How can i fill a combobox based on the value of a var.
This is what i'm trying to do, but this code is all wrong:
<mx:ComboBox editable="false" enabled="true"><mx:ArrayCollection>
<mx:Object label="Main stage" data="stage1"/>
<mx:Object label="2nd stage" data="stage2"/>
<mx:Object label="3rd stage" data="stage3"/>
</mx:ArrayCollection>
Currenctlyselected value of combox = callfunctioninas3();
</mx:ComboBox>
//code in <!CDATA{
private function callfunctioninas3():void
{
if (currentOrder.order=="stage1") {
//set value of combox to "Main stage"
} else if (currentOrder.order=="stage2") {
//set value of combox to "2nd stage"
} else if (currentOrder.order=="stage3") {
//set value of combox to "3rd stage"
} else {
//set the combox to nothing
}
}
Sorry for my amateur coding, but it shows how i'd like to do it!
Thanks a lot for any help