6 Replies Latest reply: Sep 12, 2013 10:25 PM by rygaar RSS

    Combining Advanced Actions in CP6

    rygaar Community Member

      This seems so simple I'm almost embarassed to post.

      1) is there a way to use [if, elseif, elseif, else] structure in conditional actions?

      2) Is there a way to call several advanced actions from one trigger (eg. on Entering a slide)?

      3) Is there a way for an advanced action to call other advanced actions?

       

      What I'm trying to accomplish:

       

      At end of quiz, show a scoring scale (several text captions) and automatically highlight the portion of the scale that corresponds to how well the user did. Suppose the user scored a 3.  The scale could have 3 captions: caption1 = [0-2: below average], caption2 = [3-4: average], caption3 = [5-6: above average].  All users see the same 3 captions, but the appropriate caption should be highlighted (I set its Alpha to 100%, and the other captions to 50%).

       

      What I have tried:

      1) to build a conditional action: if score > 4 then highlight caption3, elseif score > 3 then highlight caption2, else highlight caption1. Unfortunately I don't see a way to use the elseif construct.

       

      2) create 3 distinct conditional advanced actions and call all of them on entering a slide: (A) if 5 <= score <= 6, then highlight caption3 only. (B) if 3 <= score <= 4, then highlight caption2 only. (C) if 0 <= score <= 2, then highlight caption1 only.  Unfortunately I cannot figure out how to call all advanced actions when the user enters the slide

       

      3) create a standard advanced action that will call the 3 conditional actions above in sequence. Unfortunately I don't see a way to call advanced actions from within an advanced action.

       

      The objective seems so simple, but I'm at a loss as to how to accomplish it. Help please.

        • 1. Re: Combining Advanced Actions in CP6
          Lilybiri CommunityMVP

          Hello,

           

          The work flow in the conditional advanced actions is a bit different from normal progamming languages. You have the possibility to create And/OR conditions, and to have a sequence of Decisions (the Untitled buttons at the top) with different conditions in each decision. But you have to know that Captivate will always evaluate all the decisions, and in sequence. So I mostly recommend for complicated situations to make a flow chart with the logic before creating the action.

           

          No, you can use only one action per trigger. But it is possible to combine all in one conditional action. To mimick a standard action, you use a condition that is always fulfilled like "If 1 is equal to 1"

           

          It is not possible to call an advanced action from another action, no subroutines. There are also no loops, no arrays.

           

          I have lot of examples on my blog for use cases of advanced actions: http://blog.lilybiri.com

           

          Your example is pretty easy:

          Decision 1 "Excellent"       

               IF cpQuizInfoPointsscored is greater or equal to 5

                             Apply Effect .....      to the appropriate shape

           

          Decision 2 "Average"

               IF cpQuizInfoPointsscored is greater or equal to 3    AND

                  cpQuizInfoPointsscored is less than 5

                             Apply Effect .....      to the appropriate shape

           

          Decision 3 "Low"

             

          IF cpQuizInfoPointsscored is less than 3

                              Apply Effect .....      to the appropriate shape

          • 2. Re: Combining Advanced Actions in CP6
            rygaar Community Member

            Thanks Lilybiri!

            • 3. Re: Combining Advanced Actions in CP6
              Lilybiri CommunityMVP

              Did you try it out? More questions?

              • 4. Re: Combining Advanced Actions in CP6
                rygaar Community Member

                Yes it worked, that's why I got so excited.

                 

                I have a lot of questions but I like to try figuring stuff out on my own first, so as not to spam the forums. One particularly tricky problem is that I can't figure out how to change the z-index (layer order) of an object from a Master slide. For instance if I have a smartshape on the master slide, and I would like it to appear above certain objects but under other objects on the regular slides, I get stuck (since the master slide object does not show up on the timeline for regular slides).  If I can't figure it out, maybe I'll start a new thread about it.

                 

                Thanks again for your help; I knew there had to be an easy solution to the if--elseif--else structure because otherwise the advanced action scripts would be too limiting. As a bonus, you told me how to combine standard and conditional actions in the same script.

                • 5. Re: Combining Advanced Actions in CP6
                  RodWard CommunityMVP

                  Any objects you add to Master slides can be set to appear on top of the objects on the slides to which the master is attached, or they will be underneath as a background, but you cannot have some objects on the master do one thing and other objects do another.  Think of the master slide objects as either being in the background or the foreground but not both.

                  • 6. Re: Combining Advanced Actions in CP6
                    rygaar Community Member

                    Thank you RodWard.