MXMLTest03 XML Read Test

by siouxcitizen forked from MXMLTest02 Text Area Test (diff: 16)
♥0 | Line 27 | Modified 2009-04-11 22:17:03 | MIT License
play

ActionScript3 source code

/**
 * Copyright siouxcitizen ( http://wonderfl.net/user/siouxcitizen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/nAQf
 */

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" width="500" height="300" backgroundColor="#FFFFFF">
    <mx:Script>
        <![CDATA[
            private function testTextArea():void {
                //XMLデータ設定
                 var xml:XML = 
                 <top>
                     <title>たいとる</title>
                     <link>リンク先URL</link>
                     <description>
                         描写
                     </description>
                </top>;
                
                //XMLデータをテキストエリアに表示
                txtData.text = "XML OutPut ->\n" 
                             + "\n タイトル: " + xml.title
                             + "\n リンク: " + xml.link
                             + "\n ディスクリプション: " + xml.description;
            }
        ]]>
    </mx:Script>
    <mx:Button id="btnTest" click="testTextArea();" x="10" y="10" label="ボタン"/>
    <mx:TextArea id="txtData" x="10" y="46" width="363" height="126">
        <mx:text>
            <![CDATA[てすとテストてすとテスト]]>
        </mx:text>
    </mx:TextArea>
</mx:Application>

Forked