• 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 update Dynamic Text element in Canvas?

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

306

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

Copy link to clipboard

Copied

.

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

 

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

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

Copy link to clipboard

Copied

LATEST

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

Geoff

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