Log in

View Full Version : Coding a music player loop button in Flash actionscript 2.0



ruinsatiable2
03-11-2011, 09:08 PM
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.



loopbutton_up.onPress = function(){
mySong.start(0, 100)
}


//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.



loopbutton_up.onPress = function(){
if (currentSound!==true)
mySong.onSoundComplete.start();
}
else{
if (currentSound!==false)
mySong.start(0, 100);
}

Hollywood
03-30-2011, 04:43 PM
hello
what exactly are you trying to do. are you trying to fast-forward the song while playing or jump to a particular section while playing.
please try and explain.

leechyeah
11-30-2011, 11:18 AM
Dear,

Have a look at:
http://www.kennybellew.com/tutorial/how_to_start.htm

It is very useful.