1 Reply Latest reply on Jul 2, 2009 12:02 AM by moutfeh5

    icon event in checkbox tree

    moutfeh5

      Hi i used an already implemented class and customized to meet my requirement, and each node has a specific icon,
      I am trying to assign an event to the icon as:

       

       

       

       

       

      super.icon.addEventListener(MouseEvent.CLICK, clickEvt);

      i tried to write in

      override

       

      protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

       

      but it didn't work,

       

      can any body help me to figure out where i can write, or what should i do assign an event handler to the icon

       

      Thank you

        • 1. Re: icon event in checkbox tree
          moutfeh5 Level 1

          Hi guys...

           

          I found the solution

          i set mouseEnabled = true; in the construction of the inherited treeItemRenderer.

          I was using the example in the Flex CookBook, In this example at the constructor level, mouseEnabled was set to false

           

          AND in the createChildren method i add MouseEvent.Click

           

          It is written below

           

           

           

           

           

           

           

           

           

          override

           

           

          protected function createChildren():

          void

          {

           

           

           

          super.createChildren();

           

           

          super.addEventListener( MouseEvent.CLICK, imageToggleHandler);

          .....

          ...

          ....

          }

           

           

          Gd Luck