Frame 1
stop();
Stage.showMenu = false;
var totalBytes = 0;
var loadedBytes = 0;
var percentage = 0;
var delay = 0;
var movieAlpha = 100;
this.onEnterFrame = function () {
loadedBytes = getBytesLoaded();
totalBytes = getBytesTotal();
percentage = Math.round((loadedBytes / totalBytes) * 100);
preloader.gotoAndStop(percentage);
if (percentage >= 100) {
if (delay == 0) {
delay = 1;
}
}
if (delay >= 1) {
delay++;
if (delay > 44) {
if (delay >= 54) {
delay = 0;
gotoAndStop ("gameScreen");
delete onEnterFrame;
}
}
}
};
Instance of Symbol 13 MovieClip "clickSound" in Frame 1
onClipEvent (load) {
musicObj = new Sound(this);
musicObj.attachSound("click");
}
Instance of Symbol 13 MovieClip "flipSound" in Frame 1
onClipEvent (load) {
musicObj = new Sound(this);
musicObj.attachSound("flip");
}
Instance of Symbol 13 MovieClip "splitSound" in Frame 1
onClipEvent (load) {
musicObj = new Sound(this);
musicObj.attachSound("split");
}
Frame 2
function activatePlusMinusButton(type, values) {
if (type == "block") {
plusClip.gotoAndStop("deactive");
minusClip.gotoAndStop("deactive");
} else if (type == "reset") {
if (credits >= betAmount) {
if ((betAmount < 1000) && ((credits - betAmount) >= 10)) {
plusClip.gotoAndStop("active");
} else {
plusClip.gotoAndStop("deactive");
}
} else {
dealClip.gotoAndStop("deactive");
plusClip.gotoAndStop("deactive");
noCredits.gotoAndStop("active");
}
if ((betAmount > 10) && (credits >= 10)) {
minusClip.gotoAndStop("active");
} else {
minusClip.gotoAndStop("deactive");
}
} else if (type == "inc-dec") {
if (values == "increment") {
if ((credits - (betAmount + 10)) >= 0) {
initialBetAmount = initialBetAmount + 10;
betAmount = initialBetAmount;
minusClip.gotoAndStop("active");
if ((betAmount < 1000) && ((credits - betAmount) >= 10)) {
plusClip.gotoAndStop("active");
} else {
plusClip.gotoAndStop("deactive");
}
} else {
trace("not necessary ....");
dealClip.gotoAndStop("deactive");
plusClip.gotoAndStop("deactive");
noCredits.gotoAndStop("active");
}
} else if (values == "decrement") {
if ((betAmount - 10) > 0) {
initialBetAmount = initialBetAmount - 10;
betAmount = initialBetAmount;
if ((credits - betAmount) >= 10) {
plusClip.gotoAndStop("active");
}
if (credits >= betAmount) {
noCredits.gotoAndStop("deactive");
dealClip.gotoAndStop("active");
}
}
if ((betAmount - 10) <= 0) {
minusClip.gotoAndStop("deactive");
}
}
winAmount = "";
}
}
stop();
var initialBetAmount = 10;
var betAmount = 10;
var credits = 1000;
this.onEnterFrame = function () {
movieAlpha = movieAlpha + 10;
this._alpha = movieAlpha;
trace(movieAlpha);
delay++;
if (delay >= 10) {
delete onEnterFrame;
}
};
Symbol 5 Button
on (release) {
getURL ("http://www.pifgames.com", "_blank");
}
Symbol 8 MovieClip Frame 1
stop();
Symbol 83 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.activatePlusMinusButton("block", null);
_parent.gamePad.gameEngine.generateRandomCards();
gotoAndStop ("deactiveHit");
}
Symbol 86 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.gamePad.gameEngine.initializeCardTakingProcess();
_parent.gamePad.gameEngine.takeCardFromDeck();
_parent.insuranceClip.gotoAndStop("deactive");
_parent.standClip.gotoAndStop("deactive");
_parent.doubleClip.gotoAndStop("deactive");
_parent.splitClip.gotoAndStop("deactive");
gotoAndStop ("deactiveHit");
}
Symbol 87 MovieClip Frame 1
stop();
_parent.betAmount = _parent.initialBetAmount;
_parent.insuranceClip.gotoAndStop("deactive");
_parent.gamePad.splitHighlight.gotoAndStop("reset");
_parent.activatePlusMinusButton("reset", null);
Symbol 113 Button
on (release) {
getURL ("http://www.pifgames.com/addgames.php", "_blank");
}
Symbol 115 Button
on (release) {
getURL ("http://www.pifgames.com/re/blackjackgold/", "_blank");
}
Symbol 120 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
if ((_parent.gamePad.gameEngine.splitSelected == true) && (_parent.gamePad.gameEngine.splitUserTurn == 1)) {
_parent.gamePad.gameEngine.splitSecondUserTurn();
} else {
_parent.gamePad.gameEngine.moveBy = "computer";
_parent.gamePad.gameEngine.initializeCardTakingProcess();
_parent.gamePad.gameEngine.takeCardFromDeck();
}
_parent.dealClip.gotoAndStop("deactiveHit");
_parent.insuranceClip.gotoAndStop("deactive");
_parent.doubleClip.gotoAndStop("deactive");
_parent.splitClip.gotoAndStop("deactive");
gotoAndStop ("deactive");
}
Symbol 121 MovieClip Frame 1
stop();
Symbol 123 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.activatePlusMinusButton("inc-dec", "decrement");
}
Symbol 124 MovieClip Frame 1
stop();
Symbol 126 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.activatePlusMinusButton("inc-dec", "increment");
}
Symbol 127 MovieClip Frame 1
stop();
Symbol 131 Button
on (release) {
_parent.splitSound.musicObj.start(0, 1);
_parent.credits = _parent.credits - _parent.initialBetAmount;
if (_parent.gamePad.gameEngine.insurance == true) {
_parent.betAmount = _parent.initialBetAmount * 2.5;
} else {
_parent.betAmount = _parent.initialBetAmount * 2;
}
_parent.gamePad.gameEngine.splitSelected = true;
_parent.gamePad.gameEngine.splitTheCard();
_parent.dealClip.gotoAndStop("deactiveHit");
_parent.standClip.gotoAndStop("deactive");
_parent.insuranceClip.gotoAndStop("deactive");
_parent.doubleClip.gotoAndStop("deactive");
gotoAndStop ("deactive");
}
Symbol 132 MovieClip Frame 1
stop();
Symbol 134 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.credits = _parent.credits - _parent.initialBetAmount;
_parent.betAmount = _parent.initialBetAmount * 2;
_parent.gamePad.gameEngine.doubleSelected = true;
_parent.gamePad.gameEngine.initializeCardTakingProcess();
_parent.gamePad.gameEngine.takeCardFromDeck();
_parent.dealClip.gotoAndStop("deactiveHit");
_parent.standClip.gotoAndStop("deactive");
_parent.insuranceClip.gotoAndStop("deactive");
_parent.splitClip.gotoAndStop("deactive");
gotoAndStop ("deactive");
}
Symbol 135 MovieClip Frame 1
stop();
Symbol 137 Button
on (release) {
_parent.clickSound.musicObj.start(0, 1);
_parent.gamePad.gameEngine.insurance = true;
_parent.gamePad.gameEngine.checkBothAreBlackJack();
_parent.credits = _parent.credits - (_parent.initialBetAmount * 0.5);
_parent.betAmount = _parent.initialBetAmount * 1.5;
if ((_parent.credits - _parent.initialBetAmount) < 0) {
_parent.doubleClip.gotoAndStop("deactive");
_parent.splitClip.gotoAndStop("deactive");
}
gotoAndStop ("deactive");
}
Symbol 138 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 1
stop();
var cardValue = 0;
Symbol 231 MovieClip Frame 2
cardValue = 1;
Symbol 231 MovieClip Frame 3
cardValue = 2;
Symbol 231 MovieClip Frame 4
cardValue = 3;
Symbol 231 MovieClip Frame 5
cardValue = 4;
Symbol 231 MovieClip Frame 6
cardValue = 5;
Symbol 231 MovieClip Frame 7
cardValue = 6;
Symbol 231 MovieClip Frame 8
cardValue = 7;
Symbol 231 MovieClip Frame 9
cardValue = 8;
Symbol 231 MovieClip Frame 10
cardValue = 9;
Symbol 231 MovieClip Frame 11
cardValue = 10;
Symbol 231 MovieClip Frame 12
cardValue = 10;
Symbol 231 MovieClip Frame 13
cardValue = 10;
Symbol 231 MovieClip Frame 14
cardValue = 10;
Symbol 231 MovieClip Frame 15
cardValue = 1;
Symbol 231 MovieClip Frame 16
cardValue = 2;
Symbol 231 MovieClip Frame 17
cardValue = 3;
Symbol 231 MovieClip Frame 18
cardValue = 4;
Symbol 231 MovieClip Frame 19
cardValue = 5;
Symbol 231 MovieClip Frame 20
cardValue = 6;
Symbol 231 MovieClip Frame 21
cardValue = 7;
Symbol 231 MovieClip Frame 22
cardValue = 8;
Symbol 231 MovieClip Frame 23
cardValue = 9;
Symbol 231 MovieClip Frame 24
cardValue = 10;
Symbol 231 MovieClip Frame 25
cardValue = 10;
Symbol 231 MovieClip Frame 26
cardValue = 10;
Symbol 231 MovieClip Frame 27
cardValue = 10;
Symbol 231 MovieClip Frame 28
cardValue = 1;
Symbol 231 MovieClip Frame 29
cardValue = 2;
Symbol 231 MovieClip Frame 30
cardValue = 3;
Symbol 231 MovieClip Frame 31
cardValue = 4;
Symbol 231 MovieClip Frame 32
cardValue = 5;
Symbol 231 MovieClip Frame 33
cardValue = 6;
Symbol 231 MovieClip Frame 34
cardValue = 7;
Symbol 231 MovieClip Frame 35
cardValue = 8;
Symbol 231 MovieClip Frame 36
cardValue = 9;
Symbol 231 MovieClip Frame 37
cardValue = 10;
Symbol 231 MovieClip Frame 38
cardValue = 10;
Symbol 231 MovieClip Frame 39
cardValue = 10;
Symbol 231 MovieClip Frame 40
cardValue = 10;
Symbol 231 MovieClip Frame 41
cardValue = 1;
Symbol 231 MovieClip Frame 42
cardValue = 2;
Symbol 231 MovieClip Frame 43
cardValue = 3;
Symbol 231 MovieClip Frame 44
cardValue = 4;
Symbol 231 MovieClip Frame 45
cardValue = 5;
Symbol 231 MovieClip Frame 46
cardValue = 6;
Symbol 231 MovieClip Frame 47
cardValue = 7;
Symbol 231 MovieClip Frame 48
cardValue = 8;
Symbol 231 MovieClip Frame 49
cardValue = 9;
Symbol 231 MovieClip Frame 50
cardValue = 10;
Symbol 231 MovieClip Frame 51
cardValue = 10;
Symbol 231 MovieClip Frame 52
cardValue = 10;
Symbol 231 MovieClip Frame 53
cardValue = 10;
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 89
gotoAndStop (1);
Symbol 238 MovieClip Frame 128
gotoAndStop (1);
Symbol 238 MovieClip Frame 156
gotoAndStop (1);
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 7
if (_parent.user == true) {
_parent._parent.noOfWinSounds++;
if (_parent._parent.noOfWinSounds == 1) {
statusSound.gotoAndPlay("winSound");
}
}
Symbol 245 MovieClip Frame 12
if (_parent.user == true) {
_parent._parent.noOfLoseSounds++;
if (_parent._parent.noOfLoseSounds == 1) {
statusSound.gotoAndPlay("loseSound");
}
}
Symbol 245 MovieClip Frame 17
if (_parent.user == true) {
_parent._parent.noOfLoseSounds++;
if (_parent._parent.noOfLoseSounds == 1) {
statusSound.gotoAndPlay("loseSound");
}
}
Symbol 249 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 21
if (user == true) {
summary.statusSound.gotoAndPlay("bustSound");
}
Symbol 263 MovieClip Frame 1
stop();
Symbol 264 MovieClip Frame 1
var noOfWinSounds = 0;
var noOfLoseSounds = 0;
Instance of Symbol 257 MovieClip "userStatus1" in Symbol 264 MovieClip Frame 1
onClipEvent (load) {
var user = true;
}
Instance of Symbol 259 MovieClip "gameEngine" in Symbol 264 MovieClip Frame 1
onClipEvent (load) {
function takeCardFromDeck() {
noOfCardsOpened++;
duplicateMovieClip (_parent.card, "card" + noOfCardsOpened, noOfCardsOpened);
_parent["card" + noOfCardsOpened]._x = _parent.deckRef._x;
_parent["card" + noOfCardsOpened]._y = _parent.deckRef._y;
if (moveBy == "user") {
numberOfUserCards++;
if (splitUserTurn == 2) {
cardXdiff = ((_parent.userRef2._x + (numberOfUserCards * cardXspacing)) - _parent.deckRef._x) / cardSpeed;
cardYdiff = ((_parent.userRef2._y + (numberOfUserCards * cardYspacing)) - _parent.deckRef._y) / cardSpeed;
} else {
cardXdiff = ((_parent.userRef._x + (numberOfUserCards * cardXspacing)) - _parent.deckRef._x) / cardSpeed;
cardYdiff = ((_parent.userRef._y + (numberOfUserCards * cardYspacing)) - _parent.deckRef._y) / cardSpeed;
}
} else if (moveBy == "computer") {
numberOfComputerCards++;
cardXdiff = ((_parent.computerRef._x + (numberOfComputerCards * cardXspacing)) - _parent.deckRef._x) / cardSpeed;
cardYdiff = (_parent.computerRef._y - _parent.deckRef._y) / cardSpeed;
}
cardMoveCompleted = 0;
actionCode = 1;
}
function initializeCardTakingProcess() {
closeTheCard = true;
flip = true;
xScale = 100;
}
function removeCards() {
var _local2 = 0;
_local2 = 1;
while (_local2 <= noOfCardsOpened) {
removeMovieClip(_parent["card" + _local2]);
_local2++;
}
}
function generateRandomCards() {
var _local4 = 52;
var _local2 = 0;
var _local3 = 0;
_local2 = 1;
while (_local2 <= _local4) {
numberArray[_local2] = _local2;
_local2++;
}
trace(numberArray);
_local2 = 1;
while (_local2 <= _local4) {
_local3 = random(numberArray.length - 1) + 1;
randomCards[_local2] = numberArray[_local3];
numberArray.splice(_local3, 1);
_local2++;
}
trace("randomCards :: " + randomCards);
_parent._parent.credits = _parent._parent.credits - _parent._parent.initialBetAmount;
_parent._parent.winAmount = "";
insurance = false;
bothAreBlackJack = false;
doubleSelected = false;
switchDoubleControlOnce = false;
splitSelected = false;
splitUserTurn = 1;
user1Total = 0;
user2Total = 0;
splitWinAmount = 0;
_parent.noOfWinSounds = 0;
_parent.noOfLoseSounds = 0;
userCardArray.splice(0, userCardArray.length);
computerCardArray.splice(0, computerCardArray.length);
removeCards();
_parent.userStatus1.gotoAndStop("reset");
_parent.userStatus2.gotoAndStop("reset");
_parent.computerStatus.gotoAndStop("reset");
_parent.userStatus1.softClip.gotoAndStop("deactive");
_parent.userStatus2.softClip.gotoAndStop("deactive");
_parent.computerStatus.softClip.gotoAndStop("deactive");
_parent.userStatus1.summary.gotoAndStop("reset");
_parent.userStatus2.summary.gotoAndStop("reset");
_parent.userStatus = _parent["userStatus" + splitUserTurn];
_parent.computerStatus.summary.gotoAndStop("reset");
_parent.splitHighlight.gotoAndStop("reset");
moveBy = "user";
numberOfUserCards = 0;
numberOfComputerCards = 0;
noOfCardsOpened = 0;
userCardValue = 0;
computerCardValue = 0;
initializeCardTakingProcess();
takeCardFromDeck();
}
function calculateCardValue(playerId) {
var _local1 = 0;
var _local3 = 0;
var _local2 = 0;
var _local4 = 0;
userSoft = false;
computerSoft = false;
if (playerId == 1) {
_local1 = 1;
while (_local1 <= numberOfComputerCards) {
if (computerCardArray[_local1] == 1) {
_local3++;
} else {
_local2 = _local2 + computerCardArray[_local1];
}
_local1++;
}
if (_local3 > 0) {
_local4 = (_local2 + 11) + (_local3 - 1);
if (_local4 <= 21) {
computerSoft = true;
} else {
_local4 = _local2 + _local3;
}
} else {
_local4 = _local2;
}
} else if (playerId == 2) {
_local1 = 1;
while (_local1 <= numberOfUserCards) {
if (userCardArray[_local1] == 1) {
_local3++;
} else {
_local2 = _local2 + userCardArray[_local1];
}
_local1++;
}
if (_local3 > 0) {
_local4 = (_local2 + 11) + (_local3 - 1);
if (_local4 <= 21) {
userSoft = true;
} else {
_local4 = _local2 + _local3;
}
} else {
_local4 = _local2;
}
}
return(_local4);
}
function checkBothAreBlackJack() {
if (bothAreBlackJack == true) {
moveBy = "computer";
initializeCardTakingProcess();
takeCardFromDeck();
}
}
function splitTheCard() {
cardXdiff = ((_parent.userRef2._x + cardXspacing) - _parent["card" + noOfCardsOpened]._x) / cardSpeed;
cardYdiff = ((_parent.userRef2._y + cardYspacing) - _parent["card" + noOfCardsOpened]._y) / cardSpeed;
cardMoveCompleted = 0;
_parent.userStatus1.gotoAndStop("reset");
actionCode = 2;
}
function moveTheSplittedCard() {
if (cardMoveCompleted < cardSpeed) {
cardMoveCompleted++;
_parent["card" + noOfCardsOpened]._x = _parent["card" + noOfCardsOpened]._x + cardXdiff;
_parent["card" + noOfCardsOpened]._y = _parent["card" + noOfCardsOpened]._y + cardYdiff;
} else {
numberOfUserCards--;
_parent.splitHighlight.gotoAndStop("player1");
moveBy = "user";
initializeCardTakingProcess();
takeCardFromDeck();
actionCode = 1;
}
}
function splitSecondUserTurn() {
splitUserTurn = 2;
_parent.userStatus = _parent["userStatus" + splitUserTurn];
_parent.splitHighlight.gotoAndStop("player2");
numberOfUserCards = 1;
moveBy = "user";
initializeCardTakingProcess();
takeCardFromDeck();
}
function dealerTurn() {
moveBy = "computer";
initializeCardTakingProcess();
takeCardFromDeck();
}
function cardMovement() {
if (cardMoveCompleted < cardSpeed) {
cardMoveCompleted++;
_parent["card" + noOfCardsOpened]._x = _parent["card" + noOfCardsOpened]._x + cardXdiff;
_parent["card" + noOfCardsOpened]._y = _parent["card" + noOfCardsOpened]._y + cardYdiff;
} else if (flip == true) {
if (closeTheCard == true) {
xScale = xScale - 25;
_parent["card" + noOfCardsOpened]._xscale = xScale;
if (xScale <= 0) {
closeTheCard = false;
_parent._parent.flipSound.musicObj.start(0, 1);
_parent["card" + noOfCardsOpened].gotoAndStop(randomCards[noOfCardsOpened] + 1);
}
} else if (closeTheCard == false) {
xScale = xScale + 25;
_parent["card" + noOfCardsOpened]._xscale = xScale;
if (xScale >= 100) {
flip = false;
if (noOfCardsOpened == 1) {
moveBy = "computer";
userCardArray[numberOfUserCards] = _parent["card" + noOfCardsOpened].cardValue;
userCardValue = calculateCardValue(2);
this[("user" + splitUserTurn) + "Total"] = userCardValue;
initializeCardTakingProcess();
takeCardFromDeck();
} else if (noOfCardsOpened == 2) {
moveBy = "user";
computerCardArray[numberOfComputerCards] = _parent["card" + noOfCardsOpened].cardValue;
computerCardValue = calculateCardValue(1);
initializeCardTakingProcess();
takeCardFromDeck();
} else if (noOfCardsOpened >= 3) {
if (moveBy == "user") {
userCardArray[numberOfUserCards] = _parent["card" + noOfCardsOpened].cardValue;
userCardValue = calculateCardValue(2);
this[("user" + splitUserTurn) + "Total"] = userCardValue;
if (userSoft == true) {
_parent.userStatus.softClip.gotoAndStop("active");
} else {
_parent.userStatus.softClip.gotoAndStop("deactive");
}
_parent.userStatus.gotoAndStop("showTotal");
_parent.userStatus.displayTotal = userCardValue;
if (userCardValue > 21) {
_parent.userStatus.gotoAndStop("bust");
if ((splitSelected == true) && (splitUserTurn == 1)) {
splitSecondUserTurn();
} else if ((splitSelected == true) && (splitUserTurn == 2)) {
dealerTurn();
} else if (insurance == true) {
dealerTurn();
} else {
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.winAmount = 0;
}
} else if (userCardValue == 21) {
if ((numberOfUserCards == 2) && (splitSelected == false)) {
_parent.userStatus.gotoAndStop("blackJack");
if ((computerCardValue == 11) || (computerCardValue == 10)) {
if (computerCardValue == 11) {
bothAreBlackJack = true;
_parent._parent.insuranceClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("active");
} else {
moveBy = "computer";
initializeCardTakingProcess();
takeCardFromDeck();
}
} else {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2.5;
_parent.userStatus.summary.gotoAndStop("win");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
}
} else if ((splitSelected == true) && (splitUserTurn == 1)) {
splitSecondUserTurn();
} else if ((splitSelected == true) && (splitUserTurn == 2)) {
dealerTurn();
} else {
moveBy = "computer";
initializeCardTakingProcess();
takeCardFromDeck();
}
} else if ((doubleSelected == true) && (switchDoubleControlOnce == false)) {
trace(" ************** doubleSelected *************** " + doubleSelected);
switchDoubleControlOnce = true;
moveBy = "computer";
initializeCardTakingProcess();
takeCardFromDeck();
} else {
_parent._parent.dealClip.gotoAndStop("activeHit");
_parent._parent.standClip.gotoAndStop("active");
}
} else if (moveBy == "computer") {
computerCardArray[numberOfComputerCards] = _parent["card" + noOfCardsOpened].cardValue;
computerCardValue = calculateCardValue(1);
if (computerSoft == true) {
_parent.computerStatus.softClip.gotoAndStop("active");
} else {
_parent.computerStatus.softClip.gotoAndStop("deactive");
}
_parent.computerStatus.gotoAndStop("showTotal");
_parent.computerStatus.displayTotal = computerCardValue;
if (computerCardValue < 17) {
initializeCardTakingProcess();
takeCardFromDeck();
} else if (computerCardValue == 21) {
if (numberOfComputerCards == 2) {
_parent.computerStatus.gotoAndStop("blackJack");
if (((numberOfUserCards == 2) && (userCardValue == 21)) && (splitSelected == false)) {
_parent.userStatus.gotoAndStop("blackJack");
_parent.computerStatus.summary.gotoAndStop("push");
_parent.userStatus.summary.gotoAndStop("push");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if (insurance == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2.5;
} else {
_parent._parent.credits = _parent._parent.credits + _parent._parent.initialBetAmount;
_parent._parent.winAmount = _parent._parent.initialBetAmount;
}
} else {
if (splitSelected == true) {
_parent.userStatus1.summary.gotoAndStop("lose");
_parent.userStatus2.summary.gotoAndStop("lose");
} else {
_parent.userStatus.summary.gotoAndStop("lose");
}
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if (insurance == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 1.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 1.5;
} else {
_parent._parent.winAmount = 0;
}
}
} else if (splitSelected == false) {
if (userCardValue == 21) {
if (numberOfUserCards == 2) {
_parent.userStatus.gotoAndStop("blackJack");
_parent.userStatus.summary.gotoAndStop("win");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2.5;
} else {
_parent.computerStatus.summary.gotoAndStop("push");
_parent.userStatus.summary.gotoAndStop("push");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if (doubleSelected == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2;
} else {
_parent._parent.credits = _parent._parent.credits + _parent._parent.initialBetAmount;
_parent._parent.winAmount = _parent._parent.initialBetAmount;
}
}
} else {
_parent.userStatus.summary.gotoAndStop("lose");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.winAmount = 0;
}
} else {
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
splitWinAmount = 0;
var _local3 = 0;
_local3 = 1;
while (_local3 <= 2) {
if (this[("user" + _local3) + "Total"] > 21) {
_parent["userStatus" + _local3].summary.gotoAndStop("bust");
} else if (this[("user" + _local3) + "Total"] == 21) {
_parent["userStatus" + _local3].summary.gotoAndStop("push");
_parent._parent.credits = _parent._parent.credits + _parent._parent.initialBetAmount;
splitWinAmount = splitWinAmount + _parent._parent.initialBetAmount;
} else if (this[("user" + _local3) + "Total"] < 21) {
_parent["userStatus" + _local3].summary.gotoAndStop("lose");
}
_local3++;
}
_parent._parent.winAmount = splitWinAmount;
}
} else if (computerCardValue > 21) {
_parent.computerStatus.gotoAndStop("bust");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if (splitSelected == false) {
if (userCardValue <= 21) {
_parent.userStatus.summary.gotoAndStop("win");
if ((numberOfUserCards == 2) && (userCardValue == 21)) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2.5;
} else if (doubleSelected == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 4);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 4;
} else {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2;
}
} else {
_parent.userStatus.summary.gotoAndStop("bust");
}
} else {
splitWinAmount = 0;
var _local3 = 0;
_local3 = 1;
while (_local3 <= 2) {
if (this[("user" + _local3) + "Total"] <= 21) {
_parent["userStatus" + _local3].summary.gotoAndStop("win");
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
splitWinAmount = splitWinAmount + (_parent._parent.initialBetAmount * 2);
} else {
_parent["userStatus" + _local3].summary.gotoAndStop("bust");
}
_local3++;
}
_parent._parent.winAmount = splitWinAmount;
}
} else if (splitSelected == false) {
if (computerCardValue > userCardValue) {
_parent.userStatus.summary.gotoAndStop("lose");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.winAmount = 0;
} else if (computerCardValue == userCardValue) {
_parent.computerStatus.summary.gotoAndStop("push");
_parent.userStatus.summary.gotoAndStop("push");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if (doubleSelected == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2;
} else {
_parent._parent.credits = _parent._parent.credits + _parent._parent.initialBetAmount;
_parent._parent.winAmount = _parent._parent.initialBetAmount;
}
} else if (userCardValue <= 21) {
_parent.userStatus.summary.gotoAndStop("win");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
if ((numberOfUserCards == 2) && (userCardValue == 21)) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2.5);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2.5;
} else if (doubleSelected == true) {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 4);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 4;
} else {
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
_parent._parent.winAmount = _parent._parent.initialBetAmount * 2;
}
} else {
_parent.computerStatus.summary.gotoAndStop("win");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
}
} else {
splitWinAmount = 0;
var _local3 = 0;
_local3 = 1;
while (_local3 <= 2) {
if (computerCardValue > this[("user" + _local3) + "Total"]) {
_parent["userStatus" + _local3].summary.gotoAndStop("lose");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
} else if (computerCardValue == this[("user" + _local3) + "Total"]) {
_parent.computerStatus.summary.gotoAndStop("push");
_parent["userStatus" + _local3].summary.gotoAndStop("push");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.credits = _parent._parent.credits + _parent._parent.initialBetAmount;
splitWinAmount = splitWinAmount + _parent._parent.initialBetAmount;
} else if (this[("user" + _local3) + "Total"] > 21) {
_parent["userStatus" + _local3].summary.gotoAndStop("bust");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
} else {
_parent["userStatus" + _local3].summary.gotoAndStop("win");
_parent._parent.dealClip.gotoAndStop("active");
_parent._parent.standClip.gotoAndStop("deactive");
_parent._parent.credits = _parent._parent.credits + (_parent._parent.initialBetAmount * 2);
splitWinAmount = splitWinAmount + (_parent._parent.initialBetAmount * 2);
}
_local3++;
}
_parent._parent.winAmount = splitWinAmount;
}
}
if ((numberOfUserCards == 2) && (numberOfComputerCards == 1)) {
if (computerCardArray[numberOfComputerCards] == 1) {
if (splitSelected == false) {
if ((_parent._parent.credits - (_parent._parent.initialBetAmount * 0.5)) >= 0) {
_parent._parent.insuranceClip.gotoAndStop("active");
}
}
}
if ((userCardValue >= 9) && (userCardValue <= 11)) {
if (splitSelected == false) {
if ((_parent._parent.credits - _parent._parent.initialBetAmount) >= 0) {
_parent._parent.doubleClip.gotoAndStop("active");
}
}
}
if ((userCardArray[1] == userCardArray[2]) && (splitSelected == false)) {
trace(Math.abs(_parent.card1._currentframe - _parent.card3._currentframe));
if ((Math.abs(_parent.card1._currentframe - _parent.card3._currentframe) % 13) == 0) {
if ((_parent._parent.credits - _parent._parent.initialBetAmount) >= 0) {
_parent._parent.splitClip.gotoAndStop("active");
}
}
}
}
}
}
}
}
}
var moveBy = "user";
var numberOfUserCards = 0;
var numberOfComputerCards = 0;
userCardArray = new Array();
computerCardArray = new Array();
var noOfCardsOpened = 0;
var userCardValue = 0;
var computerCardValue = 0;
var userSoft = false;
var computerSoft = false;
var insurance = false;
var bothAreBlackJack = false;
var doubleSelected = false;
var switchDoubleControlOnce = false;
var splitSelected = false;
var splitUserTurn = 1;
var user1Total = 0;
var user2Total = 0;
var splitWinAmount = 0;
numberArray = new Array();
randomCards = new Array();
var actionCode = 0;
var cardSpeed = 5;
var cardMoveCompleted = 0;
var cardXdiff = 0;
var cardYdiff = 0;
var cardXspacing = 25;
var cardYspacing = 10;
var flip = false;
var closeTheCard = true;
var xScale = 100;
}
onClipEvent (enterFrame) {
switch (actionCode) {
case 1 :
cardMovement();
break;
case 2 :
moveTheSplittedCard();
break;
}
}
Instance of Symbol 257 MovieClip "userStatus2" in Symbol 264 MovieClip Frame 1
onClipEvent (load) {
var user = true;
}
Symbol 269 MovieClip Frame 1
stop();