2 Replies Latest reply on Jul 9, 2010 5:49 AM by StyleDesign007

    Play button AS2 not working need help please!

    StyleDesign007

      Hi,

       

      I have an AS2 project with two scenes, Scene 1 is has a pre-loader and Scene 2 has an embedded .flv animation from after effects with some other basic tweened shape layers and masks. I've used the Components UI and dragged a "Replay" button to the last keyframe with a seperate actions layer with the following code:

       

      stop();

       

      Replay.addEventListener(MouseEvent.CLICK, replayMovie);
      function replayMovie(evt)
      {
      gotoAndPlay("Scene 2",1);
      }

       

      I'm a beginner in Flash and have been following instructions off the net but I can't get it to Replay the movie when the button is clicked, it does nothing

      any help will be appreciated. Untitled-1-01.jpg

        • 1. Re: Play button AS2 not working need help please!
          DazFaz Level 1

          Hi,

           

          I would not reply on the scene naming thingy if I were you. IN the pat I have had the very same problem and found that using

          _root.gotoAndPlay(frameNumberHere); works a lot better.

           

          ALSO

           

          if your scene 1 has 10 frames in it and your want to gotoAndPLat the 1st frame of your second scene then use:

          var number_of_Frames_in_1st_scene = 10

          var frame_I_want_to_go_to_and_play_in_my_second_scene_is = 1

          var frameNumber = number_of_Frames_in_1st_scene + frame_I_want_to_go_to_and_play_in_my_second_scene_is;

          _root.gotoAndPlay(frameNumber);

           

          dont forget the _root.

          • 2. Re: Play button AS2 not working need help please!
            StyleDesign007 Level 1

            Thanks DazFaz but that didn't work either, it gets to the end of the movie and stops with the button that does nothing. I've been all over the net and tried everything but nothing works, don't know waht it could be, I mean it's a simple enough code and I've watched tuts on youtube but still won't work. Any chance I could send the .fla file to someone and see if we can figure this out? I've spent hours upon hours on it and it's for a paying client which we've already lost all profit on because of this.