Challenge for readers to find which advanced action will fail, and why it will fail.
Challenge
Fixing bugs is one of the best ways of learning. That is my personal experience and I suspect I am not at all unique. Several years ago I solved a problem for a Captivate user, which I will use now for this challenge.
Watch the output
Goal was to show a sequence of images, not all in the same location, by clicking a button. In this case, there are only 4 images. It is looping, you can continue clicking eternally. No multi state objects were used (they didn’t exist yet when I solved this issue):

Possible actions
To understand the meaning of the labels, here is the timeline of the photo-slide:
You’ll see the Preview of two advanced actions, created in CP2019. They both use one user variable v_click which is defined with a default value of 0.
Action A
Action B
Your challenge
- Which action will be functional: A or B?
- Why will the non-functional action fail?
- Could you ‘fix’ the non-functional action?
- Why is using a shared action not considered to be an alternative.
- …. other ideas?
Looking forward to your answers….
Slight specification on Le Dirlo’s answer:
On Action A, variable v_click doesn’t actually keep the same value, but runs quickly through all values between 0 and 3, and then back to 0 in an instance, resulting in only Photo4 to appear visibly on the screen. The others are shown and hidden in a split second, too fast to be actually visible on the screen, because the Advanced Action runs through all 4 decision blocks in a moment’s time.
No straightforward way to fix Action A. If no cycling would be required, one could just reverse the order of decision blocks, but since Photo1 should appear again here after Photo4, this won’t work here. Photo4 wouldn’t show. One would have to introduce a second variable, I guess.
Action B should work fine, provided there is no other means than the button to alter variable v_click.
Shared Action is not required, as there’s just one button to press. Nothing to share here.
I will explain tomorrow for everyone the correct action and the reasons.
However I disagree with the sentenc about the Shared action. That is not a valid reason because a Shared action can also be used for other projects, one of its big advantages. There is however a more logical reason why I couldn’t use a Shared action in this case. Wait for my answer-blog.
…
Hello Lilybiri !…
Nice pictures !… (Is it you ??…)
I think the correct action is A !…
Action B is failing because you increment v_click indefinitely… So what will happen when v_click = 6 ??? for example…
I also remember that I have problems to show a single image in a group ? (not sure about that…)
So to make action B works, I will add a lign :
if v_script >= 5, affect v_script with 1
Argggghhhh !… I’ve just seen that you already did this => if v_click = 4 , assign v_clik with 0
So… I don’t know !!!… But I will test it !!… and come back !!…
You must be logged in to post a comment.