Highlighted

How to update Dynamic Text element in Canvas?

Community Beginner ,
Oct 23, 2019

Copy link to clipboard

Copied

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

Views

104

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

How to update Dynamic Text element in Canvas?

Community Beginner ,
Oct 23, 2019

Copy link to clipboard

Copied

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

Views

105

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
Oct 23, 2019 0
Community Beginner ,
Oct 23, 2019

Copy link to clipboard

Copied

.

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...
Oct 23, 2019 0
Adobe Community Professional ,
Oct 24, 2019

Copy link to clipboard

Copied

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

 

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...
Oct 24, 2019 0
Community Beginner ,
Oct 24, 2019

Copy link to clipboard

Copied

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

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...
Oct 24, 2019 0
GmR LATEST
Community Beginner ,
Oct 24, 2019

Copy link to clipboard

Copied

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

Geoff

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