Copy link to clipboard
Copied
Please help to find solution. I can't find the answer, have posted this question here in different places, nobody can tell it to me.
HOW TO STOP ANIMATION IN ex. 30 SECOND
I used to write like this:
setTimeout(
function()
{ stop(); },
30000
);
It doesn't works anymore with AdobeAnimate. I don't understand - what happened.
It is extremelly important for me because i can't finish web banners with AdWords technical specification. There should be stop in 30 seconds.
Version with "this.stop()" doesn't work for me. I can't place it in 30 second phisically - i need a timer to set in the first frame. And in any case it doesn't stop movie clips inside - they still rolling.
Finally, I found it!
var timer;
var scene = this;
function stopAnimation() {
scene.stop();
}
timer = setTimeout(stopAnimation, 30000, this);
Sorry but I've never worked with HTML Canvas!
Copy link to clipboard
Copied
stop(); method will stop the current timeline only, if you have an animation inside some movie clip then you have to write the mc name:
setTimeout(
function()
{mcName.stop(); },
30000
);
And if you're animating the movie clips by a code then you've to stop that code, I mean if you're using some EnterFrame loop, you've to remove it after 30 seconds.
Copy link to clipboard
Copied
Sorry ... but this function (setTimeout...) doesnt work at all. No way - with or without mcName
Copy link to clipboard
Copied
Well I am actually still using Flash CC, wait maybe someone else can help you with that case.
I can give you another solution if you want to try it:
var myTimer:Timer = new Timer(30000, 1);
myTimer.addEventListener(TimerEvent.TIMER, onTimer);
function onTimer(e:TimerEvent):void
{
stop();
};
myTimer.start();
you can use a timer event instead of setTimeout()
Copy link to clipboard
Copied
Thank you...
But unfortunatelly it doesnt work too.
Animation even doesnt start. Just blank screen appears when exporting movie.
Copy link to clipboard
Copied
You're working on HTML5 canvas I think setTimeout & timer event will not work..
try:
timer = setInterval(this.stop(), 30000);
Copy link to clipboard
Copied
This just stopped animation at the frame where it stands. Thats all. It doesnt work as a timer.
(Yes. im working with HTML canvas ...)
I cant understand - there are millions with different codes and scripts and what else ... And no one can just say : "Animation.Stop.Frame.Nr.XXX"
Copy link to clipboard
Copied
Finally, I found it!
var timer;
var scene = this;
function stopAnimation() {
scene.stop();
}
timer = setTimeout(stopAnimation, 30000, this);
Sorry but I've never worked with HTML Canvas!
Copy link to clipboard
Copied
Oh! Yeah! It works!
Thank you!
Now i just need to figure out, how to stop everything in timeline and inside the movieClips on timeline at the same moment ...
Copy link to clipboard
Copied
You're welcome
function stopAnimation(){
scene.stop();
scene.mcName.stop();
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now