Dynamically passing parameters to event listeners AS3?

By using a variable from outer scope inside an anonymous function you got big trouble with closures and memory leak already: position is used in function(e:MouseEvent) but it was created in function Grid() so it'll obey function Grid() 's changes. And you're dealing with 256 function(e:MouseEvent) s that you added but can't remove, overheading memory!

You could add a name to this button, for example button.name = "button" + position; and in event handler function you can extract position parameter from target name (e.target.name).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions