views:

20

answers:

1

In flex, I am handling event like this,

myImage.addEventListener(MouseEvent.CLICK, redoOperation);

Now, I want to pass some value to redoOperation. (function redoOperation(myId:String)) How can I pass String to it?

+2  A: 

I would use an anonymous function and pass the parameter in that way. This is similar to how you would do it in JavaScript.

myImage.addEventListener(MouseEvent.CLICK, function(e:Event):void { redoOperation(myId); });
steve_c