Results 1 to 3 of 3

Thread: Flash and visual basic

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    France
    Posts
    90

    Hi,

    I'm embedding a Flash movie in my VB app. There are 4 buttons in my Flash movie. Each button in the movie, when clicked, should load a different form of my VB app.

    Does anybody know why this VB code doesn't work? Only the button with args ="1" works, and nothing else.

    Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)

    If args = "1" Then
    form2.show

    If args = "2" Then
    form3.show

    If args = "3" Then
    form4.show

    If args = "4" Then
    form5.show

    End If
    End If
    End If
    End If
    End Sub

    Thanks for any help!

  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112
    The first If statement is checking for arg = "1". If arg is not "1" then your code is jumping to the last End If statement. (There is no Else clause in your code, so your program has no instructions if arg is not "1".)

    I think it would probably be better if you used a Select Case statement anyway.

    Code:
    Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
        Select Case args
            Case "1"
                form2.Show
            Case "2"
                form3.Show
            Case "3"
                form4.Show
            Case "4"
                form5.Show
        End Select
    End Sub
    Hope this helps.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    France
    Posts
    90

    Talking


    Ishamel,

    You are my hero.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width