Welcome to WebmasterWorld Guest from 23.22.250.113

Forum Moderators: open

Message Too Old, No Replies

Playing multiple flash videos sequentially & looping

     

Anlina

6:38 pm on Sep 22, 2008 (gmt 0)

5+ Year Member



I have several Flash presentations that were made for a client. Each one starts and plays through to the end (kind of like a mini commercial done in flash).

I need to take all these videos and set it up so that they will play one after another, and when it gets to the end of the last video it loops to the beginning and plays again. I'd like to set it up in a way that is flexible enough to add/remove/change a video without a lot of extra work or working on multiple files if I do make changes to a specific video.

I'm just not sure the best way to approach this. Suggestions? Is there a free script out there that will let me do this - that would be ideal. Otherwise, I have no problem putting it together myself, I just need some direction.

Demaestro

6:48 pm on Sep 22, 2008 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can do this with some actionscript programming.

All you need is to have a flvplayback object on the stage... then with actionscript you can load each video and using the VideoEvent or VideoState, I can't remember which you can detect when the video is done playing at which time you load the next video.

Then using some recursion you should be able to loop to the start once all the videos have played.

I don't know of a defaulted script that does this but if you have more questions about making your own I will try to help.

rocknbil

9:25 pm on Sep 22, 2008 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I'm just not sure the best way to approach this.

Investigate "NetConnection()" in the Flash help files. This will lead to a tutorial that loads the video externally. The Flash loads, it calls an XML file that contains a list of the .flv's and their captions which display on a drop-down in the flash. The actual videos don't load until the item is selected in the list and you push play, to keep it lightweight and streaming only on demand.

You have one serious problem with stringing together video actually placed in the Flash - the entire thing must load (or at least a buffer full) before it will play. Your page is now weighted by the total size of the combined videos, instead of a 100K page, it will be multiple megabytes.

So I would suggest taking an externally loading Flash player and modify it to "loop" through your list of videos. When it gets to the end, depending on how you code this, you would either reset a counter to 0 or use goToAndPlay(1) to start at the first frame again.

EDIT: thought I had a mini-tut here, but it was for a slide show. The loop can be picked up from the concepts in the slide show, located here [webmasterworld.com], but you'd need to construct the external viewer into this.

Anlina

1:30 pm on Sep 23, 2008 (gmt 0)

5+ Year Member



Thanks for the suggestions.

I should have mentioned that loading time is much less of an issue, as this isn't going to be deployed to the web but will just run on a monitor in the client's lobby.

rocknbil

6:07 pm on Sep 23, 2008 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Well, even so, it will reduce maintenance. If you embed the video directly in the Flash, you have to recompile a new .swf every time you add one. If it's loaded externally, you just put the .flv in your video directory, and update the XML file to include the new one.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month