5 Replies Latest reply on Mar 6, 2008 11:25 AM by Webshark2000

    [CS3] How can I jump to an embedded frame?

    Webshark2000 Level 1
      I'm using Flash CS3 with ActionScript 2.0 and I have a project with just one scene. Within the scene are 10 frames and within each of the 10 frames are movieclips that I'm going to call "chapters". Each of the chapters have numerous frames within them that we want to user to go through one at a time. We have a "next" and "back" button on each frame so they can go back a frame to review something and go forward a frame once they've sat through the content on the frame.

      The problem is that when they enter a new chapter I don't know how to code the "back" button to go back to the last frame of the previous chapter. I tried this code:

      on(release)
      {
      _parent.gotoAndStop(_parent._currentframe - 1);
      gotoAndStop(12);
      }

      which takes you to the first frame of the previous chapter, but I think once you're there it doesn't see the code to gotoAndStop(12) (12 being the last frame of the previous chapter). How would I get it to go to the previous chapter and then jump to frame 12?

      Thanks.
        • 1. Re: [CS3] How can I jump to an embedded frame?
          robdillon Most Valuable Participant
          Why not label the frame that you want to target? Then you can use that label: _parent.gotoAndStop("chXEnd");
          • 2. Re: [CS3] How can I jump to an embedded frame?
            Webshark2000 Level 1
            Tried it; didn't work. Since the frame I'm wanting to go to is inside a movieclip that's inside the parent movieclip, it doesn't see it, no matter what I name it. It's set up like this:

            Scene 1
            [frame1 frame2 frame3 frame4 frame5 frame6 frame7 frame8 frame9 frame10]
            ch1_mc ch2_mc ch3_mc ch4_mc ch5_mc ch6_mc ch7_mc ch8_mc ch9_mc ch10_mc
            12 frames 9 frames 10 frames etc etc etc etc etc etc etc

            So I need to get from the first frame of say chapter 3 to the last frame of chapter 2, or from the first frame of chapter 2 to the last frame of chapter 1.
            • 3. Re: [CS3] How can I jump to an embedded frame?
              robdillon Most Valuable Participant
              Then the problem is a matter of scope. Since you are placing your code directly on the objects, I'm guessing that you are not naming the object instances and/or maintaining them on the timeline so that they hold a reference to one another.

              Without seeing the actual movie, its difficult to tell what the solution might be. Can you post an example that I can look at?
              • 4. Re: [CS3] How can I jump to an embedded frame?
                clbeech Level 3
                I think that in essence there is a better way to go about the design of a system of this nature. The UI controls should reside on the main timeline, as a single instance, and that the operating codes should be 'dynamic' in that they do not limit you to a specific number of pages or chapters within the file. In this way adding or removing a chapter or page, or different page quantities, will not effect the navigation system, and allow you to construct the elements with more freedom, and without a system of 'labels' (although i do like labels - lol) I have prepared a demo example of a system such as this for you to review HERE
                • 5. Re: [CS3] How can I jump to an embedded frame?
                  Webshark2000 Level 1
                  Thanks for the info, I'll have to keep that in mind for future projects, but we've been working on this for about 2 months and it would be a huge burden to have to change the navigation system now. Here's a photo of the main timeline:

                  Image 1

                  And here is an example of one of the chapters:

                  Image 2

                  All of the chapters are set up the same way. There is a "chapter" movieclip on each of the frames in Scene 1 so all of the base items (background, navigation buttons, etc) are the same in every chapter.
                  So, if anyone has any suggestions, let me know.