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
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Wed Feb 17, 2016 12:22 am

What do you mean? I thought I was storing it in Local Storage... no?
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

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
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Wed Feb 17, 2016 1:05 am

Oh, okay, so how do I go about saving the value for next time?
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Wed Feb 17, 2016 1:07 am

@blackhornet, if I sent you the capx, could you help me out with fixing it?
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Wed Feb 17, 2016 1:13 am

I gave you an example already.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

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
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Wed Feb 17, 2016 1:24 am

LocalStorage.Set("Year", Year)
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Wed Feb 17, 2016 1:29 am

Like this?
Image
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Wed Feb 17, 2016 1:31 am

No, give me a minute to update the sample.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests