특별한딸기이야기
http통신 본문
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
private function onClick() : void
{
getData.send();
}
private function onResult(event : ResultEvent) : void
{
txtResult.text = event.result.toString();
}
private function onFault(event : FaultEvent) : void
{
txtResult.text = event.fault.toString();
}
]]>
</mx:Script>
<mx:HTTPService id="getData" url="http://www.google.co.kr/" result="onResult(event);" fault="onFault(event);" resultFormat="text" />
<mx:Button x="10" y="10" label="send" click="onClick();" id="btnSend" />
<mx:TextArea x="10" y="40" width="344" height="226" id="txtResult" />
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
private function onClick() : void
{
getData.send();
}
private function onResult(event : ResultEvent) : void
{
txtResult.text = event.result.toString();
}
private function onFault(event : FaultEvent) : void
{
txtResult.text = event.fault.toString();
}
]]>
</mx:Script>
<mx:HTTPService id="getData" url="http://www.google.co.kr/" result="onResult(event);" fault="onFault(event);" resultFormat="text" />
<mx:Button x="10" y="10" label="send" click="onClick();" id="btnSend" />
<mx:TextArea x="10" y="40" width="344" height="226" id="txtResult" />
</mx:Application>
'딸기 공부방 > flex' 카테고리의 다른 글
http로 서버에 정보 전달하기 (0) | 2008.12.27 |
---|---|
xml 통신 (0) | 2008.12.27 |
graphic (1) | 2008.12.27 |
horizontallist, tilelist (1) | 2008.12.27 |
datagrid, advancedatagrid (1) | 2008.12.27 |