I'm making a mp3 project for an assignment and it works when i press the play button, it just won't stop when I press it again. here's the code...
15 public void act()
16 {
17 play();
18 stop();
19 }
20
21 public void play()
22 {
23 GreenfootSound sound = new GreenfootSound("Fetty Wap - Trap Queen.mp3");
24 if(Greenfoot.mouseClicked(this) == true)
25 {
26 sound.play();
27 }
28
29 }
30
31 public void stop()
32 {
33 GreenfootSound sound = new GreenfootSound("Fetty Wap - Trap Queen.mp3");
34 if(Greenfoot.mousePressed(this))
35 {
36 sound.stop();
37 }
38 }
39}

