all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

addEventListener(MouseEvent.MOUSE_OVER, afunction(i) )



addEventListener(MouseEvent.MOUSE_OVER, afunction(i) ) Panosher
7/6/2007 4:13:47 PM
flash actionscript: Anybody knows how to pass a variable to a function that is called by an event
listener ??????????

I recieve the error "Expected 2, get 1"

a=1

lala.addEventListener(MouseEvent.MOUSE_OVER, getvar(a) );

function getvar(event:MouseEvent, a:Number):void {
needthevar[a].textColor = 0xFFFFFF;
mybar.y=needthevar[a].y;
}
Re: addEventListener(MouseEvent.MOUSE_OVER, afunction(i) ) kglad
7/6/2007 6:22:38 PM
you can't. and there's no need.

AddThis Social Bookmark Button