<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style source="style.css"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
private function sendAction():void {
var d:Date = new Date();
httpService.url = "response.txt?uid=" + d.getTime().toString();
httpService.send();
}
private function actResult(event:ResultEvent):void{
resultText.text += event.result.toString();
}
private function actFault(event:FaultEvent):void{
Alert.show(event.message.toString());
}
]]>
</mx:Script>
<mx:HTTPService
id="httpService"
method="GET"
showBusyCursor="true"
result="actResult(event)"
fault="actFault(event)"
resultFormat="text"
/>
<mx:Panel
title="サービステスト"
height="75%"
width="75%"
layout="horizontal"
paddingTop="10"
paddingBottom="10"
paddingLeft="10"
paddingRight="10"
>
<mx:VBox>
<mx:Button
label="ソウシン"
id="actButton"
click="sendAction();"
/>
</mx:VBox>
<mx:TextArea
fontFamily="HGP"
id="resultText"
editable="true"
height="100%"
width="100%"
color="#000000"
/>
</mx:Panel>
</mx:Application>
|