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

Advanced Action: button hiding images (conditional action)

New Here ,
Jan 30, 2017 Jan 30, 2017

Using Adobe Captivate 9

MAC El Capitan OS

I need help in writing  my advance action  as I am trying to build an e-learning course wherein the student has to go through images as reference before filling out a form . There are 5 buttons in total each would be displaying a different image and NO limit as to how many times the user can click it to see the image.

I would like for the button to hide the other   i m a g es once the user clicks the other button. I have come across a  tutorial from Lynda which gives me half of what I need but doesn't hide the images.

I have already tried to use
Here's what I've done so far:
I have created a variable with the literal val ue             of FalseScreen Shot 2017-01-09 at 3.34.23 PM Screen Shot 2017-01-26 at 5.15.58 PM

I have tried to add hide image on the If actions but found that it doesn't work totally unless double clicked. Please help me rewrite my advance action, as I am very new to Captivate and have little to no experience in programming. Thank you!

273
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 , Jan 30, 2017 Jan 30, 2017

First tip: use the Preview button in the top right control panel (looks like a Play button) to see the complete conditional action, including all decisions. No need to take two screenshots, one for THEN and one for ELSE.

I always prefer to use 0 or 1 for a Boolean variable, false and true work but more to be typed.

Your question is not very clear to me. First you tell that you allow to click as many times on each button as wished, later on that you want to hide the button? I presume this is a typo

...
Translate
Community Expert ,
Jan 30, 2017 Jan 30, 2017

First tip: use the Preview button in the top right control panel (looks like a Play button) to see the complete conditional action, including all decisions. No need to take two screenshots, one for THEN and one for ELSE.

I always prefer to use 0 or 1 for a Boolean variable, false and true work but more to be typed.

Your question is not very clear to me. First you tell that you allow to click as many times on each button as wished, later on that you want to hide the button? I presume this is a typo and that you don't want the already shown images to remain visible when a new image is shown? In that case your approach will not work, you don't have to use a visibility variable (can be used for a toggle button, have a look at my blog post 1 action = 5 Toggle Buttons - Captivate blog ).

Just to show an image out of several, you don't even need a conditional action. Group all the images, and use this action:

  HIde Gr_Image

  Show ImageA

  Assign v_one with 1

I added the third command, if you answer positive on my second question, because in that case you'll need a Boolean variable to track i a button has already been clicked, in this example te first button, tracking variable is v_one, image to be shown is ImageA.

   

Second question: What do you want to happen when all buttons have been clicked? A Next button to appear, or to open a 'forms', or to go to another slide? In all these cases you'll need a conditional action with two decisions, where the first decision will have the commands I just showed, always executed because of the condition:

First decision 'Always'

   IF 1 is equal to 1

                     HIde Gr_Image

                    Show ImageA

                      Assign v_one with 1

Second decision checks if all variables have the value 1

    IF v_one is equal to 1   AND

        v_two is equal to 1   AND

         ......

   Show Bt_Next

   Enable Bt_Next

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
New Here ,
Feb 01, 2017 Feb 01, 2017

thank you very much, truly  you are an asset to the captivate community.

that was my missing link all along -- to group the images together

I however would be doing this for 30 slides, each containing 6 images to show and hide, I was wondering if I could reuse my variables or have a more sustainable way of doing this instead.

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 ,
Feb 01, 2017 Feb 01, 2017
LATEST

You cannot use a shared action in this case because the variable 'v_xxx' is used in both decisions.

However it is perfectly possible to reuse the variables! You'll have to reset them to 0, and this can be done using the On Enter event of the slide:

   Assign v_one with 0

  Assign v_two with 0

.....

Apply that standard action to the On Enter event for all slides where you want to use the work flow. It is not important to have exactly 6 images, can be used also on slides with less images.

Grouping is underestimated, I was really very happy when that feature appeared in CP6. This was a video I created to celebrate it:

Advanced Actions in Captivate 6 - YouTube

I show how much time can be saved compared with previous versions.

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