2 Replies Latest reply on Jan 3, 2011 5:35 PM by learner_doug

    How to pass a variable value from a click handler to an AS function?

    learner_doug Level 1

      I'd like to be able to click a button, pass a value to a variable, then switch that variable to be evaluated inside case routine.

       

       

      mxml:

      click="someClickHandler(event);    <!--  like the variable to get set with the click-handler  -->

       

      AS:

      public function genericFunction(event:MouseEvent):void

       

      {

      switch(variableName)

      {

       

      case1:

      action;

      action2;

      break;

       

      case2:

      action;

      action2;

      break;

      .

      .

      .

      caseN:

      action;

      action2;

      break;

      }

       

       

      }

      Thanks.