Intro
- Dare to Share - part 1 explained how to create a shared action, meaning of the parameters
- Dare to Share - part 2 showed how to reuse those actions within the same project
Advantages of using shared actions (both in 7/8) within same project:
- Saving time: you don't have to create a new name as for a duplicated advanced action, just choose the parameter(s)
- Managing shared actions is in the Library, not in a separate dialog box
- Since you are using the same shared action over and over again, this helps keeping file size down
Getting shared actions in another project
1. Using Export/Import (7 - 8)
Similar to other Library assets, you can export shared actions from the Library and import them in another project. Use the small icons in the top bar of the Library:
The extension of those small exported files is cpaa. When they are imported in another project:
- They appear in the Library of that project, with a Usage of 0
- If the shared actions do use variables that are not defined as parameters, those variables will be created in the project to which you imported the shared actions.
2. Copy/Paste from External Library (7-8)
This is my preferred work flow. I love keeping much used assets in a separate project file, that I use as External Library:
- Project file that you want to use as Library has to be closed
- Use File, Import, External Library and point to the project file
- Copy/paste the shared actions to the Library of the active project fie.
The results will be the same as with the first method, but you don't have to bother about saving the exported files somewhere and importing them from that same location.
CP8 tip:
If you are using the default UI, not the Expert mode, this External Library will open as a Floating panel. This means that you can drag it wherever you want, increase its size etc. That functionality is available in CP8 for the normal panels only when you choose for Expert mode.
3. Drag from External Library (8)
You can drag shared actions from the external Library to the present project Library, alternative for Copy/Paste/
But you can also drag a shared action from the External Library directly on:
- a slide: in that case it will be associated with the On Enter event, and you can immediately choose the parameter
- an interactive object (button, click box, shape button...): in that case the shared action will be associated with the On Success event of the interactive object.
Dragging from the library on a slide or an interactive object is also possible from the present library of course.
Tips and Tricks for Captivate 8 users
1. Warning about dragging from External Library on event
If you have several shared actions that use the same variable, do not drag them on slides or interactive objects. There is a small bug (hopefully will be removed soon): if you drag them one by one to an event (on slide or object), before those shared actions are in the present Library, the variable will be created as many times as you execute a drag action. And each variable will have another name, which can be disturbing the logic of your shared actions.
Example:
In the Dashboard use case, described in Features of Captivate 8 the variable v_counter is used in two shared actions, and one advanced action:
If you drag the shared action FirstViewBt from an External Library to a new project (like the last movie in the same article), not to the Library but immediately on one of the buttons used on the first dashboard visit, the variable v_counter - not defined as a parameter - will be created. If you do the same with the shared action NextViewBt, it will not use the created variable v_counter, but a second variable v_counter1 will be created. This will cause problems: not only will the number of visits not be updated as expected, but the Advanced action, ResetStart, will only reset the variable v_counter, not the second one v_counter1.
To avoid this kind of problems: drag the shared actions (all at once is possible) from the External Library to the present Library (Usage will be 0), and drag them from that Library onto events.
2. Choosing variables as parameters
In Captivate 8, variables and literals don't have to be parameters, they are only candidates. You can easily choose a variable to be a parameter in one shared action, and not in another one.
Example:
For the Dashboard use case, the variables v_ch1, v_ch2, v_ch3 and v_ch4 are:
- defined as parameters both in the shared actions FirstViewBt and NextViewBt because they have to be edited when applied to another button
- not defined as parameters for the shared action EnterDash, because they have never to be edited.
3. Careful with literals as parameters
In some rare use cases it can be interesting to define a literal as a parameter. I want to warn however: if you define a literal of 1 as a parameter and that number appears several times in the shared action, all the literals will be changed to the value you give when entering the parameter value.
QuizMessage: a conditional action with 4 decisions, that shows a different item/group based on the obtained percentage for a Quiz. In this case it can be useful to define the limiting scores as parameters:
Whereas in this case, it is not a good idea to define the '1' as a parameter, because it appears in two different lines, once in the condition itself and once in the Assign statement. Only when you can replace the Assign by a Toggle statement, you could define the literal as a parameter because in that case it would appear only in the condition:
Conclusion
As long as you can apply the shared action without having to edit a statement/condition, or to add/delete a line they can be a real time saver. But often editing is necessary, certainly in Captivate 7. For the Dashboard use case: if you do not have the same number of buttons on your dashboard, you have to edit the EnterDash action for sure. And how do you manage shared actions? I will write another blog post in the near future on those subjects.