Skip to main content
jasona92196440
Known Participant
January 11, 2017
Answered

Multi-State objects advanced actions and adding up clicks

  • January 11, 2017
  • 1 reply
  • 209 views

Morning all

I am normally pretty good at advanced actions but am failing at this help please!

One multi state object. Inside it are 5 different states each with text on. One button with conditional action linked to. One hidden Reference box. One Var to count clicks

Click button advance action works like this. var greater or equal to 0 / Expression add 1 to var / Change state to state 1.   Next part of conditional action says var greater or equal to 1 Expression add 1 to var / Change state to state 2. and so on until the var reaches 5 then hidden ref is shown.

My issue there is no Move to Next State facility in the advance actions so how do i callcullate up each click to move through states. At the momentit pings straight to one state then stays there. I know i could just turn different text boxes on and off but this would be neater.

Thanks Jason

    This topic has been closed for replies.
    Correct answer Lilybiri

    Can you post a screenshot of the advanced action?

    I suspect you forgot that all decisions in a conditional action are always executed. With your setup, the result will be that only the last decision will be done because you are incrementing the counter. A similar 'logical bug' led to the creation of this article:

    Blog after Posterous? - ClickClick - Captivate blog

    Trying to explain:

    • first decision results in True for the condition, commands are executed but include the Increment command (no need for an Expression anymore since a couple of versions)
    • second decision now results in True, so those commands will override the first commands, you increment again which leads to
    • third decision is True, .....etc

    Solution (one of many):

      Take "Increment v_counter" out of the decision by creation of a first decision that is a mimicked standard action: (or a last decision would be OK as well)

            IF 1 is equal to 1

                 Increment v_counter

    Now you can keep the other decisions, maybe you have to edit the literal for each decision. Do take out the Increment command, please.

    1 reply

    Lilybiri
    LilybiriCorrect answer
    Legend
    January 11, 2017

    Can you post a screenshot of the advanced action?

    I suspect you forgot that all decisions in a conditional action are always executed. With your setup, the result will be that only the last decision will be done because you are incrementing the counter. A similar 'logical bug' led to the creation of this article:

    Blog after Posterous? - ClickClick - Captivate blog

    Trying to explain:

    • first decision results in True for the condition, commands are executed but include the Increment command (no need for an Expression anymore since a couple of versions)
    • second decision now results in True, so those commands will override the first commands, you increment again which leads to
    • third decision is True, .....etc

    Solution (one of many):

      Take "Increment v_counter" out of the decision by creation of a first decision that is a mimicked standard action: (or a last decision would be OK as well)

            IF 1 is equal to 1

                 Increment v_counter

    Now you can keep the other decisions, maybe you have to edit the literal for each decision. Do take out the Increment command, please.

    jasona92196440
    Known Participant
    January 11, 2017

    Sorry for late response oh great one, I was actually at yoga (modern man).

    Fantastic, works a treat. All those expressions I've wasted, and I thought I was being clever.

    Thanks again

    Ninja Skills