Page 1 of 1

global variable

Posted: Thu Oct 11, 2012 11:06 am
by Eric Brouwer

First let me describe what i try to do.

on screen1 there are 2 pictures.
If i click on picture 1 it goes to screen 2
if i click on picture 2 is goes also to screen 2

On screen 2 it need to load a picture.
depending on which picture i clicked on screen 1,
if i click on picture 1 then picture x needs to be displayed on screen 2
if i click on picture 2 then picture y needs to be displayed on screen 2

I was thinking to use a global variable.
when on screen 1 click on picture 1 i set the global variable value to 1
when on screen 1 click on picture 2 i set the global variable value to 2

then on screen 2 load depending on the global variable i can either display picture x or y on screen 2.

However is there a way to use a global variable?


global variable

Posted: Thu Oct 11, 2012 11:35 am
by Maryna Brodina

Hello! Try to use localStorage http://help.gotiggr.com/getting-start...


global variable

Posted: Thu Oct 11, 2012 12:42 pm
by Eric Brouwer

Thanks,

Of course, did not think of that to use localStorage.
I know how it works so that is no problem for me.