5 Replies Latest reply on Feb 20, 2007 6:09 PM by kglad

    button within a MC

    teeravuss Level 1
      I have a MC that contains 11 buttons. Each button is set in the actionscript to send the playhead in the main timeline to play at a marker... the actionscript for the buttons is as follows:

      on (release) {
      gotoAndPlay("Scene 1", "portrait");
      }

      ("portrait" is the marker title) It would seem that because script assist gives the option for "scene 1" in the scene field, that it would work. But it doesn't.

      I would put the 11 buttons on the main timeline to dodge this problem, but the way I have it set up (when you roll over the MC, the MC drops down the box with the 11 buttons) doesn't allow for that.

      I know this has been addressed on multiple occassions, but the AS I've seen in the previous threads doesn't seem to answer the question as to why and/or how one could control the main timeline with a button within a movie clip

      thanks ahead of time for any help you may offer!
        • 1. Re: button within a MC
          kglad Adobe Community Professional & MVP
          don't use the goto functions and don't use scenes to navigate. use the goto methods and frame labels:

          • 2. Re: button within a MC
            teeravuss Level 1
            thank you, that is working :)

            but, I've come across another problem (maybe I should've gone more indepth in how I have my hiearchy setup).

            I have my main.swf file which has 6 buttons. Each button will load an external .swf file into the main.swf using a target.

            like so:

            on (release) {
            target.loadMovie("lyrics.swf");
            }

            It's in the lyrics.swf file that I'm attempting to control the main timeline of lyrics.swf with buttons inside a MC.

            The AS you posted works great (thanks btw) when I open the lyrics.swf file by itself. However, when I load it into the main.swf file, the buttons inside the MC no longer work.

            Do you know why? and how to get over this hurdle? I'm so illterate when it comes to actionscript, so I really appreciate your help :) thanks!
            • 3. Re: button within a MC
              kglad Adobe Community Professional & MVP
              _root refers to the main timeline. when lyrics.swf is published or tested without it loading into another swf, the main timeline is lyrics.swf's main timeline. when lyrics.swf is loaded into another swf, the main timeline is that other (main.swf) timeline.

              to remedy, you can use a relative path in lyrics.swf or just use:

              • 4. Re: button within a MC
                teeravuss Level 1
                Thanks, that did it!
                • 5. Re: button within a MC
                  kglad Adobe Community Professional & MVP
                  you're welcome.