我在這裏有一個問題,解壓縮我在combobox.i中的.zip文件,選擇1 .zip文件,然後選擇特定的.zip文件按鈕應解壓縮並將內容放入另一個組合框中。有人可以幫我在這裏?如何在ActionScript中使用base64編碼解壓縮文件?
這裏是一個代碼:
// ActionScript file
import flash.display.*;
import flash.events.*;
import flash.utils.ByteArray;
import com.Base64;
import mx.controls.Alert;
[Bindable] private var sfile:FileReference;
[Bindable] private var zipdataProvdr:ArrayCollection = new ArrayCollection([{label: "test", file: "test"},{label: "elm34001", file: "elm34001"}, {label: "elm34003", file: "elm34003"}, {label: "elm34005", file: "elm34005"}, {label: "elm34009", file: "elm34009"},{label: "elm34011", file: "elm34011"}, {label: "elm34013", file: "elm34013"}]);
//private var zip:FZip;
//private var flag:Boolean;
private function init(event:Event):void
{
var file:ByteArray = new ByteArray();
file = "test.zip";
var encode:String = Base64.encodeByteArray(file);
Alert.show("Encoded file is " + encode);
for (var i:int = 0; i < zipdataProvdr.length; i++)
{
file = zipdataProvdr[i];
Alert.show("file is " + file);
}
//var encoded:String = Base64.encodeByteArray(file);
//Alert.show("encoded file is " + encoded.toString());
}
你能展示一些你目前在做什麼的代碼嗎?你卡在哪裏? –
上面是代碼,我不能將一個zip文件分配給bytearray變量? – kanak