Instance of Symbol 139 MovieClip in Frame 1
onClipEvent (load) {
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
onClipEvent (load) {
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 temp = this[e1];
this[e1] = this[e2];
this[e2] = temp;
};
Array.prototype.shuffle = function () {
var j = 0;
while (j < this.length) {
var e1 = Math.randi(0, this.length);
var e2 = Math.randi(0, this.length);
this.swap(e1, e2);
j++;
}
};
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 _str = new String();
var j = 0;
while (j < this.length) {
var ascii = this.charCodeAt(j);
if ((0 < j) && ((ascii >= "A".charCodeAt(0)) && ("Z".charCodeAt(0) >= ascii))) {
_str = _str + " ";
}
_str = _str + this.charAt(j);
j++;
}
return(_str);
};
MovieClip.prototype.setColor = function (col) {
var _color = new Color(this);
_color.setRGB(col);
};
this._x = 0;
this._y = 0;
Object.prototype.GeographyGame = function () {
this.current_map = 0;
this.num_player_turns = this.num_total_turns;
this.score = 0;
this.timeline.score = 0;
this.timeline.turns_remaining = this.num_total_turns;
this.original_mascot_x = -20;
this.mouse_over_region = undefined;
this.old_mouse_over_region = undefined;
this.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 () {
if (this.current_map == this.timeline.maps._totalframes) {
_root.score = this.score;
if (this.turn_mode == "Infinite Turns") {
_root.gotoAndStop(_root._totalframes);
} else {
_root.gotoAndStop(_root._totalframes - 1);
}
} else {
this.initialize_variables();
this.load_current_map();
this.build_region_database();
this.create_mascot();
}
};
GeographyGame.prototype.initialize_variables = function () {
this.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
this.current_region = 0;
if (this.mode == "Turns Reset Every Level") {
this.num_player_turns = this.num_total_turns;
this.timeline.turns_remaining = this.num_total_turns;
}
};
GeographyGame.prototype.load_current_map = function () {
this.timeline.maps.gotoAndStop(this.current_map + 1);
};
GeographyGame.prototype.build_region_database = function () {
var index = 0;
this.regions = new Array();
for (var j in this.timeline.maps) {
var _mc = this.timeline.maps[j];
if (typeof(_mc) == "movieclip") {
this.regions[index] = _mc._name;
_mc.original_color = parseInt(this.map_colors[index % this.map_colors.length]);
_mc.setColor(_mc.original_color);
_mc.selected = false;
index++;
}
}
this.num_total_map_regions = this.regions.length;
this.regions.shuffle();
};
GeographyGame.prototype.create_mascot = function () {
this.timeline.mascot.removeMovieClip();
this.timeline.attachMovie("mascot_gg", "mascot", 1);
this.timeline.mascot._x = this.original_mascot_x;
this.timeline.mascot._y = this.fly_height;
this.timeline.mascot.field = this.regions[this.current_region].standardForm();
this.timeline.current_region_name = "";
};
GeographyGame.prototype.action = function () {
if (this.mode & GEOGRAPHY_GAME_PAUSED) {
return(undefined);
}
if (this.mode & GEOGRAPHY_GAME_DISPLAYING_REGION) {
this.animate_mascot();
}
if ((this.mode & GEOGRAPHY_GAME_WAITING_FOR_USER) || (this.mode & GEOGRAPHY_GAME_DISPLAYING_REGION)) {
this.render_map();
} else if (this.mode & GEOGRAPHY_GAME_CORRECT_ANSWER) {
this.check_correct_message_done();
} else if (this.mode & GEOGRAPHY_GAME_INCORRECT_ANSWER) {
this.check_incorrect_message_done();
}
};
GeographyGame.prototype.animate_mascot = function () {
this.timeline.mascot._x = this.timeline.mascot._x + this.fly_by_speed;
this.timeline.current_region_name = this.regions[this.current_region].standardForm();
if ((this.timeline.mascot._x - this.timeline.mascot._width) >= this.screen_width) {
this.mode = GEOGRAPHY_GAME_WAITING_FOR_USER;
this.timeline.mascot._x = this.original_mascot_x;
}
};
GeographyGame.prototype.render_map = function () {
this.old_mouse_over_region = this.mouse_over_region;
var num_checked_regions = 0;
for (var j in this.timeline.maps) {
var _mc = this.timeline.maps[j];
if (((typeof(_mc) == "movieclip") && (_mc.hitTest(_root._xmouse, _root._ymouse, true))) && (!_mc.selected)) {
this.mouse_over_region = _mc;
break;
}
if (typeof(_mc) == "movieclip") {
num_checked_regions++;
}
}
if (!this.old_mouse_over_region.selected) {
this.old_mouse_over_region.setColor(this.old_mouse_over_region.original_color);
}
if (!this.mouse_over_region.selected) {
this.mouse_over_region.setColor(this.rollover_color);
}
if ((num_checked_regions == this.num_total_map_regions) && (!this.old_mouse_over_region.selected)) {
this.old_mouse_over_region.setColor(this.old_mouse_over_region.original_color);
}
};
GeographyGame.prototype.mouse_click = function () {
if ((this.mode & GEOGRAPHY_GAME_WAITING_FOR_USER) || (this.mode & GEOGRAPHY_GAME_DISPLAYING_REGION)) {
for (var j in this.timeline.maps) {
var _mc = this.timeline.maps[j];
if (_mc.hitTest(_root._xmouse, _root._ymouse, true) && (!_mc.selected)) {
this.evaluate_guess(_mc);
this.timeline.mascot._x = this.original_mascot_x;
return(undefined);
}
}
}
};
GeographyGame.prototype.evaluate_guess = function (region_mc) {
if (region_mc._name == this.regions[this.current_region]) {
this.player_guessed_correctly(region_mc);
} else {
this.player_guessed_incorrectly(region_mc);
}
};
GeographyGame.prototype.player_guessed_correctly = function (region_mc) {
this.score = this.score + this.points_correct_answer;
this.timeline.score = this.score;
region_mc.selected = true;
region_mc.setColor(this.guessed_color);
region_mc._alpha = this.guessed_alpha;
this.regions.splice(this.current_region, 1);
this.mode = GEOGRAPHY_GAME_CORRECT_ANSWER;
this.create_correct_answer_message();
};
GeographyGame.prototype.player_guessed_incorrectly = function (region_mc) {
this.score = this.score + this.points_incorrect_answer;
this.timeline.score = this.score;
region_mc.setColor(region_mc.original_color);
if (this.region_cycle == "Guess Once and Remove") {
this.regions.splice(this.current_region, 1);
this.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
} else if (this.region_cycle == "Guess Once and Cycle") {
this.regions.push(this.regions[this.current_region]);
this.regions.splice(this.current_region, 1);
this.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
} else if (this.region_cycle == "Guess Many Times") {
this.mode = GEOGRAPHY_GAME_INCORRECT_ANSWER;
}
if ((this.turn_mode == "Turns Reset Every Level") || (this.turn_mode == "One Set of Turns")) {
this.num_player_turns--;
this.timeline.turns_remaining = this.num_player_turns;
if (this.num_player_turns < 0) {
_root.gotoAndStop(_root._totalframes);
}
}
this.create_incorrect_answer_message();
};
GeographyGame.prototype.create_correct_answer_message = function () {
this.timeline.attachMovie("correct_gg", "message", 2);
this.timeline.message._x = this.timeline.maps._x;
this.timeline.message._y = this.timeline.maps._y;
this.timeline.message.play();
var _sound = new Sound();
_sound.attachSound(this.correct_sound_linkage);
_sound.start(0, 0);
};
GeographyGame.prototype.create_incorrect_answer_message = function () {
this.timeline.attachMovie("incorrect_gg", "message", 2);
this.timeline.message._x = this.timeline.maps._x;
this.timeline.message._y = this.timeline.maps._y;
this.timeline.message.play();
var _sound = new Sound();
_sound.attachSound(this.incorrect_sound_linkage);
_sound.start(0, 0);
};
GeographyGame.prototype.check_correct_message_done = function () {
if (this.timeline.message._currentframe == this.timeline.message._totalframes) {
this.timeline.message.removeMovieClip();
this.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
this.timeline.mascot.field = this.regions[this.current_region].standardForm();
this.check_map_status();
}
};
GeographyGame.prototype.check_incorrect_message_done = function () {
if (this.timeline.message._currentframe == this.timeline.message._totalframes) {
this.timeline.message.removeMovieClip();
if (this.region_cycle == "Guess Many Times") {
this.mode = GEOGRAPHY_GAME_WAITING_FOR_USER;
} else {
this.mode = GEOGRAPHY_GAME_DISPLAYING_REGION;
this.timeline.mascot.field = this.regions[this.current_region].standardForm();
}
this.check_map_status();
}
};
GeographyGame.prototype.check_map_status = function () {
if (this.regions.length == 0) {
this.current_map++;
this.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 _str = new String("");
var j = 0;
while (j < str.length) {
if ((str.charAt(j) != " ") && (str.charAt(j) != ";")) {
_str = _str + str.charAt(j);
}
j++;
}
return(_str);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((0 < action.length) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var sections = action.split(".");
var timeline_action = sections.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 timeline_reference = timeline;
var j = 0;
while (j < sections.length) {
timeline_reference = timeline_reference[sections[j]];
j++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
timeline_reference[timeline_function](function_parameter);
}
}
function execute_action() {
unloaded = true;
_parent._visible = false;
simple_script(_parent.play_action_val, _parent);
}
_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) {
var _local2 = "Up";
switch (_parent.xin_motion_val) {
case _local2 :
_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) {
var _local2 = "Toward";
switch (_parent.xin_motion_val) {
case _local2 :
_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_y - _parent._y) < Math.abs(orig_x - _parent._x)) {
_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") && (1 >= Math.abs(_parent._alpha - orig_a))) || (((_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 ((10 < rl) && (10 < rt)) {
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) {
var _local2 = "Down";
switch (_parent.xout_motion_val) {
case _local2 :
if (orig_y >= _parent._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 ((orig_y + (dist_y * 2)) < _parent._y) {
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 (orig_x >= _parent._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 ((orig_x + (dist_x * 2)) < _parent._x) {
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 (1 < Math.abs(perc_fadeout - 100)) {
break;
}
execute_action();
}
_local2 = "Yes";
if (!((typeof(_parent.xout_alphatype_val) == typeof(_local2)) ? (_parent.xout_motion_val == _local2) : false)) {
} 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-australia", "_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");
}