How to Set the Visibility of an Item in a TileList to False
-
26-09-2019 - |
문제
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="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.
제휴하지 않습니다 StackOverflow