Skip to main content
Ajoten
Participating Frequently
December 19, 2017
Answered

A different action for a different state - is this possible?

  • December 19, 2017
  • 3 replies
  • 1000 views

On a launch page I have buttons with 3 states (Unavailable, Play, Replay). I want to assign the action "No Action" to the first state - the others simply jump to the same slide.

Is this possible?

Andrew.

    This topic has been closed for replies.
    Correct answer Lilybiri

    @Lilybiri, I will definitely investigate the Enable/Disable method. My fear was that as I could see no "Retain enabled-ness" type option, returning to the home page would reset the button to No Action.

    I have to admit I could find no guidance anywhere in the official help on using the Enable action, so aren't sure exactly what it does.


    I have examples on my blog site.

    Here is a possible work flow, hope I understood the result you want.

    You have sequence imposed. That means you'll need to create only one variable to track. I will label that var v_counter. Give it a default value of 0, it will be incremented On Enter for the menu slide. I am not sure which version you use, so screenshots will not be possible because the Advanced Actions dialog box changed in CP2017. Create a user variable for each button: v_one, v_two...... which will be Boolean. Default value = 0. This will be toggled to 1 when a button is clicked.

    Create the states for the buttons on the menu slide. When the buttion is disabled, the Rollover and Down InBuilt states will not appear, neither will the hand cursor. Be sure to check the option 'Retain State'.  Personally I would keep the Normal state as 'Unavailable state', will make it easier. If the button is disabled, that 'Normal' state will be the one that appears.

    Create a conditional advanced action with as many decisions as you have buttons + 1 decision, the first, that will always be executed. It assigns the value 1 to the associated user variable (like v_one) and calculates v_counter by summng all the other user variables. If only the first button has been clicked, any number of times, the counter will always remain = 1.

    The other decisions are conditional, checking the variable and based on its value will enable buttons, and change state for newly enabled button to 'Play'. The buttons themselves will only have the Jump command. The Return button at the end of each part can change the state of the just used button to 'Replay'.

    Hope this makes sense.

    3 replies

    Ajoten
    AjotenAuthor
    Participating Frequently
    December 20, 2017

    I was trying to keep my question as simple as possible to avoid complex answers but I shall expand a bit.

    We have a launch page with 4 buttons/4 parts of the training that need to be done in order. I want to "enable" the next one after the previous has been finished. Hence my potentially elegant solution was...

    1. At the very start of the training, buttons for parts 2, 3 and 4 are in a state where "On success" = "No Action".
    2. When a "Return to menu" button is clicked at the end of part 1, button 2 changes to a state in which "On success" = "Jump to slide". And so on.
    3. At any stage the user can return to the menu and replay anything that has been completed due to the "Retain state on revisit" option being selected.

    Sounds like it can't be done.

    Ajoten
    AjotenAuthor
    Participating Frequently
    December 20, 2017

    Sorry, a bit more re step #2 above...

    Click "Return" at end of part 1 results in

    Button 2 > state changes to "Play" (jump to slide) AND

    Button 1 > state changes to "Replay" (jump to slide)

    Lilybiri
    Legend
    December 20, 2017

    Why just not disable/enable the buttons instead of 'No action'? If I understand the setup correctly, that would be a lot easier.  Sorry, byt I love the KISS principle, why make it complicated when it can be so easy.  At least if you allow me to push you at looking at another work flow than the one you are fixed on?

    Jeremy Shimmerman
    Participating Frequently
    December 19, 2017

    What determines how the different states triggered? In other words, what would make the state 'unavailable' vs 'play'?

    Lilybiri
    Legend
    December 19, 2017

    I'm not a native English speaker, don't understand your last question. You created custom states. Those states can only be made visible with an action 'Change State', because they are not InBuilt states which react to a different situation.  When you change the state you can change the variable, and then add conditions based on the value of the var, to do what you want.

    Jeremy Shimmerman
    Participating Frequently
    December 19, 2017

    I might have accidentally hit reply to your answer instead of the OP. I meant to post the question to the OP.  

    I wanted to know what determines the different states of the button.  That way you can create a variable that will change what action is executed.  

    Lilybiri
    Legend
    December 19, 2017

    You cannot attach an action to a state, it is always attached to the Success event of that button.

    You will hae to get to the show/hide workflow, this is not possible with multistate objects.

    Ir you have to use variables, to track the state which is active and create a conditional action that executes a command based on the value of that tracking variable.That way you have only one action triggered by the Success event of the button.