1 Reply Latest reply on Mar 9, 2007 7:51 AM by kglad

    MC actionscript

    brimbo69
      Hi there,

      If anyone can solve this problem with the actionscript I'm using would be extremely greatful.

      Basically I have a set number of movie clips with self contained btns, once each clip has played the root advances to the next frame where more clips with the same functions lie. I have some script which works fine but wont work again on the following scene. The code is below and all movie clips, buttons and frame labels have been adjusted for the two different scenes. However think something needs changing in the second code to perhaps point at the root timeline of the 2nd scene. The code is as follows:

      mc1.btn1.onPress = function() {
      mc1.play();
      // <-- should be the movieclip that this button causes to play
      if (!this.played) {
      this.played = true;
      _root.movieStarted++;
      if (_root.movieStarted == 7) {
      // <-- movieNum needs to be defined. it's the number of movies you want to play before advancing the _root timeline
      this._parent.onEnterFrame = function() {
      if (mc1._currentframe == mc1._totalframes) {
      // <-- same movieclip as in 2nd line above
      delete this.onEnterFrame;
      _root.gotoAndPlay("next");
      // <-- nextKeyFrame should be the frame label to which you want to advance after all movieclips have completed play
      }
      };
      }
      }
      };