특별한딸기이야기
combobox 본문
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function onChange() : void
{
var msg : String;
msg = "selectedIndex - " + String(cmbFruits.selectedIndex) + "\n";
msg += "selectedItem.code - " + String(cmbFruits.selectedItem.code) + "\n";
msg += "selectedItem.label - " + String(cmbFruits.selectedItem.label) + "\n";
Alert.show(msg);
}
]]>
</mx:Script>
<mx:ArrayCollection id="fruit">
<mx:source>
<mx:Object label="사과" code="55" />
<mx:Object label="배" code="66" />
<mx:Object label="복숭아" code="77" />
<mx:Object label="감" code="88" />
<mx:Object label="자두" code="99" />
</mx:source>
</mx:ArrayCollection>
<mx:ComboBox x="129" y="110" id="cmbFruits" dataProvider="{fruit}" change="onChange()" fontSize="12" />
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function onChange() : void
{
var msg : String;
msg = "selectedIndex - " + String(cmbFruits.selectedIndex) + "\n";
msg += "selectedItem.code - " + String(cmbFruits.selectedItem.code) + "\n";
msg += "selectedItem.label - " + String(cmbFruits.selectedItem.label) + "\n";
Alert.show(msg);
}
]]>
</mx:Script>
<mx:ArrayCollection id="fruit">
<mx:source>
<mx:Object label="사과" code="55" />
<mx:Object label="배" code="66" />
<mx:Object label="복숭아" code="77" />
<mx:Object label="감" code="88" />
<mx:Object label="자두" code="99" />
</mx:source>
</mx:ArrayCollection>
<mx:ComboBox x="129" y="110" id="cmbFruits" dataProvider="{fruit}" change="onChange()" fontSize="12" />
</mx:Application>
'딸기 공부방 > flex' 카테고리의 다른 글
drag & drop (0) | 2008.12.27 |
---|---|
horizontallist, tilelist (0) | 2008.12.26 |
listbox (0) | 2008.12.26 |
바인딩 (1) | 2008.12.26 |
버튼으로 숫자선택 (0) | 2008.12.26 |