I actually want to do a button on/off for music but i don't know how to stop around that is actually playing..


1 2 3 4 5 | //instead of: Greenfoot.playSound( "sound.mp3" ); //do this: GreenfootSound sound = new GreenfootSound( "sound.mp3" ); sound.play(); |
1 2 | sound.pause(); //pauses the sound; sound.stop(); //stops the sound; |