<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal"
    creationComplete="App_init()" fontSize="12" viewSourceURL="srcview/index.html">
    
    <mx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;            
            
            private function App_init():void{
                this.htmlXML.url="htmlCode.xml";
                this.htmlXML.send();
            }
            
            private function httpResultHandler(event:ResultEvent):void
            {                
                this.myDataGrid.dataProvider=event.result.showCode.html;            
            }
        ]]>
    </mx:Script>
    
    <mx:HTTPService id="htmlXML" result="httpResultHandler(event)" />
    <mx:DataGrid id="myDataGrid" width="435" height="300">
    <mx:columns>
        <mx:DataGridColumn headerText="顯示HTML原始碼">            
            <mx:itemRenderer>
                <mx:Component>
                    <mx:Text text="{data.code}" height="100"/>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
    </mx:columns>
    </mx:DataGrid>
</mx:Application>