Skip to main content
Inspiring
July 22, 2025
Answered

Movieclip wont do roll out animation properly

  • July 22, 2025
  • 2 replies
  • 924 views

Im making a movieclip as a navigation button on my html5 canvas. I want a simple roll in and roll out animation. What i noticed is the animation wont roll out from the button. I have asked chatgpt everything how to make only a specific area of a movieclip interact nothing works. Also the movieclip is glitchy sometimes even when the mouse is completely out from the movieclip it still holds on hover. I have tried so many codes and everything. How can i make it work smoothly and make several buttons in the same movieclip do the same roll in roll out animation you see in the video i attached.
This is the code for me movieclip right now: 

let currentState = "idle"; // Can be "idle", "hovering", "hoveringOut"

this.navi1.stop();

this.navi1.addEventListener("mouseover", function () {
if (currentState !== "hovering") {
currentState = "hovering";
this.navi1.gotoAndPlay("hoverIn");
}
}.bind(this));

this.navi1.addEventListener("mouseout", function () {
if (currentState !== "hoveringOut") {
currentState = "hoveringOut";
this.navi1.gotoAndPlay("hoverOut");
}
}.bind(this));

    Correct answer kglad

    add

     

    stage.enableMouseOver(10);

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    July 22, 2025

    Hi.

     

    I think it's easier to use a Button symbol because you don't have to code the hover interaction.

     

    Here is an exmple of how to achieve this behavior in a very simple way, by smartly structuring the buttons and only using a couple of stops.
    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/simple_hover_interaction

    Regards,
    JC

    Inspiring
    July 22, 2025

    The thing is i want to make my buttons smoothly change when i hover them. Im trying to make one movieclip play certain keyframes inside of the movieclip when the mouse interacts with one of the buttons. Is this hard to achieve?

    JoãoCésar17023019
    Community Expert
    Community Expert
    July 22, 2025

    The buttons smoothly change in the sample provided.

     

    Although it's a Button symbol, there's a MovieClip instance containing an animation in each state (up and over).

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    July 22, 2025

    add

     

    stage.enableMouseOver(10);

    Inspiring
    July 22, 2025

    Thank you so much this really helped. But is there anyway to make it hover out inside the movieclip. Right now it hovers out but only when the mouse is outside the movieclip is there any way to make it hover out earlier?

    kglad
    Community Expert
    Community Expert
    July 22, 2025

    like when?