Skip to main content
IndyMediaArtists
Participant
November 19, 2010
Question

Getting user variables to persist?

  • November 19, 2010
  • 1 reply
  • 291 views

Hi:

I am creating a Captivate presentation, where one the first slide, a user selects either a red, green or blue car button.  I would like whatever car color they choose to persist and be available on every slide and the other cars be hidden.

For example, if you click the blue car button on slide 1, then on slide 2, 3, 4.... you will see the blue car image.

Slides:

1 - I have created the variable carcolor and assigned a value of 0.

2 - Three image buttons (with cars as images) on this slide :  redcarbtn, greencarbtn and bluecarbtn.  When a user clicks a car, a new value is assigned for carcolor.  redcarbtn = 1, greencarbtn = 2 and bluecarbtn = 3.

I created an advanced action called determinecarcolor.  This advanced action has a condition express using decisions:

If carcolor=1, then show redcarimage.  Else, hide redcarimage.

If carcolor=2, then show greencarimage.  Else, hide greencarimage.

If carcolor=1, then show bluecarimage.  Else, hide bluecarimage.

On exit, determinecarcolor is executed.

redcarimage is an image of a red car, greencarimage is an image of a green car and bluecarimage is an image of a blue car.

3 - I have redcarimage, greencarimage and bluecarimage stacked on top of each other.

4 - I have redcarimage, greencarimage and bluecarimage stacked on top of each other.

5 - I have redcarimage, greencarimage and bluecarimage stacked on top of each other.

and so on....

PROBLEM:  The above works but on slide 3, 4, 5...  all of the cars appear.  It should just be the car they selected on slide 2.

Help!

Peace,

Loren

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    November 19, 2010

    Hello and welcome to the forum,

    It is a pity that you do not tell which version of Captivate you are using. I will describe the solution for Captivate 5.

    I was planning to write a blog posting about hiding/showing objects with advanced actions, perhaps I could use your project as an example.

    First a question: are those cars always on the same location on the slide, or do you have different car images on different slides?

    Think your issue is due to the fact that each object has its unique ID. So, even if it is the same car image on slides 2, 3, 4 they do have different ID's and your advanced action should be adapted to hide/show using the changed ID.

    If the cars are always in the same location on the slide, this can be solved this way:

    • create the cars on slide 1: labeled green, red, blue  (I'm always using short names, sorry) and make their timing 'for the rest of the project';
    • put click boxes on top of them CB_green, CB_red, CB_blue or you can also work with your buttons as you described
    • define the user variable v_color
    • if the user clicks on CB_green or on the button assign the value as you described so well
    • create an advanced conditional action with 3 decisions:
      • if v_color = 1
          hide green
          hide blue
      • if v_color = 2
          hide red
          hide blue
      • if v_color = 3
          hide red
          hide green
    • assign this action on entering slide 2: only one car will be visible from this slide on. The trick is that you can hide an object on a slide where it is not really on (here slide 2) if this object is timed for the rest of the project. But you can never show an object on a slide where it is not really situated. So you can only show the cars in the first slide, but if they are timed for the rest of the project you can hide them on slide 2 or slide 3 or... Once the object is hidden you will not be able to show it again, unless you return to slide 1 where the object really 'sits'.

    This is a rather long explanation, please let me know if it is clear enough. Will try to post it on my blog with a couple of examples.

    Lilybiri