4 Replies Latest reply on Jan 22, 2009 6:37 PM by kglad

    Controlling scenes from a movie clip.

    DjPhantasy5 Level 1
      Hey again all, I'm having trouble and I hope the pros can help me out. I've started making a movie clip that will go to different frames within the movie clip when a button inside the clip is interacted with (I made it so a button would be increasingly highlighted when moused over). Everything works fine in the animation, however I want the main scene to jump to a different frame when the button inside the movie clip is release. In other words, I want a button in a movie clip to control the playback of the main presentation when it is released. Here's my script thinking that it will work:

      Home> ButtonMovieClip frame 5 actions...

      homebtn.onRollOver = function() {
      gotoAndPlay(22)
      }
      homebtn.onReleaseOutside = function(){
      gotoAndPlay(40)
      }
      homebtn.onRollOut = function() {
      gotoAndPlay(40)
      }
      homebtn.onRelease = function() {
      gotoAndPlay ("Home", 2)
      };

      Thanks for the input! I always enjoy learning something new. ^_^
        • 1. Re: Controlling scenes from a movie clip.
          shintashi Level 1
          I made a button a while ago for my current project (on the game over screen)

          on(release){
          _root.gotoAndStop("frame1");
          }

          it works fine, but the accumulated data (from variables) has to be reset as well - that's the part you want to watch out for. If you have no actual data, then you can simply label the various frames and use _root to get there.
          • 2. Controlling scenes from a movie clip.
            DjPhantasy5 Level 1
            It worked but not all the time... See below.
            • 3. Controlling scenes from a movie clip.
              DjPhantasy5 Level 1
              Actually that didn't work as well as I thought I did. If I try doing using the same script in a different scene then it will always go back to the first scene that appears in the SWF...
              I thought this would work when I wanted to go to another scene when using the button in the movie clip:

              Different Scene from before this time> aboutbtn_mc:
              aboutbtn.onRollOver = function() {
              gotoAndPlay(22)
              aboutbtn.onReleaseOutside = function(){
              gotoAndPlay(40)
              }
              aboutbtn.onRollOut = function() {
              gotoAndPlay(40)
              }
              homebtn.onRelease = function() {
              _root.gotoAndPlay ("Highlights", 50)
              };

              It would go back to the Home scene instead of the Highlights scene instead. Is there a quick fix to this solution or am I just going to have to have it go to a frame in the root and then have that jump to the scene I want?
              • 4. Re: Controlling scenes from a movie clip.
                kglad Adobe Community Professional & MVP
                use _root to reference your main timeline and use the goto methods with frame labels. or even better use a variable to reference the main timeline and apply the goto methods to that reference:

                var tl:MovieClip=this; //on your main timeline

                tl.gotoAndPlay("scene2_frame1"); // <- label this frame.