5 Replies Latest reply on May 31, 2006 10:28 PM by kglad

    Playing one movieclip instance after another


      I’m new to actionscripting and have been stuck on what I imagine as an ‘easy’ yet fundamental problem with flash. I’ve created a simple menu with 4 option buttons. When each one is clicked upon, it will play a movieclip instance to the right of the buttons. There are 4 movieclip instances to the right of the buttons which are all at frame 1 of their timeline where there is a ‘stop’ action. Each instance plays (it constructs a graphic to the right of the buttons) until a ‘stop’ action is encountered half way through (frame 40), the graphic then de-constructs after the stop action (frames 41 to 80). So what I want to happen is that, say, when button 1 is clicked upon, it will deconstruct whatever graphic is currently displayed (play whatever instance is currently displayed - frame 41 onwards), and then after that it will construct the graphic for button 1 (play instance 1 – frames 2 - 40). I have no problem in knowing what is the currently playing movieclip instance (deconstructing the graphic), it’s constructing the graphic AFTER the deconstructing has finished. So, in essence, I want to play 2 movieclip instances ONE AFTER THE OTHER – when one movieclip has finished, then play the next one. The way Flash works, when I play 2 instances, they run concurrently.

      Code for clicking on button 1 at present (where buildRHS1 is the instance label for constructing the graphic for button 1, buildRHS2 is the instance label for constructing the graphic for button 2 etc.)


      on (release) {
      if (option == 2) {
      } else if (option == 3) {
      } else if (option == 4) {
      option = 1;
      buildRHS1.gotoAndPlay(2); //I want this to play AFTER buildRHS2 or buildRHS3 or buildRHS4 has finished playing

      I’ve tried different ways of trying to achieve this but with no success (like checking if buildRHS2._currentframe = buildRHS2._totalFrames, but after that check has been done, the playhead moves on. I've also tried putting buildrhs2.gotoAndPlay(2) on the last frame of buildRHS1 or buildRHS3 or buildRHS4 or).

      Please have pity on an ex-Authoware programmer and help him aboard the good ship ‘Flash’ – I’ve been stuck on this problem for an embarrassingly long time!

      Thanx in advance,

      - Brian