Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Stop timer

Contributor ,
May 11, 2016 May 11, 2016

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.

TOPICS
ActionScript
2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 11, 2016 May 11, 2016

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!

Translate
Enthusiast ,
May 11, 2016 May 11, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2016 May 11, 2016

Sorry ... but this function (setTimeout...) doesnt work at all. No way - with or without mcName

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 11, 2016 May 11, 2016

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()

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2016 May 11, 2016

Thank you...
But unfortunatelly it doesnt work too.
Animation even doesnt start. Just blank screen appears when exporting movie.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 11, 2016 May 11, 2016

You're working on HTML5 canvas I think setTimeout & timer event will not work..

try:

timer = setInterval(this.stop(), 30000);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2016 May 11, 2016

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"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 11, 2016 May 11, 2016

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 11, 2016 May 11, 2016

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 ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 11, 2016 May 11, 2016
LATEST

You're welcome

function stopAnimation(){

    scene.stop();

scene.mcName.stop();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines