5 Replies Latest reply on Jun 30, 2009 5:56 PM by kglad

    Timeline Best Practices?


      I am fairly new to flash and I have been trying to make a product demo. Basically I want some text to fade in and then some pictures to show up one by one and then disappear and then some new text fades in etc. This is to talk about a product and show various parts of it as the text on the screen is discussing those parts of the product.


      My question is what the preferred way of doing this is. Here are the options I can think of.


      Approach 1) Put all animation in the main timeline. All text tweens take place on frames in the main timeline.

      Approach 2) Put the text fade-in tweens in a movie clip and put that on the main timeline.


      I have tried both these approaches but neither one has been working for me for the following reason.


      Approach 1) Makes timeline very long and unwieldy. If one thing changes, it shifts everything over and messes up my whole timeline. Hard to manage.

      Approach 2) If I have a stop(); on the main timeline, my animation stops in mid fade. In cases where I don't have a stop, I can't figure out how to do a series of objects fading in one after another. Is there a way to check if a movieclip has finished and only go to the next frame if it has finished? How do I get a series of clips to play one after another when I am running them as seperate movieclips off the main timeline.


      Thanks in advance for your help. This newbie has already spent hours working on this and greatly appreciates your help.

        • 1. Re: Timeline Best Practices?
          kglad Adobe Community Professional & MVP

          with 2, if you have a stop() on the main timeline that will not stop the playhead advancing when playing a movieclip that's on the main timeline.  if the main timeline stop() occurs before the movieclip exists, no part of the movieclip's timeline will play and if the stop() occurs at or after the movieclip is instantiated the movieclip's timeline will play until it reaches a stop, until it reaches its end (at which point it will loop back to the beginning) or the movieclip is removed from the timeline.


          and the most precise and flexible way to control tweens is with code and, not with timeline tweening.

          • 2. Re: Timeline Best Practices?
            Theeal123 Level 1

            So what is the best way to create a demo of the sort that I am talking about?With movieclips instead of putting everything in the main timeline?


            It sounds like I need it like this:


            Frame 1 place movieclip1 (at end of movieclip send to frame 3 in main timeline)

            Frame 2 stop(); (because I want it finish playing the movie clip before it reaches the next frame)

            Frame 3 remove movieclip1 and place movieclip2 which will start tweening in

            Frame 4 stop();



            Assuming I used this approach, how do I tell the movieclip to advance to the frame 3 in the main timeline when it finishes?


            Also, I have used actionscript before but most of the flash books I have read talk about using tweening in the timeline so I was trying that. How would I do it via actionscript? Is there a way to find out if a tween is done to know whether to start the next tween? Something like


            if (tween1.done == true) then {

            //run tween 2


            • 3. Re: Timeline Best Practices?
              kglad Adobe Community Professional & MVP

              if you're doing timeline tweening you can put your movieclip mc1 on frame 1 and attach a stop() to frame 1.  at the end of mc1's timeline, put _parent.nextFrame().


              in frame 2, of the main timeline create a blank keyframe and add the 2nd movieclip that should start its tween after mc1 completes its tween.  at the end of mc2's timeline, put _parent.nextFrame() if there's going to be something happening after the 2nd tween completes.


              but again, there are several benefits to doing this with code.  in the help files, under actionscript 2.0 components language check the tween class.  there are examples of how to use it.  play with it and the benefits should become apparent.

              • 4. Re: Timeline Best Practices?
                Theeal123 Level 1

                I am using actionscript 3. Any idea how to refer to parent in as3?


                Also, if I do the tween in actionscript, how do I check that one tween has finished so that my code can start the second tween? I have not been able to find anything so I could do something like if (tween1.done == true) { play next tween }



                • 5. Re: Timeline Best Practices?
                  kglad Adobe Community Professional & MVP

                  use parent without the underline for as3


                  under actionscript 3.0, check the tween class.   check the tween events and see if you can find what you're looking for.  hint:  it's there.