A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: child object interferes with parent eventListener

  1. #1
    reMember
    Join Date
    May 2001
    Location
    Boston, Massachusetts, USA
    Posts
    128

    Unhappy child object interferes with parent eventListener

    So I have a MC called "slider" slider has multiple graphics and clips and buttons in it. I have an event handler that tells the "slider" clip to move when you rollover and to move back when you rollout. Problem is that anything you rollover in the parent clip, once rolled off, even thought it is still in the parent clip, it triggers the rollout action.

    I can't use the mouseEnable = false; code since I have buttons in there that i need to use. Any help is appreciated. Thanks!
    Code:
    this.slider.addEventListener(MouseEvent.MOUSE_OVER, slideOvr);
    this.slider.addEventListener(MouseEvent.MOUSE_OUT, slideOut);
    
    function slideOvr(event:MouseEvent):void{
    	TweenLite.to(event.target.parent, mySpeed, {y:slideY-85, ease:myEase, overwrite:0});
    	}
    function slideOut(event:MouseEvent):void{
    	TweenLite.to(event.target.parent, mySpeed, {y:slideY, ease:myEase, overwrite:0});
    }
    1 post closer to a meeeeeellion......

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Verify that event.target == event.currentTarget before initiating the Tweens.

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