For a recent webinar about conditional advanced actions I recreated a file in Captivate 6 to check a Sequence of clicks, as described in the article. You can play with this file in the Example section. In this version I used a lot of custom motion path effects to put the cards on a stack. If the sequence is not correct, there is a reset button to offer the user a new attempt. And that meant that the motion effects had to be reset. I was very happy to find an easy way for this work flow, and that is the goal of this article.
Play with this movie that has only 4 slides: on the first slide you choose between two ways of playing and will be navigated to either the second or third slide depending on the choice. On slides 2 and 3 in case of wrong answer you can reset the cards to their original position, on slide 2 this will happen with the Next button, after you checked the sequence with the Question Mark button. On slide 3 you have a reset button? Last slide will only be reached in case of a correct answer. Want to cheat? The sequence is 57142
The work flow is pretty simple: you have to return to the very first slide, and using an advanced action on entering that first slide, redirect again to the slide just left. And the objects that had moved will be back in their original place, the effect is reset. I tried out different other work flows like navigating to the previous slide, but for some reasons it only is functional if you return to the very first slide. In the example movie, the On Enter action for that first slide is a bit more complicated because I have some more actions to be done, but in the next example I keep it really simple, just having the focus on resetting the effects.
Second example with details
This example has 5 slides: Intro, TimeBased, ButtonTrigger, AATrigger and Summary. On slides 2,3,4 you'll find an effect applied to one object, first time-based, then triggered by a button and at last one triggered by an advanced action attached to another button. On slides 2 and 4 other objects with effects will appear, which was not possible for the slide with the button that triggers an Effect, because you can only apply one effect that way.
I used default buttons from the Shape Button category, but changed the triggered actions. On the Intro slide there is only a Next button (used a rollover shape as tooltip). On slide 2 you'll find 3 buttons, timed for the rest of the project (and hidden on the last slide Summary). Each of them has a tooltip as well, and they all have a pausing point near the end of the slide, but play button pauses a little bit before the others:
Reset button: the default action for this button is 'StartSlide', and this is what I wanted it to do.
Play button: has a different functionality, depending on the slides
- on slide 2 (TimeBased), slide is paused on entering, and this Play button will just release that pause by the statement 'Assign cpCmndResume with 1'. The playhead will continue, and the three objects that start on different moments will get visible with their effect.
- on slide 3 (ButtonTrigger): no need to pause on entering, I covered the original play button with a transparent shape button that triggered the Effect on the hexagon by a simple action, thus limited to one object with effect.
- on slide 4 (AATrigger): no need to pause on entering; again I covered the original play button with a transparent shape button that triggered an Advanced action NewApply with two statements: "Apply Effect..." and "Continue". This button pauses at exactly 1secs, whereas the other objects appear after that time (see timeline). The Continue statement is needed to release the play head so that the other objects appear with their effect.
Advanced Action EnterIntro
This action, triggered by the On Enter event for the first slide (Intro), has to be conditional. It has to check if this slide is visited for the first time. To achieve this I created a user variable v_visited (no default value, so empty to start with) that will be set to 1 when the slide is visited for the first time. On all following visits, the user is navigated back to the last visited slide, the slide on which he clicked the Reset button. And that makes the magic happen: the object that was moved by the applied effect is back in its original location. The conditional action is rather simple:
IF v_visited is equal to 1
THEN Go to Last Visited Slide
ELSE Assign v_visited with 1
When returning to the last visited slide, all objects will be in their original place. Even if you have clicked twice the Play button! Try it out with the example movie. You'll see a different behaviour depending on the slides:
- On Slide 2 (TimeBased): pressing the Play button a second time will not have any effect, since the play head has stopped at the pausing point of the Next/Reset button and all effects have been played.
- On Slide 3 (ButtonTrigger): pressing the Play button another time will replay the Effect, since it is triggered by that button. But motion effects are always relative to the present position of the object. So.... the hexagon will move outside of the stage.
- On Slide 4 (AATrigger): if you press the Play button again, the hexagon will move again (outside of the stage), but not the other objects. Their effects were time-based and the play head is at a position after those effects. If I had applied the effect to those objects by the Advanced action as well, they would have played. But then it was not possible to start the effects at different times.