# A bit of help with XML and streaming MP3s

**URL:** <https://forum.kirupa.com/t/a-bit-of-help-with-xml-and-streaming-mp3s/127314>\
**Category:** Uncategorized\
**Created:** [November 1, 2004, 11:11pm UTC](https://forum.kirupa.com/t/a-bit-of-help-with-xml-and-streaming-mp3s/127314 "2004-11-01T23:11:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rockinwebguy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rockinwebguy/32/420_2.png) [@Rockinwebguy](https://forum.kirupa.com/u/Rockinwebguy)\
**Post date:** [November 1, 2004, 11:11pm UTC](https://forum.kirupa.com/t/a-bit-of-help-with-xml-and-streaming-mp3s/127314/1 "2004-11-01T23:11:28Z")

</div>

I have followed along with a tutorial that enable me to create a MP3 player that I built inside a music web site. It works perfectly locally, but when on the web, it doesn’t seem to want to load the MP3s. I thought it would stream the files, but alas, realize it does not. Bleow is the code from the Flash file calling to the XML. Can anyone think of a way of altering the code so that each file is streamed?

Thanks so much!

XMLNode.prototype.moveBefore = function(beforeNode){  
if (this == beforeNode) return (0);  
beforeNode.parentNode.insertBefore( this.cloneNode(true), beforeNode);  
this.removeNode();  
}  
Clamp = function(min, n, max){  
if (n\<min) return min;  
if (n\>max) return max;  
return n;  
}

var song\_spacing = 20;  
var over\_node;  
GenerateSongListing = function(playlist\_xml, target\_mc){

```
target_mc = target_mc.createEmptyMovieClip("list_mc",1);

var songs = playlist_xml.firstChild.childNodes;
for (var i=0; i&lt;songs.length; i++){
	var song_mc = target_mc.attachMovie("song", "song"+i, i);
	song_mc._y = i*song_spacing;
	
	song_mc.node = songs*;
	song_mc.title_txt.text = songs*.attributes.title;
	song_mc.moved = false;
	
	song_mc.select_btn.onPress = function(){
		this._parent.onMouseMove = function(){
			if (!this.moved){
				dragline_mc._visible = true;
				dragline_mc._y = playlist_mc._y + this._y;
				highlight_mc._visible = true;
				highlight_mc._y = playlist_mc._y + this._y;
				this.moved = true;
			}
		}
	}
	
	song_mc.select_btn.onDragOver = function(){
		over_node = this._parent.node;
		dragline_mc._y = playlist_mc._y + this._parent._y;
	}
	
	song_mc.onMouseUp = function(){
		if (this.onMouseMove){
			delete this.onMouseMove;
			dragline_mc._visible = false;
			highlight_mc._visible = false;
			if (this.moved){
				this.node.moveBefore(over_node);
				GenerateSongListing(playlist_xml, playlist_mc);
			}
		}
	}
	
	song_mc.select_btn.onRelease = function(){
		if (!this._parent.moved){
			SetSong(this._parent.node);
		}
	}
	
}

```

}

var playlist\_xml = new XML();  
playlist\_xml.ignoreWhite = true;  
playlist\_xml.onLoad = function(success){  
if (success){  
GenerateSongListing(this, playlist\_mc);  
}else trace(“Error loading XML file”); // no success? trace error (wont be seen on web)  
}  
playlist\_xml.load(“mp3\_playlist.xml”);

dragline\_mc.\_visible = false;  
highlight\_mc.\_visible = false;  
show\_mc.\_visible = false;

show\_btn.onRelease = function(){  
show\_mc.\_visible = true;  
var songs = playlist\_xml.firstChild.childNodes;  
show\_mc.display\_txt.text = playlist\_xml;  
show\_mc.display\_txt.text = show\_mc.display\_txt.text.split("\>").join("\>

");  
}
