Solved

Wait or Pause command in Timeline

Posted on 2004-08-23
11
880 Views
Last Modified: 2008-01-09
I'm working on a simple shape tween of text to give a morphing text effect. Instead of just keyframing two equal keyframes 30 frames apart (for a pause before it continues to the next txt morph) if it was possible to right an AS to have it "stop();" and wait for 1 second or 30 frames and then "gotoAndPlay (thenextframe);".

I'm sure there is a way. Key framing would be fine but having it in a script would make it easier to adjust.

Thanks, Chris
0
Comment
Question by:PBS39Webmaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
ID: 11875254
Here is some code to pause, and resume, the timeline:

stop();
var myInterval = setInterval(function () {
    play();
    clearInterval(myInterval);
}, 1.5*1000); // stop for 1.5 seconds
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 11878551
alternatively,

pauseFrame = function (lat) {
      this.stop();
      this.clearInternalInterval = function() {
            clearInterval(this.timeInt);
            delete this.timeInt;
            delete this.clearInternalInterval;
            this.play();
      };
      this.timeInt = setInterval(this, "clearInternalInterval", lat);
};
_root.pauseFrame(5000);

can't remember where this code came from, but works a bomb.
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11878674
Is that not the same code as I gave, put into a function, blu?
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 39

Expert Comment

by:blue-genie
ID: 11878721
yeah muso either way you'll use setInterval to achieve it, but whoever wrote this function (found it in my resources folder) - added some smart looking stuff :-).

doing it this way will allow more flexibility in the long run, but if its not gonna be reused through the movie, its superfluous.

0
 
LVL 10

Expert Comment

by:muso120999
ID: 11878740
True, if your going to use the function the declaration should only be used once, at the start of the root timeline, and only "_root.pauseFrame(n);" from there on.  The reason I didn't specify a function in my example was for simplicity, which is what I guessed PBS39Webmaster was after.

But I agree, your example is more flexible on the long-run ;-)
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 11878802
ps. where you from?
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11878848
a little place called the UK, why?
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 11878943
just wondering re. times.
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11878959
Ah!
0
 

Author Comment

by:PBS39Webmaster
ID: 11883492
Both scripts work however when I put them in the timeline on the one frame between shape tweens(the one frame that solid and does not have any morph to it..remember I'm pausing on text), it pauses on the next keyframe where the word is not legible becuase it has begun it's next tween. It's like Flash can't process the stop(), fast enough, but it does hold it. Do I have to put an additional "holding" frame or something? Also, I am trying to get away from traditional tweening. I know I move instances w/ code can I also shape tween w/ AS so I can easily adjust the length (in frames). Right now I keyframe everythign and hopr for the best. Then if I want to change the length of the tween from 15frames to 30frames I have to adjust all the keyframes in my timeline and I am tweening between 6 words. It's just a lot of work. Would be easier to change the number. I can post this as another question so there are more points to give. Let me know.
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11885333
Thanks for the points!

Of course, I don't know what your timeline looks like, but I would suggest inserting a frame without any kind of tweening.

You can do this by (please make a copy of your file before trying this ;):
1. Selecting the column of frames where a new tween starts (drag the mouse from the top layer to the bottom, to select one frame from each of the layers - but making sure the first frame you start dragging the mouse isn't selected first or you will drag its contents!)
2. Insert 2 new frames by selecting "Insert frame", or pressing F5 twice.
3. Extend the selection so that your selection is the same as in (1), but you are also selecting the 2 new frames (so 3 columns are selected now)
4. Select "Insert Keyframe" or press F6 - this will convert all currently selected frames to Keyframes
5. Now you probably should select each of the frames with tweening still on them, from the middle column of keyframes just created, and select "Remove Tween"

This should give you a clear frame to put any coding on that you need.

The above instructions should work, but as I don't know what your timeline looks like, or the complexity of it, I've had to guess a bit.  If there is anything that isn't clear, or doesn't make sense then feel free to ask!
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question