Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Plz Help Error In VB6


eamaan1
 Share

Recommended Posts

When i tried to run the Main menu.frm it says Error Method or data member not found

and the highlighted come is
```
Call MenuMusic.PlayMedia
```
The Whole code is
```
Option Explicit

Private Sub Form_Load()
    Dim i As Long
    Dim Ending As String

    For i = 1 To 3
        If i = 1 Then
            Ending = ".gif"
        End If

        If i = 2 Then
            Ending = ".jpg"
        End If

        If i = 3 Then
            Ending = ".png"
        End If

        If FileExists("GUI\MainMenu" & Ending) Then
            frmMainMenu.Picture = LoadPicture(App.Path & "\GUI\MainMenu" & Ending)
        End If
    Next i

    Ending = ReadINI("CONFIG", "MenuMusic", App.Path & "\config.ini")
    If LenB(Ending) <> 0 Then
        Call MenuMusic.PlayMedia(App.Path & "\Music\" & Ending, True)
    End If

    Call MainMenuInit
End Sub

Private Sub Form_GotFocus()
    If frmMirage.Socket.State = 0 Then
        frmMirage.Socket.Connect
    End If
End Sub

Private Sub picAutoLogin_Click()
    If ConnectToServer = False Or (ConnectToServer = True And AutoLogin = 1 And AllDataReceived) Then
        Call MenuState(MENU_STATE_AUTO_LOGIN)
    End If
End Sub

Private Sub picIpConfig_Click()
    Me.Visible = False
    frmIpconfig.Visible = True
End Sub

Private Sub picNewAccount_Click()
    Me.Visible = False
    frmNewAccount.Visible = True
End Sub

Private Sub picDeleteAccount_Click()
    frmDeleteAccount.Visible = True
    Me.Visible = False
End Sub

Private Sub picLogin_Click()
    If LenB(frmLogin.txtPassword.Text) <> 0 Then
        frmLogin.Check1.Value = Checked
    Else
        frmLogin.Check1.Value = Unchecked
    End If

    Me.Visible = False
    frmLogin.Visible = True
End Sub

Private Sub picCredits_Click()
    Me.Visible = False
    frmCredits.Visible = True
End Sub

Private Sub picQuit_Click()
    Call GameDestroy
End Sub

Private Sub Status_Timer()
    If ConnectToServer = True Then
        If Not AllDataReceived Then
            Call SendData("givemethemax" & END_CHAR)
        Else
            lblOnline.Caption = "Online"
            lblOnline.ForeColor = vbRed
        End If
    Else
        picNews.Caption = "The server is down."

        lblOnline.Caption = "Offline"
        lblOnline.ForeColor = vbRed
    End If
End Sub

```
i wanted to make the GUI bigger so i run the programm and how do i make it save and make the main menu bigger and THX

:azn:

psss:"If u are confused ask me i will tell u"
Link to comment
Share on other sites

when i compile my Client.exe it says

error its says meathod or data member not found

and the errored code is
```
Call frmMainMenu.MenuMusic.StopMedia
```
then here is the whole code's
```
Option Explicit

Public Sub MapMusic(ByVal Song As String)
    If Not Map(GetPlayerMap(MyIndex)).music = CurrentSong Then
        Call PlayBGM(Map(GetPlayerMap(MyIndex)).music)
    End If
End Sub

Public Sub PlayBGM(Song As String)
    If ReadINI("CONFIG", "Music", App.Path & "\config.ini") = 1 Then
        If FileExists("\Music\" & Song) Then
            If Not LenB(Song) = 0 Then
                If Not Left$(Song, 7) = "http://" Then
                    Call frmMirage.MusicPlayer.PlayMedia(App.Path & "\Music\" & Song, True)
                    CurrentSong = Song
                Else
                    Call frmMirage.MusicPlayer.PlayMedia(Song, True)
                    CurrentSong = Song
                End If
            End If
        Else
            Call AddText(Song & " does not exist!", BRIGHTRED)
        End If
    End If
End Sub

Public Sub PlaySound(Sound As String)
    If ReadINI("CONFIG", "Sound", App.Path & "\config.ini") = 1 Then
        If FileExists("\SFX\" & Sound) Then
            Call frmMirage.SoundPlayer.PlayMedia(App.Path & "\SFX\" & Sound, False)
        Else
            Call AddText(Sound & " does not exist!", BRIGHTRED)
        End If
    End If
End Sub

Public Sub PlayBGS(Sound As String)
    If ReadINI("CONFIG", "Sound", App.Path & "\config.ini") = 1 Then
        If FileExists("\SFX\" & Sound) Then
            Call frmMirage.BGSPlayer.PlayMedia(App.Path & "\BGS\" & Sound, True)
        Else
            Call AddText(Sound & " does not exist!", BRIGHTRED)
        End If
    End If
End Sub

Public Sub StopBGM()
    Call frmMainMenu.MenuMusic.StopMedia
    Call frmMirage.MusicPlayer.StopMedia
    Call frmMirage.BGSPlayer.StopMedia
    CurrentSong = vbNullString
End Sub

Public Sub StopSound()
    Call frmMirage.SoundPlayer.StopMedia
End Sub

```
And i dont know how to make it correct i have put a music to main menu and the error is occuring to the main menu music
Plz tell me i pressed File > Make a client.exe and compiled whne i was doing that this error occoured
and THX
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...