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

How to replace the code for stage.addChild(exportRoot) for the latest Animate v20

Contributor ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

For smoother html canvas playback, I used to replace this published code:

fnStartAnimation = function() {
		stage.addChild(exportRoot);
		createjs.Ticker.setFPS(lib.properties.fps);
		createjs.Ticker.addEventListener("tick", stage);
	}	

with this code:

fnStartAnimation = function() {
		stage.addChild(exportRoot);
		createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED;
		createjs.Ticker.setFPS(lib.properties.fps);
		createjs.Ticker.addEventListener("tick", stage);
}	

But with this new update the code looks like this:

 

fnStartAnimation = function() {
		stage.addChild(exportRoot);
		createjs.Ticker.framerate = lib.properties.fps;
		createjs.Ticker.addEventListener("tick", stage);
	}	  

 What's the correct way to add this line of code back into it without screwing anything up?

createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED;

 

TOPICS
Ad development , Code , Other , Performance

Views

991

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
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 23, 2019 Nov 23, 2019

Hi.

 

The timingMode from the Ticker class is a static property which means its associated to the class itself not to an instance of the class.

 

So it doesn't matter from where you change it.

 

With that being sad, you can add the code to the first frame of the main timeline, for example, and everything should work as expected.

 
Please let us know.
 
 
Regards,
JC

Votes

Translate

Translate
Community Expert ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

Hi.

 

The timingMode from the Ticker class is a static property which means its associated to the class itself not to an instance of the class.

 

So it doesn't matter from where you change it.

 

With that being sad, you can add the code to the first frame of the main timeline, for example, and everything should work as expected.

 
Please let us know.
 
 
Regards,
JC

Votes

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
community guidelines
Contributor ,
Nov 30, 2019 Nov 30, 2019

Copy link to clipboard

Copied

Thanks JC.   I appreciate it!

Votes

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
community guidelines
Community Expert ,
Nov 30, 2019 Nov 30, 2019

Copy link to clipboard

Copied

LATEST

You're welcome!

Votes

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
community guidelines