Trick for ActionScript-3 to pass extra parameter in the listener function.
SOURCE CODE
SOURCE CODE
mc.addEventListener(MouseEvent.CLICK, foo("Wow!"));
function foo(str:String)
{
return function(e:MouseEvent) { trace(str); }
}
OUTPUTWow!
Comments
Post a Comment