storage

Get help using Construct 2

Post » Mon Dec 02, 2013 11:43 am

i got a problem on one layout where i set the local key "Progress" to 1 it messes out on the other layout where i say set Progress to Webstorage.localValue(Progress) Progress is now "NaN" how do i fix please help
B
3
Posts: 13
Reputation: 226

Post » Mon Dec 02, 2013 8:04 pm

Have a look at the manual
If you had done it you would have read the following notice:

Note WebStorage only stores strings. If you set a key to a number like 100, when you retrieve it back it will be a string. To convert it back, use the system expression int, e.g. int(WebStorage.LocalValue("score")).
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Mon Dec 02, 2013 9:38 pm

yes NaN = Not a Number just convert it back to a Number and you are good to goyonda2013-12-02 21:39:07
B
19
S
6
G
3
Posts: 197
Reputation: 4,154


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Congrats2u and 24 guests