2 Replies Latest reply on Nov 18, 2009 11:32 AM by Handycam

    Getting the value of a checkbox in an item renderer?

    Handycam Level 1

      I have a list that uses an item renderer with buttons and data.  I need to add a checkbox and get the value of this checkbox passed along with the event of the pushbutton.

       

      Safari.png

       

      When the user clicks "add to menu: there is a click handler:

      protected function addButton_clickHandler(event:MouseEvent):void
                     {
                          doubleIt = double.selected;
                          owner.dispatchEvent(new Event("ADD_TO_MENU", true));
                     }
      

      Back in the main application, there is a listener for this event.  I want that handler to be able to "know" the status of that checkbox (i.e. the value of "doubleIt", defined as a public boolean).

      private function addToMenuHandler(event:Event):void {
                 var i:int = event.target.selectedIndex;
                 var obj:Object = new Object();
                 obj = recipeListCollection.getItemAt(i);
                 menuList += obj;
      }
      

      I have tried various permutations of the event.target, but can't figure out how to access that variable.