Flash MAME Front End... a Flash-based front end for MAME
Home Cabinet Flash FE Dynamic FE Downloads FAQ Links

Below is the code (and comments) for the dynamic version of the Flash-based MAME front end


This code loads the data from the XML config file:

 

// Setting up definitions for the XML file

_root.playlist == undefined ? playlist = "ffe.xml" : playlist=_root.playlist;

_root.createEmptyMovieClip("container",1);

_global.total_games;

_global.current_game = 1;

// gamelist loading

data_xml = new XML();

data_xml.ignoreWhite = true;

data_xml.onLoad = loadData;

data_xml.load(playlist);

function loadData(success){

if (success){

// If the loading was successful, configure arrays to hold data

aPath = new Array();

gameName = new Array();

gameROM = new Array();

gameController = new Array();

gameSubtitle = new Array();

gameROM = this.firstChild.childNodes;

game_total = gameROM.length;

for (var i = 0; i<game_total; i++) {

// Loop through the list and populate the arrays

aPath.push(gameROM[i].attributes.path); gameName.push(gameROM[i].attributes.title); gameSubtitle.push(gameROM[i].attributes.Subtitle); gameController.push(gameROM[i].attributes.controller);

}

// Set the total_games variable to control end-of-list looping

total_games=i;

// Load the first image

container.loadMovie(gameROM[2].attributes.picture);

container._x = 50; container._y = 250 ;

}

}