# Random Video Play List

**URL:** <https://forum.kirupa.com/t/random-video-play-list/209536>\
**Category:** flash\
**Created:** [December 9, 2006, 11:00pm UTC](https://forum.kirupa.com/t/random-video-play-list/209536 "2006-12-09T23:00:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![santhoshdotcom](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@santhoshdotcom](https://forum.kirupa.com/u/santhoshdotcom)\
**Post date:** [December 9, 2006, 11:00pm UTC](https://forum.kirupa.com/t/random-video-play-list/209536/1 "2006-12-09T23:00:52Z")

</div>

I am working on my xml video play list. But I want to auto play songs after one another. How can i do that. Here is my code. If anyone could help me:hangover:

stop();  
var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
theVideo.attachVideo(ns);

var vlist:XML =new XML();  
vlist.ignoreWhite = true;  
vlist.onLoad = function() {  
var videos:Array = this.firstChild.childNodes;  
for (i=0;i\<videos.length;i++){  
videoList.addItem(videos\*.attributes.desc,videos\*.attributes.url);  
}

i = 0;  
if (i\<0){  
i++  
}

ns.play(videoList.getItemAt(i).data);  
ns.seek(2);

videoList.selectedIndex = i;  
}  
var vidList:Object = new Object();  
vidList.change = function() {  
ns.play(videoList.getItemAt(videoList.selectedIndex).data);  
}  
videoList.addEventListener(“change”,vidList);

vlist.load(“videos.xml”);
