Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

StageWebView & localStorage

$
0
0

[as]

 

var www:StageWebView = new StageWebView();

// line below won't compile

//www.engine = StageWebViewEngine.WEBKIT_ENGINE;

www.stage = this.stage;

www.viewPort = new Rectangle (0, 0, 600, 600);

 

var source:File = File.applicationDirectory.resolvePath("htmls");//copy entire folder (with css)

var destination:File = File.applicationStorageDirectory; 

source.copyTo(destination, true);//copy to the application storage 

//get path to the html page within copied folder 

var resultsPageUrl:String = "file://" + destination.resolvePath("manage.html").nativePath; 

www.loadURL(resultsPageUrl); 

 

[/as]

 

manage.html (snip):

[js]

 

myStorage = localStorage;


localStorage.setItem('myCat','Tom');

[/js]

 

I end up with these run-time errors

 

TypeError: Result of expression 'this.get.bind' [undefined] is not a function.

&

ReferenceError: Can't find variable: localStorage

 

 

 

 

Does anyone know how to use localStorage in javascript from StageWebView on all devices?

 

Window.localStorage - Web APIs | MDN


Viewing all articles
Browse latest Browse all 2954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>