Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe and Support WebmasterWorld
How to randomize huge number of flash movies dartingaround msg:3792286 1:51 am on Nov 23, 2008 (gmt 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
rocknbil msg:3793873 2:48 pm on Nov 25, 2008 (gmt 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"?> <movielist> <movie url="video1.flv" caption="Video 1"/> <movie url="video2.flv" caption="Video 2"/> </movielist>
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.
dartingaround msg:3794365 4:21 am on Nov 26, 2008 (gmt 0)
I would like to have the script automatically play one file... instead of the visitor selecting one!