PDA

View Full Version : Wanting to get control of swf to load next on the percent completed



lukeo25
12-11-2017, 08:10 PM
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

SamT
12-13-2017, 09:29 AM
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