From what I can see, you can't use API to control what an image element shows, you have to predefine image to be already pointing to some image or gallery.
Also, you cannot use API to load sound files, you have to define sound element for each file, and then you can give them ID and set all volumes to 0 by default, so that you could use API to play certain instance at certain volume, but all of that seems to be oriented towards having pages for each different model/sound file.
Do you now have different page for each field?
If you have a tease page for each field, I suppose you have step to start audio, then number of alternating say/image steps on each page (and async timer probably),
If you wanted to make dialogs maintainable from single action on each page, you could do this:
In init script you define global function:
Code: Select all
var currentLine = 0;
function getNextLine(){
var result = dialogueLines[currentLine];
currentLine = (currentLine + 1) % dialogueLines.length;
return result;
}
Code: Select all
currentLine = 0;
var dialogueLines = [
'page2 line 1',
'page2 line 2',
'page2 line 3'
]
Code: Select all
getNextLine()