Skip to main content
Participant
May 26, 2010 3:08 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

5 replies

Inspiring
May 26, 2010 10:41 PM UTC

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

Translate
Participant
May 27, 2010 7:52 AM UTC

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?

Translate
Inspiring
May 27, 2010 5:44 PM UTC

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

Translate