5 Replies Latest reply on Oct 3, 2008 4:23 PM by Pasewark

    Movie Clip with Actionscript question

    Pasewark
      Hi Everyone,

      I have a question. I hope someone can help.

      I have a flash movie with 10 scenes.
      In scene 10, I have a movie that is a menu with 10 buttons. Each button should resolve to a certain frame in scene 10.

      For example, the first button in the movie should go to frame 45.

      I am using this script:

      on (release) {
      _parent.gotoAndPlay(45);
      }

      When I test the scene. The buttons work. When I publish the entire movie, the button goes to frame 45 in scene one.

      What am I doing wrong?

      Help!
        • 1. Re: Movie Clip with Actionscript question
          clbeech Level 3
          first off - scene + code = bad news;

          but... you have to also declare the 'scene' when making the call as in:

          _parent.gotoAndPlay('scene10', 45);

          (note: 'scene10' should be exactly the same as the name of the scene)
          • 2. Re: Movie Clip with Actionscript question
            Pasewark Level 1
            I tried the follow code:

            on (release) {
            _parent.gotoAndPlay('scene 10', 45);
            }

            but it doesn't work.

            Is there a better way to code this for the same results? I'm using AS2.
            • 3. Re: Movie Clip with Actionscript question
              clbeech Level 3
              is 'scene 10' exactly the name of the scene?

              this is kinda why using scenes doesn't work well with code, when the file is compiled it all becomes 'one' timeline basically. it's best not to use them in this capacity, it seems like a great way to organize you work at first - but really it's meant more for long animation projects that will run straight through for animation rather than for the more dynamic side of things.
              • 4. Re: Movie Clip with Actionscript question
                Pasewark Level 1
                Hi,

                yes, 'scene 10' is the scene name. I'm using scenes to break up the presentation into manageable sections. As it turns out the last scene needs a menu to get quick access to frames in that scene which are software screenshots.

                Logically, the code: on (release) {_parent.gotoAndPlay('scene 10', 45);}
                should work. I was having trouble figuring out the correct syntax. It's really confusing me that it doesn't. I think I'll try and move the menu code to the main timeline, but I'm not sure how that's going to work.
                • 5. Re: Movie Clip with Actionscript question
                  Pasewark Level 1
                  I was able to resolve the issue by targeting a frame label, instead of a scene/frame number.

                  I used:
                  on (release) {
                  _parent.gotoAndPlay("Add_01");
                  }

                  Seems to work okay.