Here is my situation. I have created animation to play on a _root timeline and when it reaches a particular frame on that timeline there is a movieclip (named and labelled “pauser”) containing the code to pause the movie for a set amount of seconds. Once that time is up the _root timeline continues and so does my animation. My animation is also remotely controlled by the viewer by STOP and PLAY button navigation.
This is the problem. The code on the stop button will stop the animation and the “pauser” movieclip, but it wont retain its position in time. Instead the animation continues immediately once the PLAY button is pressed.
//This is the code to pause my movie
// frame 1
play();
tellTarget ("…/") {
stop();
}
pause = 20;
Hi,
Are you working in MX. telltarget is flash 4 and deprecated, not advisable to use it.
For your pause you re better off using setInterval()
The fla you posted is empty - or rather tere is an fla inside it, but <B>nothing</B> in the fla ?
If you post again I will take a look for you
Hi,
Not sure what you want to achieve - are you saying that when a user clicks the play button you don’t want the box to move immediately, like a delayed reaction ?
<B>OR</B>
if the box is in its delayed position, do you want the delay to continue until the ten seconds is up before the box continues.
The file seems to work perfectly to me, but I have probably misunderstood what you need.
Sorry if I have not been clear. I hope this helps.
If the box is in its delayed position (ie hit STOP 3 seconds after delay has begun) I would like the box to continue with the remaining delay (7 seconds) once the PLAY button is pressed.
Hi,
Think I have fixed it the way you want, if you click on stop it will stop anywhere and continue immediately you click on play, however if the box is in the stop position it will not move, even when you click play, until the time is up.
You may want to alter the delay, I have set it at 10000 milliseconds, but that is the only thing you need to play around with. Look inside the box mc and look at the actions I have put there for you.
However the ability to stop the box when in the delay is not functional. How can you target the box to stop within the delay.
If I manually STOP the box within the delay with the STOP button, lets say at 4 seconds, I should have 6 seconds left within my delay. So when I go and press the PLAY button 6 seconds should pass before the box continues to move.
Hi,
It does exactly that ! Or have I misunderstood you ( again). I f you look at the setInterval code, you will see a variable count - this set to =1, in the following frame count =0, look at the code on your button, it says
[AS]
on(release){
if(count != 1);
play();
}[/AS]
What this means is the box will NOT move whilst count = 1.When the delay reaches the end and the box move, count is immediately set to 0 allowing the user to stop and start, but no way will it start during the delay period.
The STOP button doesn’t stop the box within the delay.
The STOP also doesn’t stop the box after the delay point.
What I am trying to achieve is the ability to STOP the entire movie within the delay period.
Lets say I press the STOP button when the box is inside the delay and then I physically walk away from the Flash movie and return some time later to the Flash movie; I wish to see the box still frozen within the delay. At this point the remaining delay time has been retained and will pass once the PLAY button is pressed.
•delay start = 0 seconds
•delay end = 10 seconds
•length of delay = 10 seconds
•if STOP button pressed at 4 second mark of delay the remaining delay time = 6 seconds
The STOP button doesn’t stop the box within the delay.
Well, ask yourself why should it ? It is already stopped when in the delay area, why do you need to stop something that has already stopped !
The STOP also doesn’t stop the box after the delay point
eerrrr yes it does, I have just double checked that and the top and play buttons work either side of the delay area.
Inside the box mc, after the frame where the delay is, the var count is to 0 which allows the buttons to work as you would expect them.
The rest of your post seems a bit contradictory - do you want the button to pause for ten seconds ? If someone clicks the stop button when the mc has already stopped ( seems unlikely to me) how long do you want the pause to last.
If you want the pause to last until a user clicks the start button, then the stop button should clear the interval and stop the animation, which will only begin once the user has clicked the play button, but the last part of your post says you want what you already have or am i going round the twist (lol!!)
Well, ask yourself why should it ? It is already stopped when in the delay area, why do you need to stop something that has already stopped !
Well this box movie is a simplified version of a larger movie presentation. I actually do need to have the ability to stop (hold) something that is located at the delay point. The reason is that I will be introducing movieclips at this point to play separately from the box movieclip. So if I need to stop the entire flash movie and then in turn resume its play I will need to utilize the remaining time within the delay in order to complete the animation of the newly introduced movieclips. I’m not sure if this is clear to you or not? I hope so!
As well, after the delay point the box doesn’t completely stop, it in fact will pause for 10 second and then resume its animation.
Hi,
So, if you click the stop button when the box has already stopped, you want to extend the delay ? Extend until user clicks the play button ?
If that is right, all you need to do is clear the interval when you click the button, also, to fix the second problem ( stopping and starting after the delay, delete from the last frame of the box movie
[AS]clearInterval(delay)[/AS]
and place it in the frame after the delay:
[AS] clearInterval(delay);
count = 0 [/AS]
With the first issue, you need to write a function that will clear the interval when certain conditions are met, and call the function when the stop button is clicked on.
I cannot do this for you today but can pick up on it after the w/e if you haven’t got there yourself - let me know.
Unfortunately I haven’t been able to solve this problem. I’m not convinced that using setInterval will solve this issue, however, I’m no expert. Do you have any suggestions ?
Hi,
Inclined to agree that setInterval may not be the way to go.
When the box is in the pause position, and the user clicks stop, you need a way of resetting the pause back to the beginning, I have an idea that getTimer may be the way to go - I am near the end of a big project at the moment, but will give it some thought and get back to you