[SOLVED]Can someone explain the synchronous Javascript playback API

Am I on the right track, this is what i’m trying to achieve, not working right now but just so you see some sample code