Custom Play/Pause button in Captivate

If you are using CP9, CP2017 or CP2019: go to a more recent post which offers an easier and better workflow for this toggle button:

Intro

This a quick tip, to avoid me having to answer this question again and again on the user forum. It is pretty easy to have custom buttons to navigate to previous, next or even last visited slides, or to toggle CC. But the play/pause button is a bit trickier. The reason is that for this button 'twin' system variables are involved: rdcmndPause and rdcmndResume. In this post I offer three solutions. Watch the movie to see the difference/
 

Example

 
Watch this movie to judge the difference between the solutions. I reused some slides from a previous post (Playtime with audio and widgets) that have a bit complex and long timelines to allow you to test the Pause/Play functionality. You'll experience the three solutions in this sequence:
  1. on the first slide, clicking the Pause button, will make it disappear and the Play button will show up: simplest solution with two buttons
  2. on the second slide, there is only one button with the text 'Play/Pause) that is already a real toggle, but its aspect will always be the same
  3. on the third and fourth slide you'll find also a toggle button, but the text will change to show you are now pausing or playing

Work flows

Solution 1: Play button and Pause button

On the first slide at the start only the Pause button, labeled BtPause is visible, whereas the second BtPlay is hidden. If you expect the user to return to this slide, you'd better set this situation on entering the slide by another standard advanced action. Both buttons trigger a standard advanced action, PauseBt/PlayBt (see screenshots in the Gallery) with these statements:
  • Assign rdcmndPause with 1 (for action PauseBt) or Assign rdcmndResume with 1 (for action PlayBt)
    here you see why I call those system variables 'twins'
  • Hide BtPause   (for action PauseBt)  or   Hide BtPlay  (for action PlayBt)
  • Show BtPlay  (for action PauseBt)   or   Show BtPause  (for action PlayBt))
The buttons I used are custom image buttons, of course you can use whatever you want; if you replace the button by an image with a click box, you have to show/hide the image as well of course.
If you use this action on more than one slide, you'll have to create a duplicate action for each slide, because of the ID's of the buttons that will be unique on each slide.
 
Warning: do not try to put those buttons on top of each other, perhaps to simulate the behavior of a toggle button, because this will not function!


Solution 2: Toggle button with text 'Play/Pause'

The second slide has an example of this toggle, with the disadvantage that the user doesn't see which state the movie has: paused or not.
Here a conditional action PlayPauseBt is needed, with one single decision (see screenshots: both Then and Else images are available). 
 
IF:     rdcmndPause is equal to 0
If this is the case, the movie is playing

THEN:    Assign rdcmndPause with 1
the movie will be paused

ELSE:    Assign rdcmndResume with 1
the movie will resume playing


If you do not mind the fact that the button will always have the same aspect this is really the simplest solution, because the action has no reference whatever to an object. This means that you can use it multiple times without haveing to create duplicates or have editing work. 

Same remark: you can also replace this button with your custom button, perhaps replace the text by an icon etc.
 

Solution 3: Toggle button with text 'Play/Pause'

This button can be found on the third/fourth slide. This time I used a blank image button BtPlayOrPause1/BtPlayOrPause2 (one ID per slide), accompanied by two Text Captions: TCPause1 & TCPlay1 for slide 3, TCPause2 & TCPlay2 for slide 3. I need again a conditional advanced action, but reusing it will force you to make duplicates because object ID's are used in the action. In the Gallery you'll find screenshots for the action PlayOrPauseBt1 that is activated by the first toggle on slide 3. 
 
IF:     rdcmndPause is equal to 0
If this is the case, the movie is playing

THEN:    
Assign rdcmndPause with 1         the movie will be paused
Hide TCPause1                                 the text Pause will be hidden
Show TCPlay1                                  text Play will be visible
ELSE:    
Assign rdcmndResume with 1     the movie will resume playing
Hide TCPlay1
Show TCPause1

Conclusion

If you want me to create a template with the advanced actions, post a comment. These actions are pretty simple, only the labeling and editing part if you use them a lot in a project are bothersome. One of my secret hopes is that in a future version of CP it will be possible to insert interactive objects on a master slide and the issue with the unique ID's will be solved.

