Skip to main content
Inspiring
October 24, 2019
Question

How to update Dynamic Text element in Canvas?

  • October 24, 2019
  • 2 replies
  • 633 views

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

This topic has been closed for replies.

2 replies

Legend
October 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

 

GmRAuthor
Inspiring
October 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

GmRAuthor
Inspiring
October 25, 2019

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

Geoff

GmRAuthor
Inspiring
October 24, 2019

.