Copy link to clipboard
Copied
Hi Guys,
I've managed to import text into a .fla (canvas) dynamic text box but I can't get <strong> or <italic> to work, the text stays regular.
Is there a way to mark up the text so individual words in a sentence are bold and italic?
Hi.
Dynamic text fields created by the Text Tool (T) are canvas based texts. And characters in canvas texts can't be styled individually.
The easiest solution will be to use a Label component (Window > Components (Ctrl/Cmd + F7)) which renders DOM labels. In this way, you could, for example, style your text like this:
setTimeout(function() // the timeout is needed to access components when the code is iniatialized
{
var labelInstance = document.getElementById("yourTextID");
labelInstance.i
...
Copy link to clipboard
Copied
With AS3 there is... but probaly not so applicable these days:
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html
Copy link to clipboard
Copied
Canvas works differently than markup (thank goodness).
Copy link to clipboard
Copied
Hi Joseph, Thanks for your reply, I'm taking from your reply that you don't know if its possible or you don't know of a solution?
Copy link to clipboard
Copied
I want to transfer from Hype 4 and this is the only thing stopping me.
If anyone knows how I can add bold and Italic to individual words in a paragraph I'd really appreciate it
Copy link to clipboard
Copied
Hi.
Dynamic text fields created by the Text Tool (T) are canvas based texts. And characters in canvas texts can't be styled individually.
The easiest solution will be to use a Label component (Window > Components (Ctrl/Cmd + F7)) which renders DOM labels. In this way, you could, for example, style your text like this:
setTimeout(function() // the timeout is needed to access components when the code is iniatialized
{
var labelInstance = document.getElementById("yourTextID");
labelInstance.innerHTML = "This is a <strong>strong</strong> word and this is an <i>italic<i/> word.";
}, 0);
I hope this helps.
Regards,
JC
Copy link to clipboard
Copied
Thank you JC,
My solution is to import an external .js file with the text and load it into a Label component, as you suggested, that's styled using a CSS component.
Works like a charm, not sure how I create a table that way yet but I can now start using Animate instead of Hype.
Really appreciate your help
Ben