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

Can I assign arguments when calling a function?

2

1 Answer 1

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); });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.