1 Reply Latest reply on Mar 23, 2012 11:21 AM by flowerfaery

    gotoAndStop help!

    flowerfaery

      I'm tring to create buttons that will cycle through a movie clip and once it gets to the last clip it starts back at the beginning clip. The button is to stop on each frame and then go to the next when clicked.

       

      I'm using Action Script 2 in CS5.5

       

      So my setup is:

       

      in Scene 1 i have a movie clip, inside is  2 layers, first layer is AS with frame 1 having stop(); in it. Second Layer is the 4 graphics (one in each frame) that i want to scroll through.

       

      back in Scene 1 i created another movie clip with two arrows on it. Inside that clip i have 3 layers. First AS layer with stop(); in Frame 1.

           Second layer is the left button (took the arrow graphic and converted to Button)  that i copied over 4 frames. I clicked on each button and entered the scripts below:

            //Frame1 btn:

      on (release) {

          _root.markings.gotoAndStop(4)

          }

      //Frame 2 btn:

      on (release) {

          _root.markings.gotoAndStop(1)

          }

      //Frame 3 btn:

      on (release) {

          _root.markings.gotoAndStop(2)

          }

      //Frame 4 btn:

      on (release) {

          _root.markings.gotoAndStop(3)

          }

       

      I did the same thing for the right arrow button on a 3rd Layer but this time wrote:

            //Frame1 btn:

      on (release) {

          _root.markings.gotoAndStop(2)

          }

      //Frame 2 btn:

      on (release) {

          _root.markings.gotoAndStop(3)

          }

      //Frame 3 btn:

      on (release) {

          _root.markings.gotoAndStop(4)

          }

      //Frame 4 btn:

      on (release) {

          _root.markings.gotoAndStop(1)

          }

       

       

       

      So theoretically this should work right? But it doesnt! The left button only goes to Frame 4 and the Right only goes to Frame 2, it doesnt play the movie clip that is holding the buttons. I've tried putting the stop(); code on all the frames but that doesnt help either.

       

      Is it something really silly that i'm missing? Any help would be greatly appreciated!