Please, help with a local storage/save problem I'm having...

Get help using Construct 2

Post » Wed Feb 17, 2016 12:17 am

Where are you saving the data?
ImageImageImage
B
71
S
19
G
179
Posts: 3,478
Reputation: 102,672

Post » Wed Feb 17, 2016 12:22 am

What do you mean? I thought I was storing it in Local Storage... no?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Wed Feb 17, 2016 12:29 am

No, you are retrieving the value that was saved, but you need to save the value for next time.
Right now you are asking if the value exists, it doesn't, so you setting your Global to a default.
ImageImageImage
B
71
S
19
G
179
Posts: 3,478
Reputation: 102,672

Post » Wed Feb 17, 2016 1:05 am

Oh, okay, so how do I go about saving the value for next time?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Wed Feb 17, 2016 1:07 am

@blackhornet, if I sent you the capx, could you help me out with fixing it?
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Wed Feb 17, 2016 1:13 am

I gave you an example already.
ImageImageImage
B
71
S
19
G
179
Posts: 3,478
Reputation: 102,672

Post » Wed Feb 17, 2016 1:21 am

I know, but man, I don't understand how to save the value for next time, based off of that example:(
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Wed Feb 17, 2016 1:24 am

LocalStorage.Set("Year", Year)
ImageImageImage
B
71
S
19
G
179
Posts: 3,478
Reputation: 102,672

Post » Wed Feb 17, 2016 1:29 am

Like this?
Image
B
27
S
5
G
1
Posts: 589
Reputation: 3,251

Post » Wed Feb 17, 2016 1:31 am

No, give me a minute to update the sample.
ImageImageImage
B
71
S
19
G
179
Posts: 3,478
Reputation: 102,672

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: ladjuric, luckyrawatlucky, lukedevel, m0nkeybusiness, tunepunk and 11 guests