The problem is that you have to include the { } s in an if statement, except if you only want one line of code executed.
For clearing up:
code:
if (condition == "whatever") DoStuff('hello');
code:
if (condition == "whatever") {
var doWhat = 'hello';
DoStuff(doWhat);
}
So, your code should be:
code:
function OnSoundEvent_CtrlClicked(Wnd, ControlId)
{
if (ControlId == "BtnPlay") {
var Message = "Sound not playing! Learn about MsgPlus.PlaySound! ";
MsgPlus.DisplayToast("", Message, "notify.wav");
}
if (ControlId == "BtnClose") Wnd.Close(1);
}
To play the sound then the toast is displayed, notify.wav must be on your script's directory.
If you want to play a sound when you want (ie without being when the toast fires up) you use MsgPlus.Playsound('sound.wav'); and sound.wav must be in your script's directory. If you want to play a sound outside the script's directory, use "\" before. Example: "\C:\sound.wav".