Sustain user input in master

Hi,

Is there a way to sustain any user input (e.g. clicking on objects) while an audio is played by an event in the slide master?

I got a slide A which makes use of a drag and drop that is in the master slide (and is has to stay there). On accept an audio is played. When I click on a button that leads to another slide B the presentation breaks down. So either I would like to sustain user input for the duration of the audio or I would like to hide the button in slide A for as long as the audio plays. is that possible?

Is it possible, in general, to access objects in a particular slide through the Master, e.g. something like prez.Slide(12).object(ABC).hide(). Is there a workaround?

Thanks, Rolf

Hi Rolf,

So either I would like to sustain user input for the duration of the audio or I would like to hide the button in slide A for as long as the audio plays

Firstly, you will hide the button by right-clicking it, select Initial Hidden.
Then, in the On Accept event, you will add actions to it as in the following image:
image
Regards,
Yen

Thanks, Yen

As far as I can see, what you describe would work if both, the drag-and-drop and the button were on the same slide. However, the drag-and-drop is in the master slide and the button in a slide A (which is based on the master). It seems I cannot show an (initially hidden) object that is not in the master slide.

This is general problem. Slide A is based on a master. As far as I can see I cannot use any events in the master to manipulate objects in slide A. The only objects I can see are those in the master.

Am I missing something?

Thanks, Rolf

Hi Rolf,

Could you please share the project and its external data folder PROJECT_FILE_files if any
so I can take a look at and understand it better?

You can send it to support@atomisystems.com.

Regards,
Yen

Hi Rolf,

You can use JavaScript in the master layout to manipulate objects in the normal slide that uses the master layout.

var objectInNormalSlide = prez.object('object name');
if (objectInNormalSlide)
  objectInNormalSlide.show();

Please make sure that the object name is unique among objects in the slide and the master layout.

Regards

Excellent - that is exactly what I needed. Thanks a lot!!!
Rolf

Hi Toan,

how could I do the same with a range of objects that start with the same prefix? Would that also be possible?

For example: I have objects named ‘NavRight_x’ or ‘NavLeft_x’ etc.

Is there a way to address every object with a name that starts in ‘Nav’?
OR
is there a way to address unique objects without knowing the full name but knowing how it starts?
For example in slide 1 the object would have the name ‘NavLeft_South’ in slide 2 there would be an object ‘NavLeft_West’.
Is there a way to hide both from the master slide even though I do not know their full name but know they start in ‘NavLeft_’.

Thanks, Rolf

Hi Rolf,

You can use the following function to hide all objects whose names start with a prefix in the current slide (including the master layout):

function hideChildObjects(parent, prefix) {
    var children = parent.children;
    for (var child of children) {
        if (child.name().startsWith(prefix))
            child.hide();
        else
            hideChildObjects(child, prefix);
    }
}

//e.g.
hideChildObjects(prez.slide, 'NavLeft_');

Regards

Hi Toan,
excellent. Thank you very much!!!
Best, Rolf