4 Replies Latest reply on Nov 10, 2007 10:15 AM by ScottE

    Navigating to Frame Label In a MC

    ScottE
      Hi All,

      I need some help and I will try to explain what I am trying to do the best i can.

      I have a flash movie that has a mc called "pages" in Scene1. In the mc "pages" I have 4 key frames each representing 4 pages (i.e. 4 movie clips each one representing a page).

      I have buttons in each of these pages. My question is this. How can I navigate from a button in a page to another page specifically going to a frame label? I can get to the page using this ActionScript:

      on (release) {
      _root.pages.gotoAndPlay(_root.link = 3);
      }

      This works. The above example takes me to page 3. However, I not only want to get to page 3 but specifically go to a frame label in the mc that I am identifying as page 3.

      Any help is much appreciated.

      Scott
        • 1. Re: Navigating to Frame Label In a MC
          kglad Adobe Community Professional & MVP
          your code is doing two things. it's assigning _root.link to be 3, and it's navigating to _root.link. i'm not sure you want to do both things.

          what's the path/name of the movieclip you want to control? is it _root.pages.page3? or _root.pages3 or something else?
          • 2. Navigating to Frame Label In a MC
            clbeech Level 3
            you do not assign a value to a variable within the gotoAndPlay method. you should state this call as: _root.pages.gotoAndPlay(3);

            if navigating to a label within that MC, ie:'pages.MC3', you may need to assign a variable like you're trying to do above, but in a different manner. since you already have 'link' on the root timeline, assign the label value to it instead of a number (change it to a String var), then in the four MCs, add a conditional statement to the first frame which then 'decides' where to go when the MC is instantiated. like for instance:

            if(_root.link == 'home') {
            gotoAndStop('home');
            }else if(_root.link == 'about') {
            gotoAndStop('about');
            }else if( ...

            but make you assignment of this var separate from the call that you'd used above, as in:

            on (release) {
            _root.link = 'home';
            _root.pages.gotoAndPlay(3);
            }

            EDIT: sorry kg, typing ... as per usual :)
            • 3. Re: Navigating to Frame Label In a MC
              ScottE Level 1
              Hi Kglad,

              The code I listed gets me to a mc I named page3Services. This mc has several frame labels - essentially each frame label has info on each service I offer. When in another mc (essentially another page) I want to navigate to a specific frame label within the mc called page3Services.

              The movie clips that represent my pages are in a mc called 'pages.' The mc page3Services is in frame 3 of the mc 'pages." That's why the above script gets you to the right page but I want not only to get there but have the frame head automatically go to a frame label within the mc page3Services.

              That's probably the best I can describe what I'm trying to do here.

              Thanks!
              Scott
              • 4. Re: Navigating to Frame Label In a MC
                ScottE Level 1
                Hi clbeech,

                I do have to use:

                on (release) {
                _root.pages.gotoAndPlay(_root.link = 3);
                }

                If I use your example the buttons in the page don't work any more but they do with the previous code.

                Each page has several buttons that navigate to the frame labels in the mc. Below is the code that effectively navigates to the correct frame label from a button within that mc:

                on (release) {
                _parent["but"+_root.link].gotoAndPlay("out");
                _root.pages["page"+_root.link].gotoAndPlay("multimedia");
                }

                I hope that helps paint a clearer picture on what's going on here.

                Many Thanks!
                Scott