This may be worth a note in case you want to have a blanket rule without needing a bunch of cases
window.maxLoops=5;
if(typeof window.loopCounter ==='undefined'){
window.loopCounter=0;
}
window.loopCounter++
if(window.loopCounter!=window.maxLoops){
hypeDocument.startTimelineNamed('animation', hypeDocument.kDirectionForward);
hypeDocument.getElementById("text").innerHTML = "Number of loops = "+window.loopCounter;
}else{
hypeDocument.goToTimeInTimelineNamed(6, 'animation');
window.loopCounter=0;
}
You wouldn’t need to put any variables in the head as well, this has a check to see if the variable exists, if it doesn’t it will make it