I am new to xml content in flash. I have been through the kirupa tut for loading xml content and have been successful in implementing it, but I now want to implement it into a scrollbar so I can use css and img tags. I can get it to work using the UI scroll component, but i want to use a custom scroll bar. I get the XML to load fine but I have no clue where to stick in the firstChild.childNodes[0] so I can call to certain attributes within the XML document.
Below is the AS for the custom scroll bar. If anyone could help I would be thankful
stop();
holder_mc.setMask(mask_mc);
var LV:LoadVars = new LoadVars();
LV.onData = function(info:String):Void {
holder_mc._txt.text = info;
holder_mc._txt.autoSize = "center";
makeScroll();
};
LV.load("text_box2.xml");
var dragging:Boolean = new Boolean();
function makeScroll():Void {
scroller_mc._x = Math.round(scroller_mc._x);
starting = holder_mc._y;
scroller_mc.onPress = function() {
dragging = true;
top = mask_mc._y;
bottom = mask_mc._y+mask_mc._height-scroller_mc._height;
this.startDrag(false, this._x, top, this._x, bottom);
this.onEnterFrame = function() {
percent = (scroller_mc._y-top)/(bottom-top);
moveAmount = percent*(holder_mc._height-(mask_mc._height/1.2));
finalY = starting-moveAmount;
currentY = holder_mc._y;
difference = (currentY-finalY)/7;
if (holder_mc._y<=starting) { holder_mc._y -= difference; }
if (Math.abs(difference)<0.05 && !dragging) {
delete this.onEnterFrame;
holder_mc._y = Math.round(holder_mc._y);
}
};
};
scroller_mc.onRelease = scroller_mc.onReleaseOutside=function () {
dragging = false;
this.stopDrag();
};
}