EXTERNAL SWF (works by itself)
this.onLoad = function() {
this.base_mc.onRollOver = function() { gotoAndPlay(1); };
this.base_mc.onRollOut = function() { gotoAndPlay(13); };
};
MAIN SWF (external swf no longer works when loaded here)
var games = new Array();
var gamesXML = new XML();
gamesXML.ignoreWhite=true;
gamesXML.load(“games.xml”);
gamesXML.onLoad = function(success) {
if (success){
var game = gamesXML.firstChild.childNodes;
for (i=0; i < game.length; i++) {
var gameTitle = game*.attributes.title;
var gameAsset = game*.attributes.asset;
var gameLink = game*.attributes.link;
games*=new Array(gameTitle,gameAsset,gameLink);
}
loadGames();
}
};
this.loadGames = function() {
for(i=0;i<games.length;i++){
this[“game”+i+"_mc"].name_txt.text=games*[0];
this[“game”+i+"_mc"].background_mc.loadMovie(games*[1]);
this[“game”+i+"_mc"].gameLink = games*[2];
}
};
[quote=victorcorey;2329616]EXTERNAL SWF (works by itself)
this.onLoad = function() {
this.base_mc.onRollOver = function() { gotoAndPlay(1); };
this.base_mc.onRollOut = function() { gotoAndPlay(13); };
};
MAIN SWF (external swf no longer works when loaded here)
var games = new Array();
var gamesXML = new XML();
gamesXML.ignoreWhite=true;
gamesXML.load(“games.xml”);
gamesXML.onLoad = function(success) {
if (success){
var game = gamesXML.firstChild.childNodes;
for (i=0; i < game.length; i++) {
var gameTitle = game*.attributes.title;
var gameAsset = game*.attributes.asset;
var gameLink = game*.attributes.link;
games*=new Array(gameTitle,gameAsset,gameLink);
}
loadGames();
}
};
this.loadGames = function() {
for(i=0;i<games.length;i++){
this[“game”+i+"_mc"].name_txt.text=games*[0];
this[“game”+i+"_mc"].background_mc.loadMovie(games*[1]);
this[“game”+i+"_mc"].gameLink = games*[2];
}
};[/quote]
Can you post the file so I can take a look at it. or post how the xml is structured as I assume the xml contains the paths for the swfs to be loaded. It is most likely a scope issue, but I need a little more info to be sure.
Sean
I was able to get it to work by changing the path in the external swf to:
_level0.game0_mc.background_mc.base_mc.onRollOver = function() { gotoAndPlay(1); };
but this seems kind of hacky.