Question from Groups, JS and sound.
Oct 29, 2019
Hello,
First I would like to apologize for my English.
I am creating a project where there are groups with text box and audios, my idea was to enter, the first box will appear and the first audio will play, when clicking on the box, it disappears and the second appears along with the second audio and so on.
As there are several slides, the idea was to leave all audios on the master slide and each group to call a specific audio on the counter.
I tried to create in JS but still do not understand the use.
I did something similar on another platform I would like to do with storyline 3.
ActivePresenter:
//Variavel caixa normal
var namePrefix = 'caixa_';
//Variavel audio
var audioPrefix = 'wd10_01a_';
var numero1 = 1;
//Função
var clickHandler = function() {
this.hide();
// Pausar narração se caixa = hide
//prez.object(audioPrefix).animate(AP.EffectType.MEDIA_STOP);
//Variavel para proxima caixa
var nextIndex = parseInt(this.name().substring(namePrefix.length)) + 1;
//Variavel proxima caixa
var nextObject = prez.object(namePrefix + nextIndex);
//Variavel proxima caixa Indica
var caixaIndica = prez.object(nameCaixaIndica);
//Se caixa hide = show e inicia audio
if (nextObject) {
nextObject.show();
prez.object(audioPrefix + numero1 + '_' + nextIndex).animate(AP.EffectType.MEDIA_PLAY);
}
//Se terminou proximo slide
else {
prez.nextSlide();
numero1 = numero1 +1;
nextIndex = 1;
}
};
//Contador
var i = 1;
var obj;
while (obj = prez.object(namePrefix + i)) {
++i;
obj.on('ap-click', clickHandler);
}
From what I researched is not possible to show and hide groups, but not using JS?
Follows the model in question.
2 Replies
Hi Luis,
you could achieve this by using layers. For each group you can create a new layer, insert the text and audio there and set a trigger to open the next layer, when the user clicks on the text box. The audio should start as soon as the new layer appers.
Hope this helps. :)
H
Sim, por camadas é possível fazer. Mas é impossível se eu tiver muitos slides e muitas caixas. Eu gostaria de acelerar o trabalho porque tenho muitos cursos para criar.
This discussion is closed. You can start a new discussion or contact Articulate Support.