Instance of Symbol 139 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
xin_motion_val = "Toward";
xin_alphatype_val = "No";
xout_motion_val = "None";
xout_alphatype_val = "No";
perc_req_val = 100;
show_perc_val = "Yes";
slow_factor_val = 0.2;
init_action_val = "_root.stop();";
play_action_val = "_root.play();";
}
Frame 182
stop();
Instance of Symbol 122 MovieClip [GeographyGameComponent] in Frame 182
//component parameters
onClipEvent (initialize) {
map_colors = [];
map_colors[0] = "0xD5A259";
map_colors[1] = "0xFC824F";
map_colors[2] = "0xE6A800";
map_colors[3] = "0xF1E2C0";
map_colors[4] = "0xFFCF00";
map_colors[5] = "0xF0C602";
map_colors[6] = "0xE69800";
map_colors[7] = "0xFF5700";
map_colors[8] = "0xFE9623";
rollover_color = "0x00CC00";
guessed_color = "0x000000";
guessed_alpha = 75;
turn_mode = "Infinite Turns";
num_total_turns = 10;
region_cycle = "Guess Once and Cycle";
fly_by_speed = 6;
fly_height = 200;
screen_width = 651.8;
points_correct_answer = 10;
points_incorrect_answer = -5;
correct_sound_linkage = "correct_sound";
incorrect_sound_linkage = "incorrect_sound";
}
Symbol 58 Button
on (release) {
_parent.gotoAndStop("mainmenu");
}
Symbol 117 Button
on (press) {
if (game.mode & GEOGRAPHY_GAME_PAUSED) {
game.mode = game.mode ^ GEOGRAPHY_GAME_PAUSED;
if (!(game.mode & GEOGRAPHY_GAME_DISPLAYING_REGION)) {
current_region_name = game.regions[game.current_region].standardForm();
}
} else {
game.mode = game.mode | GEOGRAPHY_GAME_PAUSED;
current_region_name = "PAUSED";
}
}
Symbol 122 MovieClip [GeographyGameComponent] Frame 1
Object.prototype.GEOGRAPHY_GAME_NULL = 0;
Object.prototype.GEOGRAPHY_GAME_DISPLAYING_REGION = 2;
Object.prototype.GEOGRAPHY_GAME_WAITING_FOR_USER = 4;
Object.prototype.GEOGRAPHY_GAME_CORRECT_ANSWER = 8;
Object.prototype.GEOGRAPHY_GAME_INCORRECT_ANSWER = 16;
Object.prototype.GEOGRAPHY_GAME_PAUSED = 32;
Array.prototype.swap = function (e1, e2) {
var _local1 = this;
var _local2 = _local1[e1];
_local1[e1] = _local1[e2];
_local1[e2] = _local2;
};
Array.prototype.shuffle = function () {
var _local1 = this;
var _local2 = 0;
while (_local2 < _local1.length) {
var e1 = Math.randi(0, _local1.length);
var _local3 = Math.randi(0, _local1.length);
_local1.swap(e1, _local3);
_local2++;
}
};
Array.prototype.returnRandomElement = function () {
return(this[Math.randi(0, this.length)]);
};
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + a);
};
String.prototype.standardForm = function () {
var _local3 = this;
var _str = new String();
var _local1 = 0;
while (_local1 < _local3.length) {
var _local2 = _local3.charCodeAt(_local1);
if ((_local1 > 0) && ((_local2 >= "A".charCodeAt(0)) && (_local2 <= "Z".charCodeAt(0)))) {
_str = _str + " ";
}
_str = _str + _local3.charAt(_local1);
_local1++;
}
return(_str);
};
MovieClip.prototype.setColor = function (col) {
var _local1 = new Color(this);
_local1.setRGB(col);
};
this._x = 0;
this._y = 0;
Object.prototype.GeographyGame = function () {
var _local1 = this;
_local1.current_map = 0;
_local1.num_player_turns = _local1.num_total_turns;
_local1.score = 0;
_local1.timeline.score = 0;
_local1.timeline.turns_remaining = _local1.num_total_turns;
_local1.original_mascot_x = -20;
_local1.mouse_over_region = undefined;
_local1.old_mouse_over_region = undefined;
_local1.initialize();
};
GeographyGame.prototype.map_colors = map_colors;
GeographyGame.prototype.rollover_color = parseInt(rollover_color);
GeographyGame.prototype.guessed_color = parseInt(guessed_color);
GeographyGame.prototype.guessed_alpha = Number(guessed_alpha);
GeographyGame.prototype.turn_mode = turn_mode;
GeographyGame.prototype.num_total_turns = Number(num_total_turns);
GeographyGame.prototype.region_cycle = region_cycle;
GeographyGame.prototype.fly_by_speed = Number(fly_by_speed);
GeographyGame.prototype.fly_height = Number(fly_height);
GeographyGame.prototype.screen_width = Number(screen_width);
GeographyGame.prototype.points_correct_answer = Number(points_correct_answer);
GeographyGame.prototype.points_incorrect_answer = Number(points_incorrect_answer);
GeographyGame.prototype.correct_sound_linkage = correct_sound_linkage;
GeographyGame.prototype.incorrect_sound_linkage = incorrect_sound_linkage;
GeographyGame.prototype.timeline = this;
delete map_colors;
delete rollover_color;
delete guessed_color;
delete guessed_alpha;
delete turn_mode;
delete num_total_turns;
delete region_cycle;
delete fly_by_speed;
delete fly_height;
delete screen_width;
GeographyGame.prototype.initialize = function () {
var _local1 = this;
var _local2 = _root;
if (_local1.current_map == _local1.timeline.maps._totalframes) {
_local2.score = _local1.score;
if (_local1.turn_mode == "Infinite Turns") {
_local2.gotoAndStop(_local2._totalframes);
} else {
_local2.gotoAndStop(_local2._totalframes - 1);
}
} else {
_local1.initialize_variables();
_local1.load_current_map();
_local1.build_region_database();
_local1.create_mascot();
}
};
GeographyGame.prototype.initialize_variables = function () {
var _local1 = this;
_local1.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
_local1.current_region = 0;
if (_local1.mode == "Turns Reset Every Level") {
_local1.num_player_turns = _local1.num_total_turns;
_local1.timeline.turns_remaining = _local1.num_total_turns;
}
};
GeographyGame.prototype.load_current_map = function () {
this.timeline.maps.gotoAndStop(this.current_map + 1);
};
GeographyGame.prototype.build_region_database = function () {
var _local2 = this;
var _local3 = 0;
_local2.regions = new Array();
for (var j in _local2.timeline.maps) {
var _local1 = _local2.timeline.maps[j];
if (typeof(_local1) == "movieclip") {
_local2.regions[_local3] = _local1._name;
_local1.original_color = parseInt(_local2.map_colors[_local3 % _local2.map_colors.length]);
_local1.setColor(_local1.original_color);
_local1.selected = false;
_local3++;
}
}
_local2.num_total_map_regions = _local2.regions.length;
_local2.regions.shuffle();
};
GeographyGame.prototype.create_mascot = function () {
var _local1 = this;
_local1.timeline.mascot.removeMovieClip();
_local1.timeline.attachMovie("mascot_gg", "mascot", 1);
_local1.timeline.mascot._x = _local1.original_mascot_x;
_local1.timeline.mascot._y = _local1.fly_height;
_local1.timeline.mascot.field = _local1.regions[_local1.current_region].standardForm();
_local1.timeline.current_region_name = "";
};
GeographyGame.prototype.action = function () {
var _local1 = this;
if (_local1.mode & GEOGRAPHY_GAME_PAUSED) {
} else {
if (_local1.mode & GEOGRAPHY_GAME_DISPLAYING_REGION) {
_local1.animate_mascot();
}
if ((_local1.mode & GEOGRAPHY_GAME_WAITING_FOR_USER) || (_local1.mode & GEOGRAPHY_GAME_DISPLAYING_REGION)) {
_local1.render_map();
} else if (_local1.mode & GEOGRAPHY_GAME_CORRECT_ANSWER) {
_local1.check_correct_message_done();
} else if (_local1.mode & GEOGRAPHY_GAME_INCORRECT_ANSWER) {
_local1.check_incorrect_message_done();
}
}
};
GeographyGame.prototype.animate_mascot = function () {
var _local1 = this;
_local1.timeline.mascot._x = _local1.timeline.mascot._x + _local1.fly_by_speed;
_local1.timeline.current_region_name = _local1.regions[_local1.current_region].standardForm();
if ((_local1.timeline.mascot._x - _local1.timeline.mascot._width) >= _local1.screen_width) {
_local1.mode = GEOGRAPHY_GAME_WAITING_FOR_USER;
_local1.timeline.mascot._x = _local1.original_mascot_x;
}
};
GeographyGame.prototype.render_map = function () {
var _local2 = this;
var _local3 = _root;
_local2.old_mouse_over_region = _local2.mouse_over_region;
var num_checked_regions = 0;
for (var j in _local2.timeline.maps) {
var _local1 = _local2.timeline.maps[j];
if (((typeof(_local1) == "movieclip") && (_local1.hitTest(_local3._xmouse, _local3._ymouse, true))) && (!_local1.selected)) {
_local2.mouse_over_region = _local1;
break;
}
if (typeof(_local1) == "movieclip") {
num_checked_regions++;
}
}
if (!_local2.old_mouse_over_region.selected) {
_local2.old_mouse_over_region.setColor(_local2.old_mouse_over_region.original_color);
}
if (!_local2.mouse_over_region.selected) {
_local2.mouse_over_region.setColor(_local2.rollover_color);
}
if ((num_checked_regions == _local2.num_total_map_regions) && (!_local2.old_mouse_over_region.selected)) {
_local2.old_mouse_over_region.setColor(_local2.old_mouse_over_region.original_color);
}
};
GeographyGame.prototype.mouse_click = function () {
var _local1 = this;
var _local3 = _root;
if ((_local1.mode & GEOGRAPHY_GAME_WAITING_FOR_USER) || (_local1.mode & GEOGRAPHY_GAME_DISPLAYING_REGION)) {
for (var j in _local1.timeline.maps) {
var _local2 = _local1.timeline.maps[j];
if (_local2.hitTest(_local3._xmouse, _local3._ymouse, true) && (!_local2.selected)) {
_local1.evaluate_guess(_local2);
_local1.timeline.mascot._x = _local1.original_mascot_x;
return;
}
}
}
};
GeographyGame.prototype.evaluate_guess = function (region_mc) {
var _local1 = this;
var _local2 = region_mc;
if (_local2._name == _local1.regions[_local1.current_region]) {
_local1.player_guessed_correctly(_local2);
} else {
_local1.player_guessed_incorrectly(_local2);
}
};
GeographyGame.prototype.player_guessed_correctly = function (region_mc) {
var _local1 = this;
var _local2 = region_mc;
_local1.score = _local1.score + _local1.points_correct_answer;
_local1.timeline.score = _local1.score;
_local2.selected = true;
_local2.setColor(_local1.guessed_color);
_local2._alpha = _local1.guessed_alpha;
_local1.regions.splice(_local1.current_region, 1);
_local1.mode = GEOGRAPHY_GAME_CORRECT_ANSWER;
_local1.create_correct_answer_message();
};
GeographyGame.prototype.player_guessed_incorrectly = function (region_mc) {
var _local1 = this;
_local1.score = _local1.score + _local1.points_incorrect_answer;
_local1.timeline.score = _local1.score;
region_mc.setColor(region_mc.original_color);
if (_local1.region_cycle == "Guess Once and Remove") {
_local1.regions.splice(_local1.current_region, 1);
_local1.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
} else if (_local1.region_cycle == "Guess Once and Cycle") {
_local1.regions.push(_local1.regions[_local1.current_region]);
_local1.regions.splice(_local1.current_region, 1);
_local1.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
} else if (_local1.region_cycle == "Guess Many Times") {
_local1.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
}
if ((_local1.turn_mode == "Turns Reset Every Level") || (_local1.turn_mode == "One Set of Turns")) {
_local1.num_player_turns--;
_local1.timeline.turns_remaining = _local1.num_player_turns;
if (_local1.num_player_turns < 0) {
_root.gotoAndStop(_root._totalframes);
}
}
_local1.create_incorrect_answer_message();
};
GeographyGame.prototype.create_correct_answer_message = function () {
var _local1 = this;
_local1.timeline.attachMovie("correct_gg", "message", 2);
_local1.timeline.message._x = _local1.timeline.maps._x;
_local1.timeline.message._y = _local1.timeline.maps._y;
_local1.timeline.message.play();
var _local2 = new Sound();
_local2.attachSound(_local1.correct_sound_linkage);
_local2.start(0, 0);
};
GeographyGame.prototype.create_incorrect_answer_message = function () {
var _local1 = this;
_local1.timeline.attachMovie("incorrect_gg", "message", 2);
_local1.timeline.message._x = _local1.timeline.maps._x;
_local1.timeline.message._y = _local1.timeline.maps._y;
_local1.timeline.message.play();
var _local2 = new Sound();
_local2.attachSound(_local1.incorrect_sound_linkage);
_local2.start(0, 0);
};
GeographyGame.prototype.check_correct_message_done = function () {
var _local1 = this;
if (_local1.timeline.message._currentframe == _local1.timeline.message._totalframes) {
_local1.timeline.message.removeMovieClip();
_local1.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
_local1.timeline.mascot.field = _local1.regions[_local1.current_region].standardForm();
_local1.check_map_status();
}
};
GeographyGame.prototype.check_incorrect_message_done = function () {
var _local1 = this;
if (_local1.timeline.message._currentframe == _local1.timeline.message._totalframes) {
_local1.timeline.message.removeMovieClip();
if (_local1.region_cycle == "Guess Many Times") {
_local1.mode = GEOGRAPHY_GAME_WAITING_FOR_USER;
} else {
_local1.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
_local1.timeline.mascot.field = _local1.regions[_local1.current_region].standardForm();
}
_local1.check_map_status();
}
};
GeographyGame.prototype.check_map_status = function () {
var _local1 = this;
if (_local1.regions.length == 0) {
_local1.current_map++;
_local1.initialize();
}
};
game = new GeographyGame();
Instance of Symbol 121 MovieClip in Symbol 122 MovieClip [GeographyGameComponent] Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (mouseDown) {
_parent.game.mouse_click();
}
onClipEvent (enterFrame) {
_parent.game.action();
}
Symbol 139 MovieClip Frame 1
stop();
Instance of Symbol 138 MovieClip "swfloader" in Symbol 139 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _local2 = str;
var _local3 = new String("");
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2.charAt(_local1) != " ") && (_local2.charAt(_local1) != ";")) {
_local3 = _local3 + _local2.charAt(_local1);
}
_local1++;
}
return(_local3);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((action.length > 0) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var _local3 = action.split(".");
var timeline_action = _local3.pop();
var first_paren = timeline_action.indexOf("(");
var second_paren = timeline_action.indexOf(")");
var timeline_function = timeline_action.substr(0, first_paren);
var function_parameter = timeline_action.substr(first_paren + 1, second_paren - (first_paren + 1));
var _local2 = timeline;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local2[_local3[_local1]];
_local1++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
_local2[timeline_function](function_parameter);
}
}
function execute_action() {
var _local1 = _parent;
unloaded = true;
_local1._visible = false;
simple_script(_local1.play_action_val, _local1);
}
_parent.anim.gotoAndStop(1);
simple_script(_parent.init_action_val, _parent);
var done = false;
var unloaded = false;
var orig_x = _parent._x;
var orig_y = _parent._y;
var dist_x = (_parent._x + ((_parent._width * 2) / 3));
var dist_y = (_parent._y + ((_parent._height * 2) / 3));
var orig_a = _parent._alpha;
var accel_jump = 0.75;
var slow_factor = _parent.slow_factor_val;
var speed_factor = (1 + (slow_factor / (1 - slow_factor)));
var ready = false;
var perc_fadeout = 0;
_parent.perc._x = _parent.anim._x - (_parent.perc._width / 2);
_parent.perc._y = _parent.anim._y - (_parent.perc._height / 2);
if (slow_factor < 1) {
switch (_parent.xin_motion_val) {
case "Up" :
_parent._y = orig_y + (dist_y * 2);
break;
case "Down" :
_parent._y = orig_y - (dist_y * 2);
break;
case "Left" :
_parent._x = orig_x + (dist_x * 2);
break;
case "Right" :
_parent._x = orig_x - (dist_x * 2);
break;
case "Toward" :
_parent._xscale = (_parent._yscale = 1);
break;
case "None" :
_parent._alpha = 0;
}
} else {
ready = true;
}
}
onClipEvent (enterFrame) {
if (unloaded) {
return(undefined);
}
if (!ready) {
switch (_parent.xin_motion_val) {
case "Toward" :
_parent._xscale = _parent._xscale + ((100 - _parent._xscale) * slow_factor);
_parent._yscale = _parent._xscale;
if (_parent.xin_alphatype_val == "Yes") {
_parent._alpha = Math.round((orig_a / 100) * Math.max(0, Math.min(_parent._xscale, 100)));
}
if (Math.abs(100 - _parent._xscale) < 0.5) {
_parent._xscale = (_parent._yscale = 100);
_parent._alpha = orig_a;
ready = true;
}
break;
default :
_parent._x = _parent._x + ((orig_x - _parent._x) * slow_factor);
_parent._y = _parent._y + ((orig_y - _parent._y) * slow_factor);
if (_parent.xin_alphatype_val == "Yes") {
if (_parent.xin_motion_val == "None") {
_parent._alpha = _parent._alpha + ((orig_a - _parent._alpha) * slow_factor);
} else if (Math.abs(orig_x - _parent._x) > Math.abs(orig_y - _parent._y)) {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x)) * 100);
} else {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y)) * 100);
}
}
if (!(((_parent.xin_motion_val == "None") && (Math.abs(_parent._alpha - orig_a) <= 1)) || (((_parent.xin_motion_val != "None") && (Math.abs(_parent._y - orig_y) < 0.5)) && (Math.abs(_parent._x - orig_x) < 0.5)))) {
break;
}
_parent._x = orig_x;
_parent._y = orig_y;
_parent._alpha = orig_a;
ready = true;
}
} else if (!done) {
var rl = _root.getBytesLoaded();
var rt = (_root.getBytesTotal() * (_parent.perc_req_val / 100));
if ((rl > 10) && (rt > 10)) {
rl = Math.min(rl, rt);
var new_frame = (_parent.anim._currentframe + Math.ceil(((_parent.anim._totalframes * (rl / rt)) - _parent.anim._currentframe) / 4));
new_frame = Math.max(1, new_frame);
if (_parent.show_perc_val == "Yes") {
_parent.perc.text = Math.round(((new_frame - 1) / (_parent.anim._totalframes - 1)) * 100) + " %";
}
if (new_frame != _parent.anim._currentframe) {
_parent.anim.gotoAndStop(new_frame);
}
if ((_parent.anim._totalframes == _parent.anim._currentframe) && (rl >= rt)) {
done = true;
}
}
} else if (slow_factor < 1) {
switch (_parent.xout_motion_val) {
case "Down" :
if (_parent._y <= orig_y) {
_parent._y = orig_y + accel_jump;
}
_parent._y = orig_y + (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y > (orig_y + (dist_y * 2))) {
execute_action();
}
break;
case "Up" :
if (_parent._y >= orig_y) {
_parent._y = orig_y - accel_jump;
}
_parent._y = orig_y - (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y < (orig_y - (dist_y * 2))) {
execute_action();
}
break;
case "Right" :
if (_parent._x <= orig_x) {
_parent._x = orig_x + accel_jump;
}
_parent._x = orig_x + (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x > (orig_x + (dist_x * 2))) {
execute_action();
}
break;
case "Left" :
if (_parent._x >= orig_x) {
_parent._x = orig_x - accel_jump;
}
_parent._x = orig_x - (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x < (orig_x - (dist_x * 2))) {
execute_action();
}
break;
case "Away" :
if ((_parent._xscale >= 100) || (_parent._yscale >= 100)) {
_parent._xscale = (_parent._yscale = 100 - accel_jump);
}
_parent._xscale = (_parent._yscale = Math.max(0.5, 100 - ((100 - _parent._yscale) * speed_factor)));
perc_fadeout = 100 - Math.round(Math.max(0, Math.min(_parent._xscale, 100)));
if (_parent._xscale < 1) {
execute_action();
}
break;
default :
perc_fadeout = perc_fadeout + ((100 - perc_fadeout) * slow_factor);
if (Math.abs(perc_fadeout - 100) > 1) {
break;
}
execute_action();
}
if (!(_parent.xout_alphatype_val === "Yes")) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 218 Button
on (release) {
getURL ("http://www.craziness.com", "_blank");
}
Symbol 226 Button
on (press) {
gotoAndPlay (1);
}
Symbol 237 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-europe", "_top");
}
Symbol 239 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-usa", "_top");
}
Symbol 241 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-south-america", "_top");
}
Symbol 243 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-central-america", "_top");
}
Symbol 245 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-canada", "_top");
}
Symbol 247 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-africa", "_top");
}
Symbol 249 Button
on (release) {
getURL ("http://www.craziness.com/games/geography-game-middle-east", "_top");
}
Symbol 252 Button
on (release) {
getURL ("http://www.gamesforyourwebsite.com", "_top");
}