Skip to main content
Known Participant
February 2, 2015
Answered

Executing more than one advanced actions?

  • February 2, 2015
  • 12 replies
  • 1505 views

I am wondering if there is a way for an object or page to execute more than one advanced action, or have an advanced action script call another script (I.e., nested scripts).

For example, let's say I have an advanced action called "Close_all" that hides all the objects on the page. When the user clicks button A, it executes Close_All.

Now I add button B that has to do something else (e.g., show a different object) in addition to performing the same function as Close_All.

Is there a way I can execute Close_All in the advanced action script for button B without having to duplicate the Close_All script?

I don't want to have to create a copy of Close_All because if I have to change anything in that script, I would also have to remember to make the same change in all copies.

This topic has been closed for replies.
Correct answer Lilybiri

The condition is in the condition part, the possible actions are in the THEN and the ELSE part. And with a combination of several decisions, which are always evaluated in sequence. In your case you have a sequence (script A) that has to be executed independent of the condition, in that case you put it in a mimicked standard action:

First decision 'Checkit'

IF page = X

   Jump to page X

ELSE

   Continue

Second decision 'Always'

IF 1 is equal to 1

   sequence of commands you have in script A

You see, no need to repeat the actions at all (and copy/paste works very quickly if you prefer one decision)

12 replies

andresRuiz
Inspiring
March 16, 2019

Hi everybody, this is a question specially for Lilybiri​:

Lets say that I have some navigation buttons in my first slide, checked to be shown for the rest of the project. But, I have on special slide with a custom TOC. When I go to this slide, in the OnEnter event I set and Advance action to hide and disable those navigation buttons, but I have to enable them again every time I go out of this slide.

To do that, I have to add the next behaviour to each button in this custom TOC: jump to slide X / show nav buttons / enable nav buttons.

But, I have more than 10 items in the custom TOC list, so what's the fastest way to add those behaviours to all that buttons?

I tried a shared action, but I only need to parametrize the slide to jump, nevertheless, also the show and enable action becomes parametrized, so I have to complete the list over and over...

How will you approach this situation?

Thanks!

RodWard
Community Expert
Community Expert
March 16, 2019

Sometimes a better way to achieve this is to put your navigation buttons on Master Slides and have one Master that doesn't have the buttons so that you can use this as the Master for slides that should not show the navigation.

Lilybiri
Legend
February 2, 2015

You cannot call a script within another action. But a lot is possible with

conditional actions with multiple decisions and with shared actions

rosm2004Author
Known Participant
February 2, 2015

Thanks Lilybiri. I am studying these options to see what I need to do.

The problem I have with conditional action scripts is that the conditions are set in the script itself. I find it difficult to get my head around that because my thinking is to test the condition first then call an action based on the condition -- For example:

if page = X

    execute script A

else

    jump to page  X

    execute script A

If I specify the conditions inside the script, I'm not sure how to achieve the above without repeating all the actions that would have been in "script A" because I don't see a way to add these actions outside of the if... else structure.

Lilybiri
LilybiriCorrect answer
Legend
February 2, 2015

The condition is in the condition part, the possible actions are in the THEN and the ELSE part. And with a combination of several decisions, which are always evaluated in sequence. In your case you have a sequence (script A) that has to be executed independent of the condition, in that case you put it in a mimicked standard action:

First decision 'Checkit'

IF page = X

   Jump to page X

ELSE

   Continue

Second decision 'Always'

IF 1 is equal to 1

   sequence of commands you have in script A

You see, no need to repeat the actions at all (and copy/paste works very quickly if you prefer one decision)