This is the solution I came up with:
canvas.addEventListener(MouseEvent.MOUSE_OVER, getHandler(canvas, 0x404040));private function getHandler(canvas:Canvas, color:uint) : Function {return function(event:MouseEvent) : void {changeBackgroundColor(canvas, color);}}private function changeBackgroundColor(canvas:Canvas, color:uint) : void {canvas.setStyle("backgroundColor", color);}
0 comments:
Post a Comment