# Xml load

**URL:** <https://forum.kirupa.com/t/xml-load/211489>\
**Category:** Uncategorized\
**Created:** [January 2, 2007, 7:06am UTC](https://forum.kirupa.com/t/xml-load/211489 "2007-01-02T07:06:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karuppaiyan](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@karuppaiyan](https://forum.kirupa.com/u/karuppaiyan)\
**Post date:** [January 2, 2007, 7:06am UTC](https://forum.kirupa.com/t/xml-load/211489/1 "2007-01-02T07:06:47Z")

</div>

hai

i use this code xml loading error  
plz help

stop();  
this.attachMovie(“theVideo”, “mcTheVideo”, this.getNextHighestDepth());  
mcTheVideo.\_x = 121;  
mcTheVideo.\_y = 150;  
mcTheVideo.swapDepths(info);  
var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
ns.setBufferTime(5);  
ns.onStatus = function(info){  
if(info.code == “NetStream.Buffer.Full”){  
bufferClip.\_visible = false;  
}  
if(info.code == “NetStream.Buffer.Empty”){  
bufferClip.\_visible = true;  
}  
if(info.code == “NetStream.Play.Stop”){  
ns.seek(0);  
}  
}  
mcTheVideo.theVideo.attachVideo(ns);  
var videoInterval = setInterval(videoStatus,100);  
var amountLoaded:Number;  
var duration:Number;  
ns[“onMetaData”] = function(obj) {  
duration = obj.duration;  
}  
function videoStatus() {  
amountLoaded = ns.bytesLoaded / ns.bytesTotal;  
loader.loadbar.\_width = amountLoaded \* 312.3;  
loader.scrub.\_x = ns.time / duration \* 312.3;  
}  
var scrubInterval;  
loader.scrub.onPress = function() {  
clearInterval(videoInterval);  
scrubInterval = setInterval(scrubit,10);  
this.startDrag(false,0,this.\_y,307,this.\_y);  
}  
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){  
clearInterval(scrubInterval);  
videoInterval = setInterval(videoStatus,100);  
this.stopDrag();  
}  
function scrubit(){  
ns.seek(Math.floor((loader.scrub.\_x/307)\*duration));  
}

var theMenu:ContextMenu = new ContextMenu();  
theMenu.hideBuiltInItems();  
\_root.menu = theMenu;  
var i1:ContextMenuItem = new ContextMenuItem(":: Video Controls::",trace);  
theMenu.customItems[0] = i1;  
var i2:ContextMenuItem = new ContextMenuItem(“Play / Pause Video”,pauseIt,true);  
theMenu.customItems[1] = i2;  
var i3:ContextMenuItem = new ContextMenuItem(“Replay Video”,replayIt);  
theMenu.customItems[2] = i3;  
var i4:ContextMenuItem = new ContextMenuItem(“© 2006 [Tamilfilmratings.com](http://Tamilfilmratings.com)”,trace,true);  
theMenu.customItems[3] = i4;  
function pauseIt() {  
ns.pause();  
}  
function replayIt(){  
ns.seek(0);  
ns.play();  
}  
this.createEmptyMovieClip(“vSound”, \_root.getNextHighestDepth())  
vSound.attachAudio(ns);  
var so:Sound = new Sound(vSound);  
so.setVolume(100);

this.onEnterFrame = function():Void {  
tTime.text = ns.time.toString() + " sec";  
};  
//start list components colour coding  
videoList.rollOverColor=“0xcccccc”;  
videoList.selectionColor=“0xcceeff”;  
videoList.backgroundColor=“none”;  
videoList.borderColor=“0x1B1B1B”;  
videoList.borderStyle=“none”;  
videoList.highlightColor=“0x1B1B1B”;  
videoList.borderCapColor=“0x1B1B1B”;  
videoList.shadowCapColor=“0x1B1B1B”;  
videoList.ShadowColor=“none”;  
///  
//start XML coding  
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);  
}  
ns.play(videoList.getItemAt(0).data);  
videoList.selectedIndex = 0;  
}  
var vidList:Object = new Object();  
vidList.change = function() {  
ns.play(videoList.getItemAt(videoList.selectedIndex).data);  
}  
videoList.addEventListener(“change”,vidList);  
vlist.load(“http://” + server + “/test-trailers/player.asp?vid=” + \_root.vid);
