homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

Playing multiple flash videos sequentially & looping

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

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.



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

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.


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

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.


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

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.


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

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved