FORUMS: list search recent posts

newb question on functions

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tadeo Cruz
newb question on functions
on Nov 16, 2009 at 8:54:53 pm

Hi, I have a question about events and a function here.
I've got this textfield with a button, but I would also like to listen to the enter key to process the text. So it is just one function called by two differents events, the question is about the parameters in the function.
This code works but I had to put that "e" in the pasar(e), not really knowing the purpose. Would appreciate a little explanation, thanks for your time.

b1.addEventListener(MouseEvent.CLICK, pasar);
stage.addEventListener(KeyboardEvent.KEY_DOWN, tecla);
function tecla(e:KeyboardEvent){if (e.keyCode == Keyboard.ENTER) {pasar(e);}}
function pasar(e:Event) {...}

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved