HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... List and images
List and images
  View type:
I am trying to display a different image with each list item in a list. First click shows one image, second a different one etc... It seems to work for my first and second image but cannot get it to work for other images any suggestions? thanks
 
OK so if they are just page objects for example a stack of hidden images you will need a construct, some background code, to switch the hidden state in a sequence.
Possibly the easiest approach would be to put them on a time line and capture the mouse clicks to provide the advance between them.
 
 
I used a #counter and am trying to get it to increment by 1 after each click and then show hide images after an if statement but cannot get it to work.
VARIABLE(Name='#Counter', Value='+1', Scope='Current Slide')
but this does not seem to increment Counter after each click.
 
 
 
I used barend method to start with as follows:

On the Slide make an action:
Navigation - Button Next - Disable.

On the List Object make an action on 'afterdisplay':
Variable Counter, value = 0; scope = current slide.

On the List Object make other actions 'onclick':
Variable Counter = #Counter + 1
If(Condition='#Counter==4)
>>Delay(Duration = 2000, Infinite = 'No')
>> Navigation - Button Next - Enable

but it seems that the #Counter variable is not being incremented.
 
 
 
 
Hi Marc,

I was away for some days because I had a lot of work.

I think you encountered the same problem as I had: defining a global variable on page 1 and setting it to 1 seems to mean it is set to 1 on every page.
I would use Objective & Score. See friendsofcourselab.info - 'advanced' - 'backwards and forwards'. Such score is not set to a value at every new page.

If this is not the solution, I'll be glad to have a look if you can somewhere post a zip with an 'isolated' example (i.e. only a few slides with the problem).
 
 
 
 
 
Hi Barend
Thanks for the help. I'll check that out. I don't even need to move from page to page but I want the counter to increment each time the button of a list is displayed to display a different image with each bullet point. Thanks again.
 
 
 
 
 
 
Hi All
I managed to get that to work using scores. Set up a clickCounter variable similar to the friendsofcourselab.info site. On the list, I added actions as follows: beforedisplay I set the clickCounter to 0 to reset it from one page to the next as follows SET SCORE(objective="clickCounter", Additive="replace", Score="0")

OnClick I have a SET SCORE to set the score to +1 then I check the value of the clickCounter using IF SCORE and show the image for each click!

Thanks Barend for pointing me in the right direction.
Subject:
Message options
No additional options