Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

How to randomize huge number of flash movies

1:51 am on Nov 23, 2008 (gmt 0)

New User

5+ Year Member

joined:Nov 23, 2008
posts: 2
votes: 0

Hello Guru's

I have a website that we are trying to add some video content to. We have hundreds of flash files we want to encorperate. We have seen the code were you can have 2 .swf randomly play... but that is not enough for ou project.

We have the adobe cs3 suite if that will make it easier.

Thanks in advance

2:48 pm on Nov 25, 2008 (gmt 0)

Senior Member

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

joined:Nov 28, 2004
votes: 0

Welcome aboard dartingaround, this should be fairly basic:

Import an XML file with a list. You can manually edit a list, or have it generated from a script. Have the XML contain members for the url and caption.

<?xml version="1.0" encoding="ISO-8859-1"?>
<movie url="video1.flv" caption="Video 1"/>
<movie url="video2.flv" caption="Video 2"/>

As you read in the XML, store it in an array. Using the random functions of Actionscript, pick a random movie URL and it's associated caption.

At this point you import the movie, attach it to a video object, begin streaming and don't start playing until the buffer is full.

The list can also be used with a combo box to make a select list (although with hundreds, another approach might be more practical.)

There are adequate samples and help docs within Flash to do all of the above.

4:21 am on Nov 26, 2008 (gmt 0)

New User

5+ Year Member

joined:Nov 23, 2008
posts: 2
votes: 0

I would like to have the script automatically play one file... instead of the visitor selecting one!

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members