0
Explorer
,
/t5/animate-discussions/canvas-js-have-a-delay-or-wait-before-running-the-following-code/td-p/10548474
Jul 08, 2019
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");
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Jul 09, 2019
Jul 09, 2019
Hi.
Use the setTimeout method.
Like this:
var root = this;
setTimeout(function()
{
root.movieClip.gotoAndPlay("frameName");
}, 200);
Regards,
JC
Community Expert
,
LATEST
/t5/animate-discussions/canvas-js-have-a-delay-or-wait-before-running-the-following-code/m-p/10548475#M195214
Jul 09, 2019
Jul 09, 2019
Copy link to clipboard
Copied
Hi.
Use the setTimeout method.
Like this:
var root = this;
setTimeout(function()
{
root.movieClip.gotoAndPlay("frameName");
}, 200);
Regards,
JC
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more