5 Replies Latest reply on Jul 31, 2008 7:48 AM by VarioPegged

    Passing Parameters in an EventListener Function

    katychapman85 Level 1
      Hey,

      I have this function:
      public function GetOptions(Menu:int):void{
      document.MenuOptions.url = " http://localhost/Flex/Personalised%20Palettes-debug/MenuOptions.php?Menu=";
      document.MenuOptions.url += Menu;
      document.MenuOptions.send();
      }

      What I'm trying to do is when a user click on a Radio button this function is called and the number of the Menu required is sent to the function.

      I've added this Event Listener to my Radio Button:

      document.RadioButtons2.addEventListener(MouseEvent.CLICK, function():void{GetOptions(2);});

      However, it's not working. Everything I've read suggests using an anonymous function in the Event Listener but for some reason it's not working.

      Any ideas?