1 Reply Latest reply on May 9, 2007 6:27 AM by parallaxed

    list of images

    obagscheid
      I would like to have a list of clickable images. I simply don't know how to do. All my good ideas are rejected by the compiler.
      Has anyone been successful with that yet?
      A serious problem is probably: how to identify what has been clicked as all images have the same id?

      Here is my code:
      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="206" height="100%" x="0" y="0">
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      [Bindable] public var level1Items:Array;
      ]]>
      </mx:Script>

      <mx:List width = "100%" height="100%" backgroundColor="0xEEEEEE"
      dataProvider="{level1Items}"
      itemRenderer="ReportThumbnail"
      click = "theIconAccordion.tabIndex = 1; " />
      </mx:Canvas>


      and here is my itemRenderer:
      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml"
      horizontalAlign="center"
      verticalGap="0" borderStyle="none" backgroundColor="0xCCCCCC" >
      <mx:Script>
      <![CDATA[
      [Bindable] public var wert:int;
      private function handleClick():void
      {

      }
      ]]>
      </mx:Script>
      <mx:Image id="image" width="60" height="60" source="{'pic/'+ data.icon}" click="handleClick();"/>
      <mx:Label text="{data.report}" width="120" textAlign="center"/>
      </mx:VBox>