# Help with a little bit of code?

**URL:** https://forum.kirupa.com/t/help-with-a-little-bit-of-code/246873
**Category:** flash
**Created:** [December 15, 2007, 7:55pm UTC](https://forum.kirupa.com/t/help-with-a-little-bit-of-code/246873 "2007-12-15T19:55:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dunkyb123](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dunkyb123](https://forum.kirupa.com/u/dunkyb123)
#### Post date: [December 15, 2007, 7:55pm UTC](https://forum.kirupa.com/t/help-with-a-little-bit-of-code/246873/1 "2007-12-15T19:55:51Z")

</div>

Hello All,

I am trying to get a video player to play a continuous list of videos, the video list will loaded via XML.

Their is no option to choose what video i just want the video to keep going through the list and when it reaches the end to start at the first video and go through the list.

My Code:

```auto
 //----------Creating The Video Source To Run----------//
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream (nc);
theVideo.attachVideo(ns);

var videoXML:XML = new XML();
videoXML.ignoreWhite = true;

var videos:Array = new Array();
var videoArray:Array = new Array();
var urls:Array = new Array();
var currentIndex:Number = 0;

videoXML.onLoad = function(success){
    if(success){
        trace("HELLO");
        videos = videoXML.firstChild.childNodes;
        for (i=0;i<videos.length;i++){
            urls.push(videos*.attributes.url) 
            
    }
        ns.play(urls[currentIndex],true);
    
    }
    else
    {
        trace("IT WENT WRONG");
    }
}

videoXML.load("bannervideo.xml");

```

My XML:

```auto
<?xml version="1.0" encoding="utf-8"?>
    <banner>
        <video url="GVideos/banner1.flv" />
        <video url="GVideos/banner2.flv" />
        <video url="GVideos/banner3.flv" />
        <video url="GVideos/banner4.flv" />
        <video url="GVideos/banner5.flv" />
        <video url="GVideos/banner6.flv" />
        <video url="GVideos/banner7.flv" />        
    </banner>

```

I appear to have a problem but i cannot see what i am doing wrong :ponder: i know it has something to do with this line of code \*\*“ns.play(urls[currentIndex],true);”

\*\*Can anybody tell me what i have done wrong?

Many Many Thanks

Dunkyb123
