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
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Wed Feb 17, 2016 12:22 am

What do you mean? I thought I was storing it in Local Storage... no?
B
33
S
8
G
1
Posts: 626
Reputation: 3,775

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
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Wed Feb 17, 2016 1:05 am

Oh, okay, so how do I go about saving the value for next time?
B
33
S
8
G
1
Posts: 626
Reputation: 3,775

Post » Wed Feb 17, 2016 1:07 am

@blackhornet, if I sent you the capx, could you help me out with fixing it?
B
33
S
8
G
1
Posts: 626
Reputation: 3,775

Post » Wed Feb 17, 2016 1:13 am

I gave you an example already.
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

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
33
S
8
G
1
Posts: 626
Reputation: 3,775

Post » Wed Feb 17, 2016 1:24 am

LocalStorage.Set("Year", Year)
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

Post » Wed Feb 17, 2016 1:29 am

Like this?
Image
B
33
S
8
G
1
Posts: 626
Reputation: 3,775

Post » Wed Feb 17, 2016 1:31 am

No, give me a minute to update the sample.
ImageImageImage
B
71
S
21
G
232
Posts: 3,695
Reputation: 129,866

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk and 63 guests