Frame 1
_root.gameData = " <gamedata seed=\"773391374\" standalone=\"1\" partner=\"nydailynews\"> <prize id=\"1\" sum=\"0.01\"/> <prize id=\"2\" sum=\"1\"/> <prize id=\"3\" sum=\"5\"/> <prize id=\"4\" sum=\"10\"/> <prize id=\"5\" sum=\"25\"/> <prize id=\"6\" sum=\"50\"/> <prize id=\"7\" sum=\"75\"/> <prize id=\"8\" sum=\"100\"/> <prize id=\"9\" sum=\"200\"/> <prize id=\"10\" sum=\"300\"/> <prize id=\"11\" sum=\"400\"/> <prize id=\"12\" sum=\"500\"/> <prize id=\"13\" sum=\"750\"/> <prize id=\"14\" sum=\"1000\"/> <prize id=\"15\" sum=\"5000\"/> <prize id=\"16\" sum=\"10000\"/> <prize id=\"17\" sum=\"25000\"/> <prize id=\"18\" sum=\"50000\"/> <prize id=\"19\" sum=\"75000\"/> <prize id=\"20\" sum=\"100000\"/> <prize id=\"21\" sum=\"200000\"/> <prize id=\"22\" sum=\"300000\"/> <prize id=\"23\" sum=\"400000\"/> <prize id=\"24\" sum=\"500000\"/> <prize id=\"25\" sum=\"750000\"/> <prize id=\"26\" sum=\"1000000\"/> <text id=\"prize1\">$.01</text> <text id=\"prize2\">$1</text> <text id=\"prize3\">$5</text> <text id=\"prize4\">$10</text> <text id=\"prize5\">$25</text> <text id=\"prize6\">$50</text> <text id=\"prize7\">$75</text> <text id=\"prize8\">$100</text> <text id=\"prize9\">$200</text> <text id=\"prize10\">$300</text> <text id=\"prize11\">$400</text> <text id=\"prize12\">$500</text> <text id=\"prize13\">$750</text> <text id=\"prize14\">$1,000</text> <text id=\"prize15\">$5,000</text> <text id=\"prize16\">$10,000</text> <text id=\"prize17\">$25,000</text> <text id=\"prize18\">$50,000</text> <text id=\"prize19\">$75,000</text> <text id=\"prize20\">$100,000</text> <text id=\"prize21\">$200,000</text> <text id=\"prize22\">$300,000</text> <text id=\"prize23\">$400,000</text> <text id=\"prize24\">$500,000</text> <text id=\"prize25\">$750,000</text> <text id=\"prize26\">$1,000,000</text> <text id=\"noprize1\">$.15</text> <text id=\"noprize2\">$.25</text> <text id=\"noprize3\">$30</text> <text id=\"noprize4\">$800</text> <text id=\"noprize5\">$950</text> <text id=\"noprize6\">$1250</text> <text id=\"noprize7\">$.99</text> <text id=\"noprize8\">$80,000</text> <text id=\"noprize9\">$45,000</text> <text id=\"noprize10\">$150</text> <text id=\"currency_symbol\">$</text> <text id=\"intro_header\">WELCOME TO DEAL OR NO DEAL</text> <text id=\"intro_text\">Now you are on TV and will have to make the choice of a lifetime. Place yourself in the show and see if you have what is takes to win. Do you have the guts to continue until the end or will you take the banker's deal? Join a real tournament to win real cash online!</text> <text id=\"intro_continue\">CONTINUING IN {0} SECONDS</text> <text id=\"intro_note\">Deal or No Deal TM & \u00A9 2006 Endemol International B.V.</text> <text id=\"intro_note_states_us\">This game is offered solely by King.com and no other entity. Residents of the following states are excluded from playing this game: Alaska, Arizona, Arkansas, Connecticut, Delaware, Florida, Illinois, Indiana, Iowa, Louisiana, Maryland, Missouri, Montana, South Dakota, Tennessee and Vermont</text> <text id=\"instructions_header\">INSTRUCTIONS</text> <text id=\"instructions_text\">The rules are simple. The briefcases open up and offer a set of prize values you can pick. Your aim is to clear away the low value prizes to try to end up with a single high prize. Beware of fake prize values. Each briefcase will only remain open for a short while and then the chance to clear a prize is gone. Having only one prize left maximizes your score. After each round you can continue to clear off prizes or make a deal with the bank to stay with your score and end the game there.</text> <text id=\"instructions_continue\">CONTINUING IN {0} SECONDS</text> <text id=\"your_box_header\">YOUR BRIEFCASE</text> <text id=\"your_box_continue\">CONTINUING IN {0} SECONDS</text> <text id=\"round_header\">Round {0}</text> <text id=\"round_header_last\">Last round!</text> <text id=\"round_text\">Try to remove {0} prizes.</text> <text id=\"round_starting\">STARTING IN {0} SECONDS</text> <text id=\"bankers_offer\">Banker's offer</text> <text id=\"gameover_header\">Game over</text> <text id=\"gameover_score\">SCORE:</text> <text id=\"gameover_bonus\">TIME BONUS:</text> <text id=\"gameover_total\">TOTAL SCORE:</text> <text id=\"gameover_last_offer_higher\">(Too bad! Last banker's offer was {0})</text> <text id=\"gameover_last_offer_lower\">(Good! Last banker's offer was {0})</text> <text id=\"gameover_ending\">ENDING IN {0} SECONDS</text> <text id=\"prize_already_removed\">Already removed!</text> <text id=\"prize_not_available\">Not available!</text> <text id=\"prize_removed\">Prize removed!</text> <text id=\"prize_removed_with_bonus\">Prize removed!\nBonus +{0}</text> <text id=\"deal_header_round1\">First Banker's Offer</text> <text id=\"deal_header_round2\">Second Banker's Offer</text> <text id=\"deal_header_round3\">Third Banker's Offer</text> <text id=\"deal_header_round4\">Last Banker's Offer!</text> <text id=\"deal_text\">Select DEAL or NO DEAL above.</text> <text id=\"deal_continue\">CONTINUING IN {0} SECONDS</text> <text id=\"end_game\">END GAME</text> <text id=\"sound_on_off\">SOUND ON/OFF</text> </gamedata>";
_root.gamemode = 2;
var game = (new com.midasplayer.game.dealornodeal.Game());
this._quality = "best";
Stage.showMenu = false;
_focusrect = false;
stop();
Symbol 15 MovieClip [finger] Frame 1
stop();
Symbol 57 MovieClip [animstar] Frame 1
this.onEnterFrame = function () {
var _local2 = 1 - ((this._totalframes - this._currentframe) / this._totalframes);
if (_local2 < 0.1) {
_local2 = 0;
}
_local2 = _local2 * _local2;
this._y = this._y + (_local2 * 1.5);
this.star.star._rotation = this.star.star._rotation + this.star.star.rotationspeed;
};
if (this.delay == undefined) {
this.delay = random(6) + 30;
}
if (this.rotation == undefined) {
this.rotation = random(360);
this._rotation = this.rotation;
}
if (this.mscale == undefined) {
this.mscale = random(200) - 100;
this._xscale = this.mscale;
this._yscale = this.mscale;
}
if (this.frame == undefined) {
this.frame = 0;
}
if (this.manager.runningstars == undefined) {
this.manager.runningstars = 0;
}
if (this.manager.generatestars || (this.manager.generatestars == undefined)) {
this.manager.generatestars = false;
this.manager.starsx1 = (375 + random(1600)) - 800;
this.manager.starsy1 = 520 + random(500);
var pos = random(3);
if (pos == 0) {
this.manager.starsx2 = (50 + random(50)) - 25;
this.manager.starsy2 = 50 + random(200);
} else if (pos == 1) {
this.manager.starsx2 = (700 + random(50)) - 25;
this.manager.starsy2 = 50 + random(200);
} else {
this.manager.starsx2 = (375 + random(700)) - 350;
this.manager.starsy2 = 250 + random(100);
}
}
if ((this.manager != undefined) && (this.manager.waitcount == undefined)) {
this.manager.waitcount = 50;
}
if ((this.manager.runningstars > 0) || (this.frame == 0)) {
this._visible = false;
} else if (this.inited == undefined) {
this.inited = true;
this._visible = true;
this.x1 = this.manager.starsx1;
this.y1 = this.manager.starsy1;
this.x2 = this.manager.starsx2 + random(3);
this.y2 = this.manager.starsy2 + random(3);
this._x = this.x1;
this._y = this.y1;
this.star.star._rotation = random(360);
this.star.star.rotationspeed = random(10) - 5;
}
Symbol 57 MovieClip [animstar] Frame 2
if (this == this.manager) {
this.manager.waitcount--;
}
if ((this.manager == undefined) || (this.manager.waitcount > 0)) {
gotoAndPlay (1);
} else if (this.manager.runningstars > 0) {
gotoAndPlay (1);
} else {
var p = (1 - ((30 - this.frame) / 30));
if (p > 1) {
p = 1;
}
var p2 = p;
p = 1 - (((1 - p) * (1 - p)) * (1 - p));
p2 = (p2 * p2) * p2;
var ysub = (p2 * 50);
this.frame++;
if (this.frame < this.delay) {
this._x = this.x1 + ((this.x2 - this.x1) * p);
this._y = (this.y1 + ((this.y2 - this.y1) * p)) + ysub;
gotoAndPlay (1);
} else {
this.rotation = undefined;
this.mscale = undefined;
this.frame = undefined;
this.delay = undefined;
this.inited = undefined;
}
}
Symbol 57 MovieClip [animstar] Frame 32
this.manager.runningstars++;
this.manager.waitcount = undefined;
Symbol 57 MovieClip [animstar] Frame 82
this.manager.runningstars--;
if (this.manager.runningstars == 0) {
this.manager.generatestars = true;
}
Symbol 79 MovieClip [prizemarker] Frame 1
stop();
Symbol 79 MovieClip [prizemarker] Frame 40
gotoAndStop (1);
Symbol 102 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 10
gotoAndPlay (3);
Symbol 274 MovieClip [box] Frame 1
stop();
Symbol 301 MovieClip [__Packages.com.midasplayer.util.GameBase] Frame 0
class com.midasplayer.util.GameBase
{
static var gameData, game_, checkGameDataIntervalId_;
function GameBase () {
gameMode_ = GAME_MODE_MONEY;
}
function startGame() {
}
static function setGameMode(gameMode) {
gameMode_ = gameMode;
}
static function getGameMode() {
return(gameMode_);
}
static function setGameType(gameType) {
gameType_ = gameType;
}
static function getGameType() {
return(gameType_);
}
static function getGameData() {
return(gameData);
}
static function reportGameStart() {
com.midasplayer.util.Log.debug("gameStart");
fscommand ("gameStart");
}
static function reportGameEnd(score) {
com.midasplayer.util.Log.debug("gameEnd " + String(score));
fscommand ("gameEnd", String(score));
}
static function reportGameQuit() {
com.midasplayer.util.Log.debug("gameQuit");
fscommand ("gameQuit");
}
function reportGameOver(score) {
com.midasplayer.util.Log.debug("gameOver " + String(score));
fscommand ("gameOver", String(score));
}
static function reportPlayData(pCode, pData, pScore) {
if (gameMode_ != GAME_MODE_MONEY) {
return(undefined);
}
var _local1;
_local1 = String(pCode);
if ((pData != null) && (pData.length > 0)) {
_local1 = _local1 + ("," + pData);
}
if (((pScore != undefined) && (pScore != null)) && (pScore.length > 0)) {
_local1 = _local1 + ("=" + pScore);
}
trace(_local1);
com.midasplayer.util.Log.debug("playData " + _local1);
fscommand ("playData", "" + _local1);
}
static function runsLocal() {
return(_root._URL.substr(0, 5).toLowerCase() == "file:");
}
function init(game) {
game_ = game;
checkGameDataIntervalId_ = setInterval(this, "checkGameData", 200);
}
function checkGameData() {
if (!hasGameData_) {
if (((_root.gameData != null) && (_root.gameData != undefined)) && (_root.gameData != "")) {
hasGameData_ = true;
parseGameData(_root.gameData);
clearInterval(checkGameDataIntervalId_);
game_.startGame();
}
}
}
function parseGameData(myData) {
gameData = new com.midasplayer.util.Map();
var _local7 = new XML();
_local7.ignoreWhite = true;
_local7.parseXML(myData);
var _local4 = _local7.firstChild;
if (_local4.nodeName == "gamedata") {
for (var _local6 in _local4.attributes) {
var _local5;
var _local2 = _local4.attributes[_local6];
gameData.put(_local6, _local2);
}
var _local1 = _local4.firstChild;
while (_local1 != null) {
if (_local1.nodeName == "text") {
com.midasplayer.util.I18n.addTranslation(String(_local1.attributes.id), String(_local1.firstChild));
} else {
var _local3 = "0";
for (var _local6 in _local1.attributes) {
var _local2 = _local1.attributes[_local6];
if (_local6 == "id") {
_local3 = _local2;
} else {
gameData.put((((_local1.nodeName + ".") + _local3) + ".") + _local6, _local2);
}
}
}
_local1 = _local1.nextSibling;
}
}
}
static var GAME_MODE_DEBUG = 0;
static var GAME_MODE_PRACTICE = 1;
static var GAME_MODE_MONEY = 2;
static var GAME_TYPE_SINGLE = 0;
static var GAME_TYPE_MULTI = 1;
static var gameMode_ = GAME_MODE_DEBUG;
static var gameType_ = GAME_TYPE_SINGLE;
static var hasGameData_ = false;
}
Symbol 302 MovieClip [__Packages.com.midasplayer.util.Map] Frame 0
class com.midasplayer.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["@" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["@" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["@" + key]);
}
function remove(key) {
var _local2 = map["@" + key];
delete map["@" + key];
lastSize = -1;
return(_local2);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
trace(_local2);
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3.substring(1);
}
return(_local2);
}
function foreach(fn) {
do {
if ((in map) == null) {
break;
}
var _local3 = in map;
} while (fn(_local3.substring(1), map[_local3]) != false);
do {
} while ("foreach" != null);
lastSize = -1;
}
}
Symbol 303 MovieClip [__Packages.com.midasplayer.util.ArrayList] Frame 0
class com.midasplayer.util.ArrayList
{
var value;
function ArrayList () {
value = new Array();
}
function insert(obj, pos) {
var _local3 = value.length;
if (pos == undefined) {
value.push(obj);
return(_local3);
}
if (pos > _local3) {
pos = _local3;
}
var _local2 = _local3 - 1;
while (_local2 > (pos - 1)) {
value[_local2 + 1] = value[_local2];
_local2--;
}
value[pos] = obj;
return(pos);
}
function get(pos) {
return(value[pos]);
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < value.length) {
if (obj == value[_local2]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function remove(obj) {
return(removeByIndex(indexOf(obj)));
}
function removeByIndex(pos) {
var _local5;
var _local3 = value.length;
if ((pos < _local3) && (pos >= 0)) {
_local5 = value[pos];
delete value[pos];
var _local2 = pos;
while (_local2 < (_local3 - 1)) {
value[_local2] = value[_local2 + 1];
_local2++;
}
value.length = _local3 - 1;
}
return(_local5);
}
function size() {
return(value.length);
}
function clear() {
value = new Array();
}
function toArray() {
return(value);
}
function foreach(fn) {
var _local2 = 0;
var _local3 = value.length;
while (_local2 < _local3) {
if (fn(_local2, value[_local2]) == false) {
break;
}
_local2++;
}
}
function sortOn(field) {
value.sortOn(field);
}
function sort() {
value.sort();
}
function subList(from, to) {
if (!to) {
to = value.length;
}
var a = (new com.midasplayer.util.ArrayList());
var i = from;
while (i < to) {
a.insert(eval (i));
i++;
}
return(a);
}
}
Symbol 304 MovieClip [__Packages.com.midasplayer.util.Log] Frame 0
class com.midasplayer.util.Log
{
function Log () {
}
static function setLevel(level) {
level_ = level;
}
static function debug(msg) {
if (level_ <= LEVEL_DEBUG) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_DEBUG, msg));
}
}
static function warning(msg) {
if (level_ <= LEVEL_WARNING) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_WARNING, msg));
}
}
static function error(msg) {
if (level_ <= LEVEL_ERROR) {
log_.insert(new com.midasplayer.util.LogEntry(LEVEL_ERROR, msg));
}
}
static function getLog() {
if (log_.size() != logStringLastUpdatedSize_) {
logString_ = "";
var _local1 = 0;
while (_local1 < log_.size()) {
var _local2 = com.midasplayer.util.LogEntry(log_.get(_local1));
if (_local1 > 0) {
logString_ = logString_ + newline;
}
logString_ = logString_ + LEVEL_STRINGS[_local2.getLevel()];
logString_ = logString_ + ": ";
logString_ = logString_ + _local2.getMessage();
logStringLastUpdatedSize_ = log_.size();
_local1++;
}
}
return(logString_);
}
static var LEVEL_ALL = -1;
static var LEVEL_NONE = 1000;
static var LEVEL_DEBUG = 0;
static var LEVEL_WARNING = 1;
static var LEVEL_ERROR = 2;
static var LEVEL_STRINGS = ["DEBUG", "WARNING", "ERROR"];
static var level_ = LEVEL_ALL;
static var log_ = new com.midasplayer.util.ArrayList();
static var logString_ = "";
static var logStringLastUpdatedSize_ = 0;
}
Symbol 305 MovieClip [__Packages.com.midasplayer.util.LogEntry] Frame 0
class com.midasplayer.util.LogEntry
{
var level_, message_;
function LogEntry (level, msg) {
level_ = level;
message_ = msg;
}
function getLevel() {
return(level_);
}
function getMessage() {
return(message_);
}
}
Symbol 306 MovieClip [__Packages.com.midasplayer.util.I18n] Frame 0
class com.midasplayer.util.I18n
{
function I18n () {
}
static function addTranslation(name, val) {
val = val.split("'").join("'");
val = val.split("&").join("&");
val = val.split("\r\n").join(newline);
translations_.put(name, val);
}
static function format(name, replace0, replace1, replace2) {
var _local2 = translations_.get(name);
if (_local2 == undefined) {
return(("{" + name) + "}");
}
if (_local2 == "null") {
return("");
}
var _local1 = _local2.toString();
if (replace0 != undefined) {
var _local3 = _local1.split("{0}");
_local1 = _local3.join(replace0);
if (replace1 != undefined) {
_local3 = _local1.split("{1}");
_local1 = _local3.join(replace1);
if (replace2 != undefined) {
_local3 = _local1.split("{2}");
_local1 = _local3.join(replace2);
}
}
}
return(_local1);
}
static var translations_ = new com.midasplayer.util.Map();
}
Symbol 307 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Game] Frame 0
class com.midasplayer.game.dealornodeal.Game extends com.midasplayer.util.GameBase
{
static var dealLayer_, board, rules, lang, gui, previewBoxes_, finger_, currentPreviewBox_, ownBox_, numBoxesSelected_, scoreText_, deal_, quitIntervalId_;
var init;
function Game () {
super();
com.midasplayer.util.GameBase.setGameMode(_root.gamemode);
com.midasplayer.util.Log.setLevel(com.midasplayer.util.Log.LEVEL_NONE);
init(this);
}
function startGame() {
com.midasplayer.util.GameBase.reportGameStart();
com.midasplayer.util.GameBase.reportPlayData(19, VERSION, "0");
initGui();
if (_root.deallayer == undefined) {
dealLayer_ = _root.createEmptyMovieClip("deallayer", _root.getNextHighestDepth());
}
if (_root.endgame_button == undefined) {
_root.attachMovie("endgame_button", "endgame_button", _root.getNextHighestDepth());
_root.endgame_button.txt.text = com.midasplayer.util.I18n.format("end_game");
_root.endgame_button._x = 5;
_root.endgame_button._y = 500;
}
_root.endgame_button.onRelease = function () {
trace("X");
com.midasplayer.game.dealornodeal.Game.exitGame();
};
if (_root.sound_button == undefined) {
_root.attachMovie("sound_button", "sound_button", _root.getNextHighestDepth());
_root.sound_button.txt.text = com.midasplayer.util.I18n.format("sound_on_off");
_root.sound_button._x = Stage.width - 5;
_root.sound_button._y = 500;
_root.sound_button.onRelease = function () {
com.midasplayer.game.dealornodeal.Game.switchSound();
};
}
board = new com.midasplayer.game.dealornodeal.Board(this);
rules = new com.midasplayer.game.dealornodeal.Rules();
roundNum_ = 0;
totalBonus_ = 0;
lastDeal_ = 0;
mouseActionIndex_ = 0;
showInstructions();
}
static function playIntroSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("intro_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("intro_theme_full_quality", 100, false, function () {
com.midasplayer.fx.SoundManager.play("Bank offers deal - heat", 100, true);
});
}
}
static function playBankOfferSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("bankeroffer_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("Bank offers deal - heat", 100, true);
}
}
static function stopBankOfferSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.stop("bankeroffer_en");
} else {
com.midasplayer.fx.SoundManager.stop("Bank offers deal - heat");
}
}
static function playPickingSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("picking_en", 100, true);
} else {
com.midasplayer.fx.SoundManager.play("background when pickign cases", 100, true);
}
}
static function stopPickingSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.stop("picking_en");
} else {
com.midasplayer.fx.SoundManager.stop("background when pickign cases");
}
}
static function playGameEndSound() {
if (lang == "en") {
com.midasplayer.fx.SoundManager.play("gameoversnd_en");
} else {
com.midasplayer.fx.SoundManager.play("game end");
}
}
static function switchSound() {
com.midasplayer.fx.SoundManager.enableSounds(!com.midasplayer.fx.SoundManager.isSoundEnabled());
}
function initGui() {
lang = String(com.midasplayer.util.GameBase.gameData.get("lang"));
if ((lang == "en") || (lang == "de")) {
} else {
lang = "";
}
gui = new com.midasplayer.game.dealornodeal.Gui();
gui.setLanguage(lang);
}
static function getRoundNum() {
return(roundNum_);
}
static function getRoundNumBoxes() {
return(NUM_BOXES_PER_ROUND[roundNum_ - 1]);
}
function showInstructions() {
if (dealLayer_.pickbg == undefined) {
gui.attachMovie(dealLayer_, "pickbg", "pickbg", dealLayer_.getNextHighestDepth());
dealLayer_.pickbg._x = gui.getX("bg");
dealLayer_.pickbg._y = gui.getY("bg");
}
board.toneDown(0);
playIntroSound();
_root.howie._x = gui.getX("howie");
_root.howie._y = gui.getY("howie");
gui.attachMovie(_root, "instructions", "instructions", _root.getNextHighestDepth());
_root.instructions._x = gui.getX("instructions");
_root.instructions._y = gui.getY("instructions");
_root.instructions.header.text = com.midasplayer.util.I18n.format("intro_header");
_root.instructions.text.text = com.midasplayer.util.I18n.format("intro_text");
_root.instructions.note.text = com.midasplayer.util.I18n.format("intro_note");
_root.instructions.note_states.text = com.midasplayer.util.I18n.format("intro_note_states_us");
_root.instructions.ending.text = "";
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showInstructionsAnim}], callback:endShowInstructions, callback_scope:this, tps:50});
previewBoxes_ = new Array();
var _local5 = 150;
var _local7 = 180;
var _local6 = 80;
var _local4 = 0;
while (_local4 < 5) {
var _local3 = new com.midasplayer.game.dealornodeal.Box(0);
_local3.setXPos(_local5);
_local3.setYPos(_local7);
_local3.setNumber(_local4 + 1);
_local3.setType(_local4 + 1);
_local5 = _local5 + _local6;
previewBoxes_[_local4] = _local3;
_local4++;
}
finger_ = _root.attachMovie("finger", "finger", _root.getNextHighestDepth());
finger_._y = -100;
finger_._x = -100;
var _local9 = new Array();
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showPreviewAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showPreviewAnim(tick, alpha) {
if (_root.removePreview) {
return(true);
}
if (tick >= mouseActions_[mouseActionIndex_ + 1][0]) {
mouseActionIndex_++;
}
var _local5 = mouseActions_[mouseActionIndex_][0];
var _local2 = mouseActions_[mouseActionIndex_][1];
var _local4 = mouseActions_[mouseActionIndex_][2];
if (_local2 == -3) {
currentPreviewBox_ = previewBoxes_[_local4];
if (!currentPreviewBox_.isOpened()) {
currentPreviewBox_.open();
}
} else if (_local2 == -2) {
finger_._visible = false;
} else if (_local2 == -1) {
finger_.gotoAndPlay(2);
currentPreviewBox_.clickAction(finger_._x, finger_._y);
} else {
var _local12 = mouseActions_[mouseActionIndex_ + 1][0];
var _local3 = mouseActions_[mouseActionIndex_ + 1][1];
var _local7 = mouseActions_[mouseActionIndex_ + 1][2];
if (_local3 < 0) {
_local3 = mouseActions_[mouseActionIndex_][1];
_local7 = mouseActions_[mouseActionIndex_][2];
}
var _local11 = _local3 - _local2;
var _local10 = _local7 - _local4;
var _local6 = (tick - _local5) / (_local12 - _local5);
var _local9 = ((lang == "en") ? 2 : 0);
var _local8 = ((lang == "en") ? -18 : 0);
finger_._x = (_local2 + (_local6 * _local11)) + _local9;
finger_._y = (_local4 + (_local6 * _local10)) + _local8;
finger_.gotoAndStop(1);
currentPreviewBox_.moveAction(finger_._x, finger_._y);
}
}
function showInstructionsAnim(tick, alpha) {
var _local4 = false;
_root.instructions.onPress = function () {
this.clicked = true;
};
var _local3 = 20;
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50 * _local3);
var _local5 = _local3 - Math.floor(_local3 * _local6);
_root.instructions_timeplayed = _local3 - _local5;
_root.instructions.ending.text = com.midasplayer.util.I18n.format("intro_continue", "" + _local5);
if (_root.instructions.clicked) {
_local4 = true;
}
if (tick >= (50 * _local3)) {
_local4 = true;
}
return(_local4);
}
function endShowInstructions() {
_root.instructions.removeMovieClip();
showSelectOwnBox();
}
function showSelectOwnBox() {
gui.attachMovie(_root, "selectownbox", "instructions", _root.getNextHighestDepth());
_root.instructions._x = gui.getX("instructions");
_root.instructions._y = gui.getY("instructions");
_root.instructions.header.text = com.midasplayer.util.I18n.format("instructions_header");
_root.instructions.text.text = com.midasplayer.util.I18n.format("instructions_text");
_root.instructions.note.text = com.midasplayer.util.I18n.format("intro_note");
_root.instructions.ending.text = "";
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showSelectOwnBoxAnim}], callback:endShowSelectOwnBox, callback_scope:this, tps:50});
}
function showSelectOwnBoxAnim(tick, alpha) {
var _local4 = false;
_root.instructions.onPress = function () {
this.clicked = true;
};
var _local3 = 40 - _root.instructions_timeplayed;
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50 * _local3);
var _local5 = _local3 - Math.floor(_local3 * _local6);
_root.instructions.ending.text = com.midasplayer.util.I18n.format("instructions_continue", "" + _local5);
if (_root.instructions.clicked) {
_root.removePreview = true;
_local4 = true;
}
if (tick >= (50 * _local3)) {
_root.removePreview = true;
_root.instructions.clicked = true;
_local4 = true;
}
return(_local4);
}
function endShowSelectOwnBox() {
trace("remove ");
finger_.removeMovieClip();
var _local3 = 0;
while (_local3 < 5) {
previewBoxes_[_local3].showSelectedBox();
_local3++;
}
_root.instructions.removeMovieClip();
_root.howie.removeMovieClip();
board.toneUp();
selectOwnBox();
}
function selectOwnBox() {
board.selectOwnBox();
}
function ownBoxSelected(box) {
ownBox_ = box;
com.midasplayer.util.GameBase.reportPlayData(112, "" + box.getNumber(), "0");
showSelectedBox();
}
function showSelectedBox() {
board.toneDown(0);
gui.attachMovie(_root, "bigbox", "bigbox", _root.getNextHighestDepth());
_root.bigbox._x = gui.getX("bigbox");
_root.bigbox._y = gui.getY("bigbox");
_root.bigbox.number.text = "" + ownBox_.getNumber();
_root.bigbox.number_shadow.text = "" + ownBox_.getNumber();
gui.attachMovie(_root, "bigbox", "bigbox2", _root.getNextHighestDepth());
_root.bigbox2._yscale = -100;
_root.bigbox2._x = gui.getX("bigbox");
_root.bigbox2._y = gui.getY("bigbox") + (2 * _root.bigbox._height);
_root.bigbox2.number.text = "" + ownBox_.getNumber();
_root.bigbox2.number_shadow.text = "" + ownBox_.getNumber();
_root.attachMovie("reflection", "reflection", _root.getNextHighestDepth());
_root.reflection._x = gui.getX("bigbox");
_root.reflection._y = gui.getY("bigbox") + _root.bigbox._height;
gui.attachMovie(_root, "bigboxmask", "bigbox3", _root.getNextHighestDepth());
_root.bigbox3._yscale = -100;
_root.bigbox3._x = gui.getX("bigbox");
_root.bigbox3._y = gui.getY("bigbox") + (2 * _root.bigbox._height);
_root.reflection.setMask(_root.bigbox3);
_root.attachMovie("starbig", "starbig", _root.getNextHighestDepth());
_root.starbig._x = gui.getX("starbig");
_root.starbig._y = gui.getY("starbig");
gui.attachMovie(_root, "selectedbox", "instructions", _root.getNextHighestDepth());
_root.instructions._x = gui.getX("selectedbox");
_root.instructions._y = gui.getY("selectedbox");
_root.instructions.header.text = com.midasplayer.util.I18n.format("your_box_header");
_root.instructions.ending.text = "";
var _local3 = new com.midasplayer.util.Spline();
_local3.addPoint(315, 190);
_local3.addPoint(460, 205);
_local3.addPoint(530, 320);
_local3.addPoint(490, 445);
_local3.addPoint(300, 460);
_local3.addPoint(210, 340);
_local3.addPoint(105, 245);
_local3.addPoint(30, 360);
_local3.addPoint(90, 450);
_local3.addPoint(180, 420);
_local3.addPoint(280, 380);
_root.trail = new com.midasplayer.util.ParticleTrail(_root, _local3);
_root.trail.start();
var _local4 = new com.midasplayer.util.Spline();
_local4.addPoint(470, 480);
_local4.addPoint(310, 480);
_local4.addPoint(225, 385);
_local4.addPoint(252, 240);
_local4.addPoint(440, 220);
_local4.addPoint(515, 340);
_local4.addPoint(575, 455);
_local4.addPoint(705, 450);
_local4.addPoint(720, 305);
_local4.addPoint(590, 230);
_local4.addPoint(410, 260);
_root.trail2 = new com.midasplayer.util.ParticleTrail(_root, _local4);
_root.trail2.start();
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showSelectedBoxAnim}], callback:endShowSelectedBox, callback_scope:this, tps:25});
}
function showSelectedBoxAnim(tick, alpha) {
var _local3 = false;
_root.instructions.onPress = function () {
this.clicked = true;
};
_root.bigbox.onPress = function () {
this.clicked = true;
};
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 125);
var _local4 = 5 - Math.floor(5 * _local5);
_root.instructions.ending.text = com.midasplayer.util.I18n.format("your_box_continue", "" + _local4);
if (_root.instructions.clicked) {
_local3 = true;
}
if (_root.bigbox.clicked) {
_local3 = true;
}
if (tick >= 125) {
_local3 = true;
}
return(_local3);
}
function endShowSelectedBox() {
_root.instructions.removeMovieClip();
_root.bigbox.removeMovieClip();
_root.bigbox2.removeMovieClip();
_root.bigbox3.removeMovieClip();
_root.starbig.removeMovieClip();
_root.reflection.removeMovieClip();
startRound(1);
}
function startRound(roundNum) {
roundNum_ = roundNum;
com.midasplayer.util.GameBase.reportPlayData(22, "" + roundNum, "0");
numBoxesSelected_ = 0;
showRoundStart();
}
function showRoundStart(r) {
board.toneDown(0);
var _local4 = NUM_BOXES_PER_ROUND[roundNum_ - 1];
gui.attachMovie(_root, "roundstart", "instructions", _root.getNextHighestDepth());
_root.instructions._x = gui.getX("instructions");
_root.instructions._y = gui.getY("instructions");
if (roundNum_ == NUM_ROUNDS) {
_root.instructions.header.text = com.midasplayer.util.I18n.format("round_header_last");
} else {
_root.instructions.header.text = com.midasplayer.util.I18n.format("round_header", "" + roundNum_);
}
_root.instructions.text.text = com.midasplayer.util.I18n.format("round_text", "" + NUM_BOXES_PER_ROUND[roundNum_ - 1]);
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showRoundStartAnim}], callback:endShowRoundStart, callback_scope:this, tps:25});
}
function showRoundStartAnim(tick, alpha) {
var _local3 = false;
_root.instructions.onPress = function () {
this.clicked = true;
};
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 125);
var _local4 = 5 - Math.floor(5 * _local5);
_root.instructions.ending.text = com.midasplayer.util.I18n.format("round_starting", "" + _local4);
if (_root.instructions.clicked) {
_local3 = true;
}
if (tick >= 125) {
_local3 = true;
}
return(_local3);
}
function endShowRoundStart() {
_root.instructions.removeMovieClip();
_root.trail.stop();
_root.trail2.stop();
board.toneUp();
com.midasplayer.fx.SoundManager.stop("intro_en");
com.midasplayer.fx.SoundManager.stop("Bank offers deal - heat");
playPickingSound();
if (roundNum_ == 1) {
board.enablePrizes();
}
board.startRound(roundNum_, NUM_BOXES_PER_ROUND[roundNum_ - 1]);
selectBox();
}
function selectBox() {
board.selectBox();
}
function boxSelected(box) {
var _local8 = box.getNumber();
var _local6 = box.getPrizeIndex();
var _local3 = box.getPrize();
var _local5 = -1;
var _local7 = box.getClickTick();
var _local4 = box.getBonus();
totalBonus_ = totalBonus_ + _local4;
if (_local3 != null) {
_local3.selected();
_local5 = _local3.getNumber();
}
com.midasplayer.util.GameBase.reportPlayData(71, (((((("" + _local8) + " ") + _local6) + " ") + _local5) + " ") + _local7, "" + _local4);
numBoxesSelected_++;
if (numBoxesSelected_ == NUM_BOXES_PER_ROUND[roundNum_ - 1]) {
board.endRound();
endRound();
} else {
selectBox();
}
}
function endRound() {
com.midasplayer.util.AnimPlayer.delay({callback_scope:this, callback:showDeal, millis:1000});
}
function showDeal() {
stopPickingSound();
com.midasplayer.util.GameBase.reportPlayData(290, "" + rules.getBankOffer(), "0");
if (roundNum_ == 4) {
lastDeal_ = rules.getBankOffer();
}
playBankOfferSound();
board.toneDown(0);
if (roundNum_ >= NUM_ROUNDS) {
scoreText_ = rules.getBankOfferText();
score_ = rules.getBankOffer();
showGameOver();
return(undefined);
}
dealLayer_.pickbg.logo._visible = false;
dealLayer_.pickbg.lights._visible = false;
gui.attachMovie(_root, "bankoffer", "bankoffer", _root.getNextHighestDepth());
_root.bankoffer._x = gui.getX("bankoffer");
_root.bankoffer._y = gui.getY("bankoffer");
_root.bankoffer.header.text = com.midasplayer.util.I18n.format("bankers_offer");
_root.bankoffer.txt.text = rules.getBankOfferText();
_root.bankoffer._visible = false;
gui.attachMovie(_root, "deal", "deal", _root.getNextHighestDepth());
_root.deal._x = gui.getX("deal");
_root.deal._y = gui.getY("deal");
gui.attachMovie(_root, "nodeal", "nodeal", _root.getNextHighestDepth());
_root.nodeal._x = gui.getX("nodeal");
_root.nodeal._y = gui.getY("nodeal");
gui.attachMovie(_root, "dealh", "dealh", _root.getNextHighestDepth());
_root.dealh._x = gui.getX("dealh");
_root.dealh._y = gui.getY("dealh");
_root.deal.light = _root.dealh;
_root.dealh._alpha = 0;
gui.attachMovie(_root, "nodealh", "nodealh", _root.getNextHighestDepth());
_root.nodealh._x = gui.getX("nodealh");
_root.nodealh._y = gui.getY("nodealh");
_root.nodealh._alpha = 0;
_root.nodeal.light = _root.nodealh;
if (lang == "en") {
gui.attachMovie(_root, "phone", "phone", _root.getNextHighestDepth());
_root.phone._x = gui.getX("bigbox") - 15;
_root.phone._y = gui.getY("bigbox") - 10;
} else {
gui.attachMovie(_root, "bigbox", "bigbox", _root.getNextHighestDepth());
_root.bigbox._x = gui.getX("bigbox");
_root.bigbox._y = gui.getY("bigbox");
_root.bigbox.number.text = "" + ownBox_.getNumber();
_root.bigbox.number_shadow.text = "" + ownBox_.getNumber();
_root.attachMovie("starbig", "starbig", _root.getNextHighestDepth());
_root.starbig._x = gui.getX("starbig");
_root.starbig._y = gui.getY("starbig");
gui.attachMovie(_root, "bigbox", "bigbox2", _root.getNextHighestDepth());
_root.bigbox2._yscale = -100;
_root.bigbox2._x = gui.getX("bigbox");
_root.bigbox2._y = gui.getY("bigbox") + (2 * _root.bigbox._height);
_root.bigbox2.number.text = "" + ownBox_.getNumber();
_root.bigbox2.number_shadow.text = "" + ownBox_.getNumber();
_root.attachMovie("reflection", "reflection", _root.getNextHighestDepth());
_root.reflection._x = gui.getX("bigbox");
_root.reflection._y = gui.getY("bigbox") + _root.bigbox._height;
gui.attachMovie(_root, "bigboxmask", "bigbox3", _root.getNextHighestDepth());
_root.bigbox3._yscale = -100;
_root.bigbox3._x = gui.getX("bigbox");
_root.bigbox3._y = gui.getY("bigbox") + (2 * _root.bigbox._height);
_root.reflection.setMask(_root.bigbox3);
}
gui.attachMovie(_root, "roundend", "instructions", _root.getNextHighestDepth());
_root.instructions._x = gui.getX("instructions");
_root.instructions._y = gui.getY("instructions");
_root.instructions.header.text = com.midasplayer.util.I18n.format("deal_header_round" + roundNum_);
_root.instructions.text.text = com.midasplayer.util.I18n.format("deal_text");
_root.instructions.ending.text = "";
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showDealAnim}], callback:endShowDeal, callback_scope:this, tps:50});
}
function fixP(tick, startTick, numTicks) {
var _local1 = (tick - startTick) / numTicks;
_local1 = ((_local1 < 0) ? 0 : (_local1));
_local1 = ((_local1 > 1) ? 1 : (_local1));
return(_local1);
}
function showDealAnim(tick, alpha) {
var _local3 = false;
if (tick > 40) {
var _local5 = _root.phone._currentframe;
if (_local5 != 10) {
_root.phone.gotoAndStop(_local5 + 1);
}
}
if (tick > 20) {
if (_root.deal.onPress == undefined) {
_root.bankoffer._visible = true;
_root.deal.onPress = function () {
this.clicked = true;
};
_root.nodeal.onPress = function () {
this.clicked = true;
};
_root.deal.onRollOver = function () {
this.light._alpha = 100;
};
_root.nodeal.onRollOver = function () {
this.light._alpha = 100;
};
_root.deal.onRollOut = function () {
this.light._alpha = 0;
};
_root.nodeal.onRollOut = function () {
this.light._alpha = 0;
};
}
var _local7 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 750);
var _local6 = 15 - Math.floor(15 * _local7);
_root.instructions.ending.text = com.midasplayer.util.I18n.format("deal_continue", "" + _local6);
}
if (tick > 750) {
_root.nodeal.clicked = true;
}
if (_root.deal.clicked) {
_local3 = true;
}
if (_root.nodeal.clicked) {
_local3 = true;
}
return(_local3);
}
function endShowDeal() {
deal_ = _root.deal.clicked;
dealLayer_.pickbg.logo._visible = true;
_root.bankoffer.removeMovieClip();
_root.deal.removeMovieClip();
_root.nodeal.removeMovieClip();
_root.dealh.removeMovieClip();
_root.nodealh.removeMovieClip();
_root.phone.removeMovieClip();
_root.bigbox.removeMovieClip();
_root.bigbox2.removeMovieClip();
_root.bigbox3.removeMovieClip();
_root.reflection.removeMovieClip();
_root.starbig.removeMovieClip();
_root.bigbox.removeMovieClip();
_root.instructions.removeMovieClip();
com.midasplayer.util.GameBase.reportPlayData(291, (deal_ ? "1" : "0"), "0");
stopBankOfferSound();
if (deal_) {
scoreText_ = rules.getBankOfferText();
score_ = rules.getBankOffer();
showGameOver();
} else if ((!deal_) && (roundNum_ < NUM_ROUNDS)) {
com.midasplayer.fx.SoundManager.play("no deal stinger");
var _local3 = new com.midasplayer.util.Spline();
_local3.addPoint(315, 190);
_local3.addPoint(460, 205);
_local3.addPoint(530, 320);
_local3.addPoint(490, 445);
_local3.addPoint(300, 460);
_local3.addPoint(210, 340);
_local3.addPoint(105, 245);
_local3.addPoint(30, 360);
_local3.addPoint(90, 450);
_local3.addPoint(180, 420);
_local3.addPoint(280, 380);
_root.trail = new com.midasplayer.util.ParticleTrail(_root, _local3);
_root.trail.start();
var _local4 = new com.midasplayer.util.Spline();
_local4.addPoint(470, 480);
_local4.addPoint(310, 480);
_local4.addPoint(225, 385);
_local4.addPoint(252, 240);
_local4.addPoint(440, 220);
_local4.addPoint(515, 340);
_local4.addPoint(575, 455);
_local4.addPoint(705, 450);
_local4.addPoint(720, 305);
_local4.addPoint(590, 230);
_local4.addPoint(410, 260);
_root.trail2 = new com.midasplayer.util.ParticleTrail(_root, _local4);
_root.trail2.start();
startRound(roundNum_ + 1);
} else {
scoreText_ = rules.getBankOfferText();
score_ = rules.getBankOffer();
showGameOver();
}
}
function showGameOver() {
_root.endgame_button.onRelease = undefined;
dealLayer_.pickbg.lights._visible = false;
com.midasplayer.util.GameBase.reportPlayData(300, "", "" + score_);
var _local7 = 0;
var _local5 = 0;
var _local6 = 0;
if ((score_ + totalBonus_) > 400000) {
_local7 = 1;
_local5 = 60;
}
if ((score_ + totalBonus_) > 600000) {
_local7 = 1;
_local5 = 70;
}
if ((score_ + totalBonus_) > 800000) {
_local7 = 1;
_local5 = 80;
_local6 = 0;
}
if ((score_ + totalBonus_) > 1000000) {
_local7 = 2;
_local5 = 80;
_local6 = 80 / _local7;
}
_root.stars = new Array();
var _local3 = 0;
while (_local3 < _local7) {
_root.stars[_local3] = new Array();
var _local4 = 0;
while (_local4 < _local5) {
_root.stars[_local3].push(gui.attachMovie(_root, "animstar", (("star_" + (_local3 + 1)) + "_") + (_local4 + 1), _root.getNextHighestDepth()));
_root.stars[_local3][_local4].manager = _root.stars[_local3][0];
_root.stars[_local3][_local4].manager.waitcount = _local6 * _local3;
_local4++;
}
_local3++;
}
stopBankOfferSound();
playGameEndSound();
board.toneDown(0);
board.disablePrizes();
gui.attachMovie(_root, "gameover", "gameover", _root.getNextHighestDepth());
_root.gameover._x = gui.getX("gameover");
_root.gameover._y = gui.getY("gameover");
_root.gameover.header.text = com.midasplayer.util.I18n.format("gameover_header");
_root.gameover.r1c1.text = com.midasplayer.util.I18n.format("gameover_score");
_root.gameover.r1c2.text = score_;
_root.gameover.r2c1.text = com.midasplayer.util.I18n.format("gameover_bonus");
_root.gameover.r2c2.text = totalBonus_;
_root.gameover.r3c1.text = com.midasplayer.util.I18n.format("gameover_total");
_root.gameover.r3c2.text = score_ + totalBonus_;
_root.gameover.ending.text = "";
_root.gameover.lastoffer.text = "";
if (roundNum_ == NUM_ROUNDS) {
if (lastDeal_ > score_) {
_root.gameover.lastoffer.text = com.midasplayer.util.I18n.format("gameover_last_offer_higher", "" + lastDeal_);
} else {
_root.gameover.lastoffer.text = com.midasplayer.util.I18n.format("gameover_last_offer_lower", "" + lastDeal_);
}
}
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showGameOverAnim}], callback:endShowGameOver, callback_scope:this, tps:25});
}
function showGameOverAnim(tick, alpha) {
var _local4 = false;
_root.gameover.onPress = function () {
this.clicked = true;
};
var _local3 = 8;
if (Number(com.midasplayer.util.GameBase.gameData.get("standalone")) == 1) {
_local3 = 2;
}
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 25 * _local3);
var _local6 = (1 + _local3) - Math.round(_local3 * _local5);
_root.gameover.ending.text = com.midasplayer.util.I18n.format("gameover_ending", "" + _local6);
if (_root.gameover.clicked) {
_local4 = true;
}
if (_local5 == 1) {
_local4 = true;
}
return(_local4);
}
function endShowGameOver() {
if (Number(com.midasplayer.util.GameBase.gameData.get("standalone")) == 1) {
showRegForm();
} else {
endGame();
}
}
function showRegForm() {
trace("REG");
var _local3 = _root.attachMovie("regform", "regform", _root.getNextHighestDepth());
_local3._x = (Stage.width - _local3._width) / 2;
_local3._y = (((Stage.height - _local3._height) / 2) - 70) - 500;
_local3.in_username.tabIndex = 1;
_local3.in_password.tabIndex = 2;
_local3.in_password2.tabIndex = 3;
_local3.in_email.tabIndex = 4;
_local3.btn_email.tabIndex = 5;
_local3.btn_check.tabIndex = 6;
_local3.btn_submit.tabIndex = 7;
_local3.btn_check.gotoAndStop(2);
_local3.btn_check.onPress = function () {
if (this._currentframe != 2) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
_local3.btn_email.gotoAndStop(2);
_local3.btn_email.onPress = function () {
if (this._currentframe != 2) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
_local3.btn_play.onRelease = function () {
com.midasplayer.util.AnimPlayer.clear();
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.game.dealornodeal.Game.removeAllClips(com.midasplayer.game.dealornodeal.Game.dealLayer_);
com.midasplayer.game.dealornodeal.Game.removeAllClips(_root);
_root.game.startGame();
};
_local3.btn_submit.form = _local3;
_local3.btn_submit.onRelease = function () {
var _local6 = this.form.in_username.text;
var _local3 = this.form.in_password.text;
var _local5 = this.form.in_password2.text;
var _local2 = this.form.in_email.text;
var _local7 = ((this.form.btn_email._currentframe == 2) ? "true" : "false");
if (_local6.length < 2) {
this.form.error_txt.text = "The username is too short.";
} else if (_local3.length < 3) {
this.form.error_txt.text = "The password is too short.";
} else if (_local3 != _local5) {
this.form.error_txt.text = "The password does not match.";
} else if (_local2.length < 6) {
this.form.error_txt.text = "Invalid email.";
} else if (_local2.indexOf("@") < 0) {
this.form.error_txt.text = "Invalid email.";
} else if (_local2.indexOf(".") < 0) {
this.form.error_txt.text = "Invalid email.";
} else if (this.form.btn_check._currentframe != 2) {
this.form.error_txt.text = "Please check the box and confirming your interest in the Deal or No Deal skill game.";
this.form.btn_check.gotoAndPlay(3);
} else {
this.form.error_txt.text = "";
this.form.username = _local6;
this.form.password = _local3;
this.form.password_validation = _local5;
this.form.email = _local2;
this.form.wantsEmail = _local7;
this.form.gameType = "dond_game";
var _local4 = com.midasplayer.util.GameBase.gameData.get("partner");
if (_local4 == undefined) {
_local4 = "nbc";
}
this.form.partner = _local4;
this.form.getURL("https://www.king.com/partnerpages/semiauto_register.jsp", "_top", "POST");
}
};
_root.regform._oy = _root.regform._y;
_root.gameover._oy = _root.gameover._y;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showRegFormAnim}], callback:undefined, callback_scope:this, tps:50});
}
function showRegFormAnim(tick, alpha) {
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 50);
_root.gameover._y = _root.gameover._oy - ((530 * _local2) * _local2);
_root.regform._y = _root.regform._oy + ((530 * _local3) * _local3);
return(false);
}
static function exitGame() {
com.midasplayer.util.AnimPlayer.clear();
board.endRound();
gui.attachMovie(_root, "pickbg", "pickbg", _root.getNextHighestDepth());
_root.pickbg._x = gui.getX("bg");
_root.pickbg._y = gui.getY("bg");
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportPlayData(101, "", "0");
score_ = rules.getBankOffer();
_root.instructions.removeMovieClip();
_root.game.showGameOver();
}
static function endGame() {
com.midasplayer.util.GameBase.reportGameEnd(score_ + totalBonus_);
quitIntervalId_ = setInterval(quitGame, 1600);
}
static function quitGame() {
clearInterval(quitIntervalId_);
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportGameQuit();
}
static function addScore(score) {
score_ = score_ + score;
displayScore();
}
static function displayScore() {
}
static function removeAllClips(level) {
for (var clip in eval (level)) {
if (typeof(eval (level)[clip]) == "movieclip") {
var clipName = String(clip);
if (clipName == "timer") {
} else if (clipName.substr(0, 3) == "sm_") {
} else {
trace(clipName);
eval (level)[clip].removeMovieClip();
}
}
}
}
static var VERSION = "1.01";
static var score_ = 0;
static var NUM_ROUNDS = 5;
static var NUM_BOXES_PER_ROUND = [5, 5, 5, 5, 5];
static var roundNum_ = 0;
static var totalBonus_ = 0;
static var lastDeal_ = 0;
static var mouseActionIndex_ = 0;
static var mouseActions_ = [[0, 217, 253], [1, -3, 0], [78, 217, 253], [90, 236, 215], [102, 236, 215], [106, 237, 210], [111, 238, 206], [118, 239, 202], [123, 240, 200], [155, 237, 194], [157, 234, 193], [158, 230, 192], [166, 224, 190], [176, -1, -1], [177, -3, 1], [178, 224, 190], [207, 227, 192], [218, 231, 207], [220, 233, 209], [221, 236, 212], [223, 240, 216], [225, 243, 219], [227, 247, 221], [228, 251, 225], [230, 254, 226], [232, 255, 227], [235, 259, 228], [363, 276, 229], [372, 282, 228], [377, 283, 226], [385, 284, 225], [387, 286, 222], [389, 289, 216], [391, 291, 211], [393, 292, 203], [395, 293, 199], [397, 294, 197], [400, 295, 194], [404, -1, -1], [405, -3, 2], [406, 295, 194], [421, 294, 193], [517, 352, 188], [519, 353, 187], [531, 361, 188], [538, 362, 189], [561, 372, 190], [590, 385, 189], [594, 387, 188], [606, 388, 187], [647, 401, 188], [652, 402, 195], [656, 403, 198], [680, 402, 209], [683, 401, 210], [705, 387, 209], [736, 367, 208], [741, 364, 207], [755, 360, 206], [776, -1, -1], [777, -3, 3], [778, 360, 206], [830, 420.95, 224], [1136, 420.95, 224], [1138, 425.95, 220], [1139, 428.95, 218], [1141, 429.95, 216], [1149, 430.95, 214], [1155, 431.95, 212], [1165, -1, -1], [1166, -3, 4], [1167, 431.95, 212], [1200, 432.95, 213], [1225, 432.95, 213], [1227, 436.95, 215], [1229, 437.95, 216], [1300, 524.95, 221], [1393, 524.95, 221], [1639, 530.95, 215], [1640, 533.95, 213], [1644, 535.95, 210], [1645, 536.95, 209], [1651, 537.95, 207], [1654, 538.95, 203], [1656, 539.95, 202], [1657, 540.95, 200], [1664, -1, -1], [1700, -2, -2]];
}
Symbol 308 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Gui] Frame 0
class com.midasplayer.game.dealornodeal.Gui
{
static var lang_;
function Gui () {
lang_ = "";
init();
}
function setLanguage(lang) {
lang_ = lang;
}
function init() {
var _local2 = _root.attachMovie("placeholder", "placeholder", _root.getNextHighestDepth());
_local2._visible = false;
}
function attachMovie(parentClip, libName, clipName, depth) {
var _local2 = (libName + "_") + lang_;
var _local1;
_local1 = parentClip.attachMovie(_local2, clipName, depth);
if (_local1 == undefined) {
_local1 = parentClip.attachMovie(libName, clipName, depth);
}
return(_local1);
}
function getClip(clipName) {
var clip;
clip = eval ((("_root.placeholder." + clipName) + "_") + lang_);
if (clip == undefined) {
clip = eval ("_root.placeholder." + clipName);
}
return(clip);
}
function getX(clipName) {
var _local2 = getClip(clipName);
return(_local2._x);
}
function getY(clipName) {
var _local2 = getClip(clipName);
return(_local2._y);
}
function getAlpha(clipName) {
var _local2 = getClip(clipName);
return(_local2._alpha);
}
function getWidth(clipName) {
var _local2 = getClip(clipName);
return(_local2._width);
}
function getHeight(clipName) {
var _local2 = getClip(clipName);
return(_local2._height);
}
}
Symbol 309 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Board] Frame 0
class com.midasplayer.game.dealornodeal.Board
{
static var game_, seed_, random_, shelfes_, numPrizes_, prizes_, numFakePrizes_, fakePrizes_, numBoxes_, boxes_, myBox_, numBoxesToSelect_, round_;
function Board (game) {
game_ = game;
seed_ = Number(com.midasplayer.util.GameBase.gameData.get("seed"));
if (Number(com.midasplayer.util.GameBase.gameData.get("standalone")) == 1) {
seed_ = random(134981374);
}
random_ = new com.midasplayer.util.Random(seed_);
init();
}
function init() {
initShelfes();
initPrizes();
initBoxes();
}
function initShelfes() {
shelfes_ = com.midasplayer.game.dealornodeal.Game.gui.attachMovie(_root, "shelfes", "shelfes", _root.getNextHighestDepth());
shelfes_._x = com.midasplayer.game.dealornodeal.Game.gui.getX("shelfes");
shelfes_._y = com.midasplayer.game.dealornodeal.Game.gui.getY("shelfes");
shelfes_._alpha = com.midasplayer.game.dealornodeal.Game.gui.getAlpha("shelfes");
}
function initPrizes() {
numPrizes_ = 26;
prizes_ = new Array();
var _local1 = 0;
while (_local1 < numPrizes_) {
var _local2 = new com.midasplayer.game.dealornodeal.Prize(_local1 + 1);
prizes_[_local1] = _local2;
_local1++;
}
numFakePrizes_ = 10;
fakePrizes_ = new Array();
_local1 = 0;
while (_local1 < numFakePrizes_) {
var _local2 = new com.midasplayer.game.dealornodeal.Prize(0, true);
_local2.setPrizeText(com.midasplayer.util.I18n.format("noprize" + (_local1 + 1)));
fakePrizes_[_local1] = _local2;
_local1++;
}
}
function initBoxes() {
numBoxes_ = 26;
boxes_ = new Array();
var _local1 = 0;
while (_local1 < numBoxes_) {
var _local2 = new com.midasplayer.game.dealornodeal.Box(_local1 + 1);
boxes_[_local1] = _local2;
_local1++;
}
}
function getPrizesLeft() {
var _local3 = new Array();
var _local4 = prizes_.length;
var _local1 = 0;
while (_local1 < _local4) {
var _local2 = com.midasplayer.game.dealornodeal.Prize(prizes_[_local1]);
if (!_local2.isSelected()) {
_local3.push(_local2);
}
_local1++;
}
return(_local3);
}
function getBoxesLeft() {
var _local3 = new Array();
var _local4 = boxes_.length;
var _local1 = 0;
while (_local1 < _local4) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxes_[_local1]);
if (!_local2.isSelected()) {
_local3.push(_local2);
}
_local1++;
}
return(_local3);
}
function getRandomPrize() {
com.midasplayer.util.GameBase.reportPlayData(55, "", "0");
numGeneratedPrizes_++;
if (random_.nextInt(100) <= 10) {
var _local4 = random_.nextInt(numFakePrizes_);
var _local3 = com.midasplayer.game.dealornodeal.Prize(fakePrizes_[_local4]);
} else {
var _local2 = getPrizesLeft();
var _local5 = random_.nextInt(_local2.length);
var _local3 = com.midasplayer.game.dealornodeal.Prize(_local2[_local5]);
}
_local3.setIsPreview(false);
return(_local3);
}
function getRandomPreviewPrize(num) {
num--;
var _local1 = previewPrizesIndex_[num];
var _local3 = com.midasplayer.game.dealornodeal.Prize(prizes_[previewPrizes_[num][_local1]]);
_local1++;
previewPrizesIndex_[num] = _local1;
_local3.setIsPreview(true);
return(_local3);
}
function getNumGeneratedPrizes() {
return(numGeneratedPrizes_);
}
function getPrizes() {
return(prizes_);
}
function toneDown(val) {
toneDownShelfes(val);
toneDownBoxes(val);
}
function toneUp() {
toneUpShelfes();
toneUpBoxes();
}
function toneDownShelfes(val) {
shelfes_._alpha = val;
}
function toneUpShelfes() {
shelfes_._alpha = 100;
}
function toneDownBoxes(val) {
var _local3 = boxes_.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxes_[_local1]);
_local2.toneDown(val);
_local1++;
}
}
function toneUpBoxes() {
var _local3 = boxes_.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxes_[_local1]);
_local2.toneUp();
_local1++;
}
}
function selectOwnBox() {
myBox_ = boxes_[random_.nextInt(boxes_.length)];
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:selectOwnBoxAnim}], callback:endSelectOwnBox, callback_scope:this, tps:50});
}
function selectOwnBoxAnim(tick) {
var _local1 = false;
if ((tick > 40) && (!myBox_.isSelected())) {
myBox_.selectOwnBox();
myBox_.showSelectedOwnBox();
}
if (tick > 70) {
_local1 = true;
}
return(_local1);
}
function endSelectOwnBox() {
ownBoxSelected(myBox_);
}
function ownBoxSelected(box) {
game_.ownBoxSelected(box);
}
function enablePrizes() {
var _local3 = prizes_.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Prize(prizes_[_local1]);
_local2.show();
_local1++;
}
}
function disablePrizes() {
var _local3 = prizes_.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Prize(prizes_[_local1]);
_local2.hide();
_local1++;
}
}
function startRound(roundNum, numBoxes) {
numBoxesToSelect_ = numBoxes;
round_ = new com.midasplayer.game.dealornodeal.Round(game_, roundNum);
}
function endRound() {
round_.stop();
delete round_;
}
function selectBox() {
enableSelectBox();
}
function boxSelected(box) {
disableSelectBox();
box.showSelectedBox();
game_.boxSelected(box);
}
function enableSelectBox() {
return(undefined);
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxes_[_local1]);
_local2.enableSelectBox();
_local1++;
}
}
function disableSelectBox() {
var _local3 = boxes_.length;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxes_[_local1]);
_local2.disableSelectBox();
_local1++;
}
}
static var numGeneratedPrizes_ = 0;
static var previewPrizesIndex_ = [0, 0, 0, 0, 0];
static var previewPrizes_ = [[12, 17, 13, 25, 0, 0, 0], [16, 4, 4], [12, 3, 14, 21], [19, 14, 7, 13], [22, 6, 0]];
}
Symbol 310 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function nextDouble() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
trace("Random::init_genrand(): seed=" + s);
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local6 - _local5)) + "ms");
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
trace(((("Random::genrand_int32(): precalc " + N) + " new numbers ~") + (_local5 - _local4)) + "ms");
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 311 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 312 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 313 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Round] Frame 0
class com.midasplayer.game.dealornodeal.Round implements com.midasplayer.timing.Timeable
{
var game_, roundNum_, time_, random_, clip_, timer_, boxesToOpen_;
function Round (game, roundNum) {
game_ = game;
roundNum_ = roundNum;
time_ = 0;
var _local3 = Number(com.midasplayer.util.GameBase.gameData.get("seed"));
if (Number(com.midasplayer.util.GameBase.gameData.get("standalone")) == 1) {
_local3 = random(134981374);
}
random_ = new com.midasplayer.util.Random(_local3 + roundNum);
initBoxes();
clip_ = _root.createEmptyMovieClip("timer", _root.getNextHighestDepth());
clip_.p = this;
clip_.onEnterFrame = function () {
this.p.timer_.advanceTime();
};
timer_ = new com.midasplayer.timing.Timer(this, 100);
}
function initBoxes() {
selectRandomBoxes();
initOpenTimes();
}
function selectRandomBoxes() {
boxesToOpen_ = new Array();
var _local7 = com.midasplayer.game.dealornodeal.Game.getRoundNumBoxes(roundNum_);
var _local6 = com.midasplayer.game.dealornodeal.Game.board.getBoxesLeft();
var _local4 = 0;
while (_local4 < _local7) {
var _local5 = random_.nextInt(_local6.length);
var _local2 = com.midasplayer.game.dealornodeal.Box(_local6[_local5]);
var _local3 = random_.nextInt(100);
if (_local3 < 30) {
_local2.setType(com.midasplayer.game.dealornodeal.Box.TYPE_ROTATE);
} else if (_local3 < 60) {
_local2.setType(com.midasplayer.game.dealornodeal.Box.TYPE_OPEN_CLOSE);
} else if (_local3 < 70) {
_local2.setType(com.midasplayer.game.dealornodeal.Box.TYPE_ZOOM);
} else if (_local3 < 80) {
_local2.setType(com.midasplayer.game.dealornodeal.Box.TYPE_MEMORY);
} else if (_local3 < 100) {
_local2.setType(com.midasplayer.game.dealornodeal.Box.TYPE_SLOT);
}
boxesToOpen_[_local4] = _local2;
_local6.splice(_local5, 1);
_local4++;
}
}
function initOpenTimes() {
var _local4 = 0;
_local4 = MIN_DELAY_INITIAL + random_.nextInt(MAX_DELAY_INITIAL - MIN_DELAY_INITIAL);
var _local2 = 0;
while (_local2 < boxesToOpen_.length) {
var _local3 = com.midasplayer.game.dealornodeal.Box(boxesToOpen_[_local2]);
_local3.openTime = _local4;
_local4 = _local4 + (300 - (150 * ((roundNum_ - 1) / (com.midasplayer.game.dealornodeal.Game.NUM_ROUNDS - 1))));
_local2++;
}
}
function stop() {
clip_.onEnterFrame = undefined;
delete timer_;
}
function tick(tick) {
time_ = tick;
var _local3 = 0;
while (_local3 < boxesToOpen_.length) {
var _local2 = com.midasplayer.game.dealornodeal.Box(boxesToOpen_[_local3]);
if (_local2.openTime > time_) {
break;
}
if (!_local2.isSelected()) {
_local2.selectBox();
}
_local3++;
}
}
function render(tick, alpha) {
}
var MIN_DELAY_INITIAL = 10;
var MAX_DELAY_INITIAL = 40;
}
Symbol 314 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var gameTicksPerSecond, timeable;
function Timer (timeable, gameTicksPerSecond) {
this.gameTicksPerSecond = gameTicksPerSecond;
millisPerGameTick = 1000 / gameTicksPerSecond;
this.timeable = timeable;
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
if ((tick % gameTicksPerSecond) == 0) {
fps = frames;
frames = 0;
}
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
frames++;
}
var time = 0;
var lastTime = 0;
var unprocessedTime = 0;
var tick = 0;
var millisPerGameTick = 0;
var fps = 0;
var frames = 0;
}
Symbol 315 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Box] Frame 0
class com.midasplayer.game.dealornodeal.Box
{
var myFloat_, number_, clip_, x_, roundNum_, centerX_, centerY_, type_, maxTime, prizeRotater_, isClosed_, isOpened_, numTimesOpenLeft_;
function Box (number) {
myFloat_ = new com.midasplayer.timing.IFloat();
init(number);
}
function init(number) {
if (number == 0) {
isPreview_ = true;
isPreviewClickable_ = false;
number_ = 1;
clip_ = com.midasplayer.game.dealornodeal.Game.gui.attachMovie(_root, "box", "pbox" + number_, _root.getNextHighestDepth());
clip_._x = com.midasplayer.game.dealornodeal.Game.gui.getX("box" + number_);
clip_._y = com.midasplayer.game.dealornodeal.Game.gui.getY("box" + number_);
x_ = clip_._x;
clip_.number.text = number_;
clip_.number_shadow.text = number_;
clip_.box = this;
setType(TYPE_SLOT);
roundNum_ = 3;
} else {
number_ = number;
clip_ = com.midasplayer.game.dealornodeal.Game.gui.attachMovie(_root, "box", "box" + number_, _root.getNextHighestDepth());
clip_._x = com.midasplayer.game.dealornodeal.Game.gui.getX("box" + number);
clip_._y = com.midasplayer.game.dealornodeal.Game.gui.getY("box" + number);
x_ = clip_._x;
clip_.number.text = number;
clip_.number_shadow.text = number;
clip_.box = this;
setType(TYPE_ZOOM);
}
}
function setNumber(number) {
number_ = number;
clip_.number.text = number;
clip_.number_shadow.text = number;
}
function setXPos(x) {
clip_._x = x;
x_ = clip_._x;
}
function setYPos(y) {
clip_._y = y;
}
function getXPos() {
return(clip_._x);
}
function getYPos() {
return(clip_._y);
}
function getCenterX() {
return((clip_._x + centerX_) - 4);
}
function getCenterY() {
return((clip_._y + centerY_) - 4);
}
function setType(type) {
type_ = type;
maxTime = 10;
if (type_ == TYPE_ROTATE) {
maxTime = 10;
}
}
function isSelected() {
return(isSelected_ || (isOwnBox_));
}
function getPrize() {
return(clickedPrize_);
}
function getPrizeIndex() {
return(clickedPrizeIndex_);
}
function getNumber() {
return(number_);
}
function getClickTick() {
return(clickTick_);
}
function getBonus() {
if ((clickedPrize_ == null) || (clickedPrize_ == undefined)) {
return(0);
}
if (clickedPrize_.isFake()) {
return(0);
}
if (clickedPrize_.isSelected()) {
return(0);
}
return(bonus_);
}
function toneDown(val) {
clip_._alpha = val;
}
function toneUp() {
if (!isOwnBox_) {
clip_._alpha = 100;
} else {
clip_._alpha = 100;
}
}
function selectOwnBox() {
isOwnBox_ = true;
}
function showSelectedOwnBox() {
clip_.attachMovie("star", "star", 2);
}
function enableSelectBox() {
}
function disableSelectBox() {
}
function selectBox() {
isSelected_ = true;
disableSelectBox();
roundNum_ = com.midasplayer.game.dealornodeal.Game.getRoundNum();
open();
}
function showSelectedBox() {
clip_.removeMovieClip();
prizeRotater_.removeMovieClip();
}
function isClosed() {
return(isClosed_);
}
function isOpened() {
return(isOpened_);
}
function clickAction(x, y) {
if (type_ == TYPE_ROTATE) {
prizeRotater_.prize1.onPressAction();
}
if (type_ == TYPE_OPEN_CLOSE) {
clip_.prizeshower.onPressAction();
}
if (type_ == TYPE_ZOOM) {
clip_.prizezoomer.prize3.onPressAction();
}
if (type_ == TYPE_MEMORY) {
clip_.prizememory.card3.prize.onPressAction();
}
if (type_ == TYPE_SLOT) {
clip_.prizeslot.scrolling1.prize.onPressAction();
}
}
function moveAction(x, y) {
if (type_ == TYPE_ZOOM) {
var _local5 = x - clip_.prizezoomer._x;
var _local4 = y - clip_.prizezoomer._y;
if (clip_.prizezoomer.hitTest(x, y) && (!clip_.prizezoomer.over)) {
clip_.prizezoomer.over = true;
clip_.prizezoomer.onRollOverAction();
} else if ((!clip_.prizezoomer.hitTest(x, y)) && (clip_.prizezoomer.over)) {
clip_.prizezoomer.over = false;
clip_.prizezoomer.onRollOutAction();
}
clip_.prizezoomer.onMouseMoveAction(x - clip_.prizezoomer.box._x, y - clip_.prizezoomer.box._y);
}
}
function open() {
isOpened_ = true;
shakeOpen();
}
function shakeOpen() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:shakeOpenAnim}], callback:shakeOpenEnd, callback_scope:this, tps:50});
}
function shakeOpenAnim(tick, alpha) {
var _local3 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 30);
if (_local2 == 1) {
_local3 = true;
}
var _local6 = 3;
var _local5 = _local6 * Math.sin(_local2 * Math.PI);
var _local4 = _local5 * Math.sin((_local2 * 10) * Math.PI);
clip_._x = x_ + _local4;
return(_local3);
}
function shakeOpenEnd() {
clip_._x = x_;
boxAction();
}
function openUpAnim(tick, alpha) {
var _local2 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 20);
var _local3 = Math.round(_local4 * 10);
clip_.gotoAndStop(_local3);
clip_.number.text = number_;
clip_.number_shadow.text = number_;
if (_local3 == 10) {
_local2 = true;
}
return(_local2);
}
function boxAction() {
if (type_ == TYPE_ROTATE) {
rotatePrizesAction();
}
if (type_ == TYPE_OPEN_CLOSE) {
openClosePrizesAction();
}
if (type_ == TYPE_ZOOM) {
zoomPrizesAction();
}
if (type_ == TYPE_MEMORY) {
memoryPrizesAction();
}
if (type_ == TYPE_SLOT) {
slotPrizesAction();
}
}
function endBoxAction() {
if (!isClosed_) {
isClosed_ = true;
closeDown();
}
}
function closeDown() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:closeDownAnim}], callback:closeDownEnd, callback_scope:this, tps:50});
}
function closeDownAnim(tick, alpha) {
var _local2 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 20);
var _local3 = Math.round(10 - (_local4 * 10));
clip_.gotoAndStop(_local3);
clip_.number.text = number_;
clip_.number_shadow.text = number_;
if (_local3 <= 1) {
_local2 = true;
}
return(_local2);
}
function closeDownEnd() {
if (isPreview_) {
showSelectedBox();
return(undefined);
}
com.midasplayer.game.dealornodeal.Game.board.boxSelected(this);
}
function slotPrizesAction() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:openUpAnim}], callback:slotPrizes, callback_scope:this, tps:50});
if (!isPreview_) {
com.midasplayer.fx.SoundManager.play("Good Case Opening 3", 30);
}
}
function slotPrizes() {
centerX_ = clip_.prize._x + (clip_.prize._width / 2);
centerY_ = clip_.prize._y + (clip_.prize._height / 2);
clip_.attachMovie("prizeslot", "prizeslot", clip_.getNextHighestDepth());
clip_.prizeslot._x = clip_.prize._x + 1;
clip_.prizeslot._y = clip_.prize._y;
clip_.prizeslot.frame._visible = false;
clip_.prizeslot.hilight._visible = false;
if ((!isPreview_) || (isPreviewClickable_)) {
clip_.prizeslot.box.onRollOver = function () {
this._parent.hilight._visible = true;
};
clip_.prizeslot.box.onRollOut = function () {
this._parent.hilight._visible = false;
};
clip_.prizeslot.box.onPress = function () {
this._parent.scrolling1.prize.onPress();
};
}
clip_.takenPrizes = new Array();
clip_.firstSpin = true;
clip_.prizeGenerated = false;
var _local2 = new Array();
_local2.push([{obj:this, func:slotPrizesRollAnim}]);
_local2.push([{obj:this, func:slotPrizesRollAnim}]);
_local2.push([{obj:this, func:slotPrizesRollAnim}]);
_local2.push([{obj:this, func:slotPrizesAnim}]);
com.midasplayer.util.AnimPlayer.play({playlist:_local2, callback:endSlotPrizes, callback_scope:this, tps:50});
}
function slotPrizesRollAnim(tick, alpha) {
if (clip_.noMoreSpin) {
return(true);
}
if (clip_.prizeGenerated == false) {
if (clip_.firstSpin) {
fixRandomPrize(clip_.prizeslot.scrolling1.prize, undefined, clip_.takenPrizes);
clip_.prizeGenerated = true;
} else if ((tick > 50) && (clickedPrize_ == null)) {
fixRandomPrize(clip_.prizeslot.scrolling1.prize, undefined, clip_.takenPrizes);
clip_.prizeGenerated = true;
}
}
var _local3 = 0;
if ((clickedPrize_ != null) && (clip_.tickAdd == undefined)) {
var _local2 = clip_.prizeslot.scrolling1._y;
if ((tick < 110) && ((_local2 > 30) || (_local2 < -10))) {
clip_.tickAdd = (150 - tick) - 40;
_local3 = clip_.tickAdd;
}
}
if (clip_.tickAdd != undefined) {
_local3 = clip_.tickAdd;
}
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent((tick + alpha) + _local3, 0, 150);
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent((tick + alpha) + _local3, 150, 80);
var _local7 = 6;
_local4 = 1 - ((1 - _local4) * (1 - _local4));
var _local2 = _local4 * ((80 * _local7) + 48);
if (_local2 < (80 * _local7)) {
clip_.prizeslot.scrolling1.scroll._visible = true;
clip_.prizeslot.scrolling1.prize._visible = false;
} else {
clip_.prizeslot.scrolling1.scroll._visible = false;
clip_.prizeslot.scrolling1.prize._visible = true;
}
_local2 = _local2 % 80;
_local2 = -40 + _local2;
if ((_local2 > -30) && (_local2 < 5)) {
var _local8 = (_local2 - -30) / 35;
clip_.prizeslot.scrolling1.scroll._yscale = 100 * _local8;
clip_.prizeslot.scrolling1.prize._yscale = 100 * _local8;
} else if ((_local2 > 15) && (_local2 < 50)) {
var _local8 = (35 - (_local2 - 15)) / 35;
clip_.prizeslot.scrolling1.scroll._yscale = 100 * _local8;
clip_.prizeslot.scrolling1.prize._yscale = 100 * _local8;
}
clip_.prizeslot.scrolling1._y = _local2;
if ((_local6 > 0.2) && (clickedPrize_ != null)) {
clip_.noMoreSpin = true;
return(true);
}
if (_local6 == 1) {
clip_.firstSpin = false;
clip_.prizeGenerated = false;
}
return(_local6 == 1);
}
function slotPrizesAnim(tick, alpha) {
var _local3 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 10, 40);
var _local8 = 3;
var _local7 = _local8 * Math.sin(_local4 * Math.PI);
var _local5 = _local7 * Math.sin((_local4 * 8) * Math.PI);
clip_._x = x_ + _local5;
if (clickedPrize_ != null) {
var _local2 = 50 - Math.round(tick / 5);
_local2 = Math.max(0, _local2);
clickedPrize_.feedback(this, _local2);
clickTick_ = tick;
bonus_ = _local2;
_local3 = true;
}
if (_local4 == 1) {
_local3 = true;
}
return(_local3);
}
function endSlotPrizes() {
clip_.prizeslot.removeMovieClip();
endBoxAction();
}
function memoryPrizesAction() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:openUpAnim}], callback:memoryPrizes, callback_scope:this, tps:50});
if (!isPreview_) {
com.midasplayer.fx.SoundManager.play("Good Case Opening TP 1", 30);
}
}
function memoryPrizes() {
centerX_ = clip_.prize._x + (clip_.prize._width / 2);
centerY_ = clip_.prize._y + (clip_.prize._height / 2);
clip_.attachMovie("prizememory", "prizememory", clip_.getNextHighestDepth());
clip_.prizememory._x = clip_.prize._x;
clip_.prizememory._y = clip_.prize._y;
clip_.prizememory.card1.prize._visible = false;
clip_.prizememory.card2.prize._visible = false;
clip_.prizememory.card3.prize._visible = false;
clip_.prizememory.card4.prize._visible = false;
var _local3 = new Array();
fixRandomPrize(clip_.prizememory.card1.prize, undefined, _local3);
fixRandomPrize(clip_.prizememory.card2.prize, undefined, _local3);
fixRandomPrize(clip_.prizememory.card3.prize, undefined, _local3);
fixRandomPrize(clip_.prizememory.card4.prize, undefined, _local3);
setPrizeClickable(clip_.prizememory.card1.prize, false);
setPrizeClickable(clip_.prizememory.card2.prize, false);
setPrizeClickable(clip_.prizememory.card3.prize, false);
setPrizeClickable(clip_.prizememory.card4.prize, false);
var _local2 = new Array();
_local2.push([{obj:this, func:memoryPrizesZoomAnim, params:{card:clip_.prizememory.card1}}]);
_local2.push([{obj:this, func:memoryPrizesFlipAnim, params:{card:clip_.prizememory.card1}}]);
_local2.push([{obj:this, func:memoryPrizesZoomAnim, params:{card:clip_.prizememory.card2}}]);
_local2.push([{obj:this, func:memoryPrizesFlipAnim, params:{card:clip_.prizememory.card2}}]);
_local2.push([{obj:this, func:memoryPrizesZoomAnim, params:{card:clip_.prizememory.card3}}]);
_local2.push([{obj:this, func:memoryPrizesFlipAnim, params:{card:clip_.prizememory.card3}}]);
_local2.push([{obj:this, func:memoryPrizesZoomAnim, params:{card:clip_.prizememory.card4}}]);
_local2.push([{obj:this, func:memoryPrizesFlipAnim, params:{card:clip_.prizememory.card4}}]);
_local2.push([{obj:this, func:memoryPrizesSelectableAnim}]);
_local2.push([{obj:this, func:memoryPrizesAnim}]);
_local2.push([{obj:this, func:memoryPrizesAnim2}]);
com.midasplayer.util.AnimPlayer.play({playlist:_local2, callback:endMemoryPrizes, callback_scope:this, tps:50});
}
function memoryPrizesZoomAnim(tick, alpha, params) {
var _local10 = false;
var _local3 = params.card.prize;
var _local2 = params.card;
var _local5 = 40;
var _local4 = 17;
var _local7 = _local2._x + 20;
var _local6 = _local2._y + 13.5;
_local3._visible = true;
if (_local2.swapped == undefined) {
_local2.swapDepths(4);
_local2.swapped = true;
}
var _local1 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 20, 30);
_local1 = 1 - ((1 - _local1) * (1 - _local1));
_local3._xscale = 100 - (60 * _local1);
_local3._yscale = 100 - (60 * _local1);
var _local9 = ((_local5 - _local2._x) - 39) + ((78 - _local3._width) / 2);
var _local8 = ((_local4 - _local2._y) - 14) + ((28 - _local3._height) / 2);
_local3._x = _local9 + ((_local7 - _local5) * _local1);
_local3._y = _local8 + ((_local6 - _local4) * _local1);
return(_local1 == 1);
}
function memoryPrizesFlipAnim(tick, alpha, params) {
var _local1 = params.card;
if (_local1.origY == undefined) {
_local1.origY = _local1._y;
}
if (_local1.origHeight == undefined) {
_local1.origHeight = _local1._height;
}
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 10);
var _local2 = 1 - com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 10, 10);
if (_local2 < 1) {
_local1.gotoAndStop(2);
_local1.prize._visible = false;
_local1._yscale = 100 - (100 * _local2);
_local1._y = _local1.origY + ((_local1.origHeight - _local1._height) / 2);
} else {
_local1._yscale = 100 - (100 * _local3);
_local1._y = _local1.origY + ((_local1.origHeight - _local1._height) / 2);
}
return(_local2 == 0);
}
function memoryPrizesSelectableAnim(tick, alpha, params) {
if (clip_.prizememory.card1.onPress == undefined) {
setPrizeClickable(clip_.prizememory.card1.prize, true);
setPrizeClickable(clip_.prizememory.card2.prize, true);
setPrizeClickable(clip_.prizememory.card3.prize, true);
setPrizeClickable(clip_.prizememory.card4.prize, true);
if ((!isPreview_) || (isPreviewClickable_)) {
clip_.prizememory.card1.onPress = function () {
this.prize.onPress();
};
clip_.prizememory.card1.onRollOver = function () {
this.gotoAndStop(3);
};
clip_.prizememory.card1.onRollOut = function () {
this.gotoAndStop(2);
};
clip_.prizememory.card2.onPress = function () {
this.prize.onPress();
};
clip_.prizememory.card2.onRollOver = function () {
this.gotoAndStop(3);
};
clip_.prizememory.card2.onRollOut = function () {
this.gotoAndStop(2);
};
clip_.prizememory.card3.onPress = function () {
this.prize.onPress();
};
clip_.prizememory.card3.onRollOver = function () {
this.gotoAndStop(3);
};
clip_.prizememory.card3.onRollOut = function () {
this.gotoAndStop(2);
};
clip_.prizememory.card4.onPress = function () {
this.prize.onPress();
};
clip_.prizememory.card4.onRollOver = function () {
this.gotoAndStop(3);
};
clip_.prizememory.card4.onRollOut = function () {
this.gotoAndStop(2);
};
}
}
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 30);
if ((_local2 < 0.3) || ((_local2 > 0.6) && (_local2 < 0.9))) {
clip_.prizememory.card1.gotoAndStop(3);
clip_.prizememory.card2.gotoAndStop(3);
clip_.prizememory.card3.gotoAndStop(3);
clip_.prizememory.card4.gotoAndStop(3);
} else {
clip_.prizememory.card1.gotoAndStop(2);
clip_.prizememory.card2.gotoAndStop(2);
clip_.prizememory.card3.gotoAndStop(2);
clip_.prizememory.card4.gotoAndStop(2);
}
if (clickedPrize_ != null) {
return(true);
}
return(_local2 == 1);
}
function memoryPrizesAnim(tick, alpha) {
var _local3 = false;
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, (maxTime * 50) - 80, 40);
var _local8 = 3;
var _local7 = _local8 * Math.sin(_local4 * Math.PI);
var _local6 = _local7 * Math.sin((_local4 * 8) * Math.PI);
clip_._x = x_ + _local6;
if (clickedPrize_ != null) {
var _local2 = 50 - Math.round(tick / 5);
_local2 = Math.max(0, _local2);
clickedPrize_.feedback(this, _local2);
clickTick_ = tick;
bonus_ = _local2;
_local3 = true;
}
if (tick >= (maxTime * 50)) {
_local3 = true;
}
return(_local3);
}
function memoryPrizesAnim2(tick, alpha) {
if (clickedPrize_ == null) {
return(true);
}
clip_.prizememory.card1.card._visible = false;
clip_.prizememory.card2.card._visible = false;
clip_.prizememory.card3.card._visible = false;
clip_.prizememory.card4.card._visible = false;
clickedPrizeClip_._visible = true;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 10);
var _local9 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 25);
_local2 = ((1 - _local2) * (1 - _local2)) * (1 - _local2);
var _local3 = clickedPrizeClip_;
var _local4 = _local3._parent;
var _local6 = 40;
var _local5 = 17;
var _local8 = _local4._x + 20;
var _local7 = _local4._y + 13.5;
var _local11 = ((_local6 - _local4._x) - 39) + ((78 - _local3._width) / 2);
var _local10 = ((_local5 - _local4._y) - 14) + ((28 - _local3._height) / 2);
_local3._x = _local11 + ((_local8 - _local6) * _local2);
_local3._y = _local10 + ((_local7 - _local5) * _local2);
_local3._xscale = 100 - (60 * _local2);
_local3._yscale = 100 - (60 * _local2);
return(_local9 == 1);
}
function endMemoryPrizes() {
clip_.prizememory.removeMovieClip();
endBoxAction();
}
function zoomPrizesAction() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:openUpAnim}], callback:zoomPrizes, callback_scope:this, tps:50});
if (!isPreview_) {
com.midasplayer.fx.SoundManager.play("Good Case Opening TP 1", 30);
}
}
function zoomPrizes() {
centerX_ = clip_.prize._x + (clip_.prize._width / 2);
centerY_ = clip_.prize._y + (clip_.prize._height / 2);
clip_.attachMovie("prizezoomer", "prizezoomer", clip_.getNextHighestDepth());
var _local2 = new Array();
fixRandomPrize(clip_.prizezoomer.prize1, undefined, _local2);
fixRandomPrize(clip_.prizezoomer.prize2, undefined, _local2);
fixRandomPrize(clip_.prizezoomer.prize3, undefined, _local2);
fixRandomPrize(clip_.prizezoomer.prize4, undefined, _local2);
com.midasplayer.game.dealornodeal.Game.gui.attachMovie(clip_, "boxclip", "boxcopy", clip_.getNextHighestDepth());
clip_.boxcopy._y = -27;
clip_.boxcopy.number.text = number_;
clip_.boxcopy._visible = false;
clip_.attachMovie("prizezoomermask", "prizezoomermask1", clip_.getNextHighestDepth());
clip_.attachMovie("prizezoomer", "prizezoomerfull", clip_.getNextHighestDepth());
clip_.prizezoomerfull.prize1.txt.text = clip_.prizezoomer.prize1.txt.text;
clip_.prizezoomerfull.prize2.txt.text = clip_.prizezoomer.prize2.txt.text;
clip_.prizezoomerfull.prize3.txt.text = clip_.prizezoomer.prize3.txt.text;
clip_.prizezoomerfull.prize4.txt.text = clip_.prizezoomer.prize4.txt.text;
clip_.prizezoomer.prize1.txt.text = "? ???,???";
clip_.prizezoomer.prize2.txt.text = "? ???,???";
clip_.prizezoomer.prize3.txt.text = "? ???,???";
clip_.prizezoomer.prize4.txt.text = "? ???,???";
clip_.prizezoomerfull._visible = false;
clip_.prizezoomerfull._x = clip_.prize._x;
clip_.prizezoomerfull._y = clip_.prize._y;
clip_.prizezoomerfull._x1 = clip_.prize._x;
clip_.prizezoomerfull._y1 = clip_.prize._y;
clip_.prizezoomer._x = clip_.prize._x;
clip_.prizezoomer._y = clip_.prize._y;
clip_.prizezoomer._xscale = 20;
clip_.prizezoomer._yscale = 20;
clip_.prizezoomermask1._x = clip_.prize._x;
clip_.prizezoomermask1._y = clip_.prize._y;
clip_.prizezoomermask1._xscale = 20;
clip_.prizezoomermask1._yscale = 20;
clip_.prizezoomer.box = clip_;
clip_.prizezoomer.onRollOverAction = function () {
if (this.glas == undefined) {
this.box.attachMovie("glas", "glas", this.box.getNextHighestDepth());
this.box.glas.setMask(this.box.prizezoomermask1);
this.box.glas.attachMovie("glas", "mask", this.box.glas.getNextHighestDepth());
this.box.glas.mask._visible = false;
this.box.glas.attachMovie("glas", "mask2", this.box.glas.getNextHighestDepth());
this.box.glas.mask2._visible = false;
this.box.boxcopy.setMask(this.box.glas.mask2);
this.box.boxcopy._visible = true;
this.box.prizezoomerfull._visible = true;
this.box.prizezoomerfull.setMask(this.box.glas.mask);
this.onMouseMove();
}
};
clip_.prizezoomer.onRollOutAction = function () {
this.box.prizezoomerfull._visible = false;
this.box.glas.removeMovieClip();
this.box.prizezoomer.setMask(null);
this.box.boxcopy.setMask(null);
this.box.boxcopy._visible = false;
};
clip_.prizezoomer.onMouseMoveAction = function (x, y) {
if (this.box.glas != undefined) {
this.box.glas._x = x;
this.box.glas._y = y;
this.box.prizezoomerfull._x = this.box.prizezoomerfull._x1 - ((this.box.glas._x - this.box.prizezoomerfull._x1) * 4);
this.box.prizezoomerfull._y = this.box.prizezoomerfull._y1 - ((this.box.glas._y - this.box.prizezoomerfull._y1) * 4);
}
};
clip_.prizezoomer.onPressAction = function () {
if (this.box.prizezoomerfull.prize1.hitTest(this.box.glas)) {
this.box.prizezoomer.prize1.onPress();
} else if (this.box.prizezoomerfull.prize2.hitTest(this.box.glas)) {
this.box.prizezoomer.prize2.onPress();
} else if (this.box.prizezoomerfull.prize3.hitTest(this.box.glas)) {
this.box.prizezoomer.prize3.onPress();
} else if (this.box.prizezoomerfull.prize4.hitTest(this.box.glas)) {
this.box.prizezoomer.prize4.onPress();
}
};
if ((!isPreview_) || (isPreviewClickable_)) {
clip_.prizezoomer.onRollOver = (clip_.prizezoomer.onDragOver = function () {
this.onRollOverAction();
});
clip_.prizezoomer.onRollOut = (clip_.prizezoomer.onDragOut = function () {
this.onRollOutAction();
});
clip_.prizezoomer.onMouseMove = function () {
this.onMouseMoveAction(this.box._xmouse, this.box._ymouse);
};
clip_.prizezoomer.onPress = function () {
this.onPressAction();
};
}
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:zoomPrizesAnim}], callback:endZoomPrizes, callback_scope:this, tps:50});
}
function zoomPrizesAnim(tick, alpha) {
var _local5 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, (maxTime * 50) - 80, 40);
var _local8 = 3;
var _local7 = _local8 * Math.sin(_local2 * Math.PI);
var _local4 = _local7 * Math.sin((_local2 * 8) * Math.PI);
clip_._x = x_ + _local4;
if (clickedPrize_ != null) {
var _local3 = 50 - Math.round(tick / 5);
_local3 = Math.max(0, _local3);
clickedPrize_.feedback(this, _local3);
clickTick_ = tick;
bonus_ = _local3;
_local5 = true;
}
if (tick >= (maxTime * 50)) {
_local5 = true;
}
_local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, (maxTime * 50) - 80, 40);
_local8 = 3;
_local7 = _local8 * Math.sin(_local2 * Math.PI);
_local4 = _local7 * Math.sin((_local2 * 8) * Math.PI);
clip_._x = x_ + _local4;
return(_local5);
}
function endZoomPrizes() {
clip_.prizezoomer.onMouseMove = undefined;
clip_.prizezoomer.removeMovieClip();
clip_.prizezoomerfull.removeMovieClip();
clip_.glas.removeMovieClip();
endBoxAction();
}
function openClosePrizesAction() {
numTimesOpenLeft_ = 4;
openClosePrizesOpen();
if (!isPreview_) {
com.midasplayer.fx.SoundManager.play("Good Case Opening AC 4c", 30);
}
}
function openClosePrizesOpen() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:openUpAnim}], callback:showPrize, callback_scope:this, tps:50});
}
function showPrize() {
centerX_ = clip_.prize._x + (clip_.prize._width / 2);
centerY_ = clip_.prize._y + (clip_.prize._height / 2);
clip_.attachMovie("prizeshower", "prizeshower", clip_.getNextHighestDepth());
clip_.prizeshower._x = clip_.prize._x;
clip_.prizeshower._y = clip_.prize._y;
clip_.prizeshower._visible = false;
fixRandomPrize(clip_.prizeshower);
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showPrizeAnim}], callback:endShowPrize, callback_scope:this, tps:50});
}
function showPrizeAnim(tick, alpha) {
var _local5 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 20);
var _local4 = 60 + (40 * (_local2 * _local2));
clip_.prizeshower._visible = true;
clip_.prizeshower._xscale = _local4;
clip_.prizeshower._yscale = _local4;
clip_.prizeshower._x = clip_.prize._x + ((clip_.prize._width - clip_.prizeshower._width) / 2);
clip_.prizeshower._y = clip_.prize._y + ((clip_.prize._height - clip_.prizeshower._height) / 2);
if (clickedPrize_ != null) {
var _local6 = (4 - numTimesOpenLeft_) * (120 - ((50 * roundNum_) / com.midasplayer.game.dealornodeal.Game.NUM_ROUNDS));
_local6 = _local6 + tick;
var _local3 = 50 - Math.round(_local6 / 5);
_local3 = Math.max(0, _local3);
clickedPrize_.feedback(this, _local3);
clickTick_ = _local6;
bonus_ = _local3;
_local5 = true;
}
var _local6 = 120 - ((50 * roundNum_) / com.midasplayer.game.dealornodeal.Game.NUM_ROUNDS);
if (tick > _local6) {
_local5 = true;
}
if (numTimesOpenLeft_ == 1) {
_local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, _local6 - 60, 40);
var _local9 = 3;
var _local8 = _local9 * Math.sin(_local2 * Math.PI);
_local4 = _local8 * Math.sin((_local2 * 8) * Math.PI);
clip_._x = x_ + _local4;
}
return(_local5);
}
function endShowPrize() {
clip_.prizeshower.removeMovieClip();
openClosePrizesClose();
}
function openClosePrizesClose() {
numTimesOpenLeft_--;
if (clickedPrize_ || (numTimesOpenLeft_ == 0)) {
endBoxAction();
} else {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:closeDownAnim}], callback:openClosePrizesOpen, callback_scope:this, tps:50});
}
}
function rotatePrizesAction() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:openUpAnim}], callback:rotatePrizes, callback_scope:this, tps:50});
if (!isPreview_) {
com.midasplayer.fx.SoundManager.play("Good Case Opening 3", 30);
}
}
function rotatePrizes() {
centerX_ = clip_.prize._x + (clip_.prize._width / 2);
centerY_ = clip_.prize._y + (clip_.prize._height / 2);
prizeRotater_ = clip_.attachMovie("prizerotater", "prizerotater", clip_.getNextHighestDepth());
prizeRotater_._x = clip_.prize._x;
prizeRotater_._y = clip_.prize._y;
prizeRotater_.prize1._oy = prizeRotater_.prize1._y;
prizeRotater_.prize2._oy = prizeRotater_.prize2._y;
fixRandomPrize(prizeRotater_.prize1);
fixRandomPrize(prizeRotater_.prize2);
myFloat_.set(0);
if (isPreview_) {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:rotatePrizesAnimPreview}], callback:endRotatePrizes, callback_scope:this, tps:50});
} else {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:rotatePrizesAnim}], callback:endRotatePrizes, callback_scope:this, tps:50});
}
}
function rotatePrizesAnim(tick, alpha) {
var _local4 = false;
var _local3 = 1.1;
_local3 = _local3 + (com.midasplayer.game.dealornodeal.Game.getRoundNum() / 3);
_local3 = _local3 + (tick / 1000);
prizeRotater_.prize1._y = prizeRotater_.prize1._y - _local3;
prizeRotater_.prize2._y = prizeRotater_.prize2._y - _local3;
if ((prizeRotater_.prize1._y + prizeRotater_.prize1._height) < 0) {
prizeRotater_.prize1._y = prizeRotater_.prize1._y + (prizeRotater_.prize1._height * 2);
fixRandomPrize(prizeRotater_.prize1);
}
if ((prizeRotater_.prize2._y + prizeRotater_.prize2._height) < 0) {
prizeRotater_.prize2._y = prizeRotater_.prize2._y + (prizeRotater_.prize1._height * 2);
fixRandomPrize(prizeRotater_.prize2);
}
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, (maxTime * 50) - 80, 40);
var _local9 = 3;
var _local8 = _local9 * Math.sin(_local6 * Math.PI);
var _local7 = _local8 * Math.sin((_local6 * 8) * Math.PI);
clip_._x = x_ + _local7;
if (clickedPrize_ != null) {
var _local2 = 50 - Math.round(tick / 5);
_local2 = Math.max(0, _local2);
clickedPrize_.feedback(this, _local2);
clickTick_ = tick;
bonus_ = _local2;
_local4 = true;
}
if (tick >= (maxTime * 50)) {
_local4 = true;
}
return(_local4);
}
function rotatePrizesAnimPreview(tick, alpha) {
var _local8 = false;
var _local10 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, maxTime * 50);
var _local12 = roundNum_ * 213.333333333333;
_local10 = 0.7 * _local10;
var _local6 = _local10 * _local12;
var _local5 = prizeRotater_.prize1._oy - _local6;
var _local3 = prizeRotater_.prize2._oy - _local6;
var _local7 = prizeRotater_.prize1._height;
var _local2 = prizeRotater_.prize1._height * 2;
_local5 = ((((_local5 + _local7) % _local2) + _local2) % _local2) - _local7;
_local3 = ((((_local3 + _local7) % _local2) + _local2) % _local2) - _local7;
if ((prizeRotater_.prize1._y < 0) && (_local5 > 0)) {
fixRandomPrize(prizeRotater_.prize1);
}
if ((prizeRotater_.prize2._y < 0) && (_local3 > 0)) {
fixRandomPrize(prizeRotater_.prize2);
}
prizeRotater_.prize1._y = _local5;
prizeRotater_.prize2._y = _local3;
var _local11 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, (maxTime * 50) - 80, 40);
var _local14 = 3;
var _local13 = _local14 * Math.sin(_local11 * Math.PI);
_local6 = _local13 * Math.sin((_local11 * 8) * Math.PI);
clip_._x = x_ + _local6;
if (clickedPrize_ != null) {
var _local4 = 50 - Math.round(tick / 5);
_local4 = Math.max(0, _local4);
clickedPrize_.feedback(this, _local4);
clickTick_ = tick;
bonus_ = _local4;
_local8 = true;
}
if (tick >= (maxTime * 50)) {
_local8 = true;
}
return(_local8);
}
function endRotatePrizes() {
prizeRotater_.removeMovieClip();
endBoxAction();
}
function fixRandomPrize(prize, pr, takenPrizes) {
var _local5;
if (pr == undefined) {
if (isPreview_) {
_local5 = com.midasplayer.game.dealornodeal.Game.board.getRandomPreviewPrize(number_);
} else {
_local5 = com.midasplayer.game.dealornodeal.Game.board.getRandomPrize();
}
}
if (takenPrizes != undefined) {
var _local3 = false;
var _local7 = takenPrizes.length;
while (!_local3) {
var _local4 = _local5.getPrizeText();
_local3 = true;
var _local2 = 0;
while (_local2 < _local7) {
if (takenPrizes[_local2] == _local4) {
_local3 = false;
}
_local2++;
}
if (!_local3) {
if (isPreview_) {
_local5 = com.midasplayer.game.dealornodeal.Game.board.getRandomPreviewPrize();
} else {
_local5 = com.midasplayer.game.dealornodeal.Game.board.getRandomPrize();
}
}
}
takenPrizes.push(_local5.getPrizeText());
}
prize.prizeObject = _local5;
prize.boxObject = this;
prize.prizeIndex = com.midasplayer.game.dealornodeal.Game.board.getNumGeneratedPrizes() - 1;
prize.txt.text = _local5.getPrizeText();
setPrizeClickable(prize, true);
}
function setPrizeClickable(prize, b) {
prize.onPressAction = function () {
trace(("\t\t[" + _root.tick) + ",-1,-1],");
var _local3 = this.boxObject;
_local3.clickedPrizeIndex_ = this.prizeIndex;
_local3.clickedPrize_ = this.prizeObject;
_local3.clickedPrizeClip_ = this;
};
if (isPreview_) {
b = isPreviewClickable_;
}
if (b) {
prize.onPress = function () {
this.onPressAction();
};
} else {
prize.onPress = undefined;
prize.useHandCursor = false;
}
}
static var TYPE_ROTATE = 1;
static var TYPE_OPEN_CLOSE = 2;
static var TYPE_ZOOM = 3;
static var TYPE_MEMORY = 4;
static var TYPE_SLOT = 5;
var isOwnBox_ = false;
var isSelected_ = false;
var prizeIndex_ = 0;
var clickedPrize_ = null;
var clickedPrizeClip_ = null;
var clickedPrizeIndex_ = -1;
var clickTick_ = 500;
var bonus_ = 0;
var isPreview_ = false;
var isPreviewClickable_ = false;
}
Symbol 316 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Prize] Frame 0
class com.midasplayer.game.dealornodeal.Prize
{
var isFake_, number_, sum_, prizeText_, clip_, markerClip_, selected_;
function Prize (number, isFake) {
isFake_ = isFake;
init(number);
}
function init(number) {
if (isFake_) {
number_ = -1;
sum_ = 0;
} else {
number_ = number;
prizeText_ = com.midasplayer.util.I18n.format("prize" + number);
sum_ = Number(com.midasplayer.util.GameBase.gameData.get(("prize." + number) + ".sum"));
clip_ = com.midasplayer.game.dealornodeal.Game.gui.attachMovie(_root, "prize" + number, "prize" + number, _root.getNextHighestDepth());
clip_._x = com.midasplayer.game.dealornodeal.Game.gui.getX("prize" + number);
clip_._y = com.midasplayer.game.dealornodeal.Game.gui.getY("prize" + number);
clip_.number.text = prizeText_;
clip_.box = this;
com.midasplayer.game.dealornodeal.Game.gui.attachMovie(clip_, "prizetag", "tag", clip_.getNextHighestDepth());
markerClip_ = com.midasplayer.game.dealornodeal.Game.gui.attachMovie(_root, "prizemarker", "prizemarker" + number, _root.getNextHighestDepth());
if (com.midasplayer.game.dealornodeal.Game.lang == "en") {
if (number <= 13) {
markerClip_._x = clip_._x + 8;
markerClip_._y = clip_._y + 3;
} else {
markerClip_._x = clip_._x + 4;
markerClip_._y = clip_._y + 2;
}
} else if (number <= 13) {
clip_.tag._x = 8;
clip_.tag._y = 5;
markerClip_._x = clip_._x + 4.5;
markerClip_._y = clip_._y + 3.3;
} else {
clip_.tag._x = 23;
clip_.tag._y = 5;
markerClip_._x = clip_._x + 22.5;
markerClip_._y = clip_._y + 3.3;
}
clip_.tag.txt.text = prizeText_;
clip_._alpha = 0;
}
}
function hide() {
clip_._alpha = 0;
}
function show() {
clip_._alpha = 100;
}
function getNumber() {
return(number_);
}
function getPrizeText() {
return(prizeText_);
}
function setPrizeText(t) {
prizeText_ = t;
}
function getSum() {
return(sum_);
}
function feedback(box, bonus) {
if (isPreview_) {
return(undefined);
}
if (isFake_) {
com.midasplayer.fx.SoundManager.play("bad case", 140);
} else if (isSelected()) {
com.midasplayer.fx.SoundManager.play("bad case", 140);
markerClip_.gotoAndPlay(2);
} else {
com.midasplayer.fx.SoundManager.play("clear case");
}
var _local2 = new com.midasplayer.game.dealornodeal.PrizePopup(box, this, bonus);
clip_._alpha = 30;
}
function selected() {
selected_ = true;
}
function isFake() {
return(isFake_);
}
function isSelected() {
return(selected_);
}
function setIsPreview(b) {
isPreview_ = b;
}
var isPreview_ = false;
}
Symbol 317 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
function SoundManager () {
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if (_local1 == undefined) {
var _local3 = new Array();
_local3.push(resource);
initialize(_local3);
}
_local1 = sounds.get(resource);
if (_local1 != undefined) {
var _local2 = percent;
_local1.sound.setVolume(_local2);
_local1.sound.volume = _local2;
}
}
static function getVolume(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
return(_local1.sound.getVolume());
}
return(100);
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local9 in list) {
var resource = list[_local9];
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:false});
}
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = getVolume(resource);
}
if (isLoop == undefined) {
isLoop = false;
}
var _local2 = sounds.get(resource);
if (_local2 != undefined) {
_local2.sound.setVolume((soundEnabled ? (volume) : 0));
_local2.realVol = volume;
_local2.playStatus = true;
_local2.onPlayedFn = fn;
_local2.sound.start(0, (isLoop ? 32767 : 1));
} else {
var _local6 = _root.getNextHighestDepth();
var _local3 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local6, _local6));
_local3.attachSound(resource);
_local3.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local3.setVolume((soundEnabled ? (volume) : 0));
_local3.start(0, (isLoop ? 32767 : 1));
sounds.put(resource, {realVol:volume, onPlayedFn:fn, sound:_local3, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 318 MovieClip [__Packages.com.midasplayer.game.dealornodeal.PrizePopup] Frame 0
class com.midasplayer.game.dealornodeal.PrizePopup
{
var clip_, y_;
function PrizePopup (box, prize, bonus) {
clip_ = _root.attachMovie("prizepopup", "pp", _root.getNextHighestDepth());
if (prize.isFake()) {
clip_.gotoAndStop(2);
clip_.txt.text = com.midasplayer.util.I18n.format("prize_not_available");
} else if (prize.isSelected()) {
clip_.gotoAndStop(2);
clip_.txt.text = com.midasplayer.util.I18n.format("prize_already_removed");
} else {
clip_.gotoAndStop(1);
clip_.txt.text = com.midasplayer.util.I18n.format("prize_removed");
if (bonus > 0) {
clip_.txt.text = com.midasplayer.util.I18n.format("prize_removed_with_bonus", "" + bonus);
}
}
clip_._x = box.getCenterX();
clip_._y = box.getCenterY();
y_ = clip_._y;
clip_._alpha = 0;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showScore}], callback:endShowScore, callback_scope:this, tps:60});
}
function showScore(tick, alpha) {
var _local5 = false;
alpha = 0;
var _local4 = 0;
tick = tick - 15;
if (tick < 0) {
return(false);
}
if (tick < 20) {
alpha = (tick * tick) / 4;
_local4 = 5 * (alpha / 100);
} else if (tick < 50) {
alpha = 100;
_local4 = 5;
} else if (tick < 70) {
alpha = ((70 - tick) * (70 - tick)) / 4;
_local4 = 5 + (5 * ((100 - alpha) / 100));
} else {
alpha = 0;
_local4 = 10;
_local5 = true;
}
clip_._alpha = alpha;
clip_._y = y_ - _local4;
return(_local5);
}
function endShowScore() {
clip_.removeMovieClip();
}
}
Symbol 319 MovieClip [__Packages.com.midasplayer.util.AnimPlayer] Frame 0
class com.midasplayer.util.AnimPlayer
{
static var clip_;
function AnimPlayer () {
}
static function staticInitializer(Void) {
clip_ = _root.createEmptyMovieClip("timer", _root.getNextHighestDepth());
clip_.onEnterFrame = function () {
com.midasplayer.util.AnimPlayer.onEnterFrame();
};
return(true);
}
static function clear() {
delete animEntries_;
delete timers_;
delete callbacks_;
delete callbackScopes_;
animEntries_ = new com.midasplayer.util.Map();
timers_ = new com.midasplayer.util.Map();
callbacks_ = new com.midasplayer.util.Map();
callbackScopes_ = new com.midasplayer.util.Map();
}
static function play(props) {
animId_++;
var _local3 = props.playlist;
var _local4 = props.callback;
var _local5 = props.callback_scope;
var _local1 = props.tps;
if (_local1 == undefined) {
_local1 = 100;
}
callbacks_.put(animId_, _local4);
callbackScopes_.put(animId_, _local5);
animEntries_.put(animId_, new com.midasplayer.util.AnimEntry(_local3, animId_));
timers_.put(animId_, new com.midasplayer.timing.Timer(com.midasplayer.util.AnimEntry(animEntries_.get(animId_)), _local1));
return(animId_);
}
static function end(animId) {
delete eval (timers_.get(animId));
timers_.remove(animId);
delete eval (animEntries_.get(animId));
animEntries_.remove(animId);
var _local2 = callbacks_.get(animId);
callbacks_.remove(animId);
var _local3 = callbackScopes_.get(animId);
callbackScopes_.remove(animId);
_local2.call(_local3);
}
static function delay(props) {
play({playlist:[{obj:com.midasplayer.util.AnimPlayer, func:delayAnim, params:{millis:props.millis}}], callback:props.callback, callback_scope:props.callback_scope, tps:50});
}
static function delayAnim(tick, alpha, params) {
if ((tick / 50) >= (params.millis / 1000)) {
return(true);
}
return(false);
}
static function tickToPercent(tick, startTick, numTicks) {
var _local1 = (tick - startTick) / numTicks;
_local1 = ((_local1 < 0) ? 0 : (_local1));
_local1 = ((_local1 > 1) ? 1 : (_local1));
return(_local1);
}
static function onEnterFrame() {
timers_.foreach(function (key, obj) {
com.midasplayer.timing.Timer(obj).advanceTime();
});
}
static var animId_ = 0;
static var animEntries_ = new com.midasplayer.util.Map();
static var timers_ = new com.midasplayer.util.Map();
static var callbacks_ = new com.midasplayer.util.Map();
static var callbackScopes_ = new com.midasplayer.util.Map();
static var staticInitialized = staticInitializer();
}
Symbol 320 MovieClip [__Packages.com.midasplayer.util.AnimEntry] Frame 0
class com.midasplayer.util.AnimEntry implements com.midasplayer.timing.Timeable
{
var playList_, animId_;
function AnimEntry (playList, animId) {
playList_ = playList;
animId_ = animId;
}
function tick(tick) {
}
function render(tick, alpha) {
if (baseTick_ == -1) {
baseTick_ = tick;
}
var _local2 = play(playList_, tick - baseTick_, alpha);
if (_local2) {
com.midasplayer.util.AnimPlayer.end(animId_);
}
}
function play(playList, tick, alpha) {
var _local12 = playList.length;
var _local4 = true;
var _local3 = 0;
while (_local3 < _local12) {
var _local2 = playList[_local3];
if (_local2 == undefined) {
} else if (_local2.length == undefined) {
var _local9 = _local2.func;
var _local8 = _local2.obj;
var _local10 = _local2.params;
var _local6 = _local9.call(_local8, tick, alpha, _local10);
if (_local6) {
playList[_local3] = undefined;
} else {
_local4 = false;
}
} else {
var _local6 = play(_local2, tick, alpha);
if (_local6) {
playList[_local3] = undefined;
baseTick_ = baseTick_ + tick;
_local4 = false;
break;
}
_local4 = false;
break;
}
_local3++;
}
return(_local4);
}
var baseTick_ = -1;
}
Symbol 321 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
function IFloat () {
}
function set(newValue) {
lastValue = value;
value = newValue;
}
function get(alpha) {
return(lastValue + ((value - lastValue) * alpha));
}
var value = 0;
var lastValue = 0;
}
Symbol 322 MovieClip [__Packages.com.midasplayer.game.dealornodeal.Rules] Frame 0
class com.midasplayer.game.dealornodeal.Rules
{
function Rules () {
}
function getNumPossiblePrizes() {
var _local3 = com.midasplayer.game.dealornodeal.Game.getRoundNum();
var _local2 = 0;
var _local1 = 0;
while (_local1 < _local3) {
_local2 = _local2 + com.midasplayer.game.dealornodeal.Game.NUM_BOXES_PER_ROUND[_local1];
_local1++;
}
return(_local2);
}
function getBankOffer() {
var _local7 = com.midasplayer.game.dealornodeal.Game.board.getPrizes();
var _local4 = 0;
var _local5 = 0;
if (com.midasplayer.game.dealornodeal.Game.getRoundNum() == 0) {
return(0);
}
var _local6 = _local7.length;
var _local2 = 0;
while (_local2 < _local6) {
var _local3 = com.midasplayer.game.dealornodeal.Prize(_local7[_local2]);
if (!_local3.isSelected()) {
_local4 = _local4 + _local3.getSum();
_local5++;
}
_local2++;
}
var _local8 = getNumPossiblePrizes();
var _local9 = _local6 - _local5;
var _local13 = ((_local9 * _local9) + 1) / ((_local8 * _local8) + 1);
var _local10 = com.midasplayer.game.dealornodeal.Game.getRoundNum();
var _local11 = com.midasplayer.game.dealornodeal.Game.NUM_ROUNDS;
var _local12 = 0.333333333333333 + ((0.666666666666667 * (_local10 - 1)) / (_local11 - 1));
_local12 = Math.log(2 * _local10) / Math.LN10;
_local4 = ((_local12 * _local13) * _local4) / _local5;
_local4 = Math.round(_local4);
if (_local4 == 1) {
_local4 = 2;
}
if (_local4 == 0) {
_local4 = 1;
}
return(_local4);
}
function getBankOfferText() {
var _local8 = com.midasplayer.game.dealornodeal.Game.board.getPrizes();
var _local5 = 0;
var _local6 = 0;
var _local7 = _local8.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local3 = com.midasplayer.game.dealornodeal.Prize(_local8[_local2]);
if (!_local3.isSelected()) {
_local5 = _local5 + _local3.getSum();
_local6++;
}
_local2++;
}
var _local9 = getNumPossiblePrizes();
var _local10 = _local7 - _local6;
var _local14 = ((_local10 * _local10) + 1) / ((_local9 * _local9) + 1);
var _local4;
var _local11 = com.midasplayer.game.dealornodeal.Game.getRoundNum();
var _local12 = com.midasplayer.game.dealornodeal.Game.NUM_ROUNDS;
var _local13 = 0.333333333333333 + ((0.666666666666667 * (_local11 - 1)) / (_local12 - 1));
_local13 = Math.log(2 * _local11) / Math.LN10;
_local5 = ((_local13 * _local14) * _local5) / _local6;
if (_local5 < 1) {
_local4 = com.midasplayer.util.I18n.format("currency_symbol") + _local5;
} else {
_local5 = Math.round(_local5);
_local4 = String(_local5);
if (_local4.length > 3) {
_local4 = (_local4.substring(0, _local4.length - 3) + ",") + _local4.substring(_local4.length - 3, _local4.length);
}
if (_local4.length > 7) {
_local4 = (_local4.substring(0, _local4.length - 7) + ",") + _local4.substring(_local4.length - 7, _local4.length);
}
_local4 = com.midasplayer.util.I18n.format("currency_symbol") + _local4;
}
return(_local4);
}
}
Symbol 323 MovieClip [__Packages.com.midasplayer.util.Spline] Frame 0
class com.midasplayer.util.Spline
{
var points_;
function Spline () {
numPoints_ = 0;
points_ = new Array();
}
function addPoint(x, y) {
points_[numPoints_] = {x:x, y:y};
points_[numPoints_ + 1] = {x:x, y:y};
points_[numPoints_ + 2] = {x:x, y:y};
numPoints_ = numPoints_ + 1;
}
function getX(t) {
if (t == 0) {
t = 0.0001;
}
if (t == 1) {
t = 0.9999;
}
var _local7 = 0;
var _local8 = numPoints_ - 1;
var _local6 = Math.ceil(_local8 * t) + 1;
var _local9 = t;
t = (((t * _local8) * 1000) % 1000) / 1000;
if (t == 0) {
_local6++;
}
var _local2 = -2;
while (_local2 <= 1) {
var _local3 = blend(_local2, t);
var _local4 = points_[_local6 + _local2].x;
_local7 = _local7 + (_local3 * _local4);
_local2++;
}
return(_local7);
}
function getY(t) {
if (t == 0) {
t = 0.0001;
}
if (t == 1) {
t = 0.9999;
}
var _local7 = 0;
var _local8 = numPoints_ - 1;
var _local6 = Math.ceil(_local8 * t) + 1;
t = (((t * _local8) * 1000) % 1000) / 1000;
if (t == 0) {
_local6++;
}
var _local2 = -2;
while (_local2 <= 1) {
var _local3 = blend(_local2, t);
var _local4 = points_[_local6 + _local2].y;
_local7 = _local7 + (_local3 * _local4);
_local2++;
}
return(_local7);
}
function blend(i, t) {
if (i == -2) {
return((((((-t) + 2) * t) - 1) * t) / 2);
}
if (i == -1) {
return((((((3 * t) - 5) * t) * t) + 2) / 2);
}
if (i == 0) {
return((((((-3 * t) + 4) * t) + 1) * t) / 2);
}
return((((t - 1) * t) * t) / 2);
}
function draw(layer) {
layer.lineStyle(1, 16777215);
var _local5 = 100;
var _local2 = 0;
while (_local2 <= _local5) {
var _local4 = getX(_local2 / _local5);
var _local3 = getY(_local2 / _local5);
if (_local2 == 0) {
layer.moveTo(_local4, _local3);
} else {
layer.lineTo(_local4, _local3);
}
_local2++;
}
}
var numPoints_ = 0;
}
Symbol 324 MovieClip [__Packages.com.midasplayer.util.ParticleTrail] Frame 0
class com.midasplayer.util.ParticleTrail
{
var numParticles_, radius_, particles_, spline_, animId_;
function ParticleTrail (layer, spline) {
numParticles_ = 40;
radius_ = 20;
particles_ = new Array();
var _local3 = 0;
while (_local3 < numParticles_) {
particles_[_local3] = new com.midasplayer.util.Particle("goldstar2", _root);
_local3++;
}
spline_ = spline;
}
function start() {
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:playAnim}], callback:endAnim, callback_scope:this, tps:50});
}
function playAnim(tick, alpha) {
var _local18 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, 0, 550);
var _local17 = spline_.getX(_local18);
var _local16 = spline_.getY(_local18);
var _local2 = 0;
while (_local2 < numParticles_) {
if (!particles_[_local2].isActive()) {
var _local4 = random(360);
var _local7 = random(radius_);
var _local5 = ((100 + random(60)) - 30) - 20;
var _local13 = _local17 + (_local7 * Math.cos((_local4 * Math.PI) / 180));
var _local12 = _local16 + (_local7 * Math.sin((_local4 * Math.PI) / 180));
particles_[_local2].setPos(_local13, _local12);
particles_[_local2].setScale(0);
particles_[_local2].setRotation(random(360));
var _local8 = random(20);
var _local3 = 10 + random(20);
var _local11 = 10 + random(30);
var _local6 = (_local8 + _local3) + _local11;
var _local9 = 10 + random(10);
var _local10 = _local6 + _local9;
particles_[_local2].addAction(0, _local10, com.midasplayer.util.Particle.ACTION_REMOVE);
particles_[_local2].addAction(_local8, _local3, com.midasplayer.util.Particle.ACTION_SCALE, {start:0, stop:_local5});
particles_[_local2].addAction(_local6, _local9, com.midasplayer.util.Particle.ACTION_SCALE, {start:_local5, stop:0});
particles_[_local2].play();
break;
}
_local2++;
}
return(false);
}
function endAnim() {
}
function stop() {
var _local2 = 0;
while (_local2 < numParticles_) {
particles_[_local2].remove();
_local2++;
}
com.midasplayer.util.AnimPlayer.end(animId_);
}
}
Symbol 325 MovieClip [__Packages.com.midasplayer.util.Particle] Frame 0
class com.midasplayer.util.Particle
{
var clip_, active_, actions_, animId_;
function Particle (clipName, layer) {
var _local2 = layer.getNextHighestDepth();
clip_ = layer.attachMovie(clipName, "paaa" + _local2, _local2);
setVisible(false);
active_ = false;
actions_ = new Array();
}
function addAction(startFrame, numFrames, actionId, params) {
actions_.push([startFrame, numFrames, actionId, params]);
}
function doActions(tick, alpha) {
var _local5 = tick + alpha;
var _local6 = actions_.length;
var _local4 = 0;
while (_local4 < _local6) {
var _local2 = actions_[_local4];
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(_local5, _local2[0], _local2[1]);
if (_local3 > 0) {
doAction(_local3, _local2[2], _local2[3]);
}
if (_local3 == 1) {
_local2[0] = ACTION_NONE;
}
_local4++;
}
}
function doAction(p, actionId, params) {
if (actionId == ACTION_REMOVE) {
if (p == 1) {
active_ = false;
}
} else if (actionId == ACTION_ALPHA) {
var _local4 = ((params.start != undefined) ? (params.start) : 100);
var _local7 = ((params.stop != undefined) ? (params.stop) : 0);
var _local5 = _local4 + ((_local7 - _local4) * p);
clip_._alpha = _local5;
} else if (actionId == ACTION_SCALE) {
var _local4 = ((params.start != undefined) ? (params.start) : 100);
var _local7 = ((params.stop != undefined) ? (params.stop) : 0);
var _local5 = _local4 + (((_local7 - _local4) * p) * p);
setScale(_local5);
}
}
function remove() {
stop();
if (clip_ != undefined) {
clip_.removeMovieClip();
}
}
function play() {
active_ = true;
setVisible(true);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:playAnim}], callback:endAnim, callback_scope:this, tps:50});
}
function playAnim(tick, alpha) {
doActions(tick, alpha);
return(!active_);
}
function endAnim() {
stop();
}
function stop() {
com.midasplayer.util.AnimPlayer.end(animId_);
active_ = false;
setVisible(false);
actions_ = new Array();
}
function isActive() {
return(active_);
}
function setVisible(v) {
clip_._visible = v;
}
function setScale(s) {
clip_._xscale = s;
clip_._yscale = s;
}
function setXScale(s) {
clip_._xscale = s;
}
function setYScale(s) {
clip_._yscale = s;
}
function setPos(x, y) {
clip_._x = x;
clip_._y = y;
}
function getXPos() {
return(clip_._x);
}
function getYPos() {
return(clip_._y);
}
function setXPos(x) {
clip_._x = x;
}
function setYPos(y) {
clip_._y = y;
}
function setRotation(r) {
clip_._rotation = r;
}
static var ACTION_NONE = -1;
static var ACTION_REMOVE = 0;
static var ACTION_ALPHA = 1;
static var ACTION_SCALE = 2;
static var ACTION_MOVE = 2;
}