|
||||||||||||||||
. . . . . |
xml playlist for Flash 8 flv video player
This tutorial follows on from the last tutorial about creating a simple flv player using NetConnnection and NetStream objects that are used in Flash Media Server actionscript programming. This tutorial was taken from the excellent video tutorials by Lee Brimelow at
GotoandLearn.com . Ok. Let us start then. The first thing to do is create a number of .flv video files and put them in the same folder as the flash and .xml files we will create. I created four .flv videos. tkd01.flv - tkd04.flv.
Flash Tutorials in Video Format -
Watch them now at LearnFlash.com
Open up a text editor and write your xml file. Call it videos.xml. <?xml version="1.0" encoding="ISO-8859-1" ?> <videos> <video url="tkd01.flv" desc="Girls paddling out" /> <video url="tkd02.flv" desc="Girls surfing" /> <video url="tkd03.flv" desc="Surfest Contest" /> <video url="tkd04.flv" desc="Tae Kwan Do" /> </videos>
Use the last fla that we did in the last tutorial.
// xml playlist
// create an XMl object
var vidList:XML = new XML();
// ignore white spaces
vidList.ignoreWhite = true;
vidList.onLoad = function() {
// put the nodes of xml into array
var videoArray:Array = this.firstChild.childNodes;
// iterate through video array
// and add videos to the listbox
for (var i = 0; i<videoArray.length; i++) {
videoList.addItem(videoArray[i].attributes.desc, videoArray[i].attributes.url);
}
// when xml is loaded play first item
ns.play(videoList.getItemAt(0).data);
// highlight first video in listbox
videoList.selectedIndex = 0;
};
// create a listener that responds
// to changes in the listbox
var vidListener:Object = new Object();
vidListener.change = function() {
// play the item selected in listbox
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
};
// register the event listener to listbox
videoList.addEventListener("change", vidListener);
// load xml file
vidList.load("videos.xml");
Flash 8 Resourcesflv video player - go back to do the first part of this tutorial to create the flv player. . |
|
||||||||||||||
|
. | Home | Flash MX | Actionscript 2.0 | Flash 3D | Flash 8 | Flash Database | Flash Mobile | Flash CS3 | Java For Kids | Video Course | General Video | Photoshop | Web Design | Digital Photography | Forum | Games | free backgrounds | Resume | Flash Animations | Streaming Video | Students Work | Links | Contact me | sitemap | reviews | store | advertisers | . . |
||||||||||||||||