특별한딸기이야기

horizontallist, tilelist 본문

딸기 공부방/flex

horizontallist, tilelist

특별한녀석 2008. 12. 26. 16:53
<?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(tlistFruits.selectedIndex) + "\n";
    msg += "selectedItem.code - " + String(tlistFruits.selectedItem.code) + "\n";
    msg += "selectedItem.label - " + String(tlistFruits.selectedItem.label) + "\n";
    Alert.show(msg);
   }
  ]]>
 </mx:Script>
 <mx:ArrayCollection id="fruits">
  <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:HorizontalList x="133" y="173" id="hlistFruits" fontSize="12" dataProvider="{fruits}" columnCount="3" columnWidth="50" />
 <mx:TileList x="133" y="319" id="tlistFruits" fontSize="12" dataProvider="{fruits}" selectedIndex="{hlistFruits.selectedIndex}" rowHeight="30" rowCount="5" columnWidth="100"
  columnCount="2" direction="horizontal" change="onChange()" />
</mx:Application>

'딸기 공부방 > flex' 카테고리의 다른 글

tree-xml  (1) 2008.12.27
drag & drop  (0) 2008.12.27
combobox  (0) 2008.12.26
listbox  (0) 2008.12.26
바인딩  (1) 2008.12.26