Hello Everyone,
I need help with coding a loop button. I really have severely minimal experience in coding, so below are two examples of what I've tried, amongst dozens of others that were incorrect.
//This example will loop the song correctly, but only if you press the loop button after the song is complete. If you press it while the song is still playing, it will play over itself.
//I don't really have a clue what I'm doing here. I just based this on someone else's code and tried to modify it myself, without really understanding what's needed. I get the error: 'else' encountered without matching 'if.' So how and where do I fix that or is my attempt at a code completely off track? Please advise either way.Code:loopbutton_up.onPress = function(){ mySong.start(0, 100) }
Code:loopbutton_up.onPress = function(){ if (currentSound!==true) mySong.onSoundComplete.start(); } else{ if (currentSound!==false) mySong.start(0, 100); }



Reply With Quote

Bookmarks