Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6667261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:54:52+00:00 2026-05-26T02:54:52+00:00

I have a case where I’m adding tabNavigator tabs dynamically and I can’t figure

  • 0

I have a case where I’m adding tabNavigator tabs dynamically and I can’t figure out how to add HTML styling to some of the words.

I really only need BOLD or UNDERLINE on a few words, but I can’t get any HTML formatting to work inside the NavigatorContent tag.

Can anyone help me with this? I have been looking for many hours and found nothing.

Here’s what I have so far. (the content is being pulled from an external XML file).

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       width="500" height="600" creationComplete="initApp()">
    <fx:Declarations>


        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:HTTPService id="chatlist" result="resultHandler(event)"
                       url="http://localhost/FlexLiveChat/LiveChat2/chat.xml"/>



    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.rpc.events.ResultEvent;

            private function initApp():void
                        {
                        chatlist.send();

                            }   
            private function resultHandler(event:ResultEvent):void
            {
                var dp:ArrayCollection = event.result.chatsession.chat as ArrayCollection;

                for(var i:int = 0; i < dp.length; i++) {
                    var t:TextField = new TextField(  );
                    t.htmlText = "This field contains <B>HTML!</B>";

                    var label:Label = new Label();
                    label.text = dp.getItemAt(i).message;

                    var context:NavigatorContent = new NavigatorContent();
                    context.label = dp.getItemAt(i).chatperson;
                    context.addElement(label);

                    tn.addChild(context);
                }
                }


        ]]>
    </fx:Script>

    <s:BorderContainer left="10" right="10" top="10" bottom="10" height="100%" borderVisible="false">

    <s:VGroup id="mainBG" x="0" y="0" width="100%" height="100%" textAlign="center">

        <mx:TabNavigator id="tn" width="100%" height="100%" color="0x323232">
            <!-- Define each panel using a VBox container. -->
            <s:NavigatorContent label="Home">
                <s:Label text="This panel is always available  \n\n container panel 1"/>    
                <mx:Text text="This is a text control."/>       
            </s:NavigatorContent>
        </mx:TabNavigator>

        <s:TextArea width="100%" height="62" textAlign="left"/>
        <s:Button label="Post Message"/>


    </s:VGroup></s:BorderContainer>
</s:WindowedApplication>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:54:52+00:00Added an answer on May 26, 2026 at 2:54 am

    You could use a text flow:

    <?xml version="1.0" encoding="utf-8"?>
    <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/mx"
              width="100%"
              height="100%"
              gap="0">
    
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.conversion.TextConverter;
                import flashx.textLayout.elements.TextFlow;
    
                private const text:String =
                    "<b>bold text</b><br />" +
                    "<br />" +
                    "<u>underlined text</u><br />" +
                    "<br />" +
                    "<ul>" +
                    "<li>list item<br /></li>" +
                    "<li>list item<br /></li>" +
                    "<li>list item<br /></li>" +
                    "</ul>" +
                    "<a href='http://www.google.com'>a link</a><br />" +
                    "<br />";
            ]]>
        </fx:Script>
    
        <s:RichEditableText editable="false"
                            selectable="true"
                            textFlow="{TextConverter.importToFlow(text, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
                            buttonMode="true"
                            width="100%"
                            height="100%" />
    
    </s:VGroup>
    

    Per your comment, you should abstract the navigator content view in to a component.

    Based upon your example:

    Your main application

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           width="500"
                           height="600"
                           creationComplete="initApp()">
    
    
        <fx:Declarations>
            <s:HTTPService id="chatlist"
                           result="resultHandler(event)"
                           url="http://localhost/FlexLiveChat/LiveChat2/chat.xml" />
        </fx:Declarations>
    
    
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
    
                private function initApp():void
                {
                    chatlist.send();
                }
    
                private function resultHandler(event:ResultEvent):void
                {
                    var dp:ArrayCollection = event.result.chatsession.chat as ArrayCollection;
    
                    for (var i:int = 0; i < dp.length; i++)
                    {
                        var htmlNavigatorContent:HtmlNavigatorContent = new HtmlNavigatorContent();
    
                        // attach result you want in the html text, 
                        // including other properties.
                        htmlNavigatorContent.htmlText = "This field contains <B>HTML!</B>";
    
                        tn.addChild(htmlNavigatorContent);
                    }
                }
            ]]>
        </fx:Script>
    
        <s:BorderContainer left="10"
                           right="10"
                           top="10"
                           bottom="10"
                           height="100%"
                           borderVisible="false">
    
            <s:VGroup id="mainBG"
                      x="0"
                      y="0"
                      width="100%"
                      height="100%"
                      textAlign="center">
    
                <mx:TabNavigator id="tn"
                                 width="100%"
                                 height="100%"
                                 color="0x323232">
                    <!-- Define each panel using a VBox container. -->
                    <s:NavigatorContent label="Home">
                        <s:Label text="This panel is always available  \n\n container panel 1" />
                        <mx:Text text="This is a text control." />
                    </s:NavigatorContent>
                </mx:TabNavigator>
    
                <s:TextArea width="100%"
                            height="62"
                            textAlign="left" />
                <s:Button label="Post Message" />
    
    
            </s:VGroup>
        </s:BorderContainer>
    </s:WindowedApplication>
    

    Create a MXML Component named: HtmlNavigatorContent

    <?xml version="1.0" encoding="utf-8"?>
    <s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        width="100%"
                        height="100%">
    
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.conversion.TextConverter;
                import flashx.textLayout.elements.TextFlow;
    
                [Bindable]
                public var htmlText:String;
            ]]>
        </fx:Script>
    
        <s:RichEditableText editable="false"
                            selectable="true"
                            textFlow="{TextConverter.importToFlow(htmlText, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
                            buttonMode="true"
                            width="100%"
                            height="100%" />
    
    </s:NavigatorContent>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i optimized this code? i dont like to have case statement, is
I have a case where autocorrection NEVER makes any sense. It's incredibly annoying. Can
I have the case where I have a public facing service sitting out on
I have a case here that I would like to have some opinions from
I have a case in my application where the user can search for a
I have a case where I have a drop-down box in an HTML webpage
I have a case where the user needs to fill out a form, and
I have a case where an action requests some class of mine. I created
I have a case where a 3rd party ad is bleeding through my modal
I have a case that keeps coming up where I'm using a ListView or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.