Flash AS3 FileReference.save()无法在Android AIR上运行

时间:2013-08-12 20:56:07

标签: android actionscript-3 air flash-cs6 filereference

我有以下代码将movieclip保存为PNG图像:

download_btn.addEventListener(TouchEvent.TOUCH_END, function(){
    if(currentImage == andy_thumb){
        savePicture(MovieClip(parent).andy, 'andy');
    }
    if(currentImage == tilly_thumb){
        savePicture(MovieClip(parent).tilly, 'tilly');
    }
    if(currentImage == trunk_thumb){
        savePicture(MovieClip(parent).trunk, 'trunk');
    }
});

function savePicture(mc:MovieClip, charName:String):void
{
    var bmd:BitmapData = new BitmapData( mc.width, mc.height );
    var bounds:Rectangle = mc.getBounds(mc);
    bmd.draw(mc, new Matrix(1,0,0,1,-bounds.left, -bounds.top));

    var file:FileReference = new FileReference();   
    file = new FileReference(); 
    file.save(PNGEncoder.encode(bmd), charName+'.png');

}

我在计算机上调试时工作正常。使用平板电脑时,会打开“下载对话框”,但在指定要将其下载到的文件位置后单击“确定”时,它不会保存文件。

任何想法都是为什么?

感谢。

0 个答案:

没有答案