Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top