Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Enabling/Disabling Sound (Cap 9)?

Guest
May 22, 2016 May 22, 2016

Hello,

I know sound can be turned off once in the settings, but I would like an advanced action/javascript version for it.

At the moment, I have a square, which is situated below a tick, and I'd like it when the tick is pressed, it hides (I already do that) and disables the click sounds. Then, when the empty square is clicked, the tick shows again (I already do this) and turns the click sound back on.

http://i.imgur.com/jkdvvzW.png

If you know any methods which allow me to do this multiple times in the project with just these two objects, please teach me.

Thank you in advance.

642
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 22, 2016 May 22, 2016

You can only mute all audio by advanced/shared actions, not just the click sounds. Muting happens by toggling the system variable cpCmndMute, which is a Boolean.

I blogged about shared actions for toggle buttons: 1 action = 5 Toggle Buttons - Captivate blog

You could use that action, and add the command to hide/show the tick. I have no idea how you realize it at this moment: with hide/show or with states? 

Translate
Community Expert ,
May 22, 2016 May 22, 2016

You can only mute all audio by advanced/shared actions, not just the click sounds. Muting happens by toggling the system variable cpCmndMute, which is a Boolean.

I blogged about shared actions for toggle buttons: 1 action = 5 Toggle Buttons - Captivate blog

You could use that action, and add the command to hide/show the tick. I have no idea how you realize it at this moment: with hide/show or with states? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 22, 2016 May 22, 2016

Thank you. I've got it working now.

I'm not sure what you meant with your last sentence.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2016 May 22, 2016

How do you show/hide the tick? It can be done in multiple ways, and you'll have to integrate the mute command (toggling) in the action that you use to do it. Since you are on CP9, I would recommend to use states, but maybe you have preferred the old Hide/Show method?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 22, 2016 May 22, 2016

I simply did it with javascript:

window.cpCmndMute = 1; //turn sound off

window.cp.show('SoundToggle2');

window.cp.hide('Tick');

window.cp.hide('SoundToggle1');

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2016 May 22, 2016

Would have been easier with states and shared actions. Because you could

use the same shared action everywhere, using parameter. Up to you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 24, 2016 Jul 24, 2016

Thanks for this solution.
One additional question, I cannot seem to find the option to mute the click sound when I use a smartshape as the button to mute the whole audio with an advanced action.

I can deselect "allow mouse click" which gets rid of the clicking sound and access it by using a keyboard short cut. But I would like to be able to click on it too.

Sorry for the trivial question...!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 24, 2016 Jul 24, 2016

Click.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 24, 2016 Jul 24, 2016

Thanks! Once again I look a fool for not scrolling down far enough.

Well, live and learn...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 24, 2016 Jul 24, 2016
LATEST

No problem, Captivate has perhaps too many features?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources