Skip to main content
Known Participant
March 21, 2011
Question

using javascript to show/hide buttons

  • March 21, 2011
  • 1 reply
  • 2492 views

I need to show a hidden button on a slide, but I need to do it from within a javascript that is being called.  Does anyone know how to do this?  I know there are functions you can use to get/set variables (cpEIGetValue) but I don't know how to access &/or manipulate objects...

Help?

Thanks - Monica

This topic has been closed for replies.

1 reply

Legend
March 22, 2011

Hi Monica,

As far as I know, this is not possible out of the box.  You can do some amazing things with JavaScript as Philip Hutchison's amazing Captivate Controller demonstrates:

http://pipwerks.com/laboratory/adobe-captivate/ <--very awesome utility!!!

But showing/hiding buttons is not one of them.  I'm curious as to why this has to be done via JavaScript.  Can you explain your situation a bit and maybe the community can help find an alternative solution that will work just as well.

Thanks,

Jim Leichliter

monicatlAuthor
Known Participant
March 22, 2011

Dang.  I was hoping it was something simple!

What I'm trying to do is I have a slide where there are two options available to the user.  These options are visible buttons that each call a different javascript to launch two separate html files (one for each button).

I don't want the user to progress beyond this slide until they have launched option B.  if they launch option A, then they need to stay on the slide until they launch option B.  I don't care if they launch option A or not... they just can't progress w/o viewing option B.  So I have a hidden third button that I want to make visible once they have invoked option B.  All the hidden third button does is it lets them continue to the next slide.  I don't want to automatically move to the next slide in case they want to invoke option A or B a second (or 3rd or 4th..etc) time....

I have tried using an Advanced action attached to my option B button that invokes two items - 1) Show hidden3rdbutton and then 2)Execute javascript to launch the html... but this doesn't work! The button never displays.  I thought since the javascript was running anyways, then I could just put some code in there to display the hidden button before the html is launched.

Am I overly complicating things?  Or does this sound doable?

Thanks in advance for any help!

Monica

RodWard
Community Expert
Community Expert
March 22, 2011

Trying to get buttons to appear inside Captivate using JavaScript is not the way to go. The JavaScript is outside the SWF file.  What you really need is to control all of this as much as possible inside the SWF.

It should be possible to do what you want just with Advanced Actions. If it hasn't been successful so far, most likely you have an error in the way you've set up the actions.

First go back and get your script working so that it just displays the hidden third button.  Then try to add calling the HTML file.

Why do you need to launch HTML files?  Is the information they contain not possible to include inside the SWF?