Copy link to clipboard
Copied
Hello, and first sorry for mu english
I am trying o make a animation with dynamic text field, everything work with simple text, but when I want to manipulate a text with html code it doesn't work
My code
info = "<b>Hello</<b>";
myTextField.text = info; ///doesn't format my text
myTextField.htmlTxt = info; ///doesn't format my text
I am making that in a HTML5 Canvas
Thanks for your help !
Hi.
Animate regular text fields are canvas based. So you cannot style text using HTML tags.
This is a canvas limitation.
And that html option for text field is greyed out because it only works in AS3 documents.
If you want HTML formatting, you can use a Label component (Window > Components).
Then you can change the text like this:
setTimeout(function()
{
dom_overlay_container.children[0].innerHTML = "<b>Hello</<b>";
}, 0);
Then you wrap this label component inside of a Graphic or Movie Clip symbol for
...Copy link to clipboard
Copied
Thanks so much JC, I really appreciate, it works and it will be more easy for me to understand by looking at your code
@Klaus, thanks for your explanation and you time too, I don't have your level in Animate CC, and in html in general, your explaination are rellay helpfull
Regards
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more