Passing Arguments through Event Handlers

Hi,

I am having trouble passing an additional value through the addEventListener method. Can someone tell me how to pass in values so my function knows what buttons were pressed?

a.addEventListener(MouseEvent.MOUSE_UP, jumpThumb(“mouseUp”, 0));
b.addEventListener(MouseEvent.MOUSE_UP, jumpThumb(“mouseUp”, 1));
c.addEventListener(MouseEvent.MOUSE_UP, jumpThumb(“mouseUp”, 2));

function jumpThumb(event:MouseEvent, mouseButton:int):void {
//statement that uses value of mouseButton
}

Thanks for any help!

Bobby

event.target will tell you what button was pressed…

or,
http://blog.onebyonedesign.com/?p=60

A good post outlining some approaches

Dale,

Thanks for the posts. They are very helpful :slight_smile:

Bobby