2 Replies Latest reply on Feb 25, 2007 5:25 AM by ggshow

    Random button code help

    sammy_baby Level 1
      I am working with a small flash file that plays a short animation that ends on frame 42 and displays a button.

      The button has the following code:

      on (release) {
      var zufall = random (6 );
      if (zufall == 1) {
      tellTarget ("") {
      gotoAndPlay(43);
      }
      }
      if (zufall == 2) {
      tellTarget ("") {
      gotoAndPlay(44);
      }
      }
      if (zufall == 3) {
      tellTarget ("") {
      gotoAndPlay(45);
      }
      }
      if (zufall == 4) {
      tellTarget ("") {
      gotoAndPlay(46);
      }
      }
      if (zufall == 5) {
      tellTarget ("") {
      gotoAndPlay(47);
      }
      }
      if (zufall == 6) {
      tellTarget ("") {
      gotoAndPlay(48);
      }
      }
      }


      The next 6 frames (43-48) have different movie clips on them and a stop actionscript. And when the user clicks the button on frame 42 one movie clip will play randomly and then after finishing goes back to frame 42 and displays the button again.

      The flash works perfectly, except the button is only randomly playing the movie clips on frames 43-47. It is ignoring frame 48.

      Does anyone have any ideas as to why?