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
20
G
192
Posts: 3,535
Reputation: 109,344

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: 590
Reputation: 3,253

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
20
G
192
Posts: 3,535
Reputation: 109,344

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: 590
Reputation: 3,253

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: 590
Reputation: 3,253

Post » Wed Feb 17, 2016 1:13 am

I gave you an example already.
ImageImageImage
B
71
S
20
G
192
Posts: 3,535
Reputation: 109,344

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: 590
Reputation: 3,253

Post » Wed Feb 17, 2016 1:24 am

LocalStorage.Set("Year", Year)
ImageImageImage
B
71
S
20
G
192
Posts: 3,535
Reputation: 109,344

Post » Wed Feb 17, 2016 1:29 am

Like this?
Image
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Wed Feb 17, 2016 1:31 am

No, give me a minute to update the sample.
ImageImageImage
B
71
S
20
G
192
Posts: 3,535
Reputation: 109,344

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: alajajm, tetuan and 10 guests