Skip to main content
Participating Frequently
January 16, 2014
Question

Storing current slide in a variable, then using the variable to get back to that slide (Captivate 6)

  • January 16, 2014
  • 1 reply
  • 644 views

I'm thinking there must be some info on this somewhere, because it's something people must want to do, but I haven't been able to find an answer.

I would like to set something up so that when a user clicks on a button, it will take them to a certain slide. But I want the current slide stored in a variable. And then, when they are ready to go back, there will be a return button, but it should check to see where they came from and then return them to that specific slide. Basically, a "return to last slide visited" type of advanced action. I can't use the "return to last slide" option because the slide they are taken to when they first click the button has multiple slides, so the "return to last slide" option would not take them to the last slide they were on before visiting this page. I tried to store this in a variable on a button click by assigning a variable with CpInfoCurrentSlide, and then jumping to a slide. But, I'm not sure how I would then use that info to return to this slide.

This topic has been closed for replies.

1 reply

RodWard
Community Expert
Community Expert
January 16, 2014

Captivate Advanced Actions don't actually provide an easy way to do this.  It's another area we really need to address in forthcoming versions.

You need to use an On Enter Slide event to store the value of the cpInfoCurrentSlide system variable in a user variable.

Then you need to create another advanced action that can be triggered by your later button.  Somewhat counterintuitively, you need to use an Expression action (rather than an Assign action) to assign the value captured in your user variable to cpCmndGotoSlide.  But that's not all.  Due to the way Captivate's slide indexes work, you'll need to deduct one from the value of your user variable before assigning it to cpCmndGotoSlide.

Then, unless you want the slide timeline to pause, you need to add a Continue action.

The final action looks a bit like this:

Participating Frequently
January 16, 2014

Thank you for the help. So, in your example, TargetSlideNumber was the variable where the current slide info was being stored On Enter? And I could use those On Enter events only on the slides that have that button? For example, if slides 5, 9, 11, and 25 all have the button that can take you to another page, I would put the On Enter event on those pages, and store the slide info in TargetSlideNumber. Once they are done with the slides they have jumped to, they can click the return button, which will run the advanced action that runs the expression you posted, and then runs "continue" to acually move to that slide. Am I following this correctly? If so this might work. I could see it being an issue in some cases, because some slides already have some On Enter events being run.

RodWard
Community Expert
Community Expert
January 16, 2014

Rather than use the On Slide Enter event, you could set the TargetSlideNumber variable via the ON Success event of the button that is clicked to jump to the other slide.

On the other slide, the Advanced Action to jump back to the target slide contains a Continue action because otherwise the timeline would be paused once you arrived at the slide.