using javascript to show/hide buttons
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Rodward,
I took your advice & went back to the basics... I modified my Advanced Action to just display my hidden button & it worked perfectly. I then added a second action to invoke my javascript right after my Show button. Both items worked like a charm! I had my displayed button & then my javascript calling my html!
The frustrating thing is that I could have sworn that I tried this option first!!
I knew that there was a simple solution...
thanks for the help!
Monica
Copy link to clipboard
Copied
Hello,
I'm sure this could work with advanced actions
Since I have been blogging and writing a lot about advanced actions, perhaps I could help to debug? If this is acceptable to you, I will have a look at your actions, and try to understand what you want to realize. What do you think?
Here is a link to my blog, just to prove my credibility:
Lilybiri
Copy link to clipboard
Copied
Lilybiri,
Thanks so much for your offer of help! I have indeed already discovered your blog & have been following a bunch of your pointers... thanks so much for all that help!
I was able to solve my issue of displaying my hidden button. And you are right... I was able to do it easily w/an advanced action. The frustrating thing is that I thought I tried that first! But I'm attempting to solve several problems at once & I'm sure that I'm not working my issues through in a systematic manner...
I'm sure you'll be hearing from me again...
Monica

