Copy link to clipboard
Copied
Hi, Folks,
I'm using a dynamic textField created on the stage of an HTML-Canvas Doc. At run time I want it to change text color on the click of a button so I used the following code:
this.myTxt.text.color = "#E25FE8";
inside a click handler. Nothing happened.
I also tried:
console.log(this.myTxt.text.color )
I got "undefined".
However, some other methods and properties do work like
this.myTxt.text = "Mucho Love".
I might be doing something wrong
Does anyone tried doing something similar?
Given that you've demonstrated in your post that you're perfectly well aware that the "text" property of a dynamic textfield is a string that contains its textual content, why on Earth are you attempting to assign to myText.text.color instead of myTxt.color?
Copy link to clipboard
Copied
Given that you've demonstrated in your post that you're perfectly well aware that the "text" property of a dynamic textfield is a string that contains its textual content, why on Earth are you attempting to assign to myText.text.color instead of myTxt.color?
Copy link to clipboard
Copied
I think you are right. I discovered my mistake earlier. Thank you for your polite reply. Have a nice day, sir