1:获取两个ComboBox的id
<mx:ComboBox width="160"
id="xianlu"dataProvider="{itmezhiwei}"
change="fnshow()"/>
<mx:ComboBox width="160"
d="chezhan1"
dataProvider="{yihao}"
selectedIndex="0"/>
2:执行事件
private function fnshow():void{
if(this.xianlu.text=="1号线"){
this.chezhan1.dataProvider=this.yihao;
}
if(this.xianlu.text=="2号线"){
this.chezhan1.dataProvider=this.erhao;
}
}
3:集合内容
private var yihao:ArrayCollection=new ArrayCollection([{label: "1"}, {label: "2"}, {label: "3"}]);
private var erhao:ArrayCollection=new ArrayCollection([{label: "11"}, {label: "22"}, {label: "33"}]);
private var itmezhiwei:ArrayCollection=new ArrayCollection([{label: "111"}, {label: "222"}, {label: "333"}]);