I am using Splash Screen music in my app when it starts up, but I want the music to stop when the user pushes a button.
I was able to get the music to play ok, but I couldn’t make it stop once it starts.
Play Code:
//Play Music
[code] If TargetWin32 Then
MoviePlayer1.PlayerType=2
SplashW2.Play
Else
Splash2.Play
End If[/code]
The Stop Code is:
//Stops Music
[code] MoviePlayer1.Stop[/code]
The two sound files are just dragged into the project. I have an MP3 for macOS and a WAV file for Windows.
I realized as soon as I posted my message that the MoviePlayer had nothing to do with the playing of the music and was not even necessary. So I changed the code to this, and it worked fine.
//Play Music
If TargetWin32 Then
SplashW2.Play
Else
Splash2.Play
End If
//StopMusic
[code]If TargetWin32 Then
SplashW2.Stop
Else
Splash2.Stop
End If[/code]