m-ed-t
09-05-2007, 10:54 AM
Hi Guys,
I am building my first Flash website and need a XML mp3 player in it. I have been following this tutorial.
pt1 - http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-1/
pt2 -http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-2/
pt3 -http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-3/
the player in the '"music page" of the site that i am creating
i have placed the player at the beginning of the site, so that the music doesn't reload every time the music page it shown. I then set all the movie clips and buttons to become invisible unless you are on the music page.
** Question :confused:
ok finally to the problem that i am having. The code creates a play list menu from the XML file it works great but once it is loaded it overlays everything through the site. does anyone know a way to load this play list into a Movie Clip so i can show and hide it? or is there a better way of doing it?
** Play List Code
playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songband = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
attachMovie("butTemp","but"+i,i+50);
eval("but"+i).id=i;
_root["but"+i]._x = 120;
_root["but"+i]._y = 225 + (i*25);
_root["but"+i].but_txt.text = songname[i];
if (i >= 3){
_root["but"+i]._x = 300
_root["but"+i]._y = 150 + (i*25);
}
if (i >= 6){
_root["but"+i]._x = 480
_root["but"+i]._y = 75 + (i*25);
}
_root["but"+i].onRelease = function(){
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
_root.sound_mc.songStarter(songfile[this.id]);
}
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr]);
};
Many Thanks
Mark
I am building my first Flash website and need a XML mp3 player in it. I have been following this tutorial.
pt1 - http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-1/
pt2 -http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-2/
pt3 -http://blog.six4rty.ch/tutorials/flash-create-a-full-streaming-flash-mp3-player-using-xml-pt-3/
the player in the '"music page" of the site that i am creating
i have placed the player at the beginning of the site, so that the music doesn't reload every time the music page it shown. I then set all the movie clips and buttons to become invisible unless you are on the music page.
** Question :confused:
ok finally to the problem that i am having. The code creates a play list menu from the XML file it works great but once it is loaded it overlays everything through the site. does anyone know a way to load this play list into a Movie Clip so i can show and hide it? or is there a better way of doing it?
** Play List Code
playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songband = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
attachMovie("butTemp","but"+i,i+50);
eval("but"+i).id=i;
_root["but"+i]._x = 120;
_root["but"+i]._y = 225 + (i*25);
_root["but"+i].but_txt.text = songname[i];
if (i >= 3){
_root["but"+i]._x = 300
_root["but"+i]._y = 150 + (i*25);
}
if (i >= 6){
_root["but"+i]._x = 480
_root["but"+i]._y = 75 + (i*25);
}
_root["but"+i].onRelease = function(){
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
_root.sound_mc.songStarter(songfile[this.id]);
}
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr]);
};
Many Thanks
Mark