开发者

How to Set the Visibility of an Item in a TileList to False

I've got a tileList in a Flex 3 website. I want to programmtically turn off the visibility of a tile. So for example:

<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=开发者_Go百科"visibleOff(event)" />


 private function removey(event:MouseEvent):void {
    myTL.getChildAt(0).visible=false;

    } 

I'm not able to "grab" the first item in the arrayCollection and set its visibility to false.

What am I doing wrong? Any suggestions?

Thank you.

-Laxmidi


dataProvider is not collection of controls. It is collection of description objects. It is itemRenderer who actually present inside of TileList. I guess you mean Tile instead of TileList? If so, just put your buttons in Tile and control them directly.


Remove the item from the dataProvider, and the List control will update correspondingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