PDA

View Full Version : Scrolling an XML built menu.....



robocop
August 20th, 2003, 10:43 AM
Hey there...i got my xml based menu finally completed...but now, i would like to put it inside of a scroller/mx scrollpane component so that people can scroll through all of the items that the XML file creates...anyone have any ideas? ive pasted the code and a link to the source files...feel free to tear em apart.....


clipYPos = 0;
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function(success){
if(success){
menuItem = this.firstChild.childNodes;
//trace(contentData);
for(var i=0; i<menuItem.length; i++){
item = _root.attachMovie("itemClip","itemClip", + i);
item.headline.text = menuItem.attributes.name;
item.myUrl = menuItem.attributes.url;
item.content.text = menuItem.attributes.content;
spacing = item.content.textHeight + item.headline._height + 20
item._x = 200;
item._y = clipYPos;
clipYPos = clipYPos + spacing;

}
}
}
menuXml.load("myMenu.xml" ;


source file: http://www.pyroblue.com/UPLOAD/myMenu.zip

im thinkin that where it says "_root.attatchMovie"....that i should add like "_root.scroller.attatchMovie"....i dunno...im at a loss....

thanks yall!!