2 Replies Latest reply on Nov 12, 2006 4:45 AM by Peter Lorent

    Passing parameters to an event handler

    landar
      I am successfully using event handlers to respond to user inputs(mouse click, enter key, etc.)

      The handler can also use the event objects parameters to perform operations based on who called the function. An example of this is the target._name, which is apparently passed when the event occurs.

      In addition, I have a need to call an event handler from within AS to essentially mimic a mouse click or keyboard entry.
      This call from AS is no problem. Just use the event handler name. For instance, mc.click(); and the handler is invoked.
      However, with the AS call there is no object passed to the handler. This differs from an event-driven call where an object
      identifying the event source is passed to the handler.

      The question is: Can you pass a parameter(s) or object to an event handler from a call in ActionScript? I have tried various ways, but nothing has worked.

      Does anyone know the insides of event handling and how the "eventObject" is passed when
      a user event occurs? Knowing how that works might give some clues as to how to pass an object from an AS call.