我在Flex 3網站中獲得了tileList。我想以編程方式關閉瓷磚的可見性。例如:如何將TileList中項目的可見性設置爲False
<mx:ArrayCollection id="myAC">
<mx:Array>
<mx:Button id="first" label="1" />
<mx:Button label="2" />
<mx:Button label="3" />
<mx:Button label="4" />
</mx:Array>
</mx:ArrayCollection>
<mx:TileList
id="myTL"
dataProvider="{myAC}"
width="400"
height="400"
columnCount="2"
rowCount="2"
/>
<mx:Button id="turnOffVisibility" click="visibleOff(event)" />
private function removey(event:MouseEvent):void {
myTL.getChildAt(0).visible=false;
}
我無法「搶」arrayCollection中的第一項並將其可見性設置爲false。
我在做什麼錯?有什麼建議麼?
謝謝。
-Laxmidi
嗨alxx,謝謝你的留言。我重新編寫它並在itemRenderer中放置一個按鈕。我將arrayCollection中的按鈕更改爲對象。 – Laxmidi 2010-09-28 17:15:42