A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: mouseclick / mouseout conflict with button

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    3

    mouseclick / mouseout conflict with button

    Basically I have a animation loop movie clip and a button layed over top that controls that animation. When hovering overtop the button, the movieclip's saturation changes by moving up a frame in the timeline. When clicked it is supposed to move the position of the movie clip.

    The problem is I can't have a mouseclick handler and mouseout handler (goes back to frame one) on the same button.

    I can't create the animation as a button because I NEED the animation to keep playing uninterrupted. I just need the saturation to change and I don't know any other way to do it other than create multiple key frames.

    Code:
    button_11.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_26);
    
    function fl_ClickToGoToAndPlayFromFrame_26(event:MouseEvent):void
    {
    	gotoAndPlay(5);
    }
    
    button_11.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_4);
    
    function fl_MouseOverHandler_4(event:MouseEvent):void
    {
    	gotoAndPlay(2);
    }
    
    
    button_11.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_2);
    
    function fl_MouseOutHandler_2(event:MouseEvent):void
    {
    	gotoAndPlay(1);
    }

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    You could remove the mouse out handler when you click on the button then add it later using a timeout.

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