loadRounds = function (nID) {
this.__theSeriesID = nID
this.theURL ="RaceXML.xml";
trace(this.theURL)
XMLObj = new XML();
XMLObj.ignoreWhite = true;
XMLObj.mc = this;
XMLObj.load(this.theURL);
XMLObj.onLoad = function(){
theXML = this.firstChild.childNodes
this.mc.createRoundTable(theXML)
}
};
createRoundTable = function (theXML) {
UpcomingRacesTable.removeMovieClip();
_root.theRaceTable.RT.removeMovieClip();
_root.theRaceTable.roundHeader.removeMovieClip();
this.RaceData = theXML;
tH = this.attachMovie("roundRow_link","roundHeader",111)
tH.rounds.text = "RD";
tH.location.text = "ORT";
tH.datum.text = "DATUM";
tH.rounds.backgroundColor = tH.location.backgroundColor = tH.datum.backgroundColor =0xa72525
RacesTable = this.createEmptyMovieClip("RT",122)
RacesTable._y = this.roundHeader._y + this.roundHeader._height+5
raceTabMask = this.attachMovie("mask_link","theTableMask",999)
raceTabMask._x = RacesTable._x
raceTabMask._y = RacesTable._y
raceTabMask._height = 150;
RacesTable.setMask(raceTabMask)
Nav = this.createEmptyMovieClip("tT",410)
for(a=0; a<this.RaceData.length; a++){
RacesTable.attachMovie("roundRow_link","roundreihe"+a,222+a)
row = RacesTable["roundreihe"+a]
row._y = ((row._height+2)*a)+1;
row.ID =this.RaceData[a].attributes.ID;
row.location.backgroundColor = row.datum.backgroundColor = row.rounds.backgroundColor =0x0099FF;
row.rounds.text = a+1
row.theTitle = row.location.text = this.RaceData[a].attributes.TITLE
row.theLocation = this.RaceData[a].firstChild.childNodes;
row.theDate = row.datum.text = this.RaceData[a].firstChild.nextSibling.childNodes;
row.onRelease = function(){
this._parent._parent.loadRace(this.ID,this.theTitle,this.theLocation,this.theDate);
}
row.onRollOver = function(){
this.rounds.backgroundColor = this.location.backgroundColor = this.datum.backgroundColor = this.series.backgroundColor =0xcccccc
}
row.onRollOut = function(){
this.rounds.backgroundColor = this.location.backgroundColor = this.datum.backgroundColor = this.series.backgroundColor =0x0099FF
}
raceTabMask._width = RacesTable._width+1;
///SCROLLER
if(RacesTable._height >= raceTabMask.height){
tL = this.attachMovie("line_link","theLine",88);
tL._x = raceTabMask._x + raceTabMask._width + 5;
tL._y = RacesTable._y;
tL._height = raceTabMask._height;
targY = raceTabMask._y
tS = this.attachMovie("scroller_link","theScroller",99)
tS._x = tL._x - (tS._width/2)
tS._y = tL._y
tS.onPress = function(){
startDrag(this,false,this._x,raceTabMask._y,this._x,RacesTable._height-this._height-5);
}
tS.onRelease = tS.onReleaseOutside = function(){
stopDrag();
}
RacesTable.onEnterFrame=function(){
scrollAmount=(RacesTable._height-(RacesTable._height/1.3))/(RacesTable._height-tS._height);
targY=-tS._y*scrollAmount;
RacesTable._y-=(RacesTable._y-targY)/5;
//trace("scrollAmount: "+scrollAmount)
}
}
///END SCROLLER
}
};
loadRounds();