Hey friends! I think that this way is erroneous... So try this Jim:
1. Create new object and name it like "sound".
2. Create a few states in this object:
disable <-- The first state. Do nothing here!
Add your *.wav files to the other states: tab "States" --> tab "Sound" --> button "Browse" --> button "Apply"
Restore <-- Windows Restore.wav
LowBattery <-- Windows Battery Low.wav
CriticalStop <-- Windows Critical Stop.wav
Logon <-- Windows Logon Sound.wav
Minimize <-- Windows Minimize.wav
Now you have a special object with all of the necessary sounds.
3. Coppy this code to your button:
Function Object_OnLButtonUp(x, y, dragged)
If Not dragged Then
Dim sfx : sfx = desktopx.object("sound").state
Select Case sfx
Case "disable" '<== Silent (no sound)
sfx = "Restore"
Case "Restore" '<== Windows Restore.wav
sfx = "LowBattery"
Case "LowBattery" '<== Windows Battery Low.wav
sfx = "CriticalStop"
Case "CriticalStop" '<== Windows Critical Stop.wav
sfx = "Logon"
Case "Logon" '<== Windows Logon Sound.wav
sfx = "Minimize"
Case "Minimize" '<== Windows Minimize.wav
sfx = "disable"
End Select
desktopx.object("sound").state = sfx : Set sfx = nothing
End If
End Function
Press your button again and again to hear each of your sounds one after another.
4. Now you just need to write a simple code which will control your sounds...
Have a nice day with DesktopX.