I want to play once a sound effect when someone place mouse inside button in MainMenu. Problem is here - MainMenu is in loop, so my sound repeat all the time. How to play sound just once when someone place mouse inside button?

Button:

```
if(mouse is in position X = <0,100> and Y = <0,100>){
    drawButton( X = 0, Y = 0, X2 = 100, Y2 = 100);
}

```

Button is in loop:

```
while( we are in MainMenu state )
{
    if(mouse is in position X = <0,100> and Y = <0,100>){
        drawButton( X = 0, Y = 0, X2 = 100, Y2 = 100);
    }
}

```

Sound:

```
Music Sound_1 = new Music("res/Sound/Sound_1.wav");

```

Play sound:

```
Sound_1.play(1.0f, 1.0f);

```

Code:

```
while( we are in MainMenu state )
{
    if(mouse is in position X = <0,100> and Y = <0,100>){
        Sound_1.play(1.0f, 1.0f); <- IT MUST PLAY JUST ONCE WHENEVER MOUSE IS IN BUTTON
        drawButton( X = 0, Y = 0, X2 = 100, Y2 = 100);
    }
}

```