0
var callback = null;
addEventListener(Event.MouseDown, callback = function(e:Event){blabla....});

Can I assign arguments when calling a function?

rptwsthi
  • 10,094
  • 10
  • 68
  • 109
  • 1
    Check this: http://stackoverflow.com/questions/1464925/passing-parameters-to-event-listeners-handlers – Miguel Garcia Feb 26 '13 at 03:56
  • Or [How to pass arguments into event listener function in flex/actionscript?](http://stackoverflow.com/questions/6406957/how-to-pass-arguments-into-event-listener-function-in-flex-actionscript/6407128#6407128) – Marty Feb 26 '13 at 04:10

1 Answers1

0

Of course. Try it this way instead.

var callback = function(e:Event, arg1, arg2) { blabla....};

addEventListener(Event.MouseDown, function(e) {  callback(e, 0, 1); } );

Or If I misunderstood your question, perhaps this way:

var callback = null;

addEventListener(Event.MouseDown, 

       callback = function(e:Event) { anotherfunction(arg1, arg2); });
loxxy
  • 12,990
  • 2
  • 25
  • 56