Highlighted

canvas js have a delay or wait() before running the following code

Explorer ,
Jul 08, 2019

Copy link to clipboard

Copied

I have been trying to find a way of delaying the running for the js code in a html canvas document.

I know how it is done with tweenjs e.g

createjs.Tween.get(this.movieClip).wait(200).to({scaleX:1.10,scaleY:1.10}, 100, createjs.Ease.quadOut);

But I want to delay or wait in running the following code instead of waiting on a tween:

this.movieClip.gotoAndPlay("frameName");

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Use the setTimeout method.

Window setTimeout() Method

Like this:

var root = this;

setTimeout(function()

{

    root.movieClip.gotoAndPlay("frameName");

}, 200);

Regards,

JC

TOPICS
Discussions

Views

465

Likes

Translate

Translate

Report

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

canvas js have a delay or wait() before running the following code

Explorer ,
Jul 08, 2019

Copy link to clipboard

Copied

I have been trying to find a way of delaying the running for the js code in a html canvas document.

I know how it is done with tweenjs e.g

createjs.Tween.get(this.movieClip).wait(200).to({scaleX:1.10,scaleY:1.10}, 100, createjs.Ease.quadOut);

But I want to delay or wait in running the following code instead of waiting on a tween:

this.movieClip.gotoAndPlay("frameName");

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Use the setTimeout method.

Window setTimeout() Method

Like this:

var root = this;

setTimeout(function()

{

    root.movieClip.gotoAndPlay("frameName");

}, 200);

Regards,

JC

TOPICS
Discussions

Views

466

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 08, 2019 0
Adobe Community Professional ,
Jul 09, 2019

Copy link to clipboard

Copied

Hi.

Use the setTimeout method.

Window setTimeout() Method

Like this:

var root = this;

setTimeout(function()

{

    root.movieClip.gotoAndPlay("frameName");

}, 200);

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 09, 2019 1