Registered User
Registered User

Reputation: 9006

Using HTML with Flex 4?

How do I add HTML inside my Flex app just like the one Tour De Flex uses.

Here's a screenshot: http://screencast.com/t/JH6X1qUBNLI

Upvotes: 0

Views: 1045

Answers (2)

Angela
Angela

Reputation: 21

The tag <mx:TextArea> can have a nested <mx:htmlText> tag that can contain HTML code. For example:

<mx:TextArea id="htmlTextWillAppear"
    width="100%" height="100%"
    borderStyle="none"
    editable="false"
    condenseWhite="true">    
    <mx:htmlText>
        <![CDATA[
            <p>This is where the HTML will go icluding Links, images, unordered lists, et.</p>
        ]]>
    </mx:htmlText>
</mx:TextArea>

The CDATA tag is needed so that the Flex compiler knows to interpret what follows literally and not as MXML tags.

I use this method to pupulate the text in my Flex website that provides tutorials for creating accessible Flex content.

Upvotes: 1

JeffryHouser
JeffryHouser

Reputation: 39408

Use the HTML Component. It is AIR only, so you won't be able to do this in a web based app.

For a web based app, you'll want to use the iFrame trick.

Upvotes: 2

Related Questions