Importing external text using xml

New Here ,
Feb 02, 2021 Feb 02, 2021

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?

Views

162

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Feb 03, 2021 Feb 03, 2021
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...

Likes

Translate

Translate
Adobe Community Professional ,
Feb 02, 2021 Feb 02, 2021

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 

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
community guidelines
Adobe Community Professional ,
Feb 02, 2021 Feb 02, 2021

Copy link to clipboard

Copied

Canvas works differently than markup (thank goodness). 

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
community guidelines
New Here ,
Feb 02, 2021 Feb 02, 2021

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?

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
community guidelines
New Here ,
Feb 02, 2021 Feb 02, 2021

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

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
community guidelines
Adobe Community Professional ,
Feb 03, 2021 Feb 03, 2021

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

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
community guidelines
New Here ,
Feb 03, 2021 Feb 03, 2021

Copy link to clipboard

Copied

LATEST

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

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
community guidelines