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

I need a timed pause in an animate project

New Here ,
Feb 02, 2018 Feb 02, 2018

Working in Animate CC version 18 on PC. How can I create a timed (say 2 seconds) pause.

2.6K
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

LEGEND , Feb 02, 2018 Feb 02, 2018

If this is AS3:

stop();

setTimeout(play, 2000);

If this is HTML5 Canvas:

this.stop();

setTimeout(this.play.bind(this), 2000);

Translate
LEGEND ,
Feb 02, 2018 Feb 02, 2018

Insert two seconds of nothing happening in your timeline?

You don't say what you want to happen after the pause so we're kind of limited in how specific a response to give. If this is in code you use 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
New Here ,
Feb 02, 2018 Feb 02, 2018

I would like for the movie to continue with the next frame.

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
LEGEND ,
Feb 02, 2018 Feb 02, 2018

If this is AS3:

stop();

setTimeout(play, 2000);

If this is HTML5 Canvas:

this.stop();

setTimeout(this.play.bind(this), 2000);

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
LEGEND ,
Feb 02, 2018 Feb 02, 2018

I thought about bind, but wasn't sure if it worked with 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
LEGEND ,
Feb 02, 2018 Feb 02, 2018
LATEST

A function's a function. I was surprised that "this.play" by itself didn't work. I'd have thought that one "this" would have been enough to nail down the scope, but apparently not.

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
LEGEND ,
Feb 02, 2018 Feb 02, 2018

This script in the timeline should do it:

var _this = this;

this.stop();

setTimeout(doPlay,2000);

function doPlay(){

  _this.play();

}

That works for AS3 and Canvas. If you're just doing AS3 you can do this:

stop();

setTimeout(play,2000);

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