Hi There,
I’m guessing I am not the first to ask this nor am I confident I am asking it in the correct location. Please don’t be mad at my rookie mistakes. I tried get this answer on my own but either I am not sure where to look or what I am looking for but I can not do this on my own. Anyone’s help would be greatly appreciated. I used the tutorial below to a tee and if I only had 4 songs I would be set. But I have 12 so they over flow the movieclip’s dimensions. I think a scroll pane is the fix but I can’t get it to work. Below is a link to the tutorial for those not familiar.
http://www.kirupa.com/web/xml/examples/MP3playlist.htm
Below is currently what I have in AC. I have not included any scrollpane attemps nothing seemed to work so I figured it would just be more trouble than it’s worth.
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.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(">
");
}
Any help to get my mp3 playlist to stay within the movieclips dimensions and be able to scroll from song to song would be great.
And if it’s not too much trouble what do I change to eliminate the ability for the user to rearrange the songs? And how do I get the play list to play all the way through without stopping at the end of each song?
I promise I have spent weeks trying to find these answers myself. No one seems to want to help. I’m hoping someone out there will.
Thanks in advance.