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 handles screen switching and game selection:

//Listener object to handle keypresses

key_listen = new Object();

key.addListener(key_listen);

//Game movement is as follows: Up moves one game forward,

//down moves one game back

key_action = function() {

// game selection and movement controls

(keyDown) {

// This is the handler for the up arrow

if (Key.isDown(key.UP)) {

current_game=current_game-1;

//If user has scrolled to beginning, roll over to end

if (current_game < 0) {

current_game=(total_games-1);

}

}

// This is the handler for the down arrow

else if (Key.isDown(key.DOWN)) {

current_game=current_game+1;

if (current_game==total_games) {

current_game=0; }

}

}

// This is the handler for the control key (game select)

else if (Key.isDown(key.CONTROL)) {

//The fscommand loads the game launch batch (.bat) file

fscommand("exec", gameROM[current_game].attributes.path);

}

// Display of game information begins here

//Display subtitle

number_display.text=gameROM[current_game].attributes.Subtitle;

//Display JPEG image

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

//Display game name

title_display.text=gameROM[current_game].attributes.gameName;

// Display of control panel

if (gameROM[current_game].attributes.controller=="1player") {

one_player.gotoAndStop(1);

}

else if (gameROM[current_game].attributes.controller=="trackball") {

one_player.gotoAndStop(3);

}

else if (gameROM[current_game].attributes.controller=="spinner") {

one_player.gotoAndStop(2);

}

else if (gameROM[current_game].attributes.controller=="2player") {

one_player.gotoAndStop(4);

}

else if (gameROM[current_game].attributes.controller=="gun"){

one_player.gotoAndStop(5);

}

}

key_listen.onKeyDown = key_action;