Question from Groups, JS and sound.

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.


//Variavel caixa normal
var namePrefix = 'caixa_';
//Variavel audio
var audioPrefix = 'wd10_01a_';
var numero1 = 1;

var clickHandler = function() {

// Pausar narração se caixa = hide

//Variavel para proxima caixa
var nextIndex = parseInt( + 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) {;
prez.object(audioPrefix + numero1 + '_' + nextIndex).animate(AP.EffectType.MEDIA_PLAY);
//Se terminou proximo slide

else {

numero1 = numero1 +1;
nextIndex = 1;

var i = 1;
var obj;
while (obj = prez.object(namePrefix + 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