특별한딸기이야기
xml 통신 본문
<?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.ResultEvent;
import mx.rpc.events.FaultEvent;
private function onClick() : void
{
getXml.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="getXml" url="http://localhost:8700/getXml.xml" result="onResult(event);" fault="onFault(event);" resultFormat="object" />
<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.ResultEvent;
import mx.rpc.events.FaultEvent;
private function onClick() : void
{
getXml.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="getXml" url="http://localhost:8700/getXml.xml" result="onResult(event);" fault="onFault(event);" resultFormat="object" />
<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' 카테고리의 다른 글
컴포넌트 만들기 (1) | 2008.12.27 |
---|---|
http로 서버에 정보 전달하기 (0) | 2008.12.27 |
http통신 (1) | 2008.12.27 |
graphic (1) | 2008.12.27 |
horizontallist, tilelist (1) | 2008.12.27 |