Frame 1
ifFrameLoaded (7) {
gotoAndPlay (3);
}
_global.ipb_get_gname = function () {
var _local3 = _root._url;
var _loc5 = "";
var _local2 = "";
var _loc6 = (_local3.lastIndexOf("\\") + 1);
if ((_loc6 == -1) || (_loc6 == 0)) {
_loc6 = _local3.lastIndexOf("/") + 1;
}
var _local1 = _loc6;
var _loc7 = String(_local3).length;
while (_local1 < String(_local3).length) {
_local2 = _local3.charAt(_local1);
if (_local2 == ".") {
break;
}
_loc5 = _loc5 + _local2;
_local1++;
}
return(_loc5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Frame 2
gotoAndPlay (2);
Frame 3
function startGame1() {
showCash();
gotoAndPlay (4);
}
function showCash() {
cashDisplay = "$" + cash;
}
startGame1();
myData = .getLocal("myfile");
score.text = myData.data.score;
fscommand ("fullscreen", true);
fscommand ("showmenu", false);
fscommand ("allowscale", true);
stop();
Frame 4
function Need() {
myData.data.score = score.text;
myData.flush();
}
function startGame() {
bet = 0;
showBet();
}
function tellBet() {
output1 = bet * 5000;
output2 = bet * 300;
output3 = bet * 100;
output4 = bet * 25;
output5 = bet * 20;
output6 = bet * 10;
output7 = bet * 3;
output8 = bet * 2;
output9 = bet;
}
function startDeal() {
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 (temp.length > 0) {
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();
handValue1();
}
function showCards() {
var _local1 = _root;
i = 0;
while (i < 5) {
_local1["card" + i].gotoAndStop(cards[i]);
i++;
}
}
function holdDraw(cardNum) {
var _local1 = cardNum;
if (hold[_local1]) {
_root["card" + _local1].gotoAndStop("back");
hold[_local1] = false;
mysound = new Sound();
mySound.attachSound("select");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
} else {
_root["card" + _local1].gotoAndStop(cards[_local1]);
hold[_local1] = true;
mysound = new Sound();
mySound.attachSound("select");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
}
}
function showFlsh() {
tellTarget ("pair") {
gotoAndStop (1);
};
tellTarget ("2p") {
gotoAndStop (1);
};
tellTarget ("3k") {
gotoAndStop (1);
};
tellTarget ("st8") {
gotoAndStop (1);
};
tellTarget ("flush") {
gotoAndStop (1);
};
tellTarget ("boat") {
gotoAndStop (1);
};
tellTarget ("4k") {
gotoAndStop (1);
};
tellTarget ("st8f") {
gotoAndStop (1);
};
tellTarget ("sf") {
gotoAndStop (1);
};
}
function secondDraw() {
showFlsh();
i = 0;
while (i < 5) {
if (!hold[i]) {
cards[i] = deck.pop();
}
i++;
}
showCards();
handVal = handValue(cards);
winAmt = bet * winnings(handVal);
resultsDisplay = ((handVal + " : ") + "$") + winAmt;
cash = cash + winAmt;
showCash();
gotoAndPlay (6);
}
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 (numa > numb) {
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) && (nums[1] == 10)) && (nums[2] == 11)) && (nums[3] == 12)) && (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) || (i > 10)) && (counts[i] >= 2)) {
jackOrHigher = true;
}
i++;
}
hasAce = false;
if (counts[1] > 0) {
hasAce = true;
}
if ((straight && (flush)) && (hasAce)) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Royal Flush");
}
if (straight && (flush)) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Straight Flush");
}
if (fourOfAKind) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Four Of A Kind");
}
if (pair && (threeOfAKind)) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Full House");
}
if (flush) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Flush");
}
if (straight) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Straight");
}
if (threeOfAKind) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Three Of A Kind");
}
if (twoPair) {
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
return("Two Pair");
}
if (pair) {
tellTarget ("pair") {
gotoAndPlay (2);
mysound = new Sound();
mySound.attachSound("won");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
};
return("Pair");
}
return("Try Again");
}
function handValue1() {
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) && (nums[1] == 10)) && (nums[2] == 11)) && (nums[3] == 12)) && (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) || (i > 10)) && (counts[i] >= 2)) {
jackOrHigher = true;
}
i++;
}
hasAce = false;
if (counts[1] > 0) {
hasAce = true;
}
if ((straight && (flush)) && (hasAce)) {
tellTarget ("sf") {
gotoAndPlay (2);
};
return("Royal Flush");
}
if (straight && (flush)) {
tellTarget ("st8f") {
gotoAndPlay (2);
};
return("Straight Flush");
}
if (fourOfAKind) {
tellTarget ("4k") {
gotoAndPlay (2);
};
return("Four Of A Kind");
}
if (pair && (threeOfAKind)) {
tellTarget ("boat") {
gotoAndPlay (2);
};
return("Full House");
}
if (flush) {
tellTarget ("flush") {
gotoAndPlay (2);
};
return("Flush");
}
if (straight) {
tellTarget ("st8") {
gotoAndPlay (2);
};
return("Straight");
}
if (threeOfAKind) {
tellTarget ("3k") {
gotoAndPlay (2);
};
return("Three Of A Kind");
}
if (twoPair) {
tellTarget ("2p") {
gotoAndPlay (2);
};
return("Two Pair");
}
if (pair) {
tellTarget ("pair") {
gotoAndPlay (2);
};
return("Pair");
}
return("Try Again");
}
function winnings(handVal) {
var _local1 = handVal;
if (_local1 == "Royal Flush") {
return(5000);
}
if (_local1 == "Straight Flush") {
return(300);
}
if (_local1 == "Four Of A Kind") {
return(100);
}
if (_local1 == "Full House") {
return(25);
}
if (_local1 == "Flush") {
return(20);
}
if (_local1 == "Straight") {
return(10);
}
if (_local1 == "Three Of A Kind") {
return(3);
}
if (_local1 == "Two Pair") {
return(2);
}
if (_local1 == "Pair") {
return(1);
}
if (_local1 == "Try Again") {
return(0);
}
return(undefined);
}
startGame();
stop();
if (cash <= 0) {
cash = 1000;
}
Frame 5
startDeal();
stop();
Frame 6
stop();
Symbol 9 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 10
gotoAndPlay (2);
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 10
gotoAndPlay (2);
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 10
gotoAndPlay (2);
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 10
gotoAndPlay (2);
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 10
gotoAndPlay (2);
Symbol 37 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 10
gotoAndPlay (2);
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 10
gotoAndPlay (2);
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 10
gotoAndPlay (2);
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 10
gotoAndPlay (2);
Symbol 87 MovieClip Frame 1
stop();
Symbol 95 Button
on (press) {
holdDraw(3);
}
Symbol 96 Button
on (press) {
holdDraw(0);
}
Symbol 97 Button
on (press) {
holdDraw(1);
}
Symbol 98 Button
on (press) {
holdDraw(4);
}
Symbol 99 Button
on (press) {
holdDraw(2);
}
Symbol 104 Button
on (release) {
if (Number(cash) > 0) {
bet = Number(bet) + 5;
cash = cash - 5;
tellBet();
mysound = new Sound();
mySound.attachSound("bet1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
}
}
Symbol 106 Button
on (press) {
if (Number(bet) > 0) {
gotoAndPlay (5);
}
}
Symbol 107 Button
on (release) {
if (Number(cash) > 0) {
bet = Number(bet) + 10;
cash = cash - 10;
tellBet();
mysound = new Sound();
mySound.attachSound("bet1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
}
}
Symbol 108 Button
on (release) {
if (Number(cash) > 0) {
bet = Number(bet) + 100;
cash = cash - 100;
tellBet();
mysound = new Sound();
mySound.attachSound("bet1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
}
}
Symbol 109 Button
on (release) {
if (Number(cash) > 0) {
bet = Number(bet) + 1000;
cash = cash - 1000;
tellBet();
mysound = new Sound();
mySound.attachSound("bet1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
}
}
Symbol 115 Button
on (press) {
_global.ipbSend();
}
Symbol 120 Button
on (press) {
holdDraw(0);
}
Symbol 121 Button
on (press) {
holdDraw(1);
}
Symbol 122 Button
on (press) {
holdDraw(2);
}
Symbol 123 Button
on (press) {
holdDraw(3);
}
Symbol 124 Button
on (press) {
holdDraw(4);
}
Symbol 127 Button
on (press) {
secondDraw();
}
Symbol 128 Button
on (press) {
Need();
tellTarget ("pair") {
gotoAndStop (1);
};
mysound = new Sound();
mySound.attachSound("play1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
if (Number(cash) <= 0) {
gotoAndStop (8);
} else {
gotoAndPlay (4);
}
output1 = "";
output2 = "";
output3 = "";
output4 = "";
output5 = "";
output6 = "";
output7 = "";
output8 = "";
output9 = "";
}
Symbol 131 Button
on (press) {
mysound = new Sound();
mySound.attachSound("play1");
mySound.start(0, 1);
mySound.setPan(0);
mySound.setVolume(100);
gotoAndPlay (3);
output1 = "";
output2 = "";
output3 = "";
output4 = "";
output5 = "";
output6 = "";
output7 = "";
output8 = "";
output9 = "";
}