I have this code:
for each(var tool in tools){ tool.addEventListener(MouseEvent.MOUSE_DOWN, function(){ trace(tool); //Always the last tool }); }
try to do:
for each(var tool in tools){ var t = tool; t.addEventListener(MouseEvent.MOUSE_DOWN, function(){ trace(t); //Always the last tool }); }