I want to show an image from a gallery, with different galleries to chose from. the shall have different propabilites to be chosen.
so i generate a random number between 1 and 10 in an eval:
Code: Select all
n = Math.floor((Math.random() * 10) + 1)
Code: Select all
switch(n) {
case 1:
case 2:
case 3: str = 10; strokes = strokes + 10; break;
case 4: str = 15; strokes = strokes + 15; break;
case 5:
case 6:
case 7: str = 20; strokes = strokes + 20; break;
case 8:
case 9: str = 25; strokes = strokes + 25; break;
case 10: str = 50; strokes = strokes + 50; break;
default: str = 1; strokes = strokes + 1;
}
up to here everything works well.
Next, i use the IF Clause in EOS.
IF:
Code: Select all
str = 50
Show a random image from gallery number 50
Goto next page
IF
Code: Select all
str = 25
Show a random image from gallery number 25
goto next page
.... and so on.
The variables work as they should. But the images don't.
I have 5 IF clauses on the page but always the last image from the last clause is shown, even if variable STR is not matching the IF sentence.
Any Ideas what i do wrong?