4 Replies Latest reply on Oct 13, 2010 8:25 AM by laxmidi

    How to Reference What Was Clicked in a TileList using an ItemRenderer

    laxmidi Level 1

      Hi,

       

      I've got a Tilelist and I'm using an ItemRenderer, which is a Button.

       

      I don't understand how to reference what was clicked. So, if the first tile (which is the first Obect) is clicked, how do I know that that particular one was clicked.

       

       

       

      <mx:TileList 

          id="myTL"

          dataProvider="{myAC}"

          width="400"

              height="400"

              columnCount="2"

              rowCount="2" />

       

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

       

       

       

      ItemRenderer:

       

      <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"

      click="Alert.show( 'This was Clicked')">

       

       

      <mx:Script>

      <![CDATA[

      import mx.controls.Alert;

      ]]>

      </mx:Script>

       

      </mx:Button>

      Thank you.
      -Laxmidi