29 responses
Is there a way to have the play/pause button on more than one slide? When I try and copy it to another slide, the "Item Name" is changed and will not allow me to call it the same name as the button on the other slide. Thanks for your help.
I tried to explain that for solution 1 and 3 you'll have to duplicate the advanced action for each slide, because the ID of the buttons (sol. 1/) and the Text Captions (sol.3) change for each slide. That is what I complain about in my conclusion: each object in Captivate has one unique ID. Look at the two last screenshots: watch the labels for the Text Captions: TcPause1 and TcPlay1. For slide 4, where I use a similar advanced action PlayOrPauseBt2 (duplicate of the first) I had to edit, the Text Captions were labeled TcPause2 and TcPlay2. I try to choose labels that are easily recognized and makes editing smoothly.
I understand. It seems the only way to get around this issue is to create a custom button widget that could be placed on a master slide... Do you think it is possible to create a play/pause custom button widget?
I tried to explain in the text (and read my wish in the conclusion, please). Indeed, for solution 1 (ID buttons) and 3 (ID Text Captions) you need an advanced action for each slide where you want to have the Pause/Play button. As an example watch the two last screenshots about solution 3. I posted them for slide 3, the action PlayOrPauseBt1. On this slide 3 the text captions are labeled TcPause1 and TcPlay1. For slide 4 that uses the same solution, I had to duplicate the action, labeled the duplicate PlayOrPauseBt2, and the difference is the ID of the Text Captions, TcPause2/TcPlay2. I always try to have labels that are easily read, and edited in the actions.
Sorry, seems I commented twice. Perhaps it could be done with a widget, but it will have to be a static widget, because you are not able to insert interactive widgets on the master slide. Captivate comes with a static button widget, but it cannot execute an advanced action.
Thank you for the information! You have posted some incredible information about Captivate, keep up the great work!!
Thanks so much Lilybiri. Great stuff, really appreciate it.

Regards
Amanda

Lieve,

Thanks, this is exactly what I have been looking for. Is there a way to do this with volume buttons as well? I am trying to create a button that will allow me to increase or decrease the volume in a project and I am not having good luck with it at all. Any thoughts?

Scott

