I have learned this method of passing values with addEventLister. Here is the code:
for (var i:uint = 0; i < asteroids.length; i++)
{
asteroids[i].x = M
When you add an anonymous function as an event listener, the only time you can reasonably remove that event listener is inside the callback.
public function changeValue(event:MouseEvent, otherArguments:Object):void
{
playSound(anote);
trace(event.currentTarget);
event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, arguments.callee);
}
Otherwise, you need to have a non-anonymous function in order to remove it.