Skip to main content
Participant
May 26, 2010
Question

Flex 4 textFlow how using tags h1, i and etc.

  • May 26, 2010
  • 1 reply
  • 2814 views

Hi !

In RichEditableText I`m using next

private var exampleText:String = "<h1>text text text</h1>";

TextFlowUtil.importFromString(exampleText);


And show Error -

Error: Unknown element h1
    at BaseTextLayoutImporter/reportError() ..........

How import html tags in RichText ?

thanks.

This topic has been closed for replies.

1 reply

Adobe Employee
May 26, 2010

TLF's HTML importer doesn't support them.  Best I can suggest is converting them into <p> tags with styling before calling the importer.

Richard

Participant
May 27, 2010

Thanks.

Now I`m use TextConvert (.."to html format"); But its work very slow, text size=  500kb (book). How it is possible to increase speed of processing?

Adobe Employee
May 27, 2010

If you are passing the html importer a string it uses a fairly slow process to make XML out of it.  It can't call XML(string) because it needs to handle street html like TextField does.

Before calling the importer do this (source is your string):

            var originalSettings:Object = XML.settings();
            try
            {
                XML.ignoreProcessingInstructions = false;       
                XML.ignoreWhitespace = false;
                var xmlSource:XML = new XML(source);               
            }           
            finally
            {
                XML.setSettings(originalSettings);
            }

And pass xmlSource to the importer.

Hope that helps,

Richard