Instance of Symbol 158 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 126
stop();
Frame 127
this.stop();
Instance of Symbol 139 MovieClip [SlotMachineSymbol] in Frame 127
//component parameters
onClipEvent (initialize) {
max_bet = 100;
starting_credit = 100;
credit_prefix = "";
bet_increment = 5;
win_factor = [];
win_factor[0] = 2;
win_factor[1] = 5;
win_factor[2] = 10;
win_factor[3] = 15;
win_factor[4] = 20;
win_factor[5] = 50;
win_factor[6] = 100;
win_factor[7] = 500;
idle_delay = 8000;
sequence_price = [];
sequence_price[0] = 200;
sequence_price[1] = 300;
sequence_price[2] = 500;
sequence_price[3] = 800;
sequence_price[4] = 1400;
sequence_price[5] = 2000;
sequence_price[6] = 5000;
}
Frame 128
this.stop();
Symbol 11 MovieClip [ExtensionsSymbol] Frame 1
#initclip 1
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
Array.prototype.swap = function (a, b) {
var temp = this[a];
this[a] = temp;
this[b] = temp;
};
Array.prototype.shuffle = function () {
var j = 0;
while (j < this.length) {
this.swap(j, Math.randi(0, this.length));
j++;
}
};
MovieClip.prototype.randf = function () {
this.gotoAndStop(Math.randi(1, this._totalframes + 1));
};
#endinitclip
Symbol 27 Button
on (press) {
this.bet_max();
}
Symbol 33 Button
on (press) {
this.increase_bet();
}
Symbol 38 Button
on (press) {
this.decrease_bet();
}
Symbol 106 MovieClip Frame 1
this.stop();
Symbol 112 Button
on (press) {
if (this._parent.mode == "waiting for spin") {
this.play();
}
}
Symbol 119 MovieClip Frame 1
this.stop();
Symbol 119 MovieClip Frame 5
this._parent.pulled_handle();
Symbol 119 MovieClip Frame 25
this.gotoAndStop(1);
Symbol 127 MovieClip Frame 1
this.stop();
Symbol 137 Button
on (press) {
this._parent.buy_next_interaction();
}
Symbol 138 MovieClip Frame 1
this.stop();
Symbol 139 MovieClip [SlotMachineSymbol] Frame 1
#initclip 2
SlotMachine = function () {
this.initialize();
};
SlotMachine.prototype = new MovieClip();
Object.registerClass("SlotMachineSymbol", SlotMachine);
SlotMachine.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
};
SlotMachine.prototype.initialize_variables = function () {
this.current_bet = this.bet_increment;
this.credit = this.starting_credit;
this.mode = "waiting for spin";
this.current_bet_txt.text = this.credit_suffix + this.current_bet;
this.credit_txt.text = this.credit_suffix + this.credit;
this.payout_txt.text = this.credit_suffix + 0;
this.current_cost_txt.text = this.credit_suffix + this.sequence_price[0];
this._x = (this._y = 0);
};
SlotMachine.prototype.initialize_graphics = function () {
var j = 1;
while (j >= 0) {
this[("spinning" + j) + "_1"]._visible = false;
this[("spinning" + j) + "_2"]._visible = false;
this[("spinning" + j) + "_3"]._visible = false;
if (this[("spinning" + j) + "_1"] == undefined) {
this.num_rollers = j - 1;
break;
}
j++;
}
this.icon1.randf();
this.icon2.randf();
this.icon3.randf();
};
SlotMachine.prototype.pulled_handle = function () {
this.icon1._visible = (this.icon2._visible = (this.icon3._visible = false));
this[("spinning" + Math.randi(1, this.num_rollers + 1)) + "_1"]._visible = true;
this[("spinning" + Math.randi(1, this.num_rollers + 1)) + "_2"]._visible = true;
this[("spinning" + Math.randi(1, this.num_rollers + 1)) + "_3"]._visible = true;
this.start_spin_time = getTimer();
this.onEnterFrame = this.check_spin_stop;
this.first_roller_stopped = false;
this.second_roller_stopped = false;
this.third_roller_stopped = false;
this.spinning_sound = new Sound(this);
this.spinning_sound.attachSound("spinning");
this.spinning_sound.start(0, 100);
this.mode = "spinning";
this.credit = this.credit - this.current_bet;
this.credit_txt.text = this.credit_suffix + this.credit;
this.calculate_icons();
};
SlotMachine.prototype.calculate_icons = function () {
var p1 = 0.004;
var p2 = 0.007;
var p3 = 0.01;
var p4 = 0.013;
var p5 = 0.025;
var p6 = 0.05;
var p7 = 0.1;
var p8 = 0.15;
if (this.credit <= (this.starting_credit / 2)) {
if (Math.random() < 0.9) {
var test = Math.random();
if (test <= (p1 * 2)) {
this.next_icon1 = 6;
this.next_icon2 = 6;
this.next_icon3 = 6;
} else if (test <= (p2 * 2)) {
this.next_icon1 = 5;
this.next_icon2 = 5;
this.next_icon3 = 5;
} else if (test <= (p3 * 2)) {
this.next_icon1 = 4;
this.next_icon2 = 4;
this.next_icon3 = 4;
} else if (test <= (p4 * 2)) {
this.next_icon1 = 3;
this.next_icon2 = 3;
this.next_icon3 = 3;
} else if (test <= (p5 * 2)) {
this.next_icon1 = 2;
this.next_icon2 = 2;
this.next_icon3 = 2;
} else if (test <= (p6 * 2)) {
this.next_icon1 = 1;
this.next_icon2 = 1;
this.next_icon3 = 1;
} else if (test <= (p7 * 2)) {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
var nums = [1, 2, 3];
nums.shuffle();
this["next_icon" + nums[0]] = 1;
this["next_icon" + nums[1]] = 1;
} else if (test <= (p8 * 2)) {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
this["next_icon" + Math.randi(1, 4)] = 1;
} else {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
}
} else {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
}
} else if (Math.random() < 0.6) {
var test = Math.random();
if (test <= p1) {
this.next_icon1 = 6;
this.next_icon2 = 6;
this.next_icon3 = 6;
} else if (test <= p2) {
this.next_icon1 = 5;
this.next_icon2 = 5;
this.next_icon3 = 5;
} else if (test <= p3) {
this.next_icon1 = 4;
this.next_icon2 = 4;
this.next_icon3 = 4;
} else if (test <= p4) {
this.next_icon1 = 3;
this.next_icon2 = 3;
this.next_icon3 = 3;
} else if (test <= p5) {
this.next_icon1 = 2;
this.next_icon2 = 2;
this.next_icon3 = 2;
} else if (test <= p6) {
this.next_icon1 = 1;
this.next_icon2 = 1;
this.next_icon3 = 1;
} else if (test <= p7) {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
var nums = [1, 2, 3];
nums.shuffle();
this["next_icon" + nums[0]] = 1;
this["next_icon" + nums[1]] = 1;
} else if (test <= p8) {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
this["next_icon" + Math.randi(1, 4)] = 1;
} else {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
}
} else {
this.next_icon1 = Math.randi(1, this.icon1._totalframes + 1);
this.next_icon2 = Math.randi(1, this.icon2._totalframes + 1);
this.next_icon3 = Math.randi(1, this.icon3._totalframes + 1);
}
};
SlotMachine.prototype.check_spin_stop = function () {
if (((getTimer() - this.start_spin_time) >= 2000) && (!this.first_roller_stopped)) {
this.first_roller_stopped = true;
var j = 1;
while (j <= this.num_rollers) {
this[("spinning" + j) + "_1"]._visible = false;
j++;
}
this.icon1.gotoAndStop(this.next_icon1);
this.icon1._visible = true;
this.play_sound("first_wheel_stop");
this.spinning_sound.setVolume(85);
} else if (((getTimer() - this.start_spin_time) >= 3000) && (!this.second_roller_stopped)) {
this.second_roller_stopped = true;
var j = 1;
while (j <= this.num_rollers) {
this[("spinning" + j) + "_2"]._visible = false;
j++;
}
this.icon2.gotoAndStop(this.next_icon2);
this.icon2._visible = true;
this.play_sound("first_wheel_stop");
this.spinning_sound.setVolume(70);
} else if (((getTimer() - this.start_spin_time) >= 4000) && (!this.third_roller_stopped)) {
this.third_roller_stopped = true;
var j = 1;
while (j <= this.num_rollers) {
this[("spinning" + j) + "_3"]._visible = false;
j++;
}
this.icon3.gotoAndStop(this.next_icon3);
this.icon3._visible = true;
this.play_sound("third_wheel_stop");
this.spinning_sound.stop();
this.calculate_outcome();
this.mode = "waiting for spin";
this.onEnterFrame = undefined;
}
};
SlotMachine.prototype.play_sound = function (linkage) {
var _sound = new Sound();
_sound.attachSound(linkage);
_sound.start(0, 1);
};
SlotMachine.prototype.increase_bet = function () {
if (this.mode == "waiting for spin") {
this.current_bet = this.current_bet + this.bet_increment;
this.current_bet = Math.min(this.current_bet, this.max_bet);
this.current_bet = Math.min(this.current_bet, this.credit);
this.current_bet_txt.text = this.credit_suffix + this.current_bet;
}
};
SlotMachine.prototype.decrease_bet = function () {
if (this.mode == "waiting for spin") {
this.current_bet = this.current_bet - this.bet_increment;
this.current_bet = Math.max(this.current_bet, this.bet_increment);
this.current_bet_txt.text = this.credit_suffix + this.current_bet;
}
};
SlotMachine.prototype.bet_max = function () {
if (this.mode == "waiting for spin") {
this.current_bet = this.max_bet;
this.current_bet = Math.min(this.current_bet, this.credit);
this.current_bet_txt.text = this.credit_suffix + this.current_bet;
}
};
SlotMachine.prototype.calculate_outcome = function () {
var results = this.get_results();
var win = -1;
if (results[1] == 1) {
var win = 0;
} else if (results[1] == 2) {
var win = 1;
} else if (results[1] == 3) {
var win = 2;
} else if (results[2] == 3) {
var win = 3;
} else if (results[3] == 3) {
var win = 4;
} else if (results[4] == 3) {
var win = 5;
} else if (results[5] == 3) {
var win = 6;
} else if (results[6] == 3) {
var win = 7;
}
this.credit = this.credit + (this.current_bet * this.win_factor[win]);
this.payout_txt.text = this.credit_suffix + (this.current_bet * this.win_factor[win]);
this.credit_txt.text = this.credit_suffix + this.credit;
if ((win >= 0) && (win <= 3)) {
this.play_sound("win1");
} else if ((win >= 4) && (win <= 6)) {
this.play_sound("win2_more");
} else if (win == 7) {
this.play_sound("win3_top_prize");
} else if (win == -1) {
this.play_sound("no_win");
}
if (this.credit > this.sequence_price[this.interaction_mc._currentframe - 1]) {
this.buy_mc.gotoAndStop(2);
} else {
this.buy_mc.gotoAndStop(1);
}
this.current_bet = Math.min(this.current_bet, this.credit);
this.current_bet_txt.text = this.current_bet;
if (this.credit == 0) {
_root.gotoAndStop("Game Over");
}
};
SlotMachine.prototype.get_results = function () {
var res = [0, 0, 0, 0, 0, 0, 0];
res[this.icon1._currentframe]++;
res[this.icon2._currentframe]++;
res[this.icon3._currentframe]++;
return(res);
};
SlotMachine.prototype.buy_next_interaction = function () {
this.credit = this.credit - this.sequence_price[this.interaction_mc._currentframe - 1];
this.credit_txt.text = this.credit_suffix + this.credit;
this.interaction_mc.nextFrame();
this.current_cost_txt.text = this.credit_suffix + this.sequence_price[this.interaction_mc._currentframe - 1];
};
#endinitclip
Instance of Symbol 119 MovieClip "lever_mc" in Symbol 139 MovieClip [SlotMachineSymbol] Frame 1
onClipEvent (load) {
this.last_idle_play = getTimer();
}
onClipEvent (enterFrame) {
if ((getTimer() - this.last_idle_play) >= this._parent.idle_delay) {
this.last_idle_play = getTimer();
this._parent.play_sound("idle" + Math.randi(1, 4));
}
}
onClipEvent (mouseDown) {
this.last_idle_play = getTimer();
}
Symbol 142 Button
on (release) {
getURL ("http://www.eyeland.com", "_self");
}
Symbol 158 MovieClip Frame 1
stop();
Instance of Symbol 157 MovieClip "swfloader" in Symbol 158 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 ((action.length > 0) && ((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) {
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 227 Button
on (press) {
this.play();
}
Symbol 233 Button
on (press) {
this.gotoAndStop("Starting Screen");
}