tags:

views:

314

answers:

1

I've done some programming where I've embedded the Flash ActiveX control into my program. I'll play SWF files in a "playlist" provided by the user. Typically, I've kept a timer going that looks at the CurrentFrame vs. TotalFrames to detect forward motion. I don't allow for looping - if the CurrentFrame ever decreases, I jump out of the file.

However, there's a new breed of SWF files - often from conversion programs that turn PowerPoint presentations into SWF files - that now do everything outside of the main timeline. So a 30 second SWF file might have only 5 frames, according to the ActiveX control. It still plays for 30 seconds, but the CurrentFrame hits TotalFrames really quickly, and my program will stop playing the file at that point. Not the desired behavior.

So - is there some way, using just the Flash ActiveX control, that I can determine whether the Flash playback is still making forward progress? Or is there some event that I can hook into or look for that Flash uses internally to indicate that it's reached the end of playback?

+1  A: 

Not much you can do about this. Basically you'd have to know what the duration is somehow and if the swf doesn't provide that information, i can't come up with a solution. If you have control over the loaded swf's you can communicate back to the host using ExternalInterface when the swf has finished. This of course won't work if you can't modify the swf's..

Antti
Thanks. It seems that this is really a lost cause. There does not appear to be a way to delve any deeper into innards of the SWF through the ActiveX interface. And since, in my case, I can't modify the SWF file, then I'm unable to pursue your suggested approach to use the ExternalInterface.
GuyWithDogs