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<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(">
");
}