im having trouble getting my links to work with the loop i set up to display all of my movieclip instances. Each instance has a button inside of it that is suppose to link to a different game, but instead they all link to the last game in the loop series.
Im putting in my whole code in hopes that someone can help me figure out how to get the getURL thing to work correctly.
im also attaching my .fla this time to see if that will help
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
_global.status = [];
_global.top = [];
_global.runners = [];
gameTime = [];
gameday = [];
inn = [];
out = [];
aTeam = [];
hTeam = [];
aRuns = [];
hRuns = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
_global.status* = xmlNode.childNodes*.attributes.status;
_global.top* = xmlNode.childNodes*.attributes.top_inning;
gameTime* = xmlNode.childNodes*.attributes.time;
gameday* = xmlNode.childNodes*.attributes.gameday_link;
_global.runners* = xmlNode.childNodes*.attributes.runner_on_base_status;
inn* = xmlNode.childNodes*.attributes.inning;
out* = xmlNode.childNodes*.attributes.outs;
aTeam* = xmlNode.childNodes*.attributes.away_name_abbrev;
hTeam* = xmlNode.childNodes*.attributes.home_name_abbrev;
aRuns* = xmlNode.childNodes*.attributes.away_team_runs;
hRuns* = xmlNode.childNodes*.attributes.home_team_runs;
}
games();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://gd2.mlb.com/components/game/mlb/year_2008/month_09/day_28/miniscoreboard.xml");
//////////////////////////////////////
myLoadInteval = setInterval(LoadFile, 10000);
function LoadFile() {
xmlData.load("http://gd2.mlb.com/components/game/mlb/year_2008/month_09/day_28/miniscoreboard.xml");
}
function games() {
xPos = 1;
spacing = 1;
for (a = 0; a<total; a++) {
duplicateMovieClip(_root.game, "game" + a, a);
this["game" + a]._x = xPos;
this["game" + a]._y = (this["game" + a]._height + spacing) * a;
}
for (p=0; p<total; p++) {
this["game" + p].time_txt.text = gameTime[p];
if(inn[p] == 1){
this["game" + p].inning_txt.text = inn[p] + "st";
}
if(inn[p] == 2){
this["game" + p].inning_txt.text = inn[p] + "nd";
}
if(inn[p] == 3){
this["game" + p].inning_txt.text = inn[p] + "rd";
}
if(inn[p] >= 4){
this["game" + p].inning_txt.text = inn[p] + "th";
}
if ((_global.status[p] == "Game Over") || (_global.status[p] == "Final") || (_global.status[p] == "Completed Early") || (_global.status[p] == "Forfeit") || (_global.status[p] == "Suspended") || (_global.status[p] == "Postponed") || (_global.status[p] == "Cancelled")) {
this["game" + p].inning_txt.text = "F/" + inn[p];
}
this["game" + p].outs_txt.text = out[p] + " Out";
this["game" + p].awayTeam_txt.text = aTeam[p];
this["game" + p].homeTeam_txt.text = hTeam[p];
this["game" + p].awayRuns_txt.text = aRuns[p];
this["game" + p].homeRuns_txt.text = hRuns[p];
if(_global.top[p] == "Y"){
this["game" + p].topInning_mc.gotoAndStop(1);
}
if(_global.top[p] == "N"){
this["game" + p].topInning_mc.gotoAndStop(2);
}
if(_global.runners[p] == 0){
this["game" + p].runners_mc.gotoAndStop(1);
}
if(_global.runners[p] == 1){
this["game" + p].runners_mc.gotoAndStop(2);
}
if(_global.runners[p] == 2){
this["game" + p].runners_mc.gotoAndStop(3);
}
if(_global.runners[p] == 3){
this["game" + p].runners_mc.gotoAndStop(4);
}
if(_global.runners[p] == 4){
this["game" + p].runners_mc.gotoAndStop(5);
}
if(_global.runners[p] == 5){
this["game" + p].runners_mc.gotoAndStop(6);
}
if(_global.runners[p] == 6){
this["game" + p].runners_mc.gotoAndStop(7);
}
if(_global.runners[p] == 7){
this["game" + p].runners_mc.gotoAndStop(8);
}
_global.gdStart = "http://mlb.mlb.com/mlb/gameday/index.jsp?gid=";
this["game" + p]mlbGD.onRelease = function() {
getURL(gsStart + gameday[p], "_blank");
}
}
for (v=0; v<total; v++){
if ((_global.status[v] == "Preview") || (_global.status[v] == "Pre-Game") || (_global.status[v] == "Suspended")) {
this["game" + v].awayRuns_txt._visible = false;
this["game" + v].homeRuns_txt._visible = false;
this["game" + v].outs_txt._visible = false;
this["game" + v].inning_txt._visible = false;
this["game" + v].time_txt._visible = true;
this["game" + v].mlbGD._visible = false;
this["game" + v].topInning_mc._visible = false;
}
if ((_global.status[v] == "Warmup") || (_global.status[v] == "Delayed Start") || (_global.status[v] == "In Progress") || (_global.status[v] == "Delayed")) {
this["game" + v].awayRuns_txt._visible = true;
this["game" + v].homeRuns_txt._visible = true;
this["game" + v].outs_txt._visible = true;
this["game" + v].inning_txt._visible = true;
this["game" + v].time_txt._visible = false;
this["game" + v].mlbGD._visible = true;
this["game" + v].topInning_mc._visible = true;
}
if ((_global.status[v] == "Game Over") || (_global.status[v] == "Final") || (_global.status[v] == "Completed Early") || (_global.status[v] == "Forfeit") || (_global.status[v] == "Suspended") || (_global.status[v] == "Postponed") || (_global.status[v] == "Cancelled")) {
this["game" + v].awayRuns_txt._visible = true;
this["game" + v].homeRuns_txt._visible = true;
this["game" + v].outs_txt._visible = false;
this["game" + v].inning_txt._visible = true;
this["game" + v].time_txt._visible = false;
this["game" + v].mlbGD._visible = true;
this["game" + v].topInning_mc._visible = false;
}
}
}