Skip to main content
Inspiring
April 5, 2008
Question

function that can be called by event and from code?

  • April 5, 2008
  • 1 reply
  • 231 views
My question is if there's a technique such as this that would allow you to have one function be called both by an event listener, and manually by having the function called out in the code. It seems with what I know you can only have one function work one way or the other, but I can't believe that's the case...

Also, I know you could say

myfunction(e:Event){
}

and this would at least allow any event type to call it? I also wonder what "e" actually is. Is this just shorthand for "event"?

Thanks!
Devin
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 5, 2008
you can can use one function by either:

1. dispatching a new event with you code-based function call or

2. call the same function from the event listener function and code.