Frame 1
function initMain() {
mainGameController(1);
initSound();
playBGsound("bgsound1");
}
function mainGameController(code) {
introMC._visible = false;
selectMC._visible = false;
gameMC._visible = false;
gameOverMC._visible = false;
switch (code) {
case 1 :
introMC._visible = true;
introMC.initMain();
break;
case 2 :
selectMC._visible = true;
selectMC.initMain();
break;
case 3 :
gameMC._visible = true;
gameMC.initMain();
break;
case 4 :
gameOverMC._visible = true;
gameOverMC.initMain();
}
}
function SoundControl() {
}
function playSound(key) {
if (!soundon) {
return(undefined);
}
switch (key) {
case "win" :
winSound.start();
break;
case "box" :
boxSound.start();
break;
case "drop" :
dropSound.start();
break;
case "youSound" :
youSound.start();
break;
case "foeSound" :
foeSound.start();
break;
case "nextRoundSound" :
nextRoundSound.start();
break;
case "startGameSound" :
startGameSound.start();
break;
case "btn1" :
btnSound1.start();
break;
case "btn2" :
btnSound2.start();
break;
case "btn3" :
btnSound3.start();
}
}
function playBGsound(key) {
if (!soundon) {
return(undefined);
}
bgSound.stop();
bgSound.attachSound(key);
bgSound.setVolume(40);
bgSound.start(0, 10000);
}
function initSound() {
drawSound = new Sound();
drawSound.attachSound("drawSound");
boxSound = new Sound();
boxSound.attachSound("boxSound");
dropSound = new Sound();
dropSound.attachSound("dropSound");
youSound = new Sound();
youSound.attachSound("youSound");
foeSound = new Sound();
foeSound.attachSound("foeSound");
nextRoundSound = new Sound();
nextRoundSound.attachSound("nextRoundSound");
btnSound1 = new Sound();
btnSound1.attachSound("btn1");
btnSound2 = new Sound();
btnSound2.attachSound("btn2");
btnSound3 = new Sound();
btnSound3.attachSound("btn3");
bgSound = new Sound();
}
function logger(msg) {
if (!testGame) {
return(undefined);
}
trace(" - " + msg);
}
var introMC;
var selectMC;
var gameMC;
var gameOverMC;
var selectedDealer;
var soundon = true;
var dealerIntervalDur = 1000;
var gameIntervalDur = 2000;
var resetGameDur = 1000;
var showResultDur = 2000;
var dealCardDur = 1000;
var maxLife = 1000;
var maxBetPoints = 100;
var maxPoints = 200;
var minPoints = 0;
var allowedBet = 20;
var lifeMax = 300;
var playerTotalPhotos = 1;
var totalPlayerScore = 0;
var testGame = true;
Frame 2
stop();
initMain();
Symbol 53 MovieClip Frame 1
stop();
var cardValue = 0;
Symbol 53 MovieClip Frame 2
cardValue = 1;
Symbol 53 MovieClip Frame 3
cardValue = 2;
Symbol 53 MovieClip Frame 4
cardValue = 3;
Symbol 53 MovieClip Frame 5
cardValue = 4;
Symbol 53 MovieClip Frame 6
cardValue = 5;
Symbol 53 MovieClip Frame 7
cardValue = 6;
Symbol 53 MovieClip Frame 8
cardValue = 7;
Symbol 53 MovieClip Frame 9
cardValue = 8;
Symbol 53 MovieClip Frame 10
cardValue = 9;
Symbol 53 MovieClip Frame 11
cardValue = 10;
Symbol 53 MovieClip Frame 12
cardValue = 10;
Symbol 53 MovieClip Frame 13
cardValue = 10;
Symbol 53 MovieClip Frame 14
cardValue = 10;
Symbol 53 MovieClip Frame 15
cardValue = 1;
Symbol 53 MovieClip Frame 16
cardValue = 2;
Symbol 53 MovieClip Frame 17
cardValue = 3;
Symbol 53 MovieClip Frame 18
cardValue = 4;
Symbol 53 MovieClip Frame 19
cardValue = 5;
Symbol 53 MovieClip Frame 20
cardValue = 6;
Symbol 53 MovieClip Frame 21
cardValue = 7;
Symbol 53 MovieClip Frame 22
cardValue = 8;
Symbol 53 MovieClip Frame 23
cardValue = 9;
Symbol 53 MovieClip Frame 24
cardValue = 10;
Symbol 53 MovieClip Frame 25
cardValue = 10;
Symbol 53 MovieClip Frame 26
cardValue = 10;
Symbol 53 MovieClip Frame 27
cardValue = 10;
Symbol 53 MovieClip Frame 28
cardValue = 1;
Symbol 53 MovieClip Frame 29
cardValue = 2;
Symbol 53 MovieClip Frame 30
cardValue = 3;
Symbol 53 MovieClip Frame 31
cardValue = 4;
Symbol 53 MovieClip Frame 32
cardValue = 5;
Symbol 53 MovieClip Frame 33
cardValue = 6;
Symbol 53 MovieClip Frame 34
cardValue = 7;
Symbol 53 MovieClip Frame 35
cardValue = 8;
Symbol 53 MovieClip Frame 36
cardValue = 9;
Symbol 53 MovieClip Frame 37
cardValue = 10;
Symbol 53 MovieClip Frame 38
cardValue = 10;
Symbol 53 MovieClip Frame 39
cardValue = 10;
Symbol 53 MovieClip Frame 40
cardValue = 10;
Symbol 53 MovieClip Frame 41
cardValue = 1;
Symbol 53 MovieClip Frame 42
cardValue = 2;
Symbol 53 MovieClip Frame 43
cardValue = 3;
Symbol 53 MovieClip Frame 44
cardValue = 4;
Symbol 53 MovieClip Frame 45
cardValue = 5;
Symbol 53 MovieClip Frame 46
cardValue = 6;
Symbol 53 MovieClip Frame 47
cardValue = 7;
Symbol 53 MovieClip Frame 48
cardValue = 8;
Symbol 53 MovieClip Frame 49
cardValue = 9;
Symbol 53 MovieClip Frame 50
cardValue = 10;
Symbol 53 MovieClip Frame 51
cardValue = 10;
Symbol 53 MovieClip Frame 52
cardValue = 10;
Symbol 53 MovieClip Frame 53
cardValue = 10;
Symbol 54 MovieClip [cardMC] Frame 1
mc._visible = false;
play();
Symbol 54 MovieClip [cardMC] Frame 6
mc._visible = true;
Symbol 54 MovieClip [cardMC] Frame 9
stop();
Symbol 64 MovieClip [dealer_daine] Frame 1
stop();
Symbol 73 MovieClip [dealer_janice] Frame 1
stop();
Symbol 82 MovieClip [dealer_linda] Frame 1
stop();
Symbol 109 MovieClip Frame 1
function initMain() {
isStartGame = true;
instructionMC._visible = false;
trace(" start " + instructionMC._visible);
}
function enterGame() {
_root.playSound("btn1");
_root.mainGameController(2);
}
function setInstructionMC() {
instructionMC._visible = true;
enterBTN._visible = false;
howToPlayBTN._visible = false;
instructionMC.closeBtn.onRelease = function () {
instructionMC._visible = false;
enterBTN._visible = true;
howToPlayBTN._visible = true;
};
}
var isStartGame;
enterBTN.onRelease = function () {
_root.playSound("btn1");
enterGame();
};
howToPlayBTN.onRelease = function () {
_root.playSound("btn1");
setInstructionMC();
};
Symbol 125 MovieClip Frame 1
function initMain() {
}
function selectedDealer(name) {
_root.selectedDealer = name;
_root.mainGameController(3);
}
dealerBtn1.onRelease = function () {
selectedDealer("janice");
};
dealerBtn2.onRelease = function () {
selectedDealer("linda");
};
dealerBtn3.onRelease = function () {
selectedDealer("daine");
};
Symbol 136 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
function initMain(n) {
meterMC._yscale = 100;
setMaxLife(n);
setText(n);
initVars();
}
function initVars() {
_maxBarMeter = meterMC._height;
thisMC = this;
_origScale = meterMC._yscale;
_currentLife = _maxLife;
}
function setMaxLife(val) {
_maxLife = val;
}
function setText(c) {
currentLifeTxt.text = ((c <= 0) ? 0 : (c));
maxLifeTxt.text = _maxLife;
}
function hitLife(hitVal) {
trace(hitVal);
var _local2 = (hitVal / _maxLife) * 100;
_tmpCurrentLife = _currentLife;
_currentLife = _currentLife - hitVal;
runLifeInterval(_local2);
}
function gainLife(hitVal) {
trace(hitVal);
var _local2 = (hitVal / _maxLife) * 100;
_tmpCurrentLife = _currentLife;
_currentLife = _currentLife + hitVal;
clearLifeInterval();
_tempMeterScale = meterMC._yscale;
thisMC.setText(_currentLife);
meterMC._yscale = _tempMeterScalee + hitVal;
}
function runLifeInterval(val) {
trace("--------val " + _currentLife);
clearLifeInterval();
_tempMeterScale = meterMC._yscale;
lifeIntervalID = setInterval(runScaleBar, 30, val);
}
function runScaleBar(val) {
thisMC.setText(_tmpCurrentLife--);
meterMC._yscale = meterMC._yscale - 1;
if ((meterMC._yscale < (_tempMeterScale - val)) || (meterMC._yscale <= 0)) {
meterMC._yscale = (((_tempMeterScale - val) <= 0) ? 0 : (_tempMeterScale - val));
thisMC.setText(_currentLife);
clearLifeInterval();
}
setBarColor();
}
function setBarColor() {
trace((meterMC._yscale + " ") + (_origScale * 0.8));
if ((meterMC._yscale <= 100) && (meterMC._yscale >= 81)) {
meterMC.gotoAndStop(1);
}
if ((meterMC._yscale <= 80) && (meterMC._yscale >= 61)) {
meterMC.gotoAndStop(2);
} else if ((meterMC._yscale <= 60) && (meterMC._yscale >= 41)) {
meterMC.gotoAndStop(3);
} else if ((meterMC._yscale < 40) && (meterMC._yscale >= 31)) {
meterMC.gotoAndStop(4);
}
if ((meterMC._yscale < 30) && (meterMC._yscale >= 1)) {
meterMC.gotoAndStop(5);
}
}
function clearLifeInterval() {
if (lifeIntervalID != undefined) {
clearInterval(lifeIntervalID);
}
}
var _maxLife;
var _maxBarMeter;
var _lifeIntervalID;
var _tempMeterScale;
var _tmpCurrentLife;
var meterMC;
var thisMC;
var _origScale;
this.onLoad = function () {
initMain(0);
};
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 9
gotoAndPlay (2);
Symbol 156 MovieClip Frame 1
function initMain() {
currentPointsTxt.text = _parent.maxPoints;
betMC.betTxt.text = _parent.minPoints;
tempCurrentScore = 0;
minPoints = _parent.minPoints;
maxPoints = _parent.maxPoints;
allowedBet = _parent.allowedBet;
}
function setScoreBet(bet, currentScore) {
_parent.setPlayerBet(bet);
tempCurrentScore = currentScore;
currentPointsTxt.text = currentScore;
if (currentScore > 0) {
okBtn.enabled = true;
okBtn._alpha = 100;
}
}
var tempCurrentScore;
var minPoints;
var maxPoints;
var allowedBet;
okBtn.onRelease = function () {
_parent.setHitPlayer();
_parent.currentPlayerScore = tempCurrentScore;
};
betMC.downBtn.onRelease = function () {
var _local4 = _parent.currentPlayerScore;
var _local2 = Number(betMC.betTxt.text);
var _local3 = Number(currentPointsTxt.text);
_local3 = _local3 + ((_local2 > 0) ? (allowedBet) : 0);
_local2 = ((((_local2 >= minPoints) && (_local2 <= _local4)) && (_local2 > 0)) ? (Number(_local2) - allowedBet) : (minPoints));
setScoreBet(_local2, _local3);
};
betMC.upBtn.onRelease = function () {
var _local4 = _parent.currentPlayerScore;
var _local2 = Number(betMC.betTxt.text);
var _local3 = Number(currentPointsTxt.text);
_local3 = _local3 - ((_local3 > 0) ? (allowedBet) : 0);
_local2 = (((_local2 >= minPoints) && (_local2 < _local4)) ? (Number(_local2) + allowedBet) : (_local4));
setScoreBet(_local2, _local3);
};
Symbol 176 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 1
stop();
this._visible = false;
Symbol 177 MovieClip Frame 2
this._visible = true;
play();
Symbol 186 MovieClip Frame 1
function getRandomCards() {
nextCard = 1;
rndCardsAR = setRanNumbers(2, 52, 52);
logger(("new RandomCards " + rndCardsAR) + "\n -------------------------- ");
}
function initMain() {
logger(" + InitMain ");
dealerLifeMC.initMain(lifeMax);
dealerImgMC.dealerNameTxt.text = _root.selectedDealer;
totalDealerCardTxt.text = 0;
totalPlayerCardTxt.text = 0;
currentLifePoints = lifeMax;
currentPlayerScore = maxPoints;
scoreBoardMC.initMain();
createHolderMC();
getRandomCards();
initDealerImg();
initGame();
}
function initVars() {
logger(" + InitVar ");
activePlayer = dealer;
initDealer = true;
isReadyForResult = false;
totalDealerCards = 0;
totalPlayerCards = 0;
dealerCardHits = 0;
playerCardHits = 0;
cardHitCtr = 0;
setPlayerBet(0);
}
function initGame() {
logger(" | init GAME \n --------------------------------------------");
runGameInterval(resetGame, resetGameDur);
setShowMsgMC("GAMESTARTED");
setBarMeterMC(0);
lockButtons(false);
}
function resetGame() {
if (nextCard > 40) {
getRandomCards();
}
logger(" + ResetGame ");
initVars();
setPlayerValue(0);
setDealerValue(0);
removeCards();
lockButtons(false);
if (isGameOver()) {
setGameOver();
} else if (activePlayer == dealer) {
logger(" | Dealer Player" + activePlayer);
setShowMsgMC("DEALSTART");
cardHitCtr = dealerCardHits;
runGameInterval(dealerAction, dealCardDur);
}
}
function runGameInterval(action, dur, param) {
logger(((" + RunGameInterval " + action) + " -- ") + dur);
clearGameIntervalID();
gameIntervalID = setInterval(action, dur, param);
}
function clearGameIntervalID() {
if (gameIntervalID != undefined) {
clearInterval(gameIntervalID);
logger(" + ClearGameIntervalID - " + gameIntervalID);
}
}
function isBusted() {
var _local1 = false;
if (activePlayer == dealer) {
_local1 = ((totalDealerCards > 21) ? true : false);
} else {
_local1 = ((totalPlayerCards > 21) ? true : false);
}
return(_local1);
}
function isWon() {
var _local1 = false;
if (((!isReadyForResult) || (totalDealerCards > 21)) || (totalPlayerCards > 21)) {
return(_local1);
}
if (activePlayer == dealer) {
_local1 = ((totalDealerCards > totalPlayerCards) ? true : false);
} else {
_local1 = ((totalPlayerCards > totalDealerCards) ? true : false);
}
return(_local1);
}
function isBlackJack() {
var _local1 = false;
if (activePlayer == dealer) {
_local1 = ((totalDealerCards == 21) ? true : false);
} else {
_local1 = ((totalPlayerCards == 21) ? true : false);
}
return(_local1);
}
function isPush() {
var _local1 = false;
if (activePlayer == dealer) {
_local1 = ((totalDealerCards == totalPlayerCards) ? true : false);
}
return(_local1);
}
function showResult(label) {
logger("+ ShowResult ");
setShowMsgMC(label);
runGameInterval(resetGame, 3000);
}
function isGameOver() {
var _local1 = false;
if (currentLifePoints <= 0) {
_local1 = true;
} else if (currentPlayerScore <= 0) {
_local1 = true;
}
return(_local1);
}
function setGameOver() {
logger("+ GameOver ");
setShowMsgMC("GAMEOVER");
runGameInterval(callGameControl, 3000);
}
function callGameControl() {
clearGameIntervalID();
_root.totalPlayerScore = currentPlayerScore;
_root.mainGameController(4);
}
function dealCard() {
var _local1;
var _local2;
var _local3;
var _local4 = ((activePlayer == dealer) ? "DEALER" : "PLAYER");
_local3 = ((activePlayer == dealer) ? (dealerHolderMC) : (playerHolderMC));
if (initDealer && (cardHitCtr < 1)) {
_local2 = 1;
} else {
_local2 = rndCardsAR[nextCard];
}
_local1 = getCardValue(_local2);
createCard(_local3, _local2, cardHitCtr);
if (cardHitCt > 1) {
_local1 = _local1 - 1;
}
if (activePlayer == dealer) {
dealerCardHits++;
setDealerValue(_local1);
} else {
playerCardHits++;
setPlayerValue(_local1);
}
nextCard++;
cardHitCtr++;
}
function openDealerFirstCard() {
var _local1;
isReadyForResult = true;
_local1 = rndCardsAR[nextCard];
cardValue = getCardValue(_local1);
dealerHolderMC.cardMC_1.mc.gotoAndStop(cardValue);
dealerHolderMC.cardMC_1.gotoAndPlay("open");
setDealerValue(cardValue - 1);
if (isWon()) {
logger("Dealer WON ");
addBarMeterMC(1);
runGameInterval(showResult, showResultDur, "DEALERWIN");
} else {
cardHitCtr = dealerCardHits;
runGameInterval(dealerAction, dealCardDur);
}
}
function isDealerStand() {
var _local1 = false;
if (totalDealerCards >= 17) {
_local1 = true;
}
return(_local1);
}
function dealerAction() {
logger("+ dealerAction ");
dealCard();
if ((cardHitCtr > 1) && (initDealer)) {
clearGameIntervalID();
initDealer = false;
initPlayer();
} else if (!initDealer) {
if (isDealerStand()) {
if (isWon()) {
logger("-------- DEALER WON ");
addBarMeterMC(1);
runGameInterval(showResult, showResultDur, "DEALERWIN");
} else if (isPush()) {
logger("-------- PUSH ");
runGameInterval(showResult, showResultDur, "PUSH");
} else if (isBusted()) {
logger("| DEALERBUSTED -- ");
runGameInterval(showResult, showResultDur, "DEALERBUSTED");
setScoreBoardMC(playerBet);
} else if (isBlackJack()) {
runGameInterval(showResult, showResultDur, "DEALERBLACKJACK");
} else {
logger("-------- PLAYER WON ");
runGameInterval(showResult, showResultDur, "PLAYERWIN");
setScoreBoardMC(playerBet);
}
}
}
}
function setDealerValue(n) {
totalDealerCards = totalDealerCards + n;
totalDealerCardTxt.text = totalDealerCards;
}
function setRanNumbers(low, high, num) {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < (high - low)) {
_local2.push((_local1 + 1) + low);
_local1++;
}
var _local4 = new Array();
while (num--) {
_local4.push(_local2.splice(Math.floor(Math.random() * _local2.length), 1));
}
return(_local4);
}
function createCard(holderMC, value, num) {
var _local1;
_local1 = holderMC.attachMovie("cardMC", "cardMC_" + value, holderMC.getNextHighestDepth());
_local1._xscale = 60;
_local1._yscale = 60;
_local1._x = (_local1._width / 2) * num;
_local1.mc.gotoAndStop(value);
logger(((" createCard " + _local1) + " ") + value);
}
function getCardValue(nc) {
nc = Number(nc + "");
var _local2 = 0;
if (nc > 1) {
if ((nc >= 2) && (nc <= 10)) {
_local2 = nc - 1;
} else if ((nc >= 15) && (nc <= 23)) {
_local2 = nc - 14;
} else if ((nc >= 28) && (nc <= 36)) {
_local2 = nc - 27;
} else if ((nc >= 41) && (nc <= 49)) {
_local2 = nc - 40;
} else {
_local2 = 10;
}
}
trace((_local2 + " -- ") + nc);
return(_local2);
}
function createHolderMC() {
dealerHolderMC.removeMovieClip();
playerHolderMC.removeMovieClip();
dealerHolderMC = this.createEmptyMovieClip("dealerHolderMC", this.getNextHighestDepth());
dealerHolderMC._x = 334;
dealerHolderMC._y = 78;
playerHolderMC = this.createEmptyMovieClip("playerHolderMC", this.getNextHighestDepth());
playerHolderMC._x = 334;
playerHolderMC._y = 157;
}
function removeCards() {
for (var _local1 in dealerHolderMC) {
dealerHolderMC[_local1].removeMovieClip();
}
for (var _local1 in playerHolderMC) {
playerHolderMC[_local1].removeMovieClip();
}
}
function logger(msg) {
_root.logger("| gameMC " + msg);
}
function setShowMsgMC(msg) {
showMsgMC.mc.gotoAndStop(msg);
showMsgMC._visible = true;
showMsgMC.gotoAndPlay("show");
}
function setScoreBoardMC(score) {
currentPlayerScore = currentPlayerScore + (playerBet + score);
scoreBoardMC.currentPointsTxt.text = currentPlayerScore;
setBarMeterMC(Math.round(score * 0.5));
logger("playerScore " + score);
}
function addBarMeterMC(value) {
if (currentLifePoints < lifeMax) {
currentLifePoints = currentLifePoints + value;
var _local1 = (currentLifePoints / lifeMax) * 100;
trace(((" currentLifePoints " + currentLifePoints) + " -- ") + _local1);
dealerLifeMC.gainLife(value);
if ((_local1 <= 100) && (_local1 >= 81)) {
setDealerImg(1);
} else if ((_local1 <= 80) && (_local1 >= 61)) {
setDealerImg(1);
} else if ((_local1 <= 60) && (_local1 >= 41)) {
setDealerImg(2);
} else if ((_local1 < 40) && (_local1 >= 31)) {
setDealerImg(3);
}
if ((_local1 < 30) && (_local1 >= 1)) {
setDealerImg(4);
}
}
}
function setBarMeterMC(value) {
currentLifePoints = currentLifePoints - value;
var _local1 = (currentLifePoints / lifeMax) * 100;
trace(((" currentLifePoints " + currentLifePoints) + " -- ") + _local1);
dealerLifeMC.hitLife(value);
if ((_local1 <= 100) && (_local1 >= 81)) {
setDealerImg(1);
} else if ((_local1 <= 80) && (_local1 >= 61)) {
setDealerImg(1);
} else if ((_local1 <= 60) && (_local1 >= 41)) {
setDealerImg(2);
} else if ((_local1 < 40) && (_local1 >= 31)) {
setDealerImg(3);
}
if ((_local1 < 30) && (_local1 >= 1)) {
setDealerImg(4);
}
}
function setDealerImg(val) {
dealerImgMC.dealerContainerMC.dealerMC.gotoAndStop(val);
_root.playerTotalPhotos = val;
logger((("setDealer -->" + val) + " ") + dealerImgMC.dealerContainerMC.dealerMC._currentframe);
}
function initDealerImg() {
dealerImgMC.dealerContainerMC.dealerMC.removeMovieClip();
dealerImgMC.dealerContainerMC.attachMovie("dealer_" + _root.selectedDealer, "dealerMC", dealerImgMC.dealerContainerMC.getNextHighestDepth());
setDealerImg(1);
logger(((("init setDealer -->" + dealerImgMC.dealerContainerMC) + " ") + "dealer_") + _root.selectedDealer);
}
function hitPlayerCard() {
activePlayer = player;
dealCard();
standBtn.enabled = true;
standBtn._alpha = 100;
if (isBusted()) {
logger("| PLAYERBUSTED -- ");
addBarMeterMC(1);
runGameInterval(showResult, showResultDur, "PLAYERBUSTED");
lockButtons(false);
} else if (isBlackJack()) {
runGameInterval(showResult, showResultDur, "PLAYERBLACKJACK");
setScoreBoardMC(playerBet * 2);
lockButtons(false);
}
}
function setPlayerValue(n) {
totalPlayerCards = totalPlayerCards + n;
totalPlayerCardTxt.text = totalPlayerCards;
}
function initPlayer() {
setShowMsgMC("PLACEBET");
runGameInterval(initPlaceBet, 1000);
initPlaceBet();
activePlayer = player;
cardHitCtr = playerCardHits;
}
function initPlaceBet() {
scoreBoardMC.betMC.downBtn.enabled = true;
scoreBoardMC.betMC.upBtn.enabled = true;
scoreBoardMC.betMC.downBtn._alpha = 100;
scoreBoardMC.betMC.upBtn._alpha = 100;
scoreBoardMC.blinkBoxMC.gotoAndPlay(2);
clearGameIntervalID();
}
function setHitPlayer() {
setShowMsgMC("PLAYERHIT");
scoreBoardMC.betMC.downBtn.enabled = false;
scoreBoardMC.betMC.upBtn.enabled = false;
scoreBoardMC.okBtn.enabled = false;
scoreBoardMC.okBtn._alpha = 30;
scoreBoardMC.betMC.downBtn._alpha = 30;
scoreBoardMC.betMC.upBtn._alpha = 30;
scoreBoardMC.blinkBoxMC.gotoAndStop(1);
hitBtn.enabled = true;
hitBtn._alpha = (hitBtn.enabled ? 100 : 30);
}
function standPlayer() {
lockButtons(false);
activePlayer = dealer;
openDealerFirstCard();
}
function setPlayerBet(bet) {
playerBet = bet;
scoreBoardMC.betMC.betTxt.text = bet;
}
function lockButtons(bol) {
logger(" -lockButtons " + bol);
scoreBoardMC.betMC.downBtn.enabled = bol;
scoreBoardMC.betMC.upBtn.enabled = bol;
standBtn.enabled = bol;
hitBtn.enabled = bol;
scoreBoardMC.okBtn.enabled = bol;
scoreBoardMC.betMC.downBtn._alpha = (bol ? 100 : 30);
scoreBoardMC.betMC.upBtn._alpha = (bol ? 100 : 30);
standBtn._alpha = (bol ? 100 : 30);
hitBtn._alpha = (bol ? 100 : 30);
scoreBoardMC.okBtn._alpha = (bol ? 100 : 30);
}
var dealerHolderMC;
var playerHolderMC;
var player = 1;
var dealer = 2;
var activePlayer;
var dealerIntervalID;
var dealerIntervalDur = _root.dealerIntervalDur;
var gameIntervalDur = _root.gameIntervalDur;
var resetGameDur = _root.resetGameDur;
var showResultDur = _root.showResultDur;
var dealCardDur = _root.dealCardDur;
var maxLife = _root.maxLife;
var maxBetPoints = _root.maxBetPoints;
var maxPoints = _root.maxPoints;
var minPoints = _root.minPoints;
var allowedBet = _root.allowedBet;
var lifeMax = _root.lifeMax;
var cardHitCtr;
var dealerCardHits;
var playerCardHits;
var nextCard;
var totalCardValue;
var totalDealerCards;
var totalPlayerCards;
var gameIntervalID;
var playerBet;
var currentLifePoints;
var currentPlayerScore;
var rndCardsAR = new Array();
var testGame = true;
var initDealer = false;
var isReadyForResult;
resetBtn.onRelease = function () {
resetGame();
};
hitBtn.onRelease = function () {
hitPlayerCard();
};
standBtn.onRelease = function () {
standPlayer();
};
Symbol 192 Button
on (release) {
getURL ("http://www.hentaikey.com/sys/members/game_signup.php?referal=2", "_blank");
}
Symbol 197 MovieClip Frame 1
function initMain() {
logger("total selectDealer " + _root.selectedDealer);
scoreTxt.text = _root.totalPlayerScore;
dealerImgMC.dealerNameTxt.text = _root.selectedDealer;
dealerImgMC.dealerContainerMC.dealerMC.gotoAndStop(1);
initDealerImg();
}
function initDealerImg() {
dealerImgMC.dealerContainerMC.dealerMC.removeMovieClip();
dealerImgMC.dealerContainerMC.attachMovie("dealer_" + _root.selectedDealer, "dealerMC", dealerImgMC.dealerContainerMC.getNextHighestDepth());
logger(((("setDealer -->" + dealerImgMC.dealerContainerMC) + " ") + "dealer_") + _root.selectedDealer);
}
var logger = _root.logger();
restartBtn.onRelease = function () {
_root.mainGameController(1);
};
upBtn.onRelease = function () {
if (dealerImgMC.dealerContainerMC.dealerMC._currentframe < _root.playerTotalPhotos) {
dealerImgMC.dealerContainerMC.dealerMC.nextFrame();
}
};
downBtn.onRelease = function () {
dealerImgMC.dealerContainerMC.dealerMC.prevFrame();
};