各位大侠,VB怎么样控制flash
这个播放器可以播放了,但哪控制条太难看了,我想用按钮来控制这个播放器的停止和播放,VB怎样传递参数给FLASH,各位太侠代码怎么写,源码在这
flv.rar
(30.83 KB)
,
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Dim tempfile As String, A Public Sub LoadM(ByVal flvfile As String) flvfile = tempfile & "?file=" & flvfile flvfile = Replace(flvfile, "\", "/") ctrl.FlashVars = "autostart=true" Call ctrl.LoadMovie(0, flvfile) End Sub Private Sub Command1_Click() LoadM (A) End Sub Private Sub Command2_Click() LoadM (dlg.FileName) End Sub Private Sub Form_Load() Dim Buf As String * 128 Dim Value As Integer Value = GetTempPath(128, Buf) tempdir = Left(Buf, Value) Randomize Timer tempfile = tempdir & Int(Rnd * 100000) + 187 extractress tempfile End Sub Private Sub OpenFile_Click() With dlg .DefaultExt = "flv" .Filter = "Flash video file (*.flv)|*.flv" .Flags = cdlOFNExplorer End With dlg.ShowOpen If dlg.FileName = "" Then Exit Sub End Sub Public Sub extractress(nom_fich As String) Dim tab_ani() As Byte Open nom_fich For Binary Access Write As 1 tab_ani = LoadResData(101, "CUSTOM") ReDim Preserve tab_ani(UBound(tab_ani)) Put 1, , tab_ani Close 1 A = nom_fich End Sub