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

How to update Dynamic Text element in Canvas?

Explorer ,
Oct 23, 2019 Oct 23, 2019

I have some text to return to my Canvas after an Ajax lookup, and wondering how to create a dynamic text element and set and read its value within the HTML5 canvas?  Have tried... but to no avail.

 

Thanks,
Geoff

TOPICS
Code
558
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
Explorer ,
Oct 23, 2019 Oct 23, 2019

.

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 ,
Oct 24, 2019 Oct 24, 2019

Just name it, then assign whatever you want to its text property.

 

this.myDynamicTextfield.text = "I am the very model of a modern major general.";

 

https://createjs.com/docs/easeljs/classes/Text.html

 

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
Explorer ,
Oct 24, 2019 Oct 24, 2019

Thanks, but as far as I can see I have done exactly that.  I have a 1 frame Timeline.  On the canvas I have a dynamic text element with the instance name "myDynText" ( Arial, bold, 20pt, colour purple). 

In my frame script is:

this.myDynText.text = "Processing... please hang on...";

But nothing appears on the canvas when testing.  No errors appear on the Output.

Can you suggest what might be wrong?

 

Geoff

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
Explorer ,
Oct 24, 2019 Oct 24, 2019
LATEST

I have found the issue was with some other code in my test.  Thanks for your help.

Geoff

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