Skip to main content
Inspiring
July 24, 2025
Answered

I want a button inside a movieclip move to next frame on the maintimeline

  • July 24, 2025
  • 1 reply
  • 144 views

Im am doing a very big project. Im doing advanced animations and i have a movieclip navigation menu. When the user hovers the navigation there appears a memes button (its called memes in instance as well) (the main navigation movieclip where the memes is inside in has navi1 as instance name) My method was to create a classic button object and place it inside the movieclip at the frame when its hovers and then use the code snippet gotoframeandstop on the maintimeline to make it go to next frame. That method didn't work by just simply putting a button inside a movieclip. 
Code for the navi1

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));

stage.enableMouseOver(10);
it seems that the button is working because the click sound works and the cursor recongnizes it but gotonextframe doesn't work

    Correct answer kglad

    you have code the button, maybe this.navi1.meme

    1 reply

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

    you have code the button, maybe this.navi1.meme

    Inspiring
    July 24, 2025

    So a Click go to frame and stop code snippet but with this.navi1.memes?