2010-09-28 122 views
0

我在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

回答

0

dataProvider是不是控件集合。它是描述對象的集合。 itemRenderer實際上存在於TileList中。我想你的意思是Tile而不是TileList?如果是這樣,只需將你的按鈕放在Tile中並直接控制它們。

+0

嗨alxx,謝謝你的留言。我重新編寫它並在itemRenderer中放置一個按鈕。我將arrayCollection中的按鈕更改爲對象。 – Laxmidi 2010-09-28 17:15:42

0

從dataProvider中刪除項目,List控件將相應更新。

相關問題