# .flvs with XML playlist

**URL:** <https://forum.kirupa.com/t/flvs-with-xml-playlist/197389>\
**Category:** flash\
**Created:** [August 15, 2006, 11:25pm UTC](https://forum.kirupa.com/t/flvs-with-xml-playlist/197389 "2006-08-15T23:25:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![East\_High](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@East\_High](https://forum.kirupa.com/u/East_High)\
**Post date:** [August 15, 2006, 11:25pm UTC](https://forum.kirupa.com/t/flvs-with-xml-playlist/197389/1 "2006-08-15T23:25:16Z")

</div>

I’m trying to use XML to make my video player easy to update 'cept it’s not really working. Can anyone here see the issue at hand? My eyes are too worn right now (been looking at it forever).:sen::crazy:

```
 ActionScript Code:
 [FONT=Courier New][LEFT][COLOR=#808080]*/////////XML/////////////*[/COLOR]

```

[COLOR=#000000] **function** [/COLOR] loadXMLCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]xmlNode[/COLOR] = [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]firstChild[/COLOR];  
[COLOR=#0000ff]video[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];  
tag = [COLOR=#000000][[/COLOR][COLOR=#000000]][/COLOR];  
total = [COLOR=#0000ff]xmlNode[/COLOR].[COLOR=#0000ff]childNodes[/COLOR].[COLOR=#0000ff]length[/COLOR];  
[COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000080]0[/COLOR]; i\<total; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]video[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = [COLOR=#0000ff]xmlNode[/COLOR].[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]nodeValue[/COLOR];  
tag[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = [COLOR=#0000ff]xmlNode[/COLOR].[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]childNodes[/COLOR][COLOR=#000000][[/COLOR][COLOR=#000080]1[/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000ff]firstChild[/COLOR].[COLOR=#0000ff]nodeValue[/COLOR];  
[COLOR=#000000]}[/COLOR]  
ns.[COLOR=#0000ff]play[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]  
content = [COLOR=#ff0000]“file not loaded!”[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
xmlData = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]XML[/COLOR]COLOR=#000000[/COLOR];  
xmlData.[COLOR=#0000ff]ignoreWhite[/COLOR] = [COLOR=#000000] **true** [/COLOR];  
xmlData.[COLOR=#0000ff]onLoad[/COLOR] = loadXML;  
xmlData.[COLOR=#0000ff]load[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_/////////////////////////////////_[/COLOR]  
[COLOR=#000000] **var** [/COLOR] nc:[COLOR=#0000ff]NetConnection[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]NetConnection[/COLOR]COLOR=#000000[/COLOR];  
nc.[COLOR=#0000ff]connect[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000] **var** [/COLOR] ns:[COLOR=#0000ff]NetStream[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]NetStream[/COLOR]COLOR=#000000[/COLOR];  
ns.[COLOR=#0000ff]setBufferTime[/COLOR]COLOR=#000000[/COLOR];  
myVideo.[COLOR=#0000ff]attachVideo[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#808080]_//path = “videos/”;_[/COLOR]  
[COLOR=#808080]_[//ns.play](https://ns.play)(path+“part1.flv”);_[/COLOR]  
[COLOR=#808080]_[//ns.play](https://ns.play)(video[p]);_[/COLOR]  
ns.[COLOR=#0000ff]onStatus[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]object[/COLOR].[COLOR=#000080]code[/COLOR] == [COLOR=#ff0000]“NetStream.Play.Start”[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]object[/COLOR].[COLOR=#000080]code[/COLOR] == [COLOR=#ff0000]“NetStream.Play.Stop”[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]loadMovieNum[/COLOR][COLOR=#000000]([/COLOR]tag[COLOR=#000000][[/COLOR]p[COLOR=#000000]][/COLOR], [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#808080]_//loadMovieNum(“logo.swf”, 1);_[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR];  
[COLOR=#808080]\*//////////////////////// \*[/COLOR]

[/LEFT]  
[/FONT]

Here’s my XML. the file is called ‘videos.xml’

```auto
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<programs>
    <videos>
        <video>/flvs/part1.flv</video>
        <tag>logo.swf</tag>
    </videos>    
</programs>

```

Thanks!
