Drag&Drop: Using Shared or Advanced Actions
In the webinar which I presented on 2018/3/15 about Shared Actions, I showed several workflows with shared actions. If you want to have a look at the presentation used during the webinar, check out my previous blog post. You’ll find a link to the published interactive movie
One of those examples, was a Drag&Drop slide where both advanced and shared actions were used as Object Actions. It can help you with the tough task to choose between the two types of actions. A similar example appears in the presentation, where only a shared actions was used. It had 7 drag sources and two drop targets:
It is still not possible to embed an iFrame in blog posts here. Click here and watch the movie to understand the goal of the D&D slide. It has 6 drag sources and only one drop target. You will be asked to drag only the correct new features in CP2017 to the drop target. Only when the answer is correct will you see the Next button. There is a Reset button for the D&D, which is not the default reset (because of the states used on the drop target) but uses an approach which I have explained already multiple times.
Setup D&D slide
Auto Submit Correct Answers is activated, and the Submit button has been dragged to the scratch area. The drop target accepts all drag sources, which will disappear behind the target but the count is limited to 3 (because there are 3 correct answers). Due to the Auto Submit which only will happen for the correct answer, the Next button will only appear when the answer is completely correct (Action ‘On Success’).
The drop target is a multistate object. I didn’t add InBuilt states in this case but three custom states, using a gradient edited for each state with ‘Edit Gradient’.
On the slide, not overlapping with any object, there is a multistate shape, labeled ‘Comments’, acting as feedback container. The normal state is blank and you see the other states in this screenshot:
Advanced Action DD_CorrectAct
I imported the shared action used in the presentation to the project Library and used is as a template for this Advanced action DD_CorrectAct. I added the Play Audio command. First I tried to add the audio to the state ‘Correct’ of the multistate shape ‘Comments’, but that proved not to work in this case, probably due to the Drag&Drop limitations. After the duration of the audio clip (4secs) the shape reverts back to the Normal state, which is invisible to the user (Alpha and Stroke set to 0).
Sorry for the generic label on he drop target. You probably know from my previous blog posts that renaming an object used in a D&D interaction, will kill the set up.
Since this action is used with exactly the same feedback text and same audio clip for 3 drag actions it is much better to use an advanced action in the situation.
Shared Action DD_IncorrectAct
The previously described Advanced action DD_CorrectAct is used as source to create a shared action. Since there is no state change needed for the drop target, the fifth command can be deleted. Five parameters are needed (due to the fact that audio couldn’t be embedded in states). Four of them are compulsory parameters, one candidate was turned into a parameter: the literal for the delay time. That delaty time has to be at least as long as the audio clip to be played.
You just need to apply the advanced action and the shared action to the proper object actions:
Goal of this simple example was to show when to use a shared action instead of an advanced action? It could have been done with 3 duplicate advanced actions, which is what I see most clients doing. Start to appreciate the advantages of shared actions over duplicate advanced actions:
- Ease of transfer to other projects
- Management in the Library
- Possibiity to use as template
Give it a try. If you want to learn more, give me some feedback, please.