Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Random FLV files 1

Status
Not open for further replies.

webmast

Programmer
Dec 21, 2001
57
IN
Hi,

I learnt how to embed external video lately by using media playback component.

It will be very kind if someone can tll me how i can call muliple .flv files one after other.

Thanks in advance,
Tommcat
 
Here's an example script: the MediaPlayback component (I called it "media" here) plays a random FLV out of 3 one after the other.

[tt]//
var videoArray:Array = ["video1.flv", "video2.flv", "video3.flv"];
function playRandomVideo():Void {
var video:String = videoArray[Math.floor(Math.random()*3)];
media.setMedia(video, "FLV");
media.play();
}
playRandomVideo();
var listner:Object = new Object();
listner.complete = playRandomVideo;
media.addEventListener("complete", listner);
stop();
//[/tt]

Kenneth Kawamoto
 
Hi Kenneth Kawamoto,

Thanks for your reply, now I seem to be getting something done.

I have a problem now.

I created a MediaPlayback component & named it as media as u had directed & put the script u gave on the frame 1

The first flv works then the next one oesnt come up, I can just see 'Paused' in the status bar. Rarely two flv work one after th other but they to stop off.

Why am i experiencing this problem. Kindly help.

Thanx in advance.
Tommcat
 
Hi Kenneth Kawamoto,

I figured it out myself...
The code is all rite, I was just trying to call the files from my system, once I put it on the server & gave a specific path everything worked fine.

Thanx a lot Kenneth Kawamoto, u were of a great help, wish I could give u another star :)

Bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top