Well, I made a game, and I have two MMControls on it, one to play background music, and one to play sound effects. Since so many parts of the program need to access these controls, I decided the entire music control into one public sub on a module, as shown here:
VB Code:
Public Sub SoundEffect(strSound As String, mmController As MMControl) frmGameScreen.mmController.Command = "close" frmGameScreen.mmController.Command = "Stop" frmGameScreen.mmController.FileName = App.Path & "\sounds\" + Trim(strSound) frmGameScreen.mmController.Command = "open" frmGameScreen.mmController.Command = "play" End Sub
The problem is when I try to call the procedure with a line like this:
VB Code:
Call SoundEffect("EXPLODE.WAV", mmMusicControl)
I get an error saying "Method or data member not found", is it not possible to do what I want to do without copying the code for both control twice? I want to avoid as much extra code as possible. Can somebody help me?




Reply With Quote