7 Replies Latest reply on Sep 30, 2009 7:34 AM by Deaf Mike

    pause/play timeline

    Deaf Mike Level 1

      Hi,

       

      I created the test SWF for a new website I'm working on:

       

      http://video-excel.com/webtemp50.html

       

      The slideshow on the left is the one I'm talking about, not the Flash video on right.

       

      Anyway, to make it work, I added a whole bunch of frames between the moving images to pause it - to give reader time to see pictures and words - then it goes on to next one.  instead of doing it this way, I am wondering if I can just put an action of some kind on a frame to tell it to pause for X number of seconds, then play again?

       

      Anyone ever done this before or know how to do this?

       

      Thanks.

        • 1. Re: pause/play timeline
          Ned Murphy Adobe Community Professional & MVP

          Look into using the setTimeout function.  So in each pausing frame you would have...

           

          stop();

          setTimeout(moveOn, 5000);  // in 5 seconds call moveOn function

           

          and on a layer that extends the length of the timeline you could have the moveOn function that gets shared by all the setTimeout calls...

           

          function moveOn(){

               play();

          }

          1 person found this helpful
          • 2. Re: pause/play timeline
            Deaf Mike Level 1

            Hi Ned,

             

            Thanks for sending this to me.  I'll give it a try soon.  If I can't get it to work, hope you can help me further [smile].

             

            Deaf Mike

            • 3. Re: pause/play timeline
              Deaf Mike Level 1

              Ned,

               

              Here is what I did and the code you sent does not work.  You can see the screen at:

               

              http://prosol1.com/mw_images/flashpause01.jpg

               

              For action A as seen in the image above, i put the following code:

               

              stop();
              setTimeout(moveOn, 5000);

               

              On action B, I put the following code:

               

              function moveOn(){
                   play();
              }

               

              What happens when you play the timeline or export to SWF, the file stops where action A is and it does not continue on.  Also, I don't know if this will make a difference or not but when I opened this simple new file up to do this test, Flash CS4 asked me if I wanted to do 2.0 AS or 3.0 AS and I selected 3.0 AS.

               

              Please advise.

               

              Deaf Guy - Mike

              • 4. Re: pause/play timeline
                Ned Murphy Adobe Community Professional & MVP

                The code works fine.  Even though you didn't do what I described, what you appear to have done will work, but not if you plan on having numerous images.  The reason it wouldn't work for numerous images is because the function can only be named once, and your approach would have it repeated for every image.

                 

                I said to put the function on a layer that extends the length of the timeline (no keyframes interupting it) but you put it on a frame within another layer in the middle of a tween.  I said this so that the function will be available to other instances where you want to pause before moving on.  So what you should do is create a new layer and place that function in the first frame of the new layer, and be sure to have that layer extend the full length of the timeline.

                 

                In any case, for what you showed, here is a link to a file that demonstrates it working.   I don't know what you might have done differently, but it mimics what you described having done...

                 

                http://www.nedwebs.com/Flash/AS3_Timeout.fla

                1 person found this helpful
                • 5. Re: pause/play timeline
                  Deaf Mike Level 1

                  Here is mine for you to see.  It seems to be identical to yours but it still doesn't work.  I noticed your green box is a movie clip; my text symbol is a graphic.

                   

                  Could that be why mine isn't working?

                   

                  http://prosol1.com/mw_images/test.fla

                  • 6. Re: pause/play timeline
                    Ned Murphy Adobe Community Professional & MVP

                    I don't have CS4 so I can't open your file.  graphic vs movieclip will not make a difference.  I can't say the same for the tween, especially if you are using the new style of tweening that CS4 includes.  While I would not expect it to make a difference, I can't confirm it.

                    1 person found this helpful
                    • 7. Re: pause/play timeline
                      Deaf Mike Level 1

                      Ned,

                       

                      First, thanks so much for your help.  You sent me the code, which works.  I figured out the problem.  It was the AS 3.0 vs. AS 2.0 and less.  My first test file was in AS 2.0 or less.  Then I created a new one in 3.0 AS and it works perfectly.  Even reduced and stretched out the pause time.

                       

                      How "good" are you with Flash?  Reason why I'm asking is we're always looking for Flash people at this company.  As you saw on the sample page on my first post, I can create decent stuff, can create video with FLV component, but as you know, that's just scratching the surface with Flash.  We're really looking for someone who knows a lot with AS.  Do you free lance?  Do you know of good websites where you can post Flash jobs?

                       

                      Thanks again  - Mike

                       

                      You can contact me direct at mwalton at prosol1 dot com if you want.