Frame 1
x = getProperty("bar", _y);
height = getProperty("bar", _height);
y1 = getProperty("loader", _y);
Frame 2
if (Number(_framesloaded) >= Number(_totalframes)) {
gotoAndPlay (4);
} else {
framepercent = int((_framesloaded / _totalframes) * 100);
setProperty("loader", _y , y1 - (((framepercent * height) * 8) / 1000));
}
Frame 3
gotoAndPlay (2);
Frame 4
tellTarget ("computer_numeric") {
gotoAndStop (1);
};
tellTarget ("player_numeric") {
gotoAndStop (1);
};
player = 0;
computer = 0;
player_point_x = getProperty("player_point", _x);
stop();
Frame 5
function calc_grade(start, array_name, end) {
play_grade = 0;
a_num = 0;
i = start;
while (end >= i) {
if (array_name[i] == -1) {
break;
}
if ((((array_name[i] % 13) == 0) || ((array_name[i] % 13) == 12)) || ((array_name[i] % 13) == 11)) {
play_grade = play_grade + 10;
} else if ((array_name[i] % 13) == 1) {
play_grade = play_grade + 11;
a_num = a_num + 1;
} else {
play_grade = play_grade + (array_name[i] % 13);
}
i = i + 2;
}
a = 1;
while (a_num >= a) {
if (21 < play_grade) {
play_grade = play_grade - 10;
}
a++;
}
return(play_grade);
}
squeezer_x = getProperty("underside", _x);
squeezer_y = getProperty("underside", _y);
setProperty("move_bg", _x , squeezer_x);
setProperty("move_bg", _y , squeezer_y);
player_grade = "";
setProperty("player_point", _x , player_point_x);
num = 1;
while (num < 25) {
duplicateMovieClip ("squeezer", "squeezer" + num, num);
num++;
}
num = 1;
first_tf = 1;
need = 0;
player_card = new array(0, 0);
computer_card = 0;
player_grad = new array(0, 0);
split = 0;
str = ",";
add_card = 0;
run_split = 1;
result = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
anchor_x = new Array(0, -25, 25, -23, 23, -21, 21, -19, 19, -17, 17, -41, 0, -47, 0, -45, 0, -43, 0, -41);
anchor_y = 36;
Frame 10
do {
i = random(52);
if (i == 0) {
i = 1;
}
if (str.indexOf(("," + i) + ",", 0) == -1) {
break;
}
} while (true);
str = (str + i) + ",";
result[num] = i;
tellTarget ("squeezer" + num) {
gotoAndStop(/:i);
};
if (num != 2) {
setProperty("squeezer" + num, _x , squeezer_x);
setProperty("squeezer" + num, _y , squeezer_y);
}
Frame 11
if (((getProperty("underside", _y) - (anchor_y * 5)) >= getProperty("move_bg", _y)) && (num == 2)) {
num = num + 1;
if (((num % 2) == 1) && (num != 1)) {
add_card = add_card + 1;
}
gotoAndPlay (10);
}
if ((getProperty("underside", _y) - (anchor_y * 5)) >= getProperty("squeezer" + num, _y)) {
num = num + 1;
if (((num % 2) == 1) && (num != 1)) {
add_card = add_card + 1;
}
if (need == 1) {
num = num + 1;
add_card = add_card + 1;
gotoAndPlay (13);
} else if (need == 2) {
gotoAndPlay (17);
} else if (add_card == 2) {
gotoAndPlay (13);
} else {
gotoAndPlay (10);
}
}
Frame 12
if (num == 2) {
setProperty("move_bg", _x , getProperty("move_bg", _x) - anchor_x[num]);
setProperty("move_bg", _y , getProperty("move_bg", _y) - anchor_y);
} else if ((split == 1) && ((num % 2) == 1)) {
setProperty("squeezer" + num, _x , getProperty("squeezer" + num, _x) - (anchor_x[num] + 15));
setProperty("squeezer" + num, _y , getProperty("squeezer" + num, _y) - anchor_y);
} else {
setProperty("squeezer" + num, _x , getProperty("squeezer" + num, _x) - anchor_x[num]);
setProperty("squeezer" + num, _y , getProperty("squeezer" + num, _y) - anchor_y);
}
gotoAndPlay (11);
Frame 13
if (player_grad[1] == 0) {
player_grade = calc_grade(1, result, 9);
} else {
setProperty("player_point", _x , player_point_x + 80);
player_grade = calc_grade(11, result, 19);
}
if ((21 < player_grade) || (add_card >= 5)) {
if ((run_split == 1) && (split == 1)) {
num = 13;
add_card = 1;
run_split = 0;
player_card[0] = add_card;
player_grad[0] = player_grade;
player_grad[1] = result[11] % 13;
need = 1;
gotoAndPlay (10);
} else if ((run_split == 0) && (player_card[0] != 0)) {
player_card[1] = add_card;
player_grad[1] = player_grade;
add_card = 2;
if ((21 >= player_grade) || ((21 < player_grade) && (21 >= player_grad[0]))) {
gotoAndPlay (17);
} else {
gotoAndPlay (18);
}
} else if (21 >= player_grade) {
if ((player_grad[1] == 0) && (run_split == 1)) {
player_card[0] = add_card;
player_grad[0] = player_grade;
} else {
player_card[1] = add_card;
player_grad[1] = player_grade;
}
gotoAndPlay (17);
} else {
if ((player_grad[1] == 0) && (run_split == 1)) {
player_card[0] = add_card;
player_grad[0] = player_grade;
} else {
player_card[1] = add_card;
player_grad[1] = player_grade;
}
gotoAndPlay (18);
}
} else if ((((result[1] % 13) == (result[3] % 13)) && (split == 0)) && (add_card == 2)) {
gotoAndPlay (15);
} else if (player_grade == 21) {
if ((player_grad[1] == 0) && (run_split == 1)) {
player_card[0] = add_card;
player_grad[0] = player_grade;
} else {
player_card[1] = add_card;
player_grad[1] = player_grade;
}
gotoAndPlay (17);
} else {
if ((player_grad[1] == 0) && (run_split == 1)) {
player_card[0] = add_card;
player_grad[0] = player_grade;
} else {
player_card[1] = add_card;
player_grad[1] = player_grade;
}
gotoAndPlay (14);
}
Frame 14
stop();
Frame 15
stop();
Frame 16
setProperty("squeezer" + (num - 4), _x , getProperty("squeezer" + num, _x) - ((anchor_x[num - 4] + 15) * 5));
result[num + 6] = result[num - 2];
tellTarget ("squeezer" + (num + 6)) {
gotoAndStop(/:result[/:num - 2]);
};
setProperty("squeezer" + (num + 6), _x , (getProperty("squeezer" + num, _x) - (anchor_x[num + 6] * 4)) + 7);
setProperty("squeezer" + (num + 6), _y , getProperty("squeezer1", _y));
setProperty("player_point", _x , player_point_x - 68);
setProperty("squeezer" + (num - 2), _x , squeezer_x);
setProperty("squeezer" + (num - 2), _y , squeezer_y);
num = 3;
add_card = add_card - 1;
need = 1;
gotoAndPlay (10);
Frame 17
if (split == 1) {
if (player_grad[1] == 0) {
num = 13;
add_card = 1;
run_split = 0;
player_card[0] = add_card;
player_grad[0] = player_grade;
player_grad[1] = result[11] % 13;
need = 1;
gotoAndPlay (10);
} else {
computer_grade = calc_grade(2, result, 10);
if (add_card == 5) {
add_card = 2;
}
if ((computer_grade < 17) && (add_card < 5)) {
need = 2;
if (first_tf == 1) {
first_tf = 0;
num = 6;
add_card = 2;
} else {
num = num + 1;
}
gotoAndPlay (10);
} else {
computer_card = add_card;
gotoAndPlay (18);
}
}
} else {
computer_grade = calc_grade(2, result, 10);
if (add_card == 5) {
add_card = 2;
}
if ((computer_grade < 17) && (add_card < 5)) {
need = 2;
if (first_tf == 1) {
first_tf = 0;
num = 6;
add_card = 2;
} else {
num = num + 1;
}
gotoAndPlay (10);
} else {
computer_card = add_card;
gotoAndPlay (18);
}
}
Frame 19
tellTarget ("squeezer2") {
gotoAndStop(/:result[2]);
};
if ((player >= 20) && (computer >= 20)) {
gotoAndPlay (1);
}
computer_grade = calc_grade(2, result, 10);
setProperty("squeezer2", _x , getProperty("move_bg", _x));
setProperty("squeezer2", _y , getProperty("move_bg", _y));
if ((((player_grad[0] == computer_grade) || (player_grad[1] == computer_grade)) || ((21 < player_grad[0]) && (21 < computer_grade))) || ((21 < player_grad[1]) && (21 < computer_grade))) {
gotoAndPlay (66);
} else if (((((21 >= player_grad[0]) && (computer_grade < player_grad[0])) || (21 < computer_grade)) || ((player_card[0] == 5) && (21 >= player_grad[0]))) && (player_grad[0] != 0)) {
if ((((player_card[0] < computer_card) && (computer_card == 5)) && (21 >= computer_card)) || (((computer_card == player_card[0]) && (player_grad[0] < computer_grade)) && (21 >= computer_grade))) {
gotoAndPlay (43);
} else {
gotoAndPlay (20);
}
} else if ((((21 >= player_grad[1]) && (computer_grade < player_grad[1])) || (21 < computer_grade)) || ((player_card[1] == 5) && (21 >= player_grad[1]))) {
if ((((player_card[1] < computer_card) && (computer_card == 5)) && (21 >= computer_card)) || (((computer_card == player_card[1]) && (player_grad[1] < computer_grade)) && (21 >= computer_grade))) {
player_grad[1] = 0;
gotoAndPlay (43);
} else {
player_grad[1] = 0;
gotoAndPlay (20);
}
} else if (((((21 >= computer_grade) && (computer_grade >= player_grad[0])) || (21 < player_grad[0])) || ((computer_card == 5) && (21 >= computer_grade))) && (player_grad[0] != 0)) {
gotoAndPlay (43);
} else if ((((21 >= computer_grade) && (computer_grade >= player_grad[1])) || (21 < player_grad[1])) || ((computer_card == 5) && (21 >= computer_grade))) {
player_grad[1] = 0;
gotoAndPlay (43);
}
Frame 39
computer = computer + 1;
tellTarget ("computer_numeric") {
gotoAndStop(/:computer + 1);
};
tellTarget ("player_numeric") {
gotoAndStop(/:player + 1);
};
player_grad[0] = 0;
if (player_grad[1] != 0) {
gotoAndPlay (18);
}
Frame 42
if (computer >= 20) {
num = 1;
while (num < 25) {
duplicateMovieClip ("squeezer", "squeezer" + num, num);
num++;
}
gotoAndPlay (109);
} else {
stop();
}
Frame 62
player = player + 1;
tellTarget ("computer_numeric") {
gotoAndStop(/:computer + 1);
};
tellTarget ("player_numeric") {
gotoAndStop(/:player + 1);
};
player_grad[0] = 0;
if (player_grad[1] != 0) {
gotoAndPlay (18);
}
Frame 65
if (player == 20) {
num = 1;
while (num < 25) {
duplicateMovieClip ("squeezer", "squeezer" + num, num);
num++;
}
gotoAndPlay (89);
} else {
stop();
}
Frame 85
computer = computer + 1;
player = player + 1;
tellTarget ("computer_numeric") {
gotoAndStop(/:computer + 1);
};
tellTarget ("player_numeric") {
gotoAndStop(/:player + 1);
};
player_grad[0] = 0;
if (player_grad[1] != 0) {
gotoAndPlay (18);
}
Frame 88
if (player >= 20) {
num = 1;
while (num < 25) {
duplicateMovieClip ("squeezer", "squeezer" + num, num);
num++;
}
gotoAndPlay (89);
} else {
stop();
}
if (computer == 20) {
num = 1;
while (num < 25) {
duplicateMovieClip ("squeezer", "squeezer" + num, num);
num++;
}
gotoAndPlay (109);
} else {
stop();
}
Frame 108
game_over = "player";
gotoAndPlay (130);
Frame 128
game_over = "computer";
gotoAndPlay (129);
Frame 129
player_grade = "";
if (game_over == "player") {
tellTarget ("over") {
gotoAndPlay (2);
};
} else if (game_over == "computer") {
tellTarget ("win") {
gotoAndPlay (2);
};
}
stop();
Frame 130
player_grade = "";
if (game_over == "player") {
tellTarget ("over") {
gotoAndPlay (2);
};
} else if (game_over == "computer") {
tellTarget ("win") {
gotoAndPlay (2);
};
}
stop();
Symbol 126 Button
on (press) {
gotoAndPlay (5);
}
Symbol 163 Button
on (press) {
tellTarget ("/") {
gotoAndPlay (1);
};
}
Symbol 165 Button
on (press) {
fscommand ("quit");
}
Symbol 167 Button
on (press) {
tellTarget ("/") {
gotoAndPlay ("blockjack");
};
}
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 12
stop();
Symbol 170 Button
on (press) {
tellTarget ("/") {
gotoAndPlay (1);
};
}
Symbol 172 Button
on (press) {
tellTarget ("/") {
gotoAndPlay ("blockjack");
};
}
Symbol 173 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 12
stop();
Symbol 175 Button
on (press) {
gotoAndPlay (17);
}
Symbol 176 Button
on (press) {
need = 1;
gotoAndPlay (10);
}
Symbol 177 Button
on (press) {
split = 1;
gotoAndPlay (16);
}
Symbol 197 MovieClip Frame 11
stop();