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
267
Posts: 3,807
Reputation: 147,745

Post » Wed Feb 17, 2016 12:22 am

What do you mean? I thought I was storing it in Local Storage... no?
B
45
S
11
G
1
Posts: 648
Reputation: 4,419

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
267
Posts: 3,807
Reputation: 147,745

Post » Wed Feb 17, 2016 1:05 am

Oh, okay, so how do I go about saving the value for next time?
B
45
S
11
G
1
Posts: 648
Reputation: 4,419

Post » Wed Feb 17, 2016 1:07 am

@blackhornet, if I sent you the capx, could you help me out with fixing it?
B
45
S
11
G
1
Posts: 648
Reputation: 4,419

Post » Wed Feb 17, 2016 1:13 am

I gave you an example already.
ImageImageImage
B
71
S
22
G
267
Posts: 3,807
Reputation: 147,745

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
45
S
11
G
1
Posts: 648
Reputation: 4,419

Post » Wed Feb 17, 2016 1:24 am

LocalStorage.Set("Year", Year)
ImageImageImage
B
71
S
22
G
267
Posts: 3,807
Reputation: 147,745

Post » Wed Feb 17, 2016 1:29 am

Like this?
Image
B
45
S
11
G
1
Posts: 648
Reputation: 4,419

Post » Wed Feb 17, 2016 1:31 am

No, give me a minute to update the sample.
ImageImageImage
B
71
S
22
G
267
Posts: 3,807
Reputation: 147,745

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests