4 Replies Latest reply on Sep 12, 2008 8:15 AM by rnothersuperior

    Menu items that call other scenes

    rnothersuperior
      I'm having an issue with my menu bar so far. I have it set up so that the "menu" that appears on screen is a movie clip with embedded buttons. When you click the menu it opens up, click it again and it closes, but there are a series of buttons inside the menu that I want to take me back to the "Home" scene.

      I have tried placing the script on the button itself and also as in my "actions" frame inside the movie clip but neither will send the user back to the "Home" scene.

      Code on button:
      on (release) {
      gotoAndPlay("Home",1)
      }

      When that didn't work I commented it out and place this code on the actions frame:
      Home_btn.onRelease = function() {
      gotoAndPlay("Home",1)
      }

      I think it is telling it to go back to the beginning of the current scene and not the scene named "Home."
      Any suggestions?
        • 1. Re: Menu items that call other scenes
          Rothrock Level 5
          The best one is to not use Scenes. They were originally designed to help timeline animators keep their work organized. When published to the swf, the scenes actually go away and the swf is just one main timeline.

          With the addition of ActionScript to Flash they have never worked really well. So if you are only doing timeline animation by all means use them. If you are going to use code: Don't!

          I think it might help if you change the code to something like:

          _root.gotoAndPlay("Home",1);

          But I'm not sure. And if that does work, really think about your next project and don't use scenes in the future! Really...
          • 2. Re: Menu items that call other scenes
            rnothersuperior Level 1
            Unfortunately that didn't work, thanks though. I'm surprised to hear that scenes are bad news. In college they practically beat it into our heads that scenes were the end-all-be-all. If I trash the scenes what method do I use then? Just everything in one timeline?
            • 3. Re: Menu items that call other scenes
              Rothrock Level 5
              Bad college! Bad College!

              Scenes are great for timeline animation. They just don't play well with actionscript. Often they work fine on this project and that one, but then for some reason it just goes kaput on the next project and then you are caught out.

              You could use just one timeline. Give the different sections labels and jump to the labels. But sometimes it gets difficult to keep everything organized on one timeline. Really the dominant metaphor of Flash is the MovieClip. So depending upon exactly what you are doing I would say organize your "scenes" into movieclips.

              You can then use code to hide/show the various clips as needed and control each of their timelines.
              • 4. Re: Menu items that call other scenes
                rnothersuperior Level 1
                Okay, thanks very much. I'll try that.