How about this..
The Elements used for the click have an id name of the Audio files. i.e Blues
The Audio elemenys are off scene
Each Audio has an id of the Audio file name + Audio. i.e. BluesAudio
testloop copy.hype.zip (517.9 KB)
if you want the loop to always start from the beginning on play, change the Conditional Ternary operator to:
isPlaying ? (theLoop.currentTime = 0, theLoop.play() ) : theLoop.pause() ;