Consulting

Results 1 to 2 of 2

Thread: Wanting to get control of swf to load next on the percent completed

  1. #1

    Wanting to get control of swf to load next on the percent completed

    I know swf is dead but we still have uses for it.
    I am using it in a ppt to play videos which have been converted to swf.
    We use these as they are the only video file types that are redirected by a Citric VPI we have to use.
    Anyway...

    Here is the code I am using. I want to be able to load the next swf if the preceding file has completed playing.
    I don't seem to be able to find much about how to do this anywhere. I'd love some help.

    Sub SflashLoad() 
        Dim oShp As Shape 
        Num = 1 
        Dim swf As ShockwaveFlash 'Select Shockwave obect
        With oShp 
            Set swf = Slide1.ShockwaveFlash1 'Select Object (Name) on slide
            swf.Movie = "S:\COR\Common\Sandbox\Vids\V00" & Num & ".swf" 
            swf.Rewind 'Rewind movie to start
            swf.Playing = True 'Set to play
            swf.Loop = False 'Turn off looping
            swf.Rewind 
            swf.Play 
             
            If swf.PercentLoaded = 100 Then 
                Num = Num + 1 
                swf.Movie = "S:\COR\Common\Sandbox\Vids\V00" & Num & ".swf" 
                swf.Rewind 'Rewind movie to start
                swf.Playing = True 'Set to play
                swf.Loop = False 'Turn off looping
                swf.Rewind 
                swf.Play 
            End If 
        End With 
    End Sub 
    
    
    Formatting tags added by mark007
    Last edited by SamT; 12-13-2017 at 09:29 AM.

  2. #2
    Moderator VBAX Wizard SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    6,312
    Location
    There is no Timing in your code, IOW, it runs an SWF, then immediately checks to see if it's done playing. As fast as VBA is, the first SWF has not yet started playing when you check if it's done playing.

    You need to wait for the first to end playing, and use that "Ending" Event to trigger another Sub that plays the next SWF
    Please take the time to read the Forum FAQ

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
  •