PDA

View Full Version : Trouble with ScrollPane Component


iamdanielle
05-23-2008, 06:48 PM
Hi...

I have very elementary actionscript capabilities and I'm totally stuck on something that should be super easy so i thought i would try posting it.

I am using the ScrollPane Component in a movieclip that i am loading xml data to. It's working great, in that all my data is loading into it. However the scroll bar never appears. Everything as the correct instance names and is linked, but it's just not working.

Below is my code...if anybody has any ideas i would be eternally grateful....

thanks,
d.




stop();
var artistsArray = new Array();
artistData = new XML();
artistData.ignoreWhite = true;
artistData.load('results.xml');
artistData.onLoad = function(sucess) {
if (sucess) {
parseFile(artistData);
}
};
function parseFile(xmlDoc_xml) {

var data_xml = xmlDoc_xml.firstChild;
for (var i = 0; i < data_xml.childNodes.length; i++) {
var contentData = new Object();
for (var j = 0; j < data_xml.childNodes[i].childNodes.length; j++) {
contentData[data_xml.childNodes[i].childNodes[j].nodeName] = data_xml.childNodes[i].childNodes[j].firstChild.nodeValue;
}
artistsArray.push(contentData);
}
}



scroller.contentPath = "container";

function onEnterFrame():Void{
if (artistData.loaded == true){

for(i=0;i<artistsArray.length;++i){
var songs:MovieClip = scroller.content.attachMovie("track", "a"+i, i);
songs._x = 10;
songs._y = 10+((songs._height+3)*i);
songs.trackname.text = artistsArray[i]["title"];
songs.desc.text = descs[i];
songs.path = paths[i];
songs.onPress = function():Void{
getURL(this.path,"_blank");
}
}

}
}