Scott, that is something different, because it is not on/off like with play/pause. Did you try the VolumeControl widget that is included with Captivate? There is a system variable cpCmndVolume but you have to offer it a 'number'. Or do you want to increase/decrease with a fixed amount? That should be possible with advanced actions and the variable.
Lilybiri - Last week I found your tips and immediately created and test solution 2. It worked great in the practice module (which I deleted because it was only a practice module). Today I begun work on my next project and started by building the Play/Pause button. The PAUSE worked just fine but reselecting the button would not resume the play of the slide; it stayed PAUSED. I tested this feature in preview mode as well as in a Published version but still encounter the same condition. Can you give any suggestions on what might cause the resume to not work? (I'm especially surprised since it worked last week.)
Bit difficult to see what could be the cause, have no crystal ball. Can you insert a text caption with the two system variables rdcmndPause (you have to type it between $$, is not available in the dropdown list for the variables you insert with X). It has no sense to insert rdcmndResume, since it never always shows the value 0. But rdcmndPause should change between 0 and 1 when you click the button.
I'm sorry, I wasn't able to follow your directions. I went to the Advanced Actions where I built the Play/Pause code, but I couldn't figure out how to code for a display from the available set of Actions. I tried using SHOW but could only select from a list of objects rather than a literal. So then I go out of that area and tried INSERT > STANDARD OBJECTS > TEXT CAPTION and then entered $rdcmndPause$ but that is exactly what displayed rather than the value of the variable. Can you specify where/how I tell Captivate to display the value of the variable? I assume it should be within the Advanced Actions as an additional command in the ACTIONS and ELSE sections but can't figure out how. Thanks so much!
Sorry, thought you did know how variables have to be inserted. Normally I do advice to use the X button in the Format accordion of the Text Caption's Properties panel, but this system variable is not available there. You need to put two $$ before and after, so it has to be $$rdcmndPause$$ When previewing or after publishing you'll see the value of the variable.
(Sorry for the long absence in response). First, thank you for the explanation on displaying a variable. This has been VERY helpful! Second, the values indicated it was all being done correctly but still wasn't working. So I deleted the first version of the code and simply recreated it. This time it worked just fine. Something must have corrupted the original Advanced Action code. Thank you for your blog and all the assistance you provide!
Using Captivate 5.5, I had the same experience as ddlush. Created the action for Solution 2, assigned it, video would pause, but not play again. Recreated the action, this time it worked.
I discovered this looking for a way to pause and start a presentation... I seem to be doing something wrong. I'm assuming the variables rdCmndPlay and rdCmndPause are set to 0? Then the buttons are called PlayBtn and PauseBtn... Yes? So is the advanced action running on the buttons, or slide intro or what? I'm not getting "pause" when pressing the buttons although they are appearing and disappearing... Hmmm
@Dan This post is almost 4 years old, was written for version 5.5. The mentioned system variables, starting with 'rd' are no longer available, they are replaced by 'cp' versions. Latest table with system variables can be downloaded from: http://blog.lilybiri.com/system-variables-in-ca... The other questions are clearly explained in the blog post. If you are a newbie to advanced actions, maybe you have to take a training or explore more blog posts like this one, which is totally free!
Thanks for your response… I did actually get it to work by using the new system variables (cpcmndPause etc.) but as you mentioned it would require creating a custom script for every slide??? WTF! That’s ridiculous… I guess that’s why they created the toolbar? Not happy with a lot of the limitations in Captivate but it’s cheaper than Articulate. Thanks!
Do not jump to conclusions, please, based on such an old article. Since Captivate 6 I'm using Shape buttons, which can be timed for the rest of the project or put on Master slides. And in Captivate 8 I will use Shared actions, not Advanced actions in order to make those actions reusable. Maybe you should first read more recent posts. After all, I'm not creating a complete manual, just offering you free tutorials for lot of use cases. And IMHO Capitvate may be cheaper but it is a lot more versatile than StoryLine which has not even a Library and relies a lot more on copy/paste. And I forget the integration of Captivate with other Adobe applications.
I'm using shape buttons also... So these buttons can be placed on a master page... or used as shared actions in Captivate 8? I'll investigate that but not a lot of information out there on Advanced/Shared actions... My complaints with Captivate are more related to text handling and objects moving and retiming events on the timeline. I have taken all the training on Lynda.com for Captivate and viewed many tutorials but still find scripting to be vague and confusing... I have some experience with action script as well. Thanks for the tips as I've viewed your comments on the Adobe Captivate forums as well as Rod's. Cheers!
http://blog.lilybiri.com/why-i-like-shape-butto... and http://blog.lilybiri.com/toggle-shape-buttons explain how you can use shape buttons. I have another article about shape buttons on question/score slides. Shared actions are reusable advanced actions that are stored in the Library (like images, clips...). You can define parameters. Have several articles about them. And I'm using an all round library with often used scripts that I can transfer in any project. The point-and-click advanced/shared actions are relying on the same logic as most programming languages, but lack more advanced features (arrays, functions to mention some). I don't understand why you call them 'confusing' since you know Actionscript. And to me, and I'm using Lynda.com daily, the Captivate courses are very basic and bit disappointing compared with the other courses. A lot is lacking and they fail totally to explain good practice.
I am having a weird issue where the button will only function (version 2) if it is quickly double-clicked or on the 3rd click with a liberal pause between clicks. Have double and triple checked logic. Even recreated the button with Pause and Continue actions still same result.
Pretty old post, which version do you use?
Hi! I am using the latest version of Captivate 9.
Post your question in the eLearning Community or in the Adobe forums. I suspect you have multiple pauses on the slide. I just published a sequence of articles about Timeline and pausing, you could check them as well.
Nice idea to custom play pause button. But when we continuously click play and pause toggle button. it jumps to the next slide, which I don't want. I have another button to go to next slide. can we restrict the play/pause button not to jump on next slide? thanks, vimal
Please come to the Captivate forums to explain the problem. There must be a conflict with the other interactive object.
2 visitors upvoted this post.