2012-04-12 49 views
0

如何顯示Flash和PHP之間的數據傳輸進度? 下面是我用來通過PHP上傳base64編碼圖像的AS3代碼。AS3 - 顯示Flash和PHP之間的數據傳輸進度

var scriptLoader:URLLoader = new URLLoader(); 
var scriptVars:URLVariables = new URLVariables(); 

var scriptRequest:URLRequest = new URLRequest("https://www.example.com/sendit.php"); 

var imagedata = Base64.encode(mybitmap); 
scriptVars.theimage = imagedata 

scriptRequest.method = URLRequestMethod.POST; 
scriptRequest.data = scriptVars; 
scriptLoader.load(scriptRequest); 

(服務器運行PHP版本5.3.10)

+0

您可以與網絡嗅探器可見。 – hakre 2012-04-12 18:41:50

+0

FileReference.upload應該有你想要的 – 2012-04-12 19:05:31

+0

@The_asMan怎樣才能做到,用**只讀**'數據'? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#data – Engineer 2012-04-12 19:09:24

回答