Welcome to another installment of Controlling Captivate! In this post we are going to show you, with the help of a FREE TLC add-in, how to show and hide elements without using any advanced actions. This blog and add-in pertain only to CP8, CP9, and HTML5 output.
Following some very straight-forward naming conventions for the slide label and object names, calling a simple function will Show/Hide objects and also keep track when all elements have been clicked. In addition, this function will show/enable the Next button for you if it is hidden.
We’re not going to go through all of the code that makes this work, we’re just going to explain the naming conventions, the functions, and the simple implementation of the ShowHide add-in. Did we mention you can get the add-in for FREE when you sign-up? Do it now by clicking the sign-up link so you can download the add-in and follow along.
Click here to download a demo.
The first step is to download the ShowHide.zip file.
The next step is to install the add-in. On the first slide of your project choose Media/HTML5 animation and point to your ShowHide.zip file?
With the animation on the stage, in the properties panel deselect the border and scrolling options. Set the animation to display for the rest of project. That’s it!
The key to using this add-in is the naming conventions.
The first step is the slide label. The slide must be named “clicks” followed by an underscore and the number of items you want to track. For example, you have three text captions you want to show/hide. Your next button is hidden until all three captions have been revealed. Your slide label will be “clicks_3”. This tells the add-in that there are three clickable objects and to set up an array to determine when all items have been clicked.
Note: By naming a custom next button “next_btn” the code will show the next button when all items are clicked.
In our demo we chose to name the text captions we are showing/hiding;
TC_2_1, TC_2_2 and TC_2_3 where:
TC = Text Caption (This can be anything, but must be the same for all objects)
2 = Slide Number (Required)
1 = Object Number (Required sequence)
Note: Ensure that all parameters are separated by an underscore.
Note: Ensure you choose “Current” and “Continue playing the project” is optional depending on your project.
We will follow the previous convention, but sequence group objects with alpha characters, so the groups in the demo for the three text captions and the three images are as follows:
GR_3_1a GR_3_2a GR_3_3a
GR_3_1b GR_3_2b GR_3_3b
GR = Group (This can be anything, but must be the same for all objects)
3 = Slide Number (Required)
1 = Group Designator (Required sequence)
a-z = (Required sequence within the group)
Note: Ensure that all parameters are separated by an underscore except for the alpha character.
That’s all there is to it! Thanks for reading and we hope you find the ShowHide add-in a valuable tool that speeds up your development.