7 Replies Latest reply on Aug 1, 2009 5:24 PM by _dwh_

    How to navigate from btn of mc_B to FRAME of mc_A using frame labels?

    _dwh_

       

       

       

      I’m using Flash MX (the pre-02004 version) to design a photo portfolio that will be distributed on CDs to potential clients.

       

      It’s broken up into subject galleries, each of which is its own movie clip.  The pages of those gallery movie clips are all separate movie clips, too, regardless of whether they contain single images or layouts of images.  Frame labels with stop codes separate each gallery_mc.

       

      Within each gallery, previous and next buttons allow page-to-page navigation.  From the last page of gallery_A_mc (e.g.), I can to go to the first page of gallery_B_mc by using the following ActionScript:

       

      on (release) {

                  this._parent.gotoAndStop("gallery_B_FrameLabel");

      }

       

      The problem I’m having, though, is when I’m on the first page of gallery_B_mc, and I want to make the previous button go to the last page of gallery_A_mc.

       

      on (release) {

                  this._parent.gotoAndStop("gallery_A_FrameLabel");

      }

      // Doesn’t work, obviously, because it launches the first page of gallery_A_mc.

       

       

      on (release) {

                  this._parent.gotoAndStop("gallery_B_FrameLabel.gallery_B_mc", 5);

      }

      // I’d think that this should make it go to frame 5 of gallery_B_mc, which is on the gallery_B_FrameLabel, but it doesn’t make it go anywhere.

       

      on (release) {

                  this._parent.gotoAndStop("gallery_B_mc”, 5);

      }

      // Also doesn’t make it go anywhere.

       

       

      Can anyone offer me a suggestion?  I’ve been reading books and doing tutorials, and have learned a lot, but I can’t seem to resolve this linkage issue. 

       

      Thanks in advance for any assistance you’re able to provide.

       

       

       

       

      _dwh_

       

       

       

       

        • 1. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
          kglad Adobe Community Professional & MVP

          label the frame you want to naviagate to when the previous button is pressed and use that in your goto parameter.

          1 person found this helpful
          • 2. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
            _dwh_ Level 1

            Thanks very much for responding, kglad!

            //

            Your suggestion sounds like an obvious solution, but I still can’t get it to work.  I labeled the last frame of gallery_A_mc as gallery_A_lastPage, but I’m still having trouble getting the previous button on frame 1 of gallery_B_mc to find that location.  I tried the following, and several other guesses, with no luck:

            //

            on (release) {

                        this._parent.gotoAndStop("gallery_A_lastPage");

            }

            //

            on (release) {

                        _root.gotoAndStop("gallery_A_lastPage");

            }

            //

            on (release) {

                        gotoAndStop("gallery_A_lastPage");

            }

            //

            //

            Again, I really appreciate that you took the time to help.  I’ll be jumping for joy when I finally do get this project working.

            • 3. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
              kglad Adobe Community Professional & MVP

              if you're attaching code to a true button and that button is on the same timeline as gallery_A_mc, use:

               


              on (release) {

                         gallery_A_mc.gotoAndStop("gallery_A_lastPage");

              }


               

              if you don't know the path from your button to gallery_A_mc, you can paste the output from:

               

              place trace(this) inside your button release and place trace(this) on gallery_A_mc's timeline.

              1 person found this helpful
              • 4. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
                _dwh_ Level 1

                 

                The prev/next buttons are on each gallery movie clip’s timeline, not on the main timeline. 

                //

                When within gallery_A_mc, the next button goes to the next frame of that gallery.  Then, on the last frame of gallery_A_mc, instead of looping to the beginning of that same clip, I want it to start the first frame of the next gallery (gallery_B_mc), and this works by using:

                //

                on (release) {

                            this._parent.gotoAndStop("gallery_B_FrameLabel");

                }

                // and gallery_B_mc is on that frame (labeled).

                //

                The linkage problems occur when going in the other direction.  When on frame 2 through the last frame of gallery_B_mc, the prev button goes to the previous frame of that clip.  When on frame 1 of gallery_B_mc, I want it to stop on the last frame of gallery_A_mc.  So, in order to get to that spot, it has to navigate up a level to get to the main timeline where all of the gallery movie clips are located, and then, it has to go down a level into the gallery_A_mc and stop on its last frame, which had been tagged with the frame label gallery_A_lastPage.

                //

                I did the trace commands on the button and the gallery_A_lastPage frame label.  Everything is on level 0, which I knew.  The trace command says that the last frame of gallery_A_mc, labeled gallery_A_lastPage, is instance 116.  The instance of the prev button on the first frame of gallery_B_mc varies from 58 to 61, depending upon what combination of locations I use to prefix its gotoAndStop command.  I gave the prev button on the first frame of gallery_B_mc its own instance name, separate from the other instances of it in gallery_B_mc, but it didn’t help.  How does knowing that gallery_A_lastPage is instance 116 and the prev button on frame 1 of gallery_B_mc is instance 58 help me tie the two together?

                //

                Again, many thanks for your help.  Mochas gracias! Merci!  (Now, if I could only figure out this AS-2 language!)

                • 5. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
                  kglad Adobe Community Professional & MVP

                  you're not assigning instance names for your object.

                   

                  an instance name is assigned, for an on-stage object, by selecting the object and, on the left side of the properties panel, typing the instance name.

                  • 6. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
                    _dwh_ Level 1

                     

                     

                    Every object has an instance name.

                     

                    Does anyone else have any suggestions

                    about how to link these two things?

                    • 7. Re: How to navigate from btn of mc_B to FRAME of mc_A using frame labels?
                      _dwh_ Level 1

                      .

                       

                       

                      Incidentally, I did make this work by putting the prev and next buttons onto the main timeline, and by scrapping the gallery mc's -- cutting each page mc out of the gallery mc's and putting them onto the main timeline.  That way, the prev button on the first page (frame) of subject B can now go to the last page of subject A with a stop code and an:

                       

                      on (release) {

                           prevFrame();

                      }

                       

                       

                      I'd still like to know how this could be done with the original architecture, though (with the prev / next buttons and the image page mc's on the timelines of individual galleries, and with the galleries tagged by frame labels on the main timeline).

                       

                       

                       

                       

                      .