在VB里面,比如说在Form里面怎么样嵌入Flash动画,还有怎么样使Flash的参数与VB交换数据?谢谢!

解决方案 »

  1.   

    写一例子给你,vb与flash交互主要要用到flash中的action中的fscommand命令,在VB中主要用flash控件的FSCommand事件来接收信息。
    1.先加载shockwareflash控件,这个你装了flash之后就有。
    2.做一个flash按钮,按钮的action为fscommand("tb_action", "close_win");按钮保存为button.swf
    3.VB建一窗体,加一个flash控件,名为xwin
    Private Sub Form_Load()
     xWin.Movie = app.path & "\button.swf"
    End Sub
    Private Sub xWin_FSCommand(ByVal command As String, ByVal args As String)
    Static NhWnd& 'Variable to store WordPad's window handleSelect Case command
        Case "tb_action"
            Select Case args
               
                Case "close_win"
                    If MsgBox("你确定要关闭窗口吗?") = vbYes Then End
               
            End Select
    End Select
    End Sub
      

  2.   

    引用一个ShockwaveFlash控件
    Private Sub Timer1_Timer()
      Flash1.Movie = App.Path & "\test.swf"
      Label1.Caption = "共" & Flash1.TotalFrames & "帧" & "  已播放到第" & Flash1.CurrentFrame & "帧"
    End SubPrivate Sub Command1_Click()
      Flash1.Playing = True
    End SubPrivate Sub Command2_Click()
      Flash1.Back
    End SubPrivate Sub Command3_Click()
      Flash1.Forward
    End SubPrivate Sub Command4_Click()
      Flash1.Stop
    End SubPrivate Sub Command5_Click()
      End
    End Sub
      

  3.   

    给你提供一个简单的方法:用WebBrowser1,
    WebBrowser1.Navigate2 urlurl指定你的FLASH动画。