Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.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 URL请求缓存响应不工作_Actionscript 3_Flash_Actionscript_Air - Fatal编程技术网

Actionscript 3 URL请求缓存响应不工作

Actionscript 3 URL请求缓存响应不工作,actionscript-3,flash,actionscript,air,Actionscript 3,Flash,Actionscript,Air,我想缓存URL请求的响应,以便在Adobe Air中脱机使用。当我为flash player编译时,缓存工作,即使在断开网络连接时,我也会得到响应,但当我为Adobe Air编译时,我会得到错误。PS:useCache和cacheResponse不起作用 stage.addEventListener(MouseEvent.CLICK , callReq) var loader:URLLoader = new URLLoader() function callReq(e:Event):v

我想缓存URL请求的响应,以便在Adobe Air中脱机使用。当我为flash player编译时,缓存工作,即使在断开网络连接时,我也会得到响应,但当我为Adobe Air编译时,我会得到错误。PS:useCache和cacheResponse不起作用

stage.addEventListener(MouseEvent.CLICK , callReq)
var loader:URLLoader = new URLLoader()

    function callReq(e:Event):void 
    {
            //URLRequestDefaults.manageCookies = true; 
        //URLRequestDefaults.useCache = true;
        var r:String = "http://onecom.no/presentation_json.php?what=get_slides&slide_id[]=2540"
        var urlRequest:URLRequest = new URLRequest(r)

        //  urlRequest.cacheResponse = true
        //  urlRequest.useCache = true

            urlRequest.url = r
        loader.addEventListener(Event.COMPLETE , Comp)
        loader.load(request)
    }

    function Comp(e:Event):void 
    {
        trace( e.target.data)   
    }

Air无法使用浏览器缓存。我必须构建自己的缓存类,将所有URLRequest响应保存到共享对象,并在没有internet连接时加载它们将它们保存到变量中,并将它们存储在设备/计算机上的本地SQLlite数据库中?。。。