How to set movieclip back to previous depth on mouse out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Max58kl
    New Member
    • Nov 2007
    • 37

    #1

    How to set movieclip back to previous depth on mouse out

    I have a button that when hovered over plays a movieclip (a info bubble appears) when I mouse out it disapears.
    There is also a video clip on the stage.
    Currently if I launch the flash movie I can play the video clip the controls are active, however as soon as
    I hover over the info button once (the info bubble is now on top of the video clip), then mouse
    off the button (the info bubble disapears) however the video controls have now become in-active.

    I need to set the hover_jim movieclip
    back to its previous depth when I mouse out of the button, jim_btn

    Code:
    var currentDepth:uint = this.numChildren - 1;
    jim_btn.addEventListener(MouseEvent.MOUSE_OVER, goto_bubble4);
    
    function goto_bubble4(evt:MouseEvent){
    this.setChildIndex(hover_jim, currentDepth);
    hover_jim.gotoAndPlay("go");
    }
    jim_btn.addEventListener(MouseEvent.MOUSE_OUT, goto_bubble_out4);
    
    function goto_bubble_out4(evt:MouseEvent){
    //this.setChildIndex(hover_jim, currentDepth);
    hover_jim.gotoAndPlay("goer");
    }
  • Max58kl
    New Member
    • Nov 2007
    • 37

    #2
    I now know how to avoid making FLVPlayBack buttons unresponsive!

    Set a variable as follows

    var topPosition:uin t = this.numChildre n - 1;

    then create a mouseover listener and function call
    which sets the setChildIndex of the hover_jim movieclip (bubble) to the topPosition variable

    jim_btn.addEven tListener(Mouse Event.MOUSE_OVE R, goto_bubble);

    function goto_bubble(evt :MouseEvent){
    this.setChildIn dex(hover_jim, topPosition);
    hover_jim.gotoA ndPlay("go");
    }

    then create a mouseout listener and function call
    which sets the setChildIndex of the hover_jim movieclip (bubble) back to 0

    jim_btn.addEven tListener(Mouse Event.MOUSE_OUT , goto_bubble_out );

    function goto_bubble_out (evt:MouseEvent ){
    setChildIndex(h over_jim, 0);
    hover_jim.gotoA ndPlay("goer");
    }







    Originally posted by Max58kl
    I have a button that when hovered over plays a movieclip (a info bubble appears) when I mouse out it disapears.
    There is also a video clip on the stage.
    Currently if I launch the flash movie I can play the video clip the controls are active, however as soon as
    I hover over the info button once (the info bubble is now on top of the video clip), then mouse
    off the button (the info bubble disapears) however the video controls have now become in-active.

    I need to set the hover_jim movieclip
    back to its previous depth when I mouse out of the button, jim_btn

    Code:
    var currentDepth:uint = this.numChildren - 1;
    jim_btn.addEventListener(MouseEvent.MOUSE_OVER, goto_bubble4);
    
    function goto_bubble4(evt:MouseEvent){
    this.setChildIndex(hover_jim, currentDepth);
    hover_jim.gotoAndPlay("go");
    }
    jim_btn.addEventListener(MouseEvent.MOUSE_OUT, goto_bubble_out4);
    
    function goto_bubble_out4(evt:MouseEvent){
    //this.setChildIndex(hover_jim, currentDepth);
    hover_jim.gotoAndPlay("goer");
    }

    Comment

    Working...