Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 flex 4.6:如何缓存使用PersistenceManager捕获的图像_Actionscript 3_Apache Flex_Flash Builder_Flexbuilder - Fatal编程技术网

Actionscript 3 flex 4.6:如何缓存使用PersistenceManager捕获的图像

Actionscript 3 flex 4.6:如何缓存使用PersistenceManager捕获的图像,actionscript-3,apache-flex,flash-builder,flexbuilder,Actionscript 3,Apache Flex,Flash Builder,Flexbuilder,我是Flex移动应用程序的初学者,我的问题是应用程序重启,然后我用PersistenceManager解决了这个问题,但是,当我用相机拍摄图像时,如果应用程序重新启动,我无法保存图像,那么当用户单击保存按钮时,如何保存所有拍摄的图像我认为这将是imagecaptured方法,但它不起作用。应用程序重新启动,相机应用程序打开以拍摄图像方法是 public function imagecaptured(event:MediaEvent):void { //su

我是Flex移动应用程序的初学者,我的问题是应用程序重启,然后我用PersistenceManager解决了这个问题,但是,当我用相机拍摄图像时,如果应用程序重新启动,我无法保存图像,那么当用户单击保存按钮时,如何保存所有拍摄的图像我认为这将是imagecaptured方法,但它不起作用。应用程序重新启动,相机应用程序打开以拍摄图像方法是

public function imagecaptured(event:MediaEvent):void
        {
            //submitButton.enabled = false;
            antherImg.label = "please wait to detect your location";
            imagepromise = event.data;
            imgBorder.source = imagepromise.file.url;
            //values to send
            var imgURL:Object = imagepromise.file.url;
            var imgName:Object = imagepromise.relativePath;

            //save Persistence
            var saveManager:PersistenceManager = new PersistenceManager();            
            saveManager.setProperty("url", imagepromise.file.url);
            saveManager.setProperty("name", imagepromise.relativePath);
        }
以及页面创建时(creationComplete)


请提供帮助,提前感谢

您的目标是iOS、Android还是两者兼而有之?(
MediaPromise.file
在iOS上不起作用。)应用程序重启前后的值是什么?我的目标是Android。这些值是qrcode、图像和标志。这些值对于持久性管理器的输入和输出没有多大意义。例如,什么是
imagepromise.file.url
之前和
saveManager.getProperty(“url”)
之后?您的PersistenceManager是否存在问题,或者url不再有效,或者您首先没有获得正确的数据?我在之前使用imagepromise.file.url,在之后使用saveManager.getProperty(“url”)检查是否捕获了图像,然后将其保留,但它不工作,图像有时会丢失,应用程序会再次打开相机。我将把图像解码到base64,通过web服务发送它,如果你想保存数组的字节的话?
 public var loadManager:PersistenceManager = new PersistenceManager();


if(loadManager.load())
            {

                var savedData:Object = saveManager.getProperty("url");
                var savedData:Object = saveManager.getProperty("name");


            }