0
我使用AS3閃存。有人能幫我嗎?我想,如果你按下save_image按鈕,那麼它將「guy」movieclip保存爲png。但它不工作:AS3 Flash - 保存movieclip爲PNG
import com.adobe.images.JPGEncoder;
import com.adobe.images.PNGEncoder
save_image.addEventListener(MouseEvent.CLICK, save_image_function);
function save_image_function(event:MouseEvent):void
{
var bmd:BitmapData = new BitmapData(50,50);
bmd.draw(guy);
var encorder:PNGEncoder = new PNGEncoder();
var bytes:ByteArray = encorder.encode(bmd);
var file:FileReference = new FileReference();
file.save(bytes, "Image.png");
}
有人可以幫我嗎?錯誤代碼是這樣的:
ReferenceError: Error #1069: Property encode not found on com.adobe.images.PNGEncoder and there is no default value. at pr2sets_fla::MainTimeline/save_image_function()