テキストファイルをHTTP通信

  http.swf



テキスト(utf-8)をそのまま表示しています( resultFormat="text" )


http://www.macromedia.com/go/getflashplayer' src='http.swf' width='100%' height='400' />




  ソースコード



style.css は、↓と同じです( フォントを使用する )
http://winofsql.jp/VA003334/flex2071127133333.htm

  
<?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>
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