Update
New version of this workflow, with example output to HTML5 and using new features can be found in this post:
Sequence Check slides (updated)
Intro
Another challenge on the user forum, http://forums.adobe.com/message/4387510#4387510: "wonder if it is possible to have 5 click boxes on a slide that must be clicked in a specific order before the slide will advance?" Had to ask for some more details. There are no extra (wrong) click boxes on the slide, the check for a correct sequence could be done by using a Check button, and the Next button should appear on the slide only when the sequence of clicks is correct. The user wanted to have the possibility to check after 5 clicks or to have an 'intermediate' check after each click. I thought it also to be a good practice to disable a click box immediately after it has been clicked, since a double click on the same click box was not wanted.
Example
Play with this SWF. You'll find two similar slides after the introduction slide.
- On slide First the Check button will appear after having clicked on the 5 click boxes in the sequence you wanted. You can watch the number of clicks in a Text caption at the bottom. Once a click box is clicked it will be disabled. If your sequence is not correct, all will be reset and you can try again.
- On slide Second you'll have the Check button from the start and you can use it at any time. If the check results in at least one wrong click, you'll get a Reset button. After the last click, if the sequence was correct the Next button will appear.
Slides, objects, labels and events
Slide First:
- 5 click boxes (that cover up rectangle shapes). I labeled those click boxes in the sequence they should be clicked: first CB_1, then CB_2 etc; each click box will trigger an advanced action with the same label. That is only possible because the click boxes were labeled before the actions.
- Buttons: BtCheck1 that will trigger the advanced action SeqCheck and button BtNext1 that has the action Go to Next Slide; both are initially invisible
- Text Captions TCNumber (shows the number of clicks), that is visible and set to show for the rest of the project (also needed on slide Second)
- Text Captions TC_Wrong/TC_OK1 that are initially invisible and used for feedback in the action SeqCheck
Slide Second
Because variables have to be reset, the On Enter event of this slide is used to trigger the Advanced action Enter2.
Almost identical to the first slide. Because the click boxes do get another ID, but trigger the same advanced actions CB1... for once I didn't even label them :-). The Text Caption TCNumber is still visible on this slide, because it was timed for rest of project. Other objects are:
- Buttons: BtCheck2 (visible) that will trigger the advanced action SeqBis and button BtNext2 (invisible) that has the action Go to Next Slide
- Button BtReset (initially invisible) that triggers the advanced action BtReset (same label possible because button got it first)
- Text Captions TC_Some/TC_OKUntil/TC_OK2 that are initially invisible and used for feedback in the action SeqBis
Variables/logic
Only two user variables were created to be used for checking the sequence:
- v_counter: will count the number of clicks (correct or incorrect); this user variables is visible in the text caption TCNumber. For that reason I gave it a default value of 0, so that it will also show a value in the text caption when no click has occurred.
- v_correct: will be incremented when a click has been in the correct sequence.
- to check if the click sequence is correct, for the click box CB_1 that should be clicked first I check "v_counter = 1?", for CB_3 it will be "v_counter = 3?' etc and increment v_correct if that is the case
- to check if until now the sequence was OK, which will be the case as long as v_correct is identical to v_counter
Advanced actions
CB_1, CB_2.... CB_5
Those are triggered by the click boxes with the same name on first slide, and also on second slide; similar conditional actions with 3 decisions:
-
Count is a mimicked Standard action, disables the click box, increments the variable v_counter and hides caption TC_Wrong if it has been made visible in a previous sequence.
-
Check as explained before will test if v_counter = n where n=number of the click box; if this is true, the var v_correct will be incremented; no Else action is needed.
-
ShowBtCheck checks if v_counter = 5 and if that is the case the button BtCheck1 will be made visible
SeqCheck
is triggered by the button BtCheck1 is a conditional action with 1 decision Sequence
It checks if the variables v_counter and v_correct have the same value, which means that the sequence was totally correct. In that case the correct feedback caption TC_OK1 is made visible and the Next button.
If the condition is not fulfilled the other feedback caption TC_Wrong gets visible and everything is reset so that the user can try again:
- v_counter and v_correct are reset to 0
- button BtCheck1 is hidden again
- all click boxes are enabled
Enter2
is triggered on entering slide Second
This is a simple standard action, resetting the variables by assigning the value 0 to them.
SeqBis,
is triggered by the button BtCheck2 is a conditional action with 2 decisions:
CheckUntil valid for intermediary checks, before all click boxes are clicked, will show the correct feedback caption (TC_Some, TC_OKUntil) and show the Reset button if the sequence is incorrect so far; this is a decision with an THEN/ELSE branching
End only will show the BtNext2 when all click boxes have been clicked and the sequence was correct.
BtReset
is triggered by the button with the same name on slide Second is a standard action that:
- v_counter and v_correct are reset to 0
- all click boxes are enabled
- Reset button is made invisible
Conclusion
In this example I really appreciated the duplicate and copy/paste functionalities of Captivate:
- Started with the first slide and the first click box. Created and attached the advanced action to that click box.
- Duplicated the click box 4 times and positioned the duplicates over the rectangles
- Renamed each click box, opened the attached advanced action and duplicated that as well, renamed as well and edited
- For the second slide I duplicated the first slide
- Copied a whole bunch of statements from the SeqCheck to use in the BtReset action as well
BTW: I always use the scratch area to keep some information about variables, events, objects, actions in the CP-file