Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27366

VS 2010 Playing multiple swf files

$
0
0
Could anyone help me out with this. I have swf files stored in my application in a folder named Videos. The problem is I can only play one file and I am trying to loop through all the files in the directory.

This Code only plays one file:

Dim path As String = Application.StartupPath & "\Videos\01_ch1sec1a.swf"

AxShockwaveFlash1.LoadMovie(0, path)
AxShockwaveFlash1.Play()
AxShockwaveFlash1.Loop = True

And this one doesn't work at all: I have included the timer event:

Private FrameCount As Integer = 0
Private LastFrame As Integer = -1
Private Sub AxShockwaveFlashTimer_Tick(sender As System.Object, e As System.EventArgs) Handles AxShockwaveFlashTimer.Tick
If FrameCount <> 0 Then 'To make sure movie was loaded
If AxShockwaveFlash1.CurrentFrame = AxShockwaveFlash1.TotalFrames Then
AxShockwaveFlash1.LoadMovie(0, "\Videos\01_ch1sec1a.swf")
Else
End If
End If
End Sub



Private Sub AxShockwaveFlash1_OnReadyStateChange(ByVal sender As System.Object, ByVal e As AxShockwaveFlashObjects._IShockwaveFlashEvents_OnReadyStateChangeEvent) Handles AxShockwaveFlash1.OnReadyStateChange

'4 = Completed (means the movie loading is finished)
If e.newState = 4 AndAlso FrameCount = 0 Then
FrameCount = AxShockwaveFlash1.TotalFrames
End If
End Sub

on the second code I know the path might be a problem as it points to a single file

Viewing all articles
Browse latest Browse all 27366

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>