
Combobox içerisine ArrayCollection kullanarak object ile verileri girmek
Combobox ın durumlarına göre iletileri almak
Combobox dan seçilenin numarasını ve text bilgisini almak
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="773" height="434">
<mx:ComboBox x="378" y="241" width="262" height="30"
labelField="ad"
open="Acildi(event)"
close="Acildi(event)"
change="Degisti(event)">
<mx:ArrayCollection>
<mx:Object ad="volkan" soyad="çelebi"/>
<mx:Object ad="Tülay" soyad="çelebi"/>
<mx:Object ad="Behiç" soyad="çelebi"/>
<mx:Object ad="Yılmaz" soyad="Demir"/>
</mx:ArrayCollection>
</mx:ComboBox>
<mx:Script>
<![CDATA[
import mx.events.DropdownEvent;
private function Acildi(evt:DropdownEvent):void
{
lbl.text="Durum: "+evt.type;
}
private function Degisti(evt:Event):void
{
lbl2.text=evt.currentTarget.selectedIndex + evt.currentTarget.selectedItem.ad + evt.currentTarget.selectedItem.soyad;
}
]]>
</mx:Script>
<mx:Label x="161" y="325" text="Label" fontSize="25" id="lbl"/>
<mx:Label x="390" y="341" text="Label" fontSize="25" id="lbl2"/>
</mx:Application>
Bu Makaleyi Tweet'le




0 yorum:
Yorum Gönder