So far I'm liking what I have done. But there's 1 problem. I was wondering if it's possible to have the dynamic text field to put the bands name on the top line, then the song on a 2nd line?
I used the tutorial here
Also..the songs start on page load. But only 1 plays at a time. So I need to keep going back and start the next one.
Here's the code from the tutorial
stop(); playlist= new XML(); playlist.ignoreWhite=true; playlist.onload = function (success) { if(success) { _global.songname = []; _global.songfile = []; for (var i=0; i<playlist.firstChild.childNodes.length; i++) { _global.songname = playlist.firstChild.childNodes[i].attributes.name; _global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file; trace(songname[i]+" "+songfile[i]); } _root.createEmptyMovieClip("sound_mc",1); _root.sound_mc.sound_obj = new Sound(); _global.song_nr = random(songfile.length); _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); } else {display_txt.text="Error Loading XML"} } MovieClip.prototype.songStarter = function (file, name) { this.sound_obj.loadSound(file,true) this.onEnterFrame = function () { if(this.sound_obj.position>0) { delete this.onEnterFrame; this._parent.display_txt.text=name; } else { this._parent.display_txt.text="loading..." } } this.sound_obj.onSoundComplete = function () (song_nr==songfiles.length-1)? _global.song_nr=0 : _global.song_nr++; _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); } } btn_play.onRelease = function () { this._parent.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); } btn_stop.onRelease = function() { this._parent.sound_mc.sound_obj.stop(); } btn_next.onRelease = function () { (song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++; _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); } btn_prev.onRelease = function () { (song_nr==0)? _global.song_nr=songfile.length-1 : _global.song_nr--; _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); } playlist.load("playlist.xml");
Can someone please clarify if this code should do what I want, or do I need to change it?
Sorry for such a long question...but I hope I'm clear on what I need fixed.
Thanks.. Hooch
Edited by Hooch, 15 July 2005 - 12:15 PM.