A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] remove listener for shorthand eventlistener?

  1. #1
    aidanmack.co.uk
    Join Date
    Dec 2001
    Location
    York, UK
    Posts
    400

    resolved [RESOLVED] remove listener for shorthand eventlistener?

    Hi,
    Could someone tell me what the syntax is for removing the listener when writing it shorthand?

    For example how do I remove the Listener for this...

    Code:
    troot.addEventListener("popUpDisplaying", function(e:Event):void {
    troot.removeEventListener("popUpDisplaying",something goes here???);
    
    });

    Thanks
    Aidan

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    arguments.callee

    Edit: You may also use e.currentTarget rather than troot within the function so that the anonymous function can be written without knowledge of what it will be attached to.

  3. #3
    aidanmack.co.uk
    Join Date
    Dec 2001
    Location
    York, UK
    Posts
    400
    Spot on, thanks 5tons.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center