Skip to main content
MongosWorld
Participant
August 31, 2020
Question

navigating from one movie clip to another within a scene

  • August 31, 2020
  • 4 replies
  • 425 views

I am not able to figure out how to click a button in a movie clip that navigates to the start of a second movie clip, both residing in the same scene. This is using JavaScript controls (HTML5 Canvas), not ActionScript. I am creating a step-by-step tutorial where all steps are movie clips on separate layers of a scene with "Next" and "Back" buttons. Can someone help??

    This topic has been closed for replies.

    4 replies

    MongosWorld
    Participant
    September 21, 2020

    I was able to get the code right so I can jump from one movie clip to another within a single scene. I am now running into a problem where I have two buttons (hotspots) in a scene. Each button instance has its own distinct name but otherwise the action for each button is nearly identical (See screenshot)

    As you can see, I have each button called out in the timeline. One is set to go to and stop on frame 5 of the main scene and the other is set to go to and stop on frame 6 (See main scene timeline below)

    The problem I am running into is when I got to preview the scene, it works until I get to the part where I choose one of the phones. Both hotspots are navigating to frame 6 (Android). Can someone tell me why this is happening?

    kglad
    Community Expert
    Community Expert
    September 22, 2020

    those are frames 4 and 5, not 5 and 6.  fix your code and retry.

    MongosWorld
    Participant
    September 25, 2020

    Not sure why you would call out those frames as 4 and 5. When I manually move the timeline to each respective frame called out in my screen cap above, they are clearly indicated as 5 and 6. I tried what you suggested anyway and it did not work. Not sure why this is so difficult. Even my "Back" and "Next" buttons are not functioning properly. The "Next" button works, but the "Back" button does not while using the exact same code (But calling a different frame to navigate to in the main scene). I really need some help here!

    MongosWorld
    Participant
    September 1, 2020

    Thanks for the quick responses. I added the .parent, and that did force the button action to go from "Intro" to "Step1" in the parent timeline...

    Here is what the code looks like...

    The problem that I am having now is that when the new movie clip loads, it doesn't stop there and play that clip, but rather it cycles through all the movie clips on the parent timeline in a split second, then replays the intro movie clip again. Am I leaving something out of the code?

     

     

     

    Legend
    September 1, 2020

    First, there's no reason to put each movieclip on its own layer.

     

    Second, it's doing exactly what you're telling it to: go to and PLAY.

     

    If you want it to stop, tell it that instead.

    Legend
    August 31, 2020

    If this is a step-by-step tutorial, you should put each step's movieclip in consecutive frames on the timeline. That way your next and back buttons just have to tell the container timeline to go to the previous and next frames.

    kglad
    Community Expert
    Community Expert
    August 31, 2020

    this.parent is a reference to the parent timeline. 

     

    this.parent.another_movieclip is a reference to another_movieclip that's on the parent timeline (at the time the code executes)