one of my colleages at work made this code for me.
the xml is read out and on frame one with this code :
// Load in the shop stuff!
var _shopArray:Array = new Array();
shopXML = new XML();
shopXML.ignoreWhite = true;
shopXML.onLoad = function()
{
var root;
root = this.firstChild;
if( root.hasChildNodes() )
{
for( var i = 0; i < root.childNodes.length; i++) {
var _anObject:Object = root.childNodes[i].attributes
_shopArray.push(_anObject);
}
}
gotoAndPlay(2);
}
shopXML.load("shops.xml");
stop();
the second frame makes buttons of the shop places inside the xml file :
// setup buttons
for (var _counter:Number = 0; _counter < 27 ; _counter++) {
var _clipId:String = "button" + _counter.toString();
var _aClip:MovieClip = this.attachMovie("citySelector", _clipId, this.getNextHighestDepth(), {_x:40, _y:80 + (_counter * 18), _cId:_counter});
_aClip.onPress = buttonClicked;
}
stop();
function buttonClicked(event:Object) {
var _shopObject:Object = _level0._shopArray[this._cId];
name.text =_shopObject.company;
address.text = _shopObject.address;
zipcode.text = _shopObject.zipcode;
city.text = _shopObject.place;
site.text = _shopObject.website;
phone.text = _shopObject.tel;
}
the buttons are created perfectly but i can't scroll them and so i wan't to put them in a scrollpane.
can somebody tell me how to attach it to a scrollpane ?
i already enabled the linkage options in flash 8.
Any help would be very appriciated.