4 Replies Latest reply on Jul 6, 2011 3:19 PM by Energetic Pixels

    dataGroup rendered item selected action

    Energetic Pixels

      Ok, I must be missing something.

       

      I have a panel (thumbs) that has a dataGroup in it.  I also have another panel (viewPanel) that has a image tag in it.  The idea is that the user clicks on a rendered item within the 'thumbs' panel to show a bigger image that will display in 'viewPanel'. Items within the 'thumbs' panel are being rendered by a custom item renderer.  In the item renderer I have a action script function called getImage which is supposed to load specific data from the dataGroup into the viewPanel -> Image tag (bigView).  But FB4 is saying that I have a Access of undefined property bigView.  What am I missing????

       

      itemRenderer =>

      <fx:Script>
                <![CDATA[
                     //This getImage function will handle a click event when user clicks
                     //on thumbnail to get a bigger image to show in viewer panel
                     protected function getImage(event:MouseEvent):void {
                          bigView.load(event.currentTarget());
                     }
                ]]>
           </fx:Script>
      
           <s:states>
      
                <s:State name="normal"  />
                <s:State name="hovered"  />
                <s:State name="selected"  />
      
           </s:states>
      
           <s:BorderContainer top="5" width="100%"
                     height="100%" borderWeight="0">
      
                <s:layout>
      
                     <s:VerticalLayout horizontalAlign="center"  />
      
                </s:layout>
                <s:Label paddingTop="5" text="{data.shortName}"  />
                <s:Image maxWidth="100" maxHeight="100"
                          horizontalAlign="center" verticalAlign="middle"
                          source="{data.imageFile}" click="getImage(event)"  />
      
           </s:BorderContainer>
      

       

       

      Is there a better way of doing this type of action???

       

      Tony