Combined Code
frame 1 {
stop();
}
movieClip 11 {
}
instance progressbar of movieClip 11 {
onClipEvent (load) {
totalFileSize = _root.getBytesTotal();
this._xscale = 0;
}
onClipEvent (enterFrame) {
bytesLoaded = _root.getBytesLoaded();
amountLoaded = bytesLoaded / totalFileSize;
percentLoaded = int(100 * amountLoaded);
this._xscale = percentLoaded;
_root.loadingMessage = percentLoaded + '%';
if (amountLoaded >= 1) {
_root.gotoAndStop('complete');
}
}
}
frame 2 {
stop();
}
button 20 {
on (press) {
play();
}
}
frame 3 {
c1 = _url.indexOf('://') + 3;
c2 = _url.indexOf('/', c1);
domain = _url.substring(c1, c2);
c3 = domain.lastIndexOf('.') - 1;
c4 = domain.lastIndexOf('.', c3) + 1;
domain = domain.substring(c4, domain.length);
if (domain != 'christiesroom.com') {
gotoAndPlay(11);
} else {
gotoAndPlay(11);
}
stop();
}
frame 4 {
click = new Sound();
click.attachSound('click');
click2 = new Sound();
click2.attachSound('click2');
applause = new Sound();
applause.attachSound('applause');
moan = new Sound();
moan.attachSound('moan');
var11._alpha = 0;
var12._alpha = 0;
var13._alpha = 0;
var14._alpha = 0;
var15._alpha = 0;
var16._alpha = 0;
var17._alpha = 0;
var18._alpha = 0;
var19._alpha = 0;
var110._alpha = 0;
bet = 5;
betDisplay = '$05.00';
picture = 0;
stop();
}
movieClip 138 {
frame 1 {
stop();
}
}
movieClip 158 {
}
button 163 {
on (press) {
click.start();
gotoAndStop(9);
}
}
frame 5 {
startDeal();
stop();
}
button 168 {
on (press) {
holdDraw(0);
}
}
button 169 {
on (press) {
holdDraw(1);
}
}
button 170 {
on (press) {
holdDraw(2);
}
}
button 171 {
on (press) {
holdDraw(3);
}
}
button 172 {
on (press) {
holdDraw(4);
}
}
button 177 {
on (press) {
secondDraw();
}
}
frame 6 {
if (cash < 900) {
if (799 < cash) {
var11._alpha = 100;
var12._alpha = 0;
var13._alpha = 0;
}
}
if (cash < 800) {
if (699 < cash) {
var11._alpha = 0;
var12._alpha = 100;
var13._alpha = 0;
}
}
if (cash < 700) {
if (599 < cash) {
var12._alpha = 0;
var13._alpha = 100;
var14._alpha = 0;
}
}
if (cash < 600) {
if (499 < cash) {
var13._alpha = 0;
var14._alpha = 100;
var15._alpha = 0;
}
}
if (cash < 500) {
if (399 < cash) {
var14._alpha = 0;
var15._alpha = 100;
var16._alpha = 0;
}
}
if (cash < 400) {
if (299 < cash) {
var15._alpha = 0;
var16._alpha = 100;
var17._alpha = 0;
}
}
if (cash < 300) {
if (199 < cash) {
var16._alpha = 0;
var17._alpha = 100;
var18._alpha = 0;
}
}
if (cash < 200) {
if (99 < cash) {
var17._alpha = 0;
var18._alpha = 100;
var19._alpha = 0;
}
}
if (cash < 100) {
if (0 < cash) {
var18._alpha = 0;
var19._alpha = 100;
var110._alpha = 0;
}
}
if (cash < 0) {
var110._alpha = 100;
var19._alpha = 0;
var18._alpha = 0;
gotoAndPlay(4);
}
if (youcash < 0) {
gotoAndPlay(4);
}
stop();
}
button 178 {
on (press) {
gotoAndPlay(4);
}
}
button 180 {
on (press) {
betDisplay = '$05.00';
bet = 5;
}
}
button 181 {
on (press) {
betDisplay = '$10.00';
bet = 10;
}
}
button 182 {
on (press) {
betDisplay = '$20.00';
bet = 20;
}
}
frame 7 {
stop();
}
movieClip 184 {
}
button 189 {
on (press) {
click.start();
gotoAndPlay(4);
}
}
frame 8 {
stop();
}
button 194 {
on (press) {
click.start();
gotoAndPlay(4);
}
}
frame 9 {
stop();
}
button 196 {
on (press) {
click.start();
gotoAndPlay(10);
}
}
frame 10 {
stop();
}
movieClip 198 {
}
button 204 {
on (press) {
click.start();
gotoAndPlay(18);
}
}
frame 11 {
stop();
}
button 213 {
on (press) {
gotoAndPlay(4);
}
}
button 214 {
on (press) {
gotoAndPlay(12);
}
}
button 215 {
on (press) {
gotoAndPlay(15);
}
}
frame 12 {
click = new Sound();
click.attachSound('click');
click2 = new Sound();
click2.attachSound('click2');
applause = new Sound();
applause.attachSound('applause');
moan = new Sound();
moan.attachSound('moan');
var11._alpha = 0;
var12._alpha = 0;
var13._alpha = 0;
var14._alpha = 0;
var15._alpha = 0;
var16._alpha = 0;
var17._alpha = 0;
var18._alpha = 0;
var19._alpha = 0;
var110._alpha = 0;
bet = 5;
betDisplay = '$05.00';
picture = 0;
stop();
}
button 224 {
on (press) {
click.start();
gotoAndPlay(13);
}
}
frame 13 {
stop();
}
button 225 {
on (press) {
click.start();
gotoAndPlay(14);
}
}
frame 14 {
stop();
}
button 227 {
on (press) {
click.start();
gotoAndPlay(24);
}
}
frame 15 {
click = new Sound();
click.attachSound('click');
click2 = new Sound();
click2.attachSound('click2');
applause = new Sound();
applause.attachSound('applause');
moan = new Sound();
moan.attachSound('moan');
var11._alpha = 0;
var12._alpha = 0;
var13._alpha = 0;
var14._alpha = 0;
var15._alpha = 0;
var16._alpha = 0;
var17._alpha = 0;
var18._alpha = 0;
var19._alpha = 0;
var110._alpha = 0;
bet = 5;
betDisplay = '$05.00';
picture = 0;
stop();
}
button 234 {
on (press) {
click.start();
gotoAndPlay(16);
}
}
frame 16 {
stop();
}
button 235 {
on (press) {
click.start();
gotoAndPlay(17);
}
}
frame 17 {
stop();
}
button 237 {
on (press) {
click.start();
gotoAndPlay(30);
}
}
frame 18 {
function startGame() {
youcash = 100;
cash = 800;
bet = 5;
picture = 0;
}
function showCash() {
cashDisplay = '$' + cash;
youcashDisplay = '$' + youcash;
}
function startDeal() {
youcash -= bet;
showCash();
createDeck();
firstDraw();
showCards();
}
function createDeck() {
suits = ['c', 'd', 's', 'h'];
temp = new Array();
suit = 0;
while (suit < 4) {
num = 1;
while (num < 14) {
temp.push(suits[suit] + num);
++num;
}
++suit;
}
deck = new Array();
while (0 < temp.length) {
r = int(Math.random() * temp.length);
deck.push(temp[r]);
temp.splice(r, 1);
}
}
function firstDraw() {
cards = new Array();
i = 0;
while (i < 5) {
cards.push(deck.pop());
++i;
}
hold = [true, true, true, true, true];
showCards();
}
function showCards() {
i = 0;
while (i < 5) {
_root['card' + i].gotoAndStop(cards[i]);
++i;
}
}
function holdDraw(cardNum) {
if (hold[cardNum]) {
_root['card' + cardNum].gotoAndStop('back');
hold[cardNum] = false;
} else {
_root['card' + cardNum].gotoAndStop(cards[cardNum]);
hold[cardNum] = true;
}
}
function secondDraw() {
i = 0;
while (i < 5) {
if (!hold[i]) {
cards[i] = deck.pop();
}
++i;
}
showCards();
handVal = handValue(cards);
winAmt = winnings(handVal);
resultsDisplay = handVal + ': ' + winAmt;
youcash += winAmt;
cash -= winAmt;
showCash();
gotoAndPlay(20);
}
function compareHands(a, b) {
numa = Number(a.substr(1, 2));
numb = Number(b.substr(1, 2));
if (numa < numb) {
return -1;
}
if (numa == numb) {
return 0;
}
if (numb < numa) {
return 1;
}
}
function handValue() {
hand = cards.slice();
hand.sort(compareHands);
suits = new Array();
nums = new Array();
i = 0;
while (i < 5) {
suits.push(hand[i].substr(0, 1));
nums.push(Number(hand[i].substr(1, 2)));
++i;
}
straight = true;
i = 0;
while (i < 4) {
if (nums[i] + 1 != nums[i + 1]) {
straight = false;
}
++i;
}
if (nums[0] == 1 and nums[1] == 10 and nums[2] == 11 and nums[3] == 12 and nums[4] == 13) {
straight = true;
}
flush = true;
i = 1;
while (i < 5) {
if (suits[i] != suits[0]) {
flush = false;
}
++i;
}
counts = new Array();
i = 0;
while (i < 14) {
counts.push(0);
++i;
}
i = 0;
while (i < 5) {
++counts[nums[i]];
++i;
}
pair = false;
twoPair = false;
threeOfAKind = false;
fourOfAKind = false;
i = 1;
while (i < 14) {
if (counts[i] == 2) {
if (pair) {
twoPair = true;
} else {
pair = true;
}
} else {
if (counts[i] == 3) {
threeOfAKind = true;
} else {
if (counts[i] == 4) {
fourOfAKind = true;
}
}
}
++i;
}
jackOrHigher = false;
i = 1;
while (i < 14) {
if ((i == 1 or 10 < i) and counts[i] >= 2) {
jackOrHigher = true;
}
++i;
}
hasAce = false;
if (0 < counts[1]) {
hasAce = true;
}
if (straight and flush and hasAce) {
return 'Royal Flush';
} else {
if (straight and flush) {
return 'Straight Flush';
} else {
if (fourOfAKind) {
return 'Four-Of-A-Kind';
} else {
if (pair and threeOfAKind) {
return 'Full House';
} else {
if (flush) {
return 'Flush';
} else {
if (straight) {
return 'Straight';
} else {
if (threeOfAKind) {
return 'Three-Of-A-Kind';
} else {
if (twoPair) {
return 'Two Pair';
} else {
if (pair and jackOrHigher) {
return 'High Pair';
} else {
if (pair) {
return 'Low Pair';
} else {
return 'Nothing';
}
}
}
}
}
}
}
}
}
}
}
function winnings(handVal) {
if (handVal == 'Royal Flush') {
return 8 * bet;
}
if (handVal == 'Straight Flush') {
return 7 * bet;
}
if (handVal == 'Four-Of-A-Kind') {
return 6 * bet;
}
if (handVal == 'Full House') {
return 5 * bet;
}
if (handVal == 'Flush') {
return 4 * bet;
}
if (handVal == 'Straight') {
return 4 * bet;
}
if (handVal == 'Three-Of-A-Kind') {
return 3 * bet;
}
if (handVal == 'Two Pair') {
return 2 * bet;
}
if (handVal == 'High Pair') {
return 1 * bet;
}
if (handVal == 'Low Pair') {
return 1 * bet;
}
if (handVal == 'Nothing') {
return 0 * bet;
}
}
startGame();
var12.gotoAndStop(1);
var13.gotoAndStop(1);
var14.gotoAndStop(1);
var15.gotoAndStop(1);
var16.gotoAndStop(1);
var17.gotoAndStop(1);
var18.gotoAndStop(1);
var19.gotoAndStop(1);
stop();
}
movieClip 241 {
frame 1 {
stop();
}
}
movieClip 244 {
frame 1 {
stop();
}
}
movieClip 247 {
frame 1 {
stop();
}
}
movieClip 250 {
frame 1 {
stop();
}
}
movieClip 253 {
frame 1 {
stop();
}
}
movieClip 256 {
frame 1 {
stop();
}
}
movieClip 259 {
frame 1 {
stop();
}
}
movieClip 320 {
frame 30 {
stop();
}
}
button 324 {
on (press) {
click2.start();
gotoAndPlay(19);
}
}
button 325 {
on (press) {
click.start();
betDisplay = '$05.00';
bet = 5;
}
}
button 326 {
on (press) {
click.start();
betDisplay = '$10.00';
bet = 10;
}
}
button 327 {
on (press) {
click.start();
betDisplay = '$20.00';
bet = 20;
}
}
frame 19 {
startDeal();
stop();
}
button 328 {
on (press) {
click.start();
holdDraw(0);
}
}
button 329 {
on (press) {
click.start();
holdDraw(1);
}
}
button 330 {
on (press) {
click.start();
holdDraw(2);
}
}
button 331 {
on (press) {
click.start();
holdDraw(3);
}
}
button 332 {
on (press) {
click.start();
holdDraw(4);
}
}
button 333 {
on (press) {
click2.start();
secondDraw();
}
}
frame 20 {
if (699 < cash) {
if (cash < 1200) {
lev = 1;
var11._alpha = 0;
var12._alpha = 0;
var12.gotoAndStop(1);
var13._alpha = 0;
var13.gotoAndStop(1);
var14._alpha = 0;
var14.gotoAndStop(1);
}
}
if (cash < 700) {
if (599 < cash) {
if (lev < 2) {
moan.start();
}
lev = 2;
var11._alpha = 0;
var12._alpha = 100;
var12.gotoAndPlay(1);
var13._alpha = 0;
var13.gotoAndStop(1);
var14._alpha = 0;
var14.gotoAndStop(1);
}
}
if (cash < 600) {
if (499 < cash) {
if (lev < 3) {
moan.start();
}
lev = 3;
var12._alpha = 0;
var12.gotoAndStop(1);
var13._alpha = 100;
var13.gotoAndPlay(1);
var14.gotoAndStop(1);
var14._alpha = 0;
}
}
if (cash < 500) {
if (399 < cash) {
if (lev < 4) {
moan.start();
}
lev = 4;
var13._alpha = 0;
var13.gotoAndStop(1);
var14.gotoAndPlay(1);
var14._alpha = 100;
var15.gotoAndStop(1);
var15._alpha = 0;
}
}
if (cash < 400) {
if (299 < cash) {
if (lev < 5) {
moan.start();
}
lev = 5;
var14._alpha = 0;
var14.gotoAndStop(1);
var15.gotoAndPlay(1);
var15._alpha = 100;
var16.gotoAndStop(1);
var16._alpha = 0;
}
}
if (cash < 300) {
if (199 < cash) {
if (lev < 6) {
moan.start();
}
lev = 6;
var15._alpha = 0;
var15.gotoAndStop(1);
var16.gotoAndPlay(1);
var16._alpha = 100;
var17.gotoAndStop(1);
var17._alpha = 0;
}
}
if (cash < 200) {
if (99 < cash) {
if (lev < 7) {
moan.start();
}
lev = 7;
var16._alpha = 0;
var16.gotoAndStop(1);
var17.gotoAndPlay(1);
var17._alpha = 100;
var18.gotoAndStop(1);
var18._alpha = 0;
}
}
if (cash < 100) {
if (0 < cash) {
if (lev < 8) {
moan.start();
}
lev = 8;
var18.gotoAndPlay(1);
var18._alpha = 100;
var17.gotoAndStop(1);
var17._alpha = 0;
var16.gotoAndStop(1);
var16._alpha = 0;
}
}
if (cash < 1) {
if (lev < 9) {
moan.start();
}
lev = 9;
var18.gotoAndPlay(1);
var18._alpha = 0;
var17.gotoAndStop(1);
var17._alpha = 0;
var16.gotoAndStop(1);
var16._alpha = 0;
var19._alpha = 100;
var19.gotoAndPlay(1);
gotoAndPlay(23);
}
if (youcash < 1) {
gotoAndPlay(21);
}
stop();
}
frame 21 {
stop();
}
button 335 {
on (press) {
click.start();
youcashDisplay = 100;
cashDisplay = 800;
gotoAndPlay(4);
}
}
frame 22 {
stop();
}
movieClip 337 {
}
button 342 {
on (press) {
click.start();
youcashDisplay = 100;
cashDisplay = 800;
gotoAndPlay(11);
}
}
frame 23 {
stop();
}
button 345 {
on (press) {
click.start();
gotoAndPlay(22);
}
}
frame 24 {
function startGame() {
youcash = 100;
cash = 800;
bet = 5;
picture = 0;
}
function showCash() {
cashDisplay = '$' + cash;
youcashDisplay = '$' + youcash;
}
function startDeal() {
youcash -= bet;
showCash();
createDeck();
firstDraw();
showCards();
}
function createDeck() {
suits = ['c', 'd', 's', 'h'];
temp = new Array();
suit = 0;
while (suit < 4) {
num = 1;
while (num < 14) {
temp.push(suits[suit] + num);
++num;
}
++suit;
}
deck = new Array();
while (0 < temp.length) {
r = int(Math.random() * temp.length);
deck.push(temp[r]);
temp.splice(r, 1);
}
}
function firstDraw() {
cards = new Array();
i = 0;
while (i < 5) {
cards.push(deck.pop());
++i;
}
hold = [true, true, true, true, true];
showCards();
}
function showCards() {
i = 0;
while (i < 5) {
_root['card' + i].gotoAndStop(cards[i]);
++i;
}
}
function holdDraw(cardNum) {
if (hold[cardNum]) {
_root['card' + cardNum].gotoAndStop('back');
hold[cardNum] = false;
} else {
_root['card' + cardNum].gotoAndStop(cards[cardNum]);
hold[cardNum] = true;
}
}
function secondDraw() {
i = 0;
while (i < 5) {
if (!hold[i]) {
cards[i] = deck.pop();
}
++i;
}
showCards();
handVal = handValue(cards);
winAmt = winnings(handVal);
resultsDisplay = handVal + ': ' + winAmt;
youcash += winAmt;
cash -= winAmt;
showCash();
gotoAndPlay(26);
}
function compareHands(a, b) {
numa = Number(a.substr(1, 2));
numb = Number(b.substr(1, 2));
if (numa < numb) {
return -1;
}
if (numa == numb) {
return 0;
}
if (numb < numa) {
return 1;
}
}
function handValue() {
hand = cards.slice();
hand.sort(compareHands);
suits = new Array();
nums = new Array();
i = 0;
while (i < 5) {
suits.push(hand[i].substr(0, 1));
nums.push(Number(hand[i].substr(1, 2)));
++i;
}
straight = true;
i = 0;
while (i < 4) {
if (nums[i] + 1 != nums[i + 1]) {
straight = false;
}
++i;
}
if (nums[0] == 1 and nums[1] == 10 and nums[2] == 11 and nums[3] == 12 and nums[4] == 13) {
straight = true;
}
flush = true;
i = 1;
while (i < 5) {
if (suits[i] != suits[0]) {
flush = false;
}
++i;
}
counts = new Array();
i = 0;
while (i < 14) {
counts.push(0);
++i;
}
i = 0;
while (i < 5) {
++counts[nums[i]];
++i;
}
pair = false;
twoPair = false;
threeOfAKind = false;
fourOfAKind = false;
i = 1;
while (i < 14) {
if (counts[i] == 2) {
if (pair) {
twoPair = true;
} else {
pair = true;
}
} else {
if (counts[i] == 3) {
threeOfAKind = true;
} else {
if (counts[i] == 4) {
fourOfAKind = true;
}
}
}
++i;
}
jackOrHigher = false;
i = 1;
while (i < 14) {
if ((i == 1 or 10 < i) and counts[i] >= 2) {
jackOrHigher = true;
}
++i;
}
hasAce = false;
if (0 < counts[1]) {
hasAce = true;
}
if (straight and flush and hasAce) {
return 'Royal Flush';
} else {
if (straight and flush) {
return 'Straight Flush';
} else {
if (fourOfAKind) {
return 'Four-Of-A-Kind';
} else {
if (pair and threeOfAKind) {
return 'Full House';
} else {
if (flush) {
return 'Flush';
} else {
if (straight) {
return 'Straight';
} else {
if (threeOfAKind) {
return 'Three-Of-A-Kind';
} else {
if (twoPair) {
return 'Two Pair';
} else {
if (pair and jackOrHigher) {
return 'High Pair';
} else {
if (pair) {
return 'Low Pair';
} else {
return 'Nothing';
}
}
}
}
}
}
}
}
}
}
}
function winnings(handVal) {
if (handVal == 'Royal Flush') {
return 8 * bet;
}
if (handVal == 'Straight Flush') {
return 7 * bet;
}
if (handVal == 'Four-Of-A-Kind') {
return 6 * bet;
}
if (handVal == 'Full House') {
return 5 * bet;
}
if (handVal == 'Flush') {
return 4 * bet;
}
if (handVal == 'Straight') {
return 4 * bet;
}
if (handVal == 'Three-Of-A-Kind') {
return 3 * bet;
}
if (handVal == 'Two Pair') {
return 2 * bet;
}
if (handVal == 'High Pair') {
return 1 * bet;
}
if (handVal == 'Low Pair') {
return 0 * bet;
}
if (handVal == 'Nothing') {
return 0 * bet;
}
}
startGame();
var22.gotoAndStop(1);
var23.gotoAndStop(1);
var24.gotoAndStop(1);
var25.gotoAndStop(1);
var26.gotoAndStop(1);
var27.gotoAndStop(1);
var28.gotoAndStop(1);
var29.gotoAndStop(1);
stop();
}
movieClip 349 {
frame 1 {
stop();
}
}
movieClip 352 {
frame 1 {
stop();
}
}
movieClip 355 {
frame 1 {
stop();
}
}
movieClip 358 {
frame 1 {
stop();
}
}
movieClip 361 {
frame 1 {
stop();
}
}
movieClip 364 {
frame 1 {
stop();
}
}
movieClip 367 {
frame 1 {
stop();
}
}
movieClip 428 {
frame 30 {
stop();
}
}
button 432 {
on (press) {
click2.start();
gotoAndPlay(25);
}
}
frame 25 {
startDeal();
stop();
}
frame 26 {
if (699 < cash) {
if (cash < 1200) {
lev = 1;
var21._alpha = 0;
var22._alpha = 0;
var22.gotoAndStop(1);
var23._alpha = 0;
var23.gotoAndStop(1);
var24._alpha = 0;
var24.gotoAndStop(1);
}
}
if (cash < 700) {
if (599 < cash) {
if (lev < 2) {
moan.start();
}
lev = 2;
var21._alpha = 0;
var22._alpha = 100;
var22.gotoAndPlay(1);
var23._alpha = 0;
var23.gotoAndStop(1);
var24._alpha = 0;
var24.gotoAndStop(1);
}
}
if (cash < 600) {
if (499 < cash) {
if (lev < 3) {
moan.start();
}
lev = 3;
var22._alpha = 0;
var22.gotoAndStop(1);
var23._alpha = 100;
var23.gotoAndPlay(1);
var24.gotoAndStop(1);
var24._alpha = 0;
}
}
if (cash < 500) {
if (399 < cash) {
if (lev < 4) {
moan.start();
}
lev = 4;
var23._alpha = 0;
var23.gotoAndStop(1);
var24.gotoAndPlay(1);
var24._alpha = 100;
var25.gotoAndStop(1);
var25._alpha = 0;
}
}
if (cash < 400) {
if (299 < cash) {
if (lev < 5) {
moan.start();
}
lev = 5;
var24._alpha = 0;
var24.gotoAndStop(1);
var25.gotoAndPlay(1);
var25._alpha = 100;
var26.gotoAndStop(1);
var26._alpha = 0;
}
}
if (cash < 300) {
if (199 < cash) {
if (lev < 6) {
moan.start();
}
lev = 6;
var25._alpha = 0;
var25.gotoAndStop(1);
var26.gotoAndPlay(1);
var26._alpha = 100;
var27.gotoAndStop(1);
var27._alpha = 0;
}
}
if (cash < 200) {
if (99 < cash) {
if (lev < 7) {
moan.start();
}
lev = 7;
var26._alpha = 0;
var26.gotoAndStop(1);
var27.gotoAndPlay(1);
var27._alpha = 100;
var28.gotoAndStop(1);
var28._alpha = 0;
}
}
if (cash < 100) {
if (0 < cash) {
if (lev < 8) {
moan.start();
}
lev = 8;
var28.gotoAndPlay(1);
var28._alpha = 100;
var27.gotoAndStop(1);
var27._alpha = 0;
var26.gotoAndStop(1);
var26._alpha = 0;
}
}
if (cash < 1) {
if (lev < 9) {
moan.start();
}
lev = 9;
var28.gotoAndPlay(1);
var28._alpha = 0;
var27.gotoAndStop(1);
var27._alpha = 0;
var26.gotoAndStop(1);
var26._alpha = 0;
var29._alpha = 100;
var29.gotoAndPlay(1);
gotoAndPlay(29);
}
if (youcash < 1) {
gotoAndPlay(27);
}
stop();
}
frame 27 {
stop();
}
button 434 {
on (press) {
click.start();
youcashDisplay = 100;
cashDisplay = 800;
gotoAndPlay(12);
}
}
frame 28 {
stop();
}
frame 29 {
stop();
}
button 435 {
on (press) {
click.start();
gotoAndPlay(28);
}
}
frame 30 {
function startGame() {
youcash = 100;
cash = 800;
bet = 5;
picture = 0;
}
function showCash() {
cashDisplay = '$' + cash;
youcashDisplay = '$' + youcash;
}
function startDeal() {
youcash -= bet;
showCash();
createDeck();
firstDraw();
showCards();
}
function createDeck() {
suits = ['c', 'd', 's', 'h'];
temp = new Array();
suit = 0;
while (suit < 4) {
num = 1;
while (num < 14) {
temp.push(suits[suit] + num);
++num;
}
++suit;
}
deck = new Array();
while (0 < temp.length) {
r = int(Math.random() * temp.length);
deck.push(temp[r]);
temp.splice(r, 1);
}
}
function firstDraw() {
cards = new Array();
i = 0;
while (i < 5) {
cards.push(deck.pop());
++i;
}
hold = [true, true, true, true, true];
showCards();
}
function showCards() {
i = 0;
while (i < 5) {
_root['card' + i].gotoAndStop(cards[i]);
++i;
}
}
function holdDraw(cardNum) {
if (hold[cardNum]) {
_root['card' + cardNum].gotoAndStop('back');
hold[cardNum] = false;
} else {
_root['card' + cardNum].gotoAndStop(cards[cardNum]);
hold[cardNum] = true;
}
}
function secondDraw() {
i = 0;
while (i < 5) {
if (!hold[i]) {
cards[i] = deck.pop();
}
++i;
}
showCards();
handVal = handValue(cards);
winAmt = winnings(handVal);
resultsDisplay = handVal + ': ' + winAmt;
youcash += winAmt;
cash -= winAmt;
showCash();
gotoAndPlay(32);
}
function compareHands(a, b) {
numa = Number(a.substr(1, 2));
numb = Number(b.substr(1, 2));
if (numa < numb) {
return -1;
}
if (numa == numb) {
return 0;
}
if (numb < numa) {
return 1;
}
}
function handValue() {
hand = cards.slice();
hand.sort(compareHands);
suits = new Array();
nums = new Array();
i = 0;
while (i < 5) {
suits.push(hand[i].substr(0, 1));
nums.push(Number(hand[i].substr(1, 2)));
++i;
}
straight = true;
i = 0;
while (i < 4) {
if (nums[i] + 1 != nums[i + 1]) {
straight = false;
}
++i;
}
if (nums[0] == 1 and nums[1] == 10 and nums[2] == 11 and nums[3] == 12 and nums[4] == 13) {
straight = true;
}
flush = true;
i = 1;
while (i < 5) {
if (suits[i] != suits[0]) {
flush = false;
}
++i;
}
counts = new Array();
i = 0;
while (i < 14) {
counts.push(0);
++i;
}
i = 0;
while (i < 5) {
++counts[nums[i]];
++i;
}
pair = false;
twoPair = false;
threeOfAKind = false;
fourOfAKind = false;
i = 1;
while (i < 14) {
if (counts[i] == 2) {
if (pair) {
twoPair = true;
} else {
pair = true;
}
} else {
if (counts[i] == 3) {
threeOfAKind = true;
} else {
if (counts[i] == 4) {
fourOfAKind = true;
}
}
}
++i;
}
jackOrHigher = false;
i = 1;
while (i < 14) {
if ((i == 1 or 10 < i) and counts[i] >= 2) {
jackOrHigher = true;
}
++i;
}
hasAce = false;
if (0 < counts[1]) {
hasAce = true;
}
if (straight and flush and hasAce) {
return 'Royal Flush';
} else {
if (straight and flush) {
return 'Straight Flush';
} else {
if (fourOfAKind) {
return 'Four-Of-A-Kind';
} else {
if (pair and threeOfAKind) {
return 'Full House';
} else {
if (flush) {
return 'Flush';
} else {
if (straight) {
return 'Straight';
} else {
if (threeOfAKind) {
return 'Three-Of-A-Kind';
} else {
if (twoPair) {
return 'Two Pair';
} else {
if (pair and jackOrHigher) {
return 'High Pair';
} else {
if (pair) {
return 'Low Pair';
} else {
return 'Nothing';
}
}
}
}
}
}
}
}
}
}
}
function winnings(handVal) {
if (handVal == 'Royal Flush') {
return 5 * bet;
}
if (handVal == 'Straight Flush') {
return 5 * bet;
}
if (handVal == 'Four-Of-A-Kind') {
return 4 * bet;
}
if (handVal == 'Full House') {
return 4 * bet;
}
if (handVal == 'Flush') {
return 3 * bet;
}
if (handVal == 'Straight') {
return 3 * bet;
}
if (handVal == 'Three-Of-A-Kind') {
return 2 * bet;
}
if (handVal == 'Two Pair') {
return 2 * bet;
}
if (handVal == 'High Pair') {
return 1 * bet;
}
if (handVal == 'Low Pair') {
return 1 * bet;
}
if (handVal == 'Nothing') {
return 0 * bet;
}
}
startGame();
var32.gotoAndStop(1);
var33.gotoAndStop(1);
var34.gotoAndStop(1);
var35.gotoAndStop(1);
var36.gotoAndStop(1);
var37.gotoAndStop(1);
var38.gotoAndStop(1);
var29.gotoAndStop(1);
stop();
}
movieClip 439 {
frame 1 {
stop();
}
}
movieClip 442 {
frame 1 {
stop();
}
}
movieClip 445 {
frame 1 {
stop();
}
}
movieClip 448 {
frame 1 {
stop();
}
}
movieClip 451 {
frame 1 {
stop();
}
}
movieClip 454 {
frame 1 {
stop();
}
}
movieClip 457 {
frame 1 {
stop();
}
}
movieClip 518 {
frame 30 {
stop();
}
}
button 522 {
on (press) {
click2.start();
gotoAndPlay(31);
}
}
frame 31 {
startDeal();
stop();
}
frame 32 {
if (699 < cash) {
if (cash < 1200) {
lev = 1;
var31._alpha = 0;
var32._alpha = 0;
var32.gotoAndStop(1);
var33._alpha = 0;
var33.gotoAndStop(1);
var34._alpha = 0;
var34.gotoAndStop(1);
}
}
if (cash < 700) {
if (599 < cash) {
if (lev < 2) {
moan.start();
}
lev = 2;
var31._alpha = 0;
var32._alpha = 100;
var32.gotoAndPlay(1);
var33._alpha = 0;
var33.gotoAndStop(1);
var34._alpha = 0;
var34.gotoAndStop(1);
}
}
if (cash < 600) {
if (499 < cash) {
if (lev < 3) {
moan.start();
}
lev = 3;
var32._alpha = 0;
var32.gotoAndStop(1);
var33._alpha = 100;
var33.gotoAndPlay(1);
var34.gotoAndStop(1);
var34._alpha = 0;
}
}
if (cash < 500) {
if (399 < cash) {
if (lev < 4) {
moan.start();
}
lev = 4;
var33._alpha = 0;
var33.gotoAndStop(1);
var34.gotoAndPlay(1);
var34._alpha = 100;
var35.gotoAndStop(1);
var35._alpha = 0;
}
}
if (cash < 400) {
if (299 < cash) {
if (lev < 5) {
moan.start();
}
lev = 5;
var34._alpha = 0;
var34.gotoAndStop(1);
var35.gotoAndPlay(1);
var35._alpha = 100;
var36.gotoAndStop(1);
var36._alpha = 0;
}
}
if (cash < 300) {
if (199 < cash) {
if (lev < 6) {
moan.start();
}
lev = 6;
var35._alpha = 0;
var35.gotoAndStop(1);
var36.gotoAndPlay(1);
var36._alpha = 100;
var37.gotoAndStop(1);
var37._alpha = 0;
}
}
if (cash < 200) {
if (99 < cash) {
if (lev < 7) {
moan.start();
}
lev = 7;
var36._alpha = 0;
var36.gotoAndStop(1);
var37.gotoAndPlay(1);
var37._alpha = 100;
var38.gotoAndStop(1);
var38._alpha = 0;
}
}
if (cash < 100) {
if (0 < cash) {
if (lev < 8) {
moan.start();
}
lev = 8;
var38.gotoAndPlay(1);
var38._alpha = 100;
var37.gotoAndStop(1);
var37._alpha = 0;
var36.gotoAndStop(1);
var36._alpha = 0;
}
}
if (cash < 1) {
if (lev < 9) {
moan.start();
}
lev = 9;
var38.gotoAndPlay(1);
var38._alpha = 0;
var37.gotoAndStop(1);
var37._alpha = 0;
var36.gotoAndStop(1);
var36._alpha = 0;
var39._alpha = 100;
var39.gotoAndPlay(1);
gotoAndPlay(35);
}
if (youcash < 1) {
gotoAndPlay(33);
}
stop();
}
frame 33 {
stop();
}
button 524 {
on (press) {
click.start();
youcashDisplay = 100;
cashDisplay = 800;
gotoAndPlay(11);
}
}
frame 34 {
stop();
}
frame 35 {
stop();
}
button 525 {
on (press) {
click.start();
gotoAndPlay(34);
}
}
frame 36 {
c1 = _url.indexOf('://') + 3;
c2 = _url.indexOf('/', c1);
domain = _url.substring(c1, c2);
if (domain != '161.58.197.107') {
gotoAndPlay(37);
} else {
gotoAndPlay(11);
}
stop();
}
frame 37 {
stop();
}