tags:

views:

12

answers:

1

Hi,

Is it possible to set the alphas of the tiles in a TileList independently of one another? How can I make object 1 have an alpha of say 0.5, but object 3 have an alpha of 0.2? If I use the tileList's backgroundAlpha, then the alphas of all of the objects are set to one value.

<mx:ArrayCollection id="myAC">
    <mx:Array>
    <mx:Object id="first" label="1" />
    <mx:Object label="2" />
    <mx:Object label="3" />
    <mx:Object label="4" />
    </mx:Array>
</mx:ArrayCollection>

<mx:TileList  
    id="myTL"
    dataProvider="{myAC}"
    width="400"
        height="400"
        columnCount="2"
        rowCount="2"
    />

Itemrenderer:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"    
click="event.target.visible=false">


</mx:Canvas>

Thank you.

-Laxmidi

+1  A: 

What are the conditions for determining the required alpha value? You may be able to check those conditions within your item renderer and set the alpha accordingly there. Otherwise you could set the alpha on your data objects and have your item renderer set the alpha like so:

backgroundAlpha={data.alpha}

Hope that helps.

Wade Mueller
Hi Wade, Thanks so much for your message. I'm trying to use a tileList to mask an image. When the user clicks on one of the tiles, then it disappears and reveals part of the image below. Unfortunately, I still haven't figured it out, yet. If you have any suggestions, please let me know. Again, thank you for helping me.
Laxmidi