首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

Flex FileReference URLRequest 请求缓存有关问题

2013-02-24 
Flex FileReference URLRequest 请求缓存问题var variables:URLVariables new URLVariables()variables

Flex FileReference URLRequest 请求缓存问题
var variables:URLVariables = new URLVariables();variables.rannum = Math.random();var url:String = 文件地址var request:URLRequest = new URLRequest(encodeURL(uri));request.data = variables;request.method = URLRequestMethod.POST;

?

?

? ? 另附完整代码

? ??

<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script><![CDATA[import mx.utils.UIDUtil;    [Bindable]  public var file:FileReference;     private var currentAction:String;     private var downloadURL:URLRequest;  private function download():void{            var url:URLRequest=new URLRequest("http://localhost:8080/FlexMessageServer/test.txt");     url.method = URLRequestMethod.POST;     url.data = UIDUtil.createUID();     file = new FileReference();      file.addEventListener(Event.COMPLETE,comple)       file.download(url)     }         private function comple(e:Event):void    {    tex.text="已下载完成!"    }  ]]> </mx:Script>  <mx:Button  x="10" y="20" label="下载一个文件" click="download()"/> <mx:ProgressBar x="10" y="100" id="progress" source="{file}" label="已加载: %3%%"/> <mx:Text text="" x="10" y="145" id="tex"/></mx:Application>

?

热点排行