<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="380" height="400">
    <mx:Panel x="18" y="10" width="344" height="382" layout="absolute" title="テキストを表示するサンプル">
    
        <mx:Label x="10" y="10" text="A.Labelを使って表示しているテキストです。テキストの一部が切り詰められています。" width="295" height="25" fontSize="15"/>
        
        <mx:HRule x="10" y="35" width="304" height="8" strokeColor="#c0c0c0"/>
        
        <mx:Text x="10" y="43" fontSize="15" width="304">
            <mx:text>
                B.Textを使って表示しているテキストです。Textは複数行のテキストを自動的に改行して、高さを調節してくれます。
            </mx:text>
        </mx:Text>
        
        <mx:HRule x="10" y="105" width="304" height="8" strokeColor="#c0c0c0"/>
                
        <mx:Text x="10" y="113" fontSize="15" width="304" link="onLinkClicked(event)">
            <mx:htmlText>
                <![CDATA[C.<font color="#ff0000">htmlText</font>プロパティにはhtmlタグの
サブセットである以下のタグを使用することができます。
    &lt;a&gt;&lt;b&gt;&lt;br&gt;&lt;font&gt;&lt;img&gt;&lt;i&gt;
    &lt;li&gt;&lt;p&gt;&lt;span&gt;&lt;u&gt;
&lt;a&gt;で囲った文字をクリックするとそのページへ
移動します。
    <a href="http://www.javadb.jp"><u><font color="#0000ff">ホームへ</font></u></a>
    <a href="event:xxxxx"><u><font color="#0000ff">アラートを表示する</font></u></a>
]]>
            </mx:htmlText>
        </mx:Text>
        
        <mx:HRule x="10" y="301" width="304" height="8" strokeColor="#c0c0c0"/>
                
        <mx:Label styleName="styleSample" x="14.5" y="313" text="D.スタイルを使って文字色を変更しています。" width="295" height="25" fontSize="15"/>
        
    </mx:Panel>
    
    <mx:Style>
        
        .styleSample{ color:blue; }
        
    </mx:Style>
    
    <mx:Script>
        <![CDATA[
        
            import mx.controls.Alert;
            //htmlTextプロパティ内のリンクがクリックされた場合のイベントハンドラ
            function onLinkClicked(event:TextEvent):void
            {
                //アラートを表示する
                Alert.show("リンクがクリックされました","アラート");
            }
            
        ]]>
    </mx:Script>

</mx:Application>