- the user chooses the code
- the lock has 13 possible digits: numbers 0-9 and letters X,Y,Z
- a C-button allows the user to reset the total code
- the code has 5 digits
- the code must not be validated but only shown on the next slide, and navigation to that slide is by a button Next
For this particular (simple) use case, what did I write down? And you'll see that I mostly define labels for everything as well.
Situations - slides - events
- User 'pushes' one of the buttons to enter a digit: which means I'll have 13 events that can trigger an action - all those actions will be similar
- User wants to change the code and clicks the C-button: event that is different from the 13 previous ones
- User has entered 5 digits and tries to push another button: has to be taken care off for each of the 13 actions described in 1.
- User clicks Next to confirm his code: special event, which will cause navigation IF the user has entered exactly 5 digits
- User clicks Next but has not entered 5 digits: should be taken care off, no navigation in that case
- 13 click boxes, each covering up a digit (0-9 and X,Y,Z), decided to label them as CB_0, CB_1..... CB_X, CB_Y, CB_Z
- 1 click box covering the C-button CB_C
- 1 button But_Next
- Since the goal is to show the entered code in ShowSlide I need 5 variables that will store the entered digits. This seems logical, but I did see that the user started by creating one variable for each digit? I suspect this is the result of just starting right away in Captivate before reflecting on the goal :-). Those five variables will be used on the second slide to show the code in a Text Caption.
Variables will be labeled: v_one, v_two, v_three, v_four, v_five
To use the C-button to reset the code, I'll need my favourite variable that is totally empty:
To track the number of entered digits for situations 3-5 I need a counter:
The last variable I didn't add immediately, but saved me a lot of editing time when creating the 13 similar advanced actions for the click boxes (see Actions).
v_current will store the digit of the current Click box (1 if the user clicked on the 1, X if he clicked on X..); and for all those genius-programmers here I really appreciate the fact that the Advanced Actions do not request me to make a difference between a number and a string when defining a variable :-)
- 13 click boxes on the 13 digits: do not create them all at once! Create one click box, configure it (inc. the attached advanced actions), and test it thoroughly. Only after that process duplicate it as many times as you need (and use my shortcut keys for aligning without a mouse Moving and Resizing Objects); believe me: that will save you a lot of clicks.
- 1 click box over the C-button
- 1 button Next
- Text Caption Instruction explaining how to enter and confirm the code
- Text Caption Warning to show up when the user enters more than 5 digits (in the same location as the previous caption)
- Text Caption TooLess to show up when the user tries to confirm with the Next button and didn't enter 5 digits, also in the same location; in this text caption the user variable v_counter is embedded
CB_1 and similar actions triggered by click box with same label (screenshots in Gallery)
- increment v_counter and store the digit (1 for CB_1) in v_current (standard action) in decision Counter
- store the digit in the appropriate variable v_one, v_two...., v_five (conditional with 5 decisions First, Second, Third, Fourth, Fifth)
- checks if the user didn't enter more than 5 digits, decision TooMuch
- resets v_counter to 0
- clears the variables v_one....v_five by using the variable v_void
- shows text caption Instruction (that could have been made invisible by a previous advanced action)
- hides text captions Warning and TooLess (that could have been made visible by a previous advanced action)
- checks if v_counter
- if Yes the text caption Instruction is hidden and TooLess is made visible
- if No the user is navigated to the next slide ShowCode
- created all the user variables and added comment to each variable
- created click box CB_1, CB_C, button But_Next,
- created text caption Instruction and formatted it, used Duplicate to create captions Warning and TooLess on slide EnterCode
- created text caption on slide ShowCode with the embedded variables (set each to length 1)
- added a testing Text Caption on first slide that shows the variables v_counter, v_current, v_one......v_five; it helps when testing to see those variables change in real time; this caption will be deleted later on
- created advanced action CB_1 from Properties panel for click box CB_1: started with first 2 decisions (Counter and First), tested, then added decisions Second...Fifth, at last added TooMuch; here it was possible to test everything because the user can select the code "11111".
- created advanced action CB_Reset from Properties panel click box CB_C and tested it in combination with CB_1
- attached this action CB_Reset also to 'On Enter' for the slide EnterCode
- created advanced action Bt_Next from Properties panel for button But_Next and tested it (still with only 1 as possible digit)
- duplicate click box CB_1 as many times as needed (here 12), label and position each click box over the appropriate digit
- open Advanced actions dialog box; duplicate action CB_1, change the label to CB_2
- because I used the variable v_current you only have to edit the first decision (Counter): change the statement "Assign v_current with 1" to "Assign v_current with 2" and that is it
- repeat that process (2-3) to create all the advanced actions CB_3....CB_Z; close Advanced Actions
- in the properties panel of the click boxes, change the attached action: because labels of the click box and the action are the same this would be easy.
- test again in all situations to detect possible bugs