Skip to main content
LALumley
Known Participant
June 21, 2016
Answered

Toggle between two smart shapes with one button?

  • June 21, 2016
  • 2 replies
  • 444 views

Hello!  I am working in Captivate 8 and trying to use a single button to switch between two smartshapes.  I cant for the life of me figure out how to do this.  I know its possible to make it "show" and "hide", but is it possible to just have the user click on a button and each time it is clicked, it goes back and forth between two different smartshapes?

Im attempting to show the user the functionality on a piece of equipment when they press a button.  When they press the button, it goes back and forth between two different read outs on the screen.

Thanks in advance!

    This topic has been closed for replies.
    Correct answer Lilybiri

    Did you look at the blog post for which I posted a link: I offer 4 scenarios.

    It can also easily be done, if you have a separate (shape) button to toggle between two different objects:

    1. Create a user variable v_visib with a default value of 0
    2. Create the two objects, and make one of them visible, the other invisible in output (eye icon in its Properties panel); I will label them ShapeOne and ShapeTwo, where ShapeOne is visible at the start
    3. Create this advanced conditional action (you can also turn it into a shared action):

                   IF v_visib is equal to 0
                            Hide ShapeOne
                            Show ShapeTwo
                            Toggle v_visib
                   ELSE

                             Hide ShapeTwo

                            Show ShapeOne

                            Toggle v_visib

       4. Assign this action to the Success event of the button

    2 replies

    Lilybiri
    Legend
    June 21, 2016
    RodWard
    Community Expert
    Community Expert
    June 21, 2016

    Yes.  You need to have the button execute a Conditional Action that toggles the value of a user variable and then uses that user variable in a condition to decide which shape gets shown or hidden.

    LALumley
    LALumleyAuthor
    Known Participant
    June 21, 2016

    Ya lost me!  haha.  Are there any examples of this being done that you know of?

    Lilybiri
    LilybiriCorrect answer
    Legend
    June 21, 2016

    Did you look at the blog post for which I posted a link: I offer 4 scenarios.

    It can also easily be done, if you have a separate (shape) button to toggle between two different objects:

    1. Create a user variable v_visib with a default value of 0
    2. Create the two objects, and make one of them visible, the other invisible in output (eye icon in its Properties panel); I will label them ShapeOne and ShapeTwo, where ShapeOne is visible at the start
    3. Create this advanced conditional action (you can also turn it into a shared action):

                   IF v_visib is equal to 0
                            Hide ShapeOne
                            Show ShapeTwo
                            Toggle v_visib
                   ELSE

                             Hide ShapeTwo

                            Show ShapeOne

                            Toggle v_visib

       4. Assign this action to the Success event of the button