Skip to main content
Inspiring
March 7, 2013
Answered

Trouble with resetting toggle buttons that Show/Hide captions

  • March 7, 2013
  • 1 reply
  • 2324 views

I have a problem with resetting the toggle buttons I use to show/hide a number of captions on a single slide. The toggle works great on the first button when I click it on and off to show or hide a caption. One click on, and the caption shows. One click off, and the caption disappears. However, if I leave a caption displayed and click on other buttons to show/hide other captions, they don't display or hide on just one click. They require two clicks. It appears something is holding up the playhead after the first toggle button is used until there's a second click. The same thing happens if I have a reset action On Enter. If I click on a caption and leave it up and move on to another slide, it does disappear when I re-enter that initial slide. However, it requires two clicks, not one, to display the caption. I find that extremely strange; I have learned most of my techniques from Lilybiri's blog, but this problem doesn't happen on her examples. I believe I am missing something obvious, but can't figure out what it is. Any assistance is great appreciated.

This topic has been closed for replies.
Correct answer globosonic

Are you using CP6? Perhaps it is mentioned somewhere but cannot find it immediately.

Bit worried about your sentence '. but if I can get this work, I would have many opportunities to re-use'. You cannot easily use advanced actions in other files, no import/export for the moment at all. The only way is to save the file as a template and use that template to create future files.

Since you do not need my third scenario, but want the user to keep everything open, this makes it already bit easier, but you'll certainly need a variable/button on a slide. You can reuse those variables on other slides.

In your use case there is certainly a need to do serious planning to avoid too many variables, scripts etc. Having blogged several times about that kind of planning. Some links:

http://lilybiri.posterous.com/beat-the-system-save-time-creating-advanced-a

http://lilybiri.posterous.com/link-score-to-attempts-in-custom-questions

To reset things when re-entering the page I would recommend to group all texts that have to be toggled in one group (if you use CP6), so that the On Enter action can be reduced to 'Hide Grp...'. Of course if those texts are different on each slide, you'll have a different group and will have to create such an On Enter action for each slide. But only one statement instead of a whole bunch saves already a lot of time.

http://www.youtube.com/watch?v=Sy09xPoP69A

If you want me to have a look, you can send a Private message,

Lilybiri


Yes, I am using Cp6. What I meant about re-using is that I have many different scenarios where a similar script could be used, so your suggestion of a template is a good one. My initial intention was to write it out in a ,txt file for reference. Thanks so much for the links and all your suggestions. I'll keep you posted.

1 reply

Lilybiri
Brainiac
March 7, 2013

You are pointing to which of my blog posts?

Could you post a screenshot of the timeline? Do the buttons all have their pausing point at exactly the same place?

Lilybiri

Inspiring
March 8, 2013

Hello Lilybiri:

Firstly, thank you so much for reviewing my question. Your feedback is highly valued by a relative newbie like myself. I am using click boxes for buttons (transparent click boxes over images). The buttons all pause at the same place. I'm sorry, but I can't recall the specific blogs I am referring to -- without doing some digging -- but in this case, I was primarily referring to the reset method of using On Enter and an Advanced Action that hides all captions. Does it make a difference that I'm using click boxes and not actual buttons for this? Many thanks in advance.

Lilybiri
Brainiac
March 9, 2013

It is very late here, think I'll have a look tomorrow. I just gave you some tips, you can take or leave...

If you use the same variable, this will not work really.

Beware: you'll end up with so much advanced actions

Lilybiri


Hello,

Trying to understand the problem, but need some more information: are the buttons showing/hiding captions or the click boxes?

Is this correct, supposing the buttons are the toggles:

  • when clicking a button first time, you want a caption to pop up; will call them button1 and text1
  • when clicking button1 a second time (before any other button has been clicked) you want text1 to hide
  • when clicking another button, button2 same scenario, but also if text1 is still visible, you want that caption to be hidden at the same time as the new caption text2 should be shown

Your work flow is OK for the first 2 situations, but not for the third one, because you are using the same variable for all buttons. If button1 has been clicked and text1 is visible, the variable v_pressed has the value 1. When clicking button2 the conditional action will see that value and thus hide text2 which has no effect, since it is already hidden, and v_pressed will be set to 0. A second click on button2 will then be necessary to show text2.

Solution: a different variable for each button, and adding Hide text... (all the text captions that are not linked with that particular button) to the statements; and set their variables to 0 as well.

Sounds very complicated, if you could explain everything in detail, maybe I could figure out an easier approach so that you'd have a lot less variables and advanced actions to create.

Lilybiri