Results 1 to 6 of 6

Thread: Play 2nd SWF

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    5

    Play 2nd SWF

    I am having no trouble playing a swf file in VB but how can a play a second SWF file AFTER the first has finished? How do I know when the first file is done playing? Tried 'isplaying' method in a while loop but can't get it to work.

    Thanks for any help!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Play 2nd SWF

    the shockwave flash player control doesn't really give you a ton of control over what is going on.

    One thing you could try, is to add a timer to your form, and check the CurrentFrame value to see if it is equal to the TotalFrames value, and if it is, that is an indication the video has finished running and you can load the next one.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    5

    Re: Play 2nd SWF

    I've tried variations of this, with no success:
    vb Code:
    1. FLVPlayer.FlashMethod_Play()
    2. FLVPlayer.Show()
    3. IsPlayingTimer.Enabled = True
    4. Do While IsPlayingTimer.Enabled = True
    5.    Application.DoEvents()
    6. Loop
    7. MsgBox("DONE")
    8.  
    9. Private Sub IsPlayingTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IsPlayingTimer.Tick
    10.     If FLVPlayer.FlashMethod_CurrentFrame = FLVPlayer.FlashProperty_TotalFrames Then
    11.          IsPlayingTimer.Enabled = False
    12.     End If
    13. End Sub

    The movie is playing fine but the msgbox isn't popping up at the end... Any ideas?

    Thanks alot for your help!

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    5

    Re: Play 2nd SWF

    Actually, I just found out that my 'movie' is only 1 frame so counting frames won't work. Is there a way to use the methods 'playing' or isplaying'?

    Thanks

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Play 2nd SWF

    Isn't it just a picture then, if its only 1 frame?

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    5

    Re: Play 2nd SWF

    Sorry, I should have been more specific. I'm using a flash player control that allows me to play an .flv or .swf. The swfs use frames but I just realized that the flv video is only on one frame when it plays. It uses all of the same methods and functions as a normal swf. I've tried using a timer to check 'isplaying' method but don't think I'm doing it properly.

    Thanks again.

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