3 Replies Latest reply on Nov 11, 2009 11:24 PM by RUSH-ME

    to attribute method click through script

    ^^GOUST^^ Level 1

      I have a button in my application to which I want the click method to be attributed to him by mx:script, calling a function and passing parameters

       

      <mx:script>

      <![CDATA[

           public function test():void
                  {
                   button1.addEventListener(MouseEvent.CLICK,  very_crazy(canvasExample));
                  }

       

           public function very_crazy(parametes:canvas):void
                   {
                         parametes.visible=false;
                   }

      ]]>

      </mx:script>

       

      <mx:button id="button1">