Mar 23 2008
Magic lines of code (Trick-Shot #1)
Always wanted a magic line of code that will do the job no matter where you put it. : ) For instance this line will remove any eventListener registered on any eventDispatcher target for any type of event.
Considering that “e” is the event:
e.target.removeEventListener(e.type,arguments.callee);
Used something like this … and no matter in which listener you will put it, will do it’s job.
private function onEvent(e:Event):void
{
e.target.removeEventListener( e.type, arguments.callee );
}
It’s not much but you could find it pretty usefull in some cases.
This “trick-shots” category will contain all sort of tiny cool thing like this. So keep an eye on this one.

