Results 1 to 3 of 3

Thread: Playing multiple swf files

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    2

    Post 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

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Playing multiple swf files

    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.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    2

    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.

Tags for this Thread

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