Playing multiple swf files
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
Re: Playing multiple swf files
Quote:
I know the path might be a problem as it points to a single file
Well yeah. Everything you do here happens just once and in relation to a single file. So what other result would you expect? You need to obtain a list of files and load each one in succession.
Re: Playing multiple swf files
By pointing to one swf i was just making an example. my folder has more than 1200 swf files, so you suggest i load all of them one by one(well that i can do) i just thought there is an easy way to do it.