• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

292

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

Community Expert , 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
...

Votes

Translate

Translate
Community Expert ,
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 

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 Expert ,
Feb 02, 2021 Feb 02, 2021

Copy link to clipboard

Copied

Canvas works differently than markup (thank goodness). 

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
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?

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

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 Expert ,
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

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

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