Frame 1
_root.gamemode = 2;
var game = (new com.midasplayer.game.fashionfactory.Game());
Symbol 22 MovieClip [poff] Frame 25
gotoAndStop (1);
Symbol 191 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);
}
}
gameData.put(((_local1.nodeName + ".") + _local3) + ".nodeData", _local1.firstChild);
}
_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 192 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 + "x";
_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 193 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 _local3 = new com.midasplayer.util.ArrayList();
var _local2 = from;
while (_local2 < to) {
_local3.insert(get(_local2));
_local2++;
}
return(_local3);
}
}
Symbol 194 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 195 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 196 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("\r\n").join(newline);
translations_.put(name, val);
}
static function format(name, replace0, replace1, replace2) {
var _local3 = translations_.get(name);
if (_local3 == undefined) {
return(("{" + name) + "}");
}
var _local1 = _local3.toString();
if (replace0 != undefined) {
var _local2 = _local1.split("{0}");
_local1 = _local2.join(replace0);
if (replace1 != undefined) {
_local2 = _local1.split("{1}");
_local1 = _local2.join(replace1);
if (replace2 != undefined) {
_local2 = _local1.split("{2}");
_local1 = _local2.join(replace2);
}
}
}
return(_local1);
}
static var translations_ = new com.midasplayer.util.Map();
}
Symbol 197 MovieClip [__Packages.com.midasplayer.game.fashionfactory.Game] Frame 0
class com.midasplayer.game.fashionfactory.Game extends com.midasplayer.util.GameBase
{
static var score_, roundNum_, maxTime_, bagsNeeded_, random_, boardLayer_, girl_, board_, gameEnded_, animId_, introBags_, introBoard_, introPlate_, randomPrizeGenerator_, timeLeft_, quitIntervalId_;
var init;
function Game () {
super();
Stage.showMenu = false;
Stage.scaleMode = "noScale";
_root._focusrect = false;
com.midasplayer.util.GameBase.setGameMode(_root.gamemode);
com.midasplayer.util.Log.setLevel(com.midasplayer.util.Log.LEVEL_NONE);
init(this);
}
function startGame() {
score_ = 0;
roundNum_ = 1;
com.midasplayer.fx.SoundManager.enableSounds(true);
maxTime_ = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".time"));
bagsNeeded_ = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".bags"));
random_ = new com.midasplayer.util.Random(Number(com.midasplayer.util.GameBase.gameData.get("seed")));
_root.attachMovie("top", "top", _root.getNextHighestDepth());
boardLayer_ = _root.createEmptyMovieClip("boardlayer", _root.getNextHighestDepth());
_root.attachMovie("bar", "bar", _root.getNextHighestDepth());
_root.bar._x = 10;
_root.bar._y = 20;
_root.bar.txt_score.txt1.txt.text = com.midasplayer.util.I18n.format("score");
_root.bar.txt_score.txt2.txt.text = com.midasplayer.util.I18n.format("score");
_root.bar.txt_level.txt1.txt.text = com.midasplayer.util.I18n.format("level");
_root.bar.txt_level.txt2.txt.text = com.midasplayer.util.I18n.format("level");
displayScore();
displayLevel();
_root.attachMovie("lowerbar", "lowerbar", _root.getNextHighestDepth());
_root.lowerbar._y = 550;
_root.lowerbar._x = 0;
_root.lowerbar.endgame.txt.text = com.midasplayer.util.I18n.format("end_game");
_root.lowerbar.sound.txt.text = com.midasplayer.util.I18n.format("sound_off");
_root.lowerbar.sound.onRelease = function () {
com.midasplayer.game.fashionfactory.Game.switchSound();
};
_root.lowerbar.endgame.onRelease = function () {
com.midasplayer.game.fashionfactory.Game.endGamePressed();
};
_root.createEmptyMovieClip("scorebar", _root.getNextHighestDepth());
_root.scorebar._x = 30;
_root.scorebar._y = 138;
_root.scorebar._rotation = -5;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = _root.scorebar.attachMovie("number", "n" + (_local3 + 1), _local3 + 1);
_local4.gotoAndStop(1);
_local3++;
}
_root.createEmptyMovieClip("bagsleftbar", _root.getNextHighestDepth());
var _local8 = 172.5;
var _local7 = 361.4;
var _local5 = 14;
var _local6 = 0.45;
_local3 = 0;
while (_local3 < 30) {
var _local4 = _root.bagsleftbar.attachMovie("bagindicator", "bag" + _local3, _local3 + 1);
_local4.gotoAndStop(1);
_local4._x = _local8 - (_local6 * _local3);
_local4._y = _local7 - (_local5 * _local3);
_local3++;
}
_root.createEmptyMovieClip("platelayer", _root.getNextHighestDepth());
girl_ = new com.midasplayer.game.fashionfactory.Girl(_root);
girl_.idle();
com.midasplayer.util.GameBase.reportGameStart();
com.midasplayer.util.GameBase.reportPlayData(19, VERSION, "0");
showInstructions();
}
static function changeBoard() {
board_.remove();
_root.game.startRoundTest();
}
static function switchSound() {
var _local2 = com.midasplayer.fx.SoundManager.isSoundEnabled();
com.midasplayer.fx.SoundManager.enableSounds(!_local2);
if (_local2) {
_root.lowerbar.sound.txt.text = com.midasplayer.util.I18n.format("sound_on");
} else {
_root.lowerbar.sound.txt.text = com.midasplayer.util.I18n.format("sound_off");
}
}
static function endGamePressed() {
if (gameEnded_) {
return(undefined);
}
_root.lowerbar.endgame.onRelease = undefined;
_root.lowerbar.endgame.useHandCursor = false;
_root.introlayer.removeMovieClip();
if (!board_.isStopped()) {
board_.stop();
}
com.midasplayer.util.AnimPlayer.stop(animId_);
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportPlayData(177, "", "0");
gameEndPressed_ = true;
_root.game.gameOver();
}
static function skipIntro() {
_root.skipintro = true;
_root.game.endIntro4();
}
function showInstructions() {
com.midasplayer.fx.SoundManager.play("snd_intro");
setBagsRemoved(0);
_root.createEmptyMovieClip("introlayer", _root.getNextHighestDepth());
var _local8 = _root.introlayer.createEmptyMovieClip("baglayer", _root.introlayer.getNextHighestDepth());
var _local7 = _root.introlayer.createEmptyMovieClip("masklayer", _root.introlayer.getNextHighestDepth());
_local8.setMask(_local7);
_local7.beginFill(16711680);
_local7.moveTo(0, 0);
_local7.lineTo(com.midasplayer.game.fashionfactory.Bag.WIDTH * 6, 0);
_local7.lineTo(com.midasplayer.game.fashionfactory.Bag.WIDTH * 6, com.midasplayer.game.fashionfactory.Bag.HEIGHT * 6);
_local7.lineTo(0, com.midasplayer.game.fashionfactory.Bag.HEIGHT * 6);
_local7.endFill();
_local7._x = com.midasplayer.game.fashionfactory.Board.BOARD_X;
_local7._y = com.midasplayer.game.fashionfactory.Board.BOARD_Y;
introBags_ = new Array();
introBags_[0] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer, 9, 13, 182, 40);
introBags_[1] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer, 6, 10, 184, 40 + com.midasplayer.game.fashionfactory.Bag.HEIGHT);
introBags_[2] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer, 9, 1, 186, 40 + (com.midasplayer.game.fashionfactory.Bag.HEIGHT * 2));
introBags_[0].show();
introBags_[1].show();
introBags_[2].show();
introBags_[0].setPrize(200);
introBags_[1].setPrize(250);
introBags_[2].setPrize(150);
introBoard_ = new Array();
var _local6 = com.midasplayer.game.fashionfactory.Board.BOARD_Y;
var _local4 = 0;
while (_local4 < 6) {
introBoard_[_local4] = new Array();
var _local5 = com.midasplayer.game.fashionfactory.Board.BOARD_X;
var _local3 = 0;
while (_local3 < 6) {
introBoard_[_local4][_local3] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer.baglayer, introShapes_[_local4][_local3], introPatterns_[_local4][_local3], _local5, _local6);
introBoard_[_local4][_local3].show();
_local5 = _local5 + com.midasplayer.game.fashionfactory.Bag.WIDTH;
_local3++;
}
_local6 = _local6 + com.midasplayer.game.fashionfactory.Bag.HEIGHT;
_local4++;
}
introBoard_[6] = new Array();
introBoard_[6][0] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer.baglayer, introShapes_[3][2], introPatterns_[5][0], com.midasplayer.game.fashionfactory.Board.BOARD_X, com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT);
introBoard_[6][1] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer.baglayer, introShapes_[3][1], introPatterns_[5][0], com.midasplayer.game.fashionfactory.Board.BOARD_X + com.midasplayer.game.fashionfactory.Bag.WIDTH, com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT);
introBoard_[7] = new Array();
introBoard_[7][0] = new com.midasplayer.game.fashionfactory.Bag(null, _root.introlayer.baglayer, introShapes_[5][2], introPatterns_[5][0], com.midasplayer.game.fashionfactory.Board.BOARD_X, com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT);
introPlate_ = new com.midasplayer.game.fashionfactory.IntroPlate(_root.introlayer);
introPlate_.setHeader(com.midasplayer.util.I18n.format("instructions0_header"));
introPlate_.setText(com.midasplayer.util.I18n.format("instructions0_text"));
introPlate_.arm1.clip._visible = false;
introPlate_.arm2.clip._visible = false;
introPlate_.arm3.clip._visible = false;
introPlate_.setStartPos(355, -240);
introPlate_.setStopPos(355, 70);
introPlate_.setStartScale(100, 80);
introPlate_.anim({callback:showIntro1, callback_scope:this, start:0, stop:50});
}
function showIntro1() {
introPlate_.setSkipText(com.midasplayer.util.I18n.format("instructions_skip"));
introPlate_.arm1.clip._rotation = 10;
introPlate_.arm1.setStartPos(12.3, 45);
introPlate_.arm1.setStopPos(-111.7, 0);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:0, stop:30});
introPlate_.arm2.clip._rotation = -7;
introPlate_.arm2.setStartPos(9, 46);
introPlate_.arm2.setStopPos(-132, 64);
introPlate_.arm2.anim({callback:null, callback_scope:this, start:20, stop:40});
introPlate_.arm3.clip._rotation = -10;
introPlate_.arm3.setStartPos(18, 100);
introPlate_.arm3.setStopPos(-104, 132);
introPlate_.arm3.anim({callback:null, callback_scope:this, start:30, stop:50});
com.midasplayer.util.AnimPlayer.delay({callback:endIntro1, callback_scope:this, millis:5000});
}
function endIntro1() {
if (_root.skipintro) {
return(undefined);
}
introPlate_.setHeader("");
introPlate_.setText("");
introPlate_.setSkipText("");
introPlate_.arm1.setStopPos(12.3, 45);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:0, stop:20});
introPlate_.arm2.setStopPos(9, 46);
introPlate_.arm2.anim({callback:null, callback_scope:this, start:15, stop:25});
introPlate_.arm3.setStopPos(18, 140);
introPlate_.arm3.anim({callback:null, callback_scope:this, start:10, stop:20});
introPlate_.setStopPos(450, 5);
introPlate_.setStopScale(105, 80);
introPlate_.anim({callback:showIntro2, callback_scope:this, start:20, stop:50});
}
function showIntro2() {
introPlate_.setNumber("1");
introPlate_.setHeader(com.midasplayer.util.I18n.format("instructions1_header"));
introPlate_.setText(com.midasplayer.util.I18n.format("instructions1_text"));
introPlate_.setSkipText(com.midasplayer.util.I18n.format("instructions_skip"));
introPlate_.arm1.clip._visible = false;
introPlate_.arm2.clip._visible = false;
introPlate_.arm3.clip._visible = false;
introPlate_.arm1.clip._rotation = -13;
introPlate_.arm1.setStartPos(14, 50);
introPlate_.arm1.setStopPos(-120, 100);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:5, stop:35});
com.midasplayer.util.AnimPlayer.delay({callback:markBag1, callback_scope:this, millis:1000});
introPlate_.arm2.clip._rotation = -37;
introPlate_.arm2.setStartPos(14, 114);
introPlate_.arm2.setStopPos(-46, 164);
introPlate_.arm2.anim({callback:null, callback_scope:this, start:0, stop:30});
com.midasplayer.util.AnimPlayer.delay({callback:markBag2, callback_scope:this, millis:1300});
com.midasplayer.util.AnimPlayer.delay({callback:endIntro2, callback_scope:this, millis:5000});
}
function markBag1() {
introBoard_[1][0].markClick();
}
function markBag2() {
introBoard_[2][1].markClick();
}
function endIntro2() {
if (_root.skipintro) {
return(undefined);
}
introPlate_.setNumber("");
introPlate_.setHeader("");
introPlate_.setText("");
introPlate_.setSkipText("");
introPlate_.setStopPos(430, 140);
introPlate_.setStopScale(100, 80);
introPlate_.arm1.setStopPos(14, 50);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:0, stop:20});
introPlate_.arm2.setStopPos(14, 114);
introPlate_.arm2.anim({callback:null, callback_scope:this, start:10, stop:20});
introPlate_.anim({callback:showIntro3, callback_scope:this, start:15, stop:40});
com.midasplayer.util.AnimPlayer.delay({callback:removeBags, callback_scope:this, millis:100});
}
function removeBags() {
introBoard_[1][0].remove();
introBoard_[2][1].remove();
introBoard_[1][0].render();
introBoard_[2][1].render();
}
function showIntro3() {
introPlate_.setNumber("2");
introPlate_.setHeader(com.midasplayer.util.I18n.format("instructions2_header"));
introPlate_.setText(com.midasplayer.util.I18n.format("instructions2_text"));
introPlate_.setSkipText(com.midasplayer.util.I18n.format("instructions_skip"));
introPlate_.arm1.clip._visible = false;
introPlate_.arm2.clip._visible = false;
introPlate_.arm3.clip._visible = false;
introPlate_.arm1.clip._rotation = 20;
introPlate_.arm1.setStartPos(14, 20);
introPlate_.arm1.setStopPos(-90, -30);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:0, stop:30});
com.midasplayer.util.AnimPlayer.delay({callback:endIntro3, callback_scope:this, millis:5000});
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:fallDownAnim}], callback:null, callback_scope:this, tps:50});
}
function fallDownAnim(tick, alpha) {
var _local4 = false;
introBoard_[6][0].show();
introBoard_[6][1].show();
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 50, 100);
var _local2 = _local3 * com.midasplayer.game.fashionfactory.Bag.HEIGHT;
introBoard_[0][0].setY(com.midasplayer.game.fashionfactory.Board.BOARD_Y + _local2);
introBoard_[6][0].setY((com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT) + _local2);
introBoard_[0][1].setY(com.midasplayer.game.fashionfactory.Board.BOARD_Y + _local2);
introBoard_[1][1].setY((com.midasplayer.game.fashionfactory.Board.BOARD_Y + com.midasplayer.game.fashionfactory.Bag.HEIGHT) + _local2);
introBoard_[6][1].setY((com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT) + _local2);
if (_local3 >= 0.5) {
introBoard_[0][0].setPatternNum(introPatterns_[1][0]);
introBoard_[6][0].setPatternNum(introPatterns_[0][0]);
introBoard_[0][1].setPatternNum(introPatterns_[1][1]);
introBoard_[1][1].setPatternNum(introPatterns_[2][1]);
introBoard_[6][1].setPatternNum(introPatterns_[0][1]);
}
introBoard_[0][0].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[6][0].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[0][1].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[1][1].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[6][1].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[0][0].render();
introBoard_[6][0].render();
introBoard_[0][1].render();
introBoard_[1][1].render();
introBoard_[6][1].render();
if ((_local3 == 1) || (_root.skipintro)) {
_local4 = true;
}
return(_local4);
}
function endIntro3() {
if (_root.skipintro) {
return(undefined);
}
introPlate_.setNumber("");
introPlate_.setHeader("");
introPlate_.setText("");
introPlate_.setSkipText("");
introPlate_.arm1.setStopPos(14, 20);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:0, stop:20});
introPlate_.setStopPos(290, 245);
introPlate_.setStopScale(100, 105);
introPlate_.anim({callback:showIntro4, callback_scope:this, start:20, stop:60});
}
function showIntro4() {
introPlate_.setNumber("3");
introPlate_.setHeader(com.midasplayer.util.I18n.format("instructions3_header"));
introPlate_.setText(com.midasplayer.util.I18n.format("instructions3_text"));
introPlate_.setSkipText(com.midasplayer.util.I18n.format("instructions_skip"));
introPlate_.arm1.clip._visible = false;
introPlate_.arm2.clip._visible = false;
introPlate_.arm3.clip._visible = false;
introPlate_.arm1.clip._rotation = 50;
introPlate_.arm1.setStartScale(40, 140);
introPlate_.arm1.setStopScale(160, 140);
introPlate_.arm1.setStartPos(90, 0);
introPlate_.arm1.setStopPos(-35, -160);
introPlate_.arm1.anim({callback:pointOtherBag, callback_scope:this, start:0, stop:40});
com.midasplayer.util.AnimPlayer.delay({callback:endIntro4a, callback_scope:this, millis:5000});
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:pairAnim}], callback:null, callback_scope:this, tps:50});
}
function pointOtherBag() {
introPlate_.arm1.setStopPos(15, -120);
introPlate_.arm1.anim({callback:null, callback_scope:this, start:10, stop:40});
}
function pairAnim(tick, alpha) {
var _local4 = false;
if ((tick > 100) && (introBags_[0].isVisible())) {
introBags_[0].displayPair();
introBoard_[0][0].displayPair();
introBags_[1].setPrize(introBags_[1].getPrize() - 25);
introBags_[2].setPrize(introBags_[2].getPrize() - 25);
introBoard_[7][0].show();
setBagsRemoved(1);
}
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 100, 140);
var _local2 = _local3 * com.midasplayer.game.fashionfactory.Bag.HEIGHT;
introBoard_[6][0].setY(com.midasplayer.game.fashionfactory.Board.BOARD_Y + _local2);
introBoard_[7][0].setY((com.midasplayer.game.fashionfactory.Board.BOARD_Y - com.midasplayer.game.fashionfactory.Bag.HEIGHT) + _local2);
if (_local3 >= 0.5) {
introBoard_[6][0].setPatternNum(introPatterns_[1][0]);
introBoard_[7][0].setPatternNum(introPatterns_[0][0]);
}
introBoard_[6][0].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[7][0].setPatternShade(com.midasplayer.game.fashionfactory.Board.getPatternShade(0, _local2));
introBoard_[6][0].render();
introBoard_[7][0].render();
introBags_[0].render();
introBoard_[0][0].render();
if ((_local3 == 1) || (_root.skipintro)) {
_local4 = true;
}
return(_local4);
}
function endIntro4a() {
if (_root.skipintro) {
return(undefined);
}
endIntro4();
}
function endIntro4() {
trace(introBoard_[7][0]);
if (introBoard_[7][0].isVisible()) {
trace("re..1");
introBoard_[1][0] = introBoard_[6][0];
introBoard_[0][0] = introBoard_[7][0];
introBoard_[2][1] = introBoard_[1][1];
introBoard_[1][1] = introBoard_[0][1];
introBoard_[0][1] = introBoard_[6][1];
} else if (introBoard_[6][0].isVisible()) {
trace("re..2");
introBoard_[1][0] = introBoard_[0][0];
introBoard_[0][0] = introBoard_[6][0];
introBoard_[2][1] = introBoard_[1][1];
introBoard_[1][1] = introBoard_[0][1];
introBoard_[0][1] = introBoard_[6][1];
}
introPlate_.setStopPos(290, -300);
introPlate_.anim({callback:endShowInstructions, callback_scope:this, start:20, stop:60});
}
function endShowInstructions() {
introBags_[0].remove();
introBags_[1].remove();
introBags_[2].remove();
introBags_[0].render();
introBags_[1].render();
introBags_[2].render();
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:removeBagsAnim}], callback:startRound, callback_scope:this, tps:50});
}
function removeBagsAnim(tick, alpha) {
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local5 = Math.ceil(_local6 * 36);
var _local4 = Math.ceil(_local5 / 6);
var _local3 = _local5 % 6;
var _local2 = 0;
while (_local2 <= _local4) {
var _local1 = 0;
while (_local1 <= _local3) {
introBoard_[_local2][_local1].remove();
introBoard_[_local2][_local1].render();
_local1++;
}
_local2++;
}
return(_local6 == 1);
}
function startRound() {
if (board_ != undefined) {
return(undefined);
}
_root.introlayer.removeMovieClip();
com.midasplayer.fx.SoundManager.stop("snd_intro");
com.midasplayer.fx.SoundManager.play("snd_start", 100, false, function () {
com.midasplayer.fx.SoundManager.play("snd_loop", 50, true);
});
maxTime_ = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".time"));
bagsNeeded_ = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".bags"));
var _local4 = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".shapes"));
var _local3 = Number(com.midasplayer.util.GameBase.gameData.get(("level." + roundNum_) + ".patterns"));
randomPrizeGenerator_ = new com.midasplayer.util.Random(random_.nextInt(1000000));
com.midasplayer.util.GameBase.reportPlayData(132, "", "0");
board_ = new com.midasplayer.game.fashionfactory.Board(this, roundNum_, boardLayer_, random_.nextInt(1000000), _local4, _local3);
board_.start();
com.midasplayer.util.AnimPlayer.delay({callback:startRound, callback_scope:this, millis:2000});
}
function endRound() {
com.midasplayer.fx.SoundManager.stop("snd_loop");
com.midasplayer.fx.SoundManager.stop("snd_time");
com.midasplayer.fx.SoundManager.stop("snd_time2");
girl_.walkOut();
if (gameEnded_) {
return(undefined);
}
if (roundNum_ == 3) {
gameOver(true);
} else {
board_.remove();
board_ = undefined;
showRoundEnded();
}
}
function showRoundEnded() {
com.midasplayer.fx.SoundManager.play("snd_clear", 100);
var _local3 = getTimeBonusScore();
com.midasplayer.util.GameBase.reportPlayData(331, "" + timeLeft_, "0");
addScore(_local3);
_root.roundscreen = _root.platelayer.attachMovie("roundscreen", "roundscreen", _root.getNextHighestDepth());
_root.roundscreen._x = 300;
_root.roundscreen._y = -390;
_root.roundscreen.time_txt.autoSize = true;
_root.roundscreen.header.text = com.midasplayer.util.I18n.format("level_cleared");
_root.roundscreen.subheader.text = com.midasplayer.util.I18n.format("qualified");
_root.roundscreen.score_txt.text = com.midasplayer.util.I18n.format("box_score");
_root.roundscreen.timebonus_txt.text = com.midasplayer.util.I18n.format("box_time_bonus");
_root.roundscreen.total_txt.text = com.midasplayer.util.I18n.format("box_total_score");
_root.roundscreen.time_txt.text = com.midasplayer.util.I18n.format("time_to_start");
_root.roundscreen.score.text = score_ - _local3;
_root.roundscreen.timebonus.text = _local3;
_root.roundscreen.total.text = score_;
var _local4 = _root.roundscreen.time_txt._width;
_root.roundscreen.time._x = _root.roundscreen.time_txt._x + _local4;
_root.roundscreen.time._y = _root.roundscreen.time_txt._y - (_local4 * 0.07);
_root.roundscreen.time.text = 10;
_root.roundscreen.stoptick = 450;
_root.roundscreen.girlwalking = false;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showRoundEndedAnim}], callback:endShowRoundEnded, callback_scope:this, tps:50});
}
function showRoundEndedAnim(tick, alpha) {
var _local6 = false;
var _local5 = 10;
var _local8 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50 * _local5);
var _local7 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 80);
_root.roundscreen._y = -390 + ((350 * _local7) * _local7);
var _local4 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, _root.roundscreen.stoptick, 50);
_local4 = 1 - _local4;
if (_local4 < 1) {
_root.roundscreen._y = -390 + (350 * _local4);
}
if ((tick > 100) && (!_root.roundscreen.girlwalking)) {
_root.roundscreen.girlwalking = true;
girl_.walkIn(roundNum_ + 1);
}
_root.roundscreen.time.text = Math.round(_local5 - (_local8 * _local5));
if (tick > 100) {
_root.roundscreen.onPress = function () {
this.clicked = true;
};
}
if (_root.roundscreen.clicked) {
if (tick < _root.roundscreen.stoptick) {
girl_.walkFaster();
_root.roundscreen.stoptick = tick;
}
}
if ((_local4 == 0) && (!girl_.isWalking())) {
_local6 = true;
}
return(_local6);
}
function endShowRoundEnded() {
roundNum_++;
_root.roundscreen.removeMovieClip();
startRound();
}
function gameOver(allCleared) {
com.midasplayer.fx.SoundManager.stop("snd_loop");
com.midasplayer.fx.SoundManager.stop("snd_time");
com.midasplayer.fx.SoundManager.stop("snd_time2");
if (gameEnded_) {
return(undefined);
}
gameEnded_ = true;
board_.remove();
showGameOver(allCleared);
}
function showGameOver(allCleared) {
com.midasplayer.fx.SoundManager.play("snd_gameover");
var _local3 = 0;
if (allCleared) {
_local3 = getTimeBonusScore();
addScore(_local3);
}
if (timeLeft_ == undefined) {
timeLeft_ = 0;
}
com.midasplayer.util.GameBase.reportPlayData(331, "" + timeLeft_, "0");
_root.roundscreen = _root.platelayer.attachMovie("roundscreen", "roundscreen", _root.getNextHighestDepth());
_root.roundscreen._x = 300;
_root.roundscreen._y = -390;
if (allCleared) {
_root.roundscreen.header.text = com.midasplayer.util.I18n.format("level_cleared");
_root.roundscreen.subheader.text = "";
} else {
_root.roundscreen.header.text = com.midasplayer.util.I18n.format("time_out");
_root.roundscreen.subheader.text = "";
if (roundNum_ < 3) {
_root.roundscreen.subheader.text = com.midasplayer.util.I18n.format("not_qualified");
}
if (gameEndPressed_) {
_root.roundscreen.header.text = "";
}
}
_root.roundscreen.time_txt.autoSize = true;
_root.roundscreen.score_txt.text = com.midasplayer.util.I18n.format("box_score");
_root.roundscreen.timebonus_txt.text = com.midasplayer.util.I18n.format("box_time_bonus");
_root.roundscreen.total_txt.text = com.midasplayer.util.I18n.format("box_total_score");
_root.roundscreen.time_txt.text = com.midasplayer.util.I18n.format("time_to_exit");
_root.roundscreen.score.text = score_ - _local3;
_root.roundscreen.timebonus.text = _local3;
_root.roundscreen.total.text = score_;
var _local4 = _root.roundscreen.time_txt._width;
_root.roundscreen.time._x = _root.roundscreen.time_txt._x + _local4;
_root.roundscreen.time._y = _root.roundscreen.time_txt._y - (_local4 * 0.07);
_root.roundscreen.time.text = 10;
_root.roundscreen.stoptick = 450;
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:showGameOverAnim}], callback:endShowGameOver, callback_scope:this, tps:50});
}
function showGameOverAnim(tick) {
var _local4 = false;
var _local3 = 7;
var _local6 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50 * _local3);
var _local5 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 80);
_root.roundscreen._y = -390 + ((350 * _local5) * _local5);
_root.roundscreen.time.text = Math.round(_local3 - (_local6 * _local3));
if (tick > 50) {
_root.roundscreen.onPress = function () {
this.clicked = true;
};
}
if ((_local6 == 1) || (_root.roundscreen.clicked)) {
_local4 = true;
}
return(_local4);
}
function endShowGameOver() {
endGame();
}
static function endGame() {
com.midasplayer.util.GameBase.reportGameEnd(score_);
quitIntervalId_ = setInterval(quitGame, 1600);
}
static function quitGame() {
clearInterval(quitIntervalId_);
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.util.GameBase.reportGameQuit();
}
static function getMatchScore() {
return(roundNum_);
}
static function getRandomBagPrize() {
var _local1 = 100 + (roundNum_ * 50);
var _local2 = (Math.round(randomPrizeGenerator_.nextInt(_local1) / 50) * 50) + _local1;
return(_local2);
}
static function getTimeBonusScore() {
var _local2 = timeLeft_ / maxTime_;
var _local1 = 0;
if (roundNum_ == 1) {
_local1 = 100 * _local2;
} else if (roundNum_ == 2) {
_local1 = 200 * _local2;
} else if (roundNum_ == 3) {
_local1 = 2000 * _local2;
}
return(Math.round(_local1));
}
static function getBagsNeeded() {
return(bagsNeeded_);
}
static function addScore(score) {
score_ = score_ + score;
displayScore();
}
static function displayScore() {
_root.scorebar.txt.text = score_;
displayDigital("_root.scorebar.n", score_);
}
static function displayDigital(mcName, val) {
var stringVal = String(val);
var len = stringVal.length;
var x = 0;
var w = 0;
var i = 10;
while (i >= 1) {
var mc = eval (mcName + i);
var n = 1;
if (len >= i) {
n = Number(stringVal.charAt(len - i)) + 2;
}
mc.gotoAndStop(n);
mc._x = x;
if (mc != null) {
x = x + mc._width;
w = w + mc._width;
}
i--;
}
var xx = (100 - w);
var i = 10;
while (i >= 1) {
var mc = eval (mcName + i);
mc._x = mc._x + xx;
i--;
}
}
static function displayLevel() {
_root.bar.level.txt.text = roundNum_;
}
static function setTime(t) {
timeLeft_ = maxTime_ - Math.round(t);
_root.timebar.txt.text = timeLeft_;
var _local2 = (-360 * t) / maxTime_;
_local2 = Math.round(_local2 / 6) * 6;
_root.top.clock.pointer._rotation = _local2;
if (_local2 <= -300) {
if (_root.timewarning == false) {
_root.timewarning = true;
com.midasplayer.fx.SoundManager.play("snd_time", 100);
}
} else {
_root.timewarning = false;
}
}
static function setBagsRemoved(n) {
girl_.blink();
n = Math.min(getBagsNeeded(), n);
var left = (getBagsNeeded() - n);
var i = 0;
while (i < left) {
var c = eval ("_root.bagsleftbar.bag" + i);
c.gotoAndStop(2);
i++;
}
var i = left;
while (i < (left + n)) {
var c = eval ("_root.bagsleftbar.bag" + i);
c.gotoAndStop(3);
i++;
}
}
static function getMaxTime() {
return(maxTime_);
}
static var VERSION = "1.05";
static var gameEndPressed_ = false;
static var introPatterns_ = [[7, 3, 1, 1, 10, 13], [13, 7, 7, 10, 1, 3], [3, 13, 10, 3, 1, 13], [3, 13, 1, 10, 7, 7], [13, 1, 7, 10, 10, 3], [7, 13, 10, 3, 10, 1]];
static var introShapes_ = [[9, 6, 7, 1, 5, 6], [5, 7, 1, 9, 6, 1], [7, 5, 9, 1, 7, 6], [9, 5, 6, 9, 7, 5], [1, 1, 6, 9, 5, 7], [6, 7, 5, 1, 9, 5]];
}
Symbol 198 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 next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(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] = _local3.lsb + mti);
mti++;
}
var _local6 = getTimer();
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
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;
}
_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 199 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 toString() {
return(((((("Integer64[value=0x" + com.midasplayer.util.Numbers.dec2hex(msb)) + ":") + com.midasplayer.util.Numbers.dec2hex(lsb)) + ":(") + p) + ")]");
}
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 200 MovieClip [__Packages.com.midasplayer.util.Numbers] Frame 0
class com.midasplayer.util.Numbers
{
function Numbers () {
}
static function dec2hex(iValue, padding) {
var _local1 = "";
while (iValue != 0) {
_local1 = "0123456789abcdef".charAt(iValue & 15) + _local1;
iValue = iValue >>> 4;
}
if (padding) {
if (_local1.length == 0) {
_local1 = "00";
}
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
} else if (_local1.length == 0) {
_local1 = "0";
}
return(_local1);
}
static function itoa(value, numZeroPadding) {
var _local2 = "" + value;
if (numZeroPadding) {
var _local1 = numZeroPadding - 1;
while (_local1 > 0) {
if (value < Math.pow(10, _local1)) {
_local2 = "0" + _local2;
}
_local1--;
}
}
return(_local2);
}
static function asTime(millis, alwaysHours, alwaysMinutes) {
if (alwaysHours) {
alwaysMinutes = true;
}
if (millis < 0) {
millis = 0;
}
millis = millis / 1000;
millis = Math.floor(millis);
var _local3 = Math.floor(millis / 3600);
var _local4 = Math.floor(millis / 60) % 60;
var _local5 = millis % 60;
var _local1 = "";
if (alwaysHours || (_local3 > 0)) {
_local1 = _local1 + itoa(_local3, 2);
}
if (alwaysHours || (_local1.length > 0)) {
_local1 = _local1 + ":";
}
var _local6 = _local1.length;
if ((alwaysMinutes || (_local4 > 0)) || (_local3 > 0)) {
_local1 = _local1 + itoa(_local4, 2);
}
if (alwaysMinutes || (_local1.length != _local6)) {
_local1 = _local1 + ":";
}
return(_local1 + itoa(_local5, 2));
}
}
Symbol 201 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 202 MovieClip [__Packages.com.midasplayer.game.fashionfactory.Board] Frame 0
class com.midasplayer.game.fashionfactory.Board implements com.midasplayer.timing.Timeable
{
static var random_;
var game_, level_, clip_, seed_, numPatterns_, numShapes_, bagLayer_, maskLayer_, shapeLayer_, bagsLayer_, bagsMaskLayer_, wantedBags_, patternNums_, bags_, tempNumbers_, availableBagsLeft_, timer_, stopped_, dragBag_, dragCol_, dragRow_, xStart_, yStart_, clickBag_, xDirection_, yDirection_, dx_, dy_, xTarget_, yTarget_, lastTick_;
function Board (game, level, clip, seed, numShapes, numPatterns) {
game_ = game;
level_ = level;
clip_ = clip;
seed_ = seed;
random_ = new com.midasplayer.util.Random(seed_);
numPatterns_ = numPatterns;
numShapes_ = numShapes;
initLayers();
initData();
initBags();
initPatterns();
initShapes();
}
function initLayers() {
var _local3 = BOARD_X;
var _local2 = BOARD_Y;
bagLayer_ = clip_.createEmptyMovieClip("baglayer", clip_.getNextHighestDepth());
maskLayer_ = clip_.createEmptyMovieClip("masklayer", clip_.getNextHighestDepth());
bagLayer_.setMask(maskLayer_);
maskLayer_.beginFill(16711680);
maskLayer_.moveTo(0, 0);
maskLayer_.lineTo(com.midasplayer.game.fashionfactory.Bag.WIDTH * NUM_COLS, 0);
maskLayer_.lineTo(com.midasplayer.game.fashionfactory.Bag.WIDTH * NUM_COLS, com.midasplayer.game.fashionfactory.Bag.HEIGHT * NUM_ROWS);
maskLayer_.lineTo(0, com.midasplayer.game.fashionfactory.Bag.HEIGHT * NUM_ROWS);
maskLayer_.endFill();
maskLayer_._x = _local3;
maskLayer_._y = _local2;
bagLayer_._x = _local3 - com.midasplayer.game.fashionfactory.Bag.WIDTH;
bagLayer_._y = _local2 - com.midasplayer.game.fashionfactory.Bag.HEIGHT;
shapeLayer_ = bagLayer_.createEmptyMovieClip("shapelayer", bagLayer_.getNextHighestDepth());
bagsLayer_ = clip_.createEmptyMovieClip("bagslayer", clip_.getNextHighestDepth());
bagsMaskLayer_ = clip_.attachMovie("bagmask2", "bagmask", clip_.getNextHighestDepth());
bagsMaskLayer_._x = 180;
bagsMaskLayer_._y = 20;
bagsLayer_.setMask(bagsMaskLayer_);
}
function initData() {
allShapes_ = new com.midasplayer.util.ArrayList();
var _local2 = 0;
while (_local2 < NUM_SHAPES) {
allShapes_.insert(_local2 + 1);
_local2++;
}
availableShapes_ = new com.midasplayer.util.ArrayList();
_local2 = 0;
while (_local2 < numShapes_) {
var _local3 = random_.nextInt(allShapes_.size());
var _local4 = Number(allShapes_.removeByIndex(_local3));
availableShapes_.insert(_local4);
_local2++;
}
allPatterns_ = new com.midasplayer.util.ArrayList();
_local2 = 0;
while (_local2 < NUM_PATTERNS) {
allPatterns_.insert(_local2 + 1);
_local2++;
}
availablePatterns_ = new com.midasplayer.util.ArrayList();
_local2 = 0;
while (_local2 < numPatterns_) {
var _local3 = random_.nextInt(allPatterns_.size());
var _local4 = Number(allPatterns_.removeByIndex(_local3));
availablePatterns_.insert(_local4);
_local2++;
}
}
function getNextPatternNum() {
if ((availablePatternsLeft_ == null) || (availablePatternsLeft_.size() == 0)) {
availablePatternsLeft_ = availablePatterns_.subList(0);
}
var _local2 = random_.nextInt(availablePatternsLeft_.size());
return(Number(availablePatternsLeft_.removeByIndex(_local2)));
}
function getNextShapeNum(patternNum) {
if ((availableShapesLeft_ == null) || (availableShapesLeft_.size() == 0)) {
availableShapesLeft_ = availableShapes_.subList(0);
}
var _local7 = random_.nextInt(availableShapesLeft_.size());
var _local6 = Number(availableShapesLeft_.removeByIndex(_local7));
if (patternNum != undefined) {
var _local4 = (_local6 * 1000) + patternNum;
var _local3 = 0;
while (_local3 < 5) {
var _local2 = wantedBags_[_local3];
if (_local2 && (!_local2.isRemoved())) {
if (_local2.getNum() == _local4) {
return(getNextShapeNum(patternNum));
}
}
_local3++;
}
}
return(_local6);
}
function initPatterns() {
patternNums_ = new Array();
var _local3 = 0;
while (_local3 <= (NUM_ROWS + 1)) {
patternNums_[_local3] = new Array();
_local3++;
}
_local3 = 1;
while (_local3 <= NUM_ROWS) {
var _local2 = 1;
while (_local2 <= NUM_COLS) {
var _local4 = getNextPatternNum();
patternNums_[_local3][_local2] = _local4;
_local2++;
}
_local3++;
}
}
function initShapes() {
bags_ = new Array();
var _local3 = 0;
while (_local3 <= (NUM_ROWS + 1)) {
bags_[_local3] = new Array();
_local3++;
}
_local3 = 1;
while (_local3 <= NUM_ROWS) {
var _local2 = 1;
while (_local2 <= NUM_COLS) {
var _local6 = _local2 * com.midasplayer.game.fashionfactory.Bag.WIDTH;
var _local5 = _local3 * com.midasplayer.game.fashionfactory.Bag.HEIGHT;
var _local4 = getPattern(_local6, _local5);
var _local7 = getNextShapeNum(_local4);
bags_[_local3][_local2] = new com.midasplayer.game.fashionfactory.Bag(this, shapeLayer_, _local7, _local4, _local6, _local5);
bags_[_local3][_local2].setDragable(true);
_local2++;
}
_local3++;
}
tempNumbers_ = new Array();
}
function updateAvailableBagsLeft() {
availableBagsLeft_.clear();
var _local11 = 0;
while (_local11 < availableShapes_.size()) {
var _local3 = 0;
while (_local3 < availablePatterns_.size()) {
var _local8 = availableShapes_.get(_local11);
var _local9 = availablePatterns_.get(_local3);
var _local5 = Number((_local8 * 1000) + _local9);
availableBagsLeft_.insert(_local5);
_local3++;
}
_local11++;
}
var _local6 = 0;
while (_local6 <= (NUM_ROWS + 1)) {
var _local7 = "";
var _local2 = 0;
while (_local2 <= (NUM_COLS + 1)) {
var _local8 = bags_[_local6][_local2].getShapeNum();
var _local9 = bags_[_local6][_local2].getPatternNum();
var _local5 = Number((_local8 * 1000) + _local9);
availableBagsLeft_.remove(_local5);
var _local4 = String(_local5);
_local11 = 0;
while (_local11 < (6 - _local4.length)) {
_local7 = _local7 + " ";
_local11++;
}
_local7 = _local7 + _local4;
_local2++;
}
_local6++;
}
_local11 = 0;
while (_local11 < 5) {
var _local10 = wantedBags_[_local11];
if (_local10 && (!_local10.isRemoved())) {
availableBagsLeft_.remove(_local10.getNum());
}
_local11++;
}
}
function initBags() {
availableBagsLeft_ = new com.midasplayer.util.ArrayList();
wantedBags_ = new Array();
var _local7 = 182;
var _local6 = 40;
var _local3 = 0;
while (_local3 < 5) {
var _local2 = getNextBag();
var _local4 = Math.floor(_local2 / 1000);
var _local5 = _local2 % 1000;
wantedBags_[_local3] = new com.midasplayer.game.fashionfactory.Bag(this, bagsLayer_, _local4, _local5);
if (_local3 >= 3) {
wantedBags_[_local3].remove();
}
wantedBags_[_local3].setX(_local7);
wantedBags_[_local3].setY(_local6);
wantedBags_[_local3].setPrize(com.midasplayer.game.fashionfactory.Game.getRandomBagPrize());
_local6 = _local6 + com.midasplayer.game.fashionfactory.Bag.HEIGHT;
_local7 = _local7 + 2;
_local3++;
}
_local3 = 0;
while (_local3 < 3) {
_local3++;
}
}
function getNextBag() {
updateAvailableBagsLeft();
var _local2 = availableBagsLeft_.size();
var _local3;
if (_local2 >= 1) {
var _local4 = random_.nextInt(_local2);
_local3 = Number(availableBagsLeft_.removeByIndex(_local4));
} else {
var _local5 = getNextShapeNum();
var _local6 = getNextPatternNum();
_local3 = (1000 * _local5) + _local6;
}
return(_local3);
}
function initTimer() {
timer_ = new com.midasplayer.timing.Timer(this, TPS);
clip_.timer = timer_;
clip_.onEnterFrame = function () {
this.timer.advanceTime();
};
}
function removeTimer() {
clip_.onEnterFrame = undefined;
delete timer_;
}
function remove() {
removeTimer();
var _local3 = 0;
while (_local3 <= (NUM_ROWS + 1)) {
var _local2 = 0;
while (_local2 <= (NUM_COLS + 1)) {
bags_[_local3][_local2].remove();
bags_[_local3][_local2].render();
_local2++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < 5) {
wantedBags_[_local4].remove();
wantedBags_[_local4].render();
_local4++;
}
bagLayer_.removeMovieClip();
maskLayer_.removeMovieClip();
shapeLayer_.removeMovieClip();
bagsLayer_.removeMovieClip();
bagsMaskLayer_.removeMovieClip();
Mouse.removeListener(this);
}
function start() {
com.midasplayer.game.fashionfactory.Game.setBagsRemoved(0);
displayBags();
}
function displayBags() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:displayBagsAnim}, {obj:this, func:displayBoardAnim}], callback:displayBagsEnd, callback_scope:this, tps:50});
}
function displayBagsAnim(tick, alpha) {
var _local2 = false;
if (tick > 10) {
wantedBags_[0].show();
}
if (tick > 20) {
wantedBags_[1].show();
}
if (tick > 30) {
wantedBags_[2].show();
}
if (tick > 40) {
_local2 = true;
}
return(_local2);
}
function displayBoardAnim(tick, alpha) {
var _local7 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 50);
var _local6 = Math.ceil((_local7 * 6) * 6) - 1;
var _local5 = Math.floor(_local6 / 6) + 1;
var _local4 = (_local6 % 6) + 1;
var _local3 = 1;
while (_local3 <= _local5) {
var _local2 = 1;
while (_local2 <= _local4) {
bags_[_local3][_local2].show();
_local2++;
}
_local3++;
}
return(_local7 == 1);
}
function displayBagsEnd() {
var _local3 = 0;
while (_local3 <= (NUM_ROWS + 1)) {
var _local2 = 0;
while (_local2 <= (NUM_COLS + 1)) {
bags_[_local3][_local2].show();
_local2++;
}
_local3++;
}
initTimer();
stopped_ = false;
}
function isStopped() {
return(stopped_);
}
function stop() {
stopped_ = true;
}
function gameOver() {
stop();
_root.game.gameOver();
}
function endRound() {
stop();
_root.game.endRound();
}
function moveBagRow(row, dx) {
var _local8 = Math.floor((dx - (dx % com.midasplayer.game.fashionfactory.Bag.WIDTH)) / com.midasplayer.game.fashionfactory.Bag.WIDTH);
dx = dx % com.midasplayer.game.fashionfactory.Bag.WIDTH;
var _local2 = 0;
while (_local2 < NUM_COLS) {
var _local5 = (_local2 - _local8) % NUM_COLS;
_local5 = (_local5 + NUM_COLS) % NUM_COLS;
bags_[row][_local2 + 1].setShapeNum(tempNumbers_[_local5]);
_local2++;
}
bags_[row][0].setShapeNum(bags_[row][NUM_COLS].getShapeNum());
bags_[row][NUM_COLS + 1].setShapeNum(bags_[row][1].getShapeNum());
_local2 = 0;
while (_local2 <= (NUM_COLS + 1)) {
var _local3 = _local2 * com.midasplayer.game.fashionfactory.Bag.WIDTH;
var _local6 = row * com.midasplayer.game.fashionfactory.Bag.HEIGHT;
_local3 = _local3 + dx;
bags_[row][_local2].setX(_local3);
bags_[row][_local2].setPatternNum(getPattern(_local3, _local6));
bags_[row][_local2].setPatternShade(getPatternShade(_local3, _local6));
_local2++;
}
}
function moveBagCol(col, dy) {
var _local8 = Math.floor((dy - (dy % com.midasplayer.game.fashionfactory.Bag.HEIGHT)) / com.midasplayer.game.fashionfactory.Bag.HEIGHT);
dy = dy % com.midasplayer.game.fashionfactory.Bag.HEIGHT;
var _local2 = 0;
while (_local2 < NUM_ROWS) {
var _local5 = (_local2 - _local8) % NUM_ROWS;
_local5 = (_local5 + NUM_ROWS) % NUM_ROWS;
bags_[_local2 + 1][col].setShapeNum(tempNumbers_[_local5]);
_local2++;
}
bags_[0][col].setShapeNum(bags_[NUM_ROWS][col].getShapeNum());
bags_[NUM_ROWS + 1][col].setShapeNum(bags_[1][col].getShapeNum());
_local2 = 0;
while (_local2 <= (NUM_ROWS + 1)) {
var _local6 = col * com.midasplayer.game.fashionfactory.Bag.WIDTH;
var _local3 = _local2 * com.midasplayer.game.fashionfactory.Bag.HEIGHT;
_local3 = _local3 + dy;
bags_[_local2][col].setY(_local3);
bags_[_local2][col].setPatternNum(getPattern(_local6, _local3));
bags_[_local2][col].setPatternShade(getPatternShade(_local6, _local3));
_local2++;
}
}
function anyMatch() {
var _local5 = 1;
while (_local5 <= NUM_ROWS) {
var _local3 = 1;
while (_local3 <= NUM_COLS) {
var _local4 = bags_[_local5][_local3].getNum();
var _local2 = 0;
while (_local2 < 5) {
if ((!wantedBags_[_local2].isRemoved()) && (_local4 == wantedBags_[_local2].getNum())) {
return(true);
}
_local2++;
}
_local3++;
}
_local5++;
}
return(false);
}
function displayPairs() {
var _local6 = 0;
var _local4 = 1;
while (_local4 <= NUM_ROWS) {
var _local3 = 1;
while (_local3 <= NUM_COLS) {
var _local5 = bags_[_local4][_local3].getNum();
var _local2 = 0;
while (_local2 < 5) {
if ((!wantedBags_[_local2].isRemoved()) && (_local5 == wantedBags_[_local2].getNum())) {
bags_[_local4][_local3].displayPair();
wantedBags_[_local2].displayPair();
_local6++;
}
_local2++;
}
_local3++;
}
_local4++;
}
if (_local6 == 1) {
com.midasplayer.fx.SoundManager.play("snd_bag_sold", 30);
}
if (_local6 == 2) {
com.midasplayer.fx.SoundManager.play("snd_bag_sold2", 30);
}
if (_local6 >= 3) {
com.midasplayer.fx.SoundManager.play("snd_bag_sold3", 30);
}
}
function removePairs() {
var _local7 = 0;
var _local8 = 0;
var _local9 = 0;
var _local4 = 0;
while (_local4 < 5) {
var _local6 = false;
var _local3 = 1;
while (_local3 <= NUM_ROWS) {
var _local2 = 1;
while (_local2 <= NUM_COLS) {
var _local5 = bags_[_local3][_local2].getNum();
if ((!wantedBags_[_local4].isRemoved()) && (_local5 == wantedBags_[_local4].getNum())) {
_local8++;
if (!_local6) {
_local9++;
_local7 = _local7 + wantedBags_[_local4].getPrize();
}
bags_[_local3][_local2].remove();
_local6 = true;
}
_local2++;
}
_local3++;
}
if (_local6) {
wantedBags_[_local4].remove();
}
_local4++;
}
if (_local8 == 2) {
_local7 = Math.round(_local7 * 1.5);
}
if (_local8 == 3) {
_local7 = _local7 * 2;
}
if (_local8 > 3) {
_local7 = _local7 * 3;
}
if (_local8 >= 2) {
numCombo_++;
}
com.midasplayer.game.fashionfactory.Game.addScore(_local7);
if (_local9 > 0) {
numBagsRemoved_ = numBagsRemoved_ + _local9;
com.midasplayer.game.fashionfactory.Game.setBagsRemoved(numBagsRemoved_);
}
}
function updateFallHeights() {
var _local4 = 1;
while (_local4 <= NUM_COLS) {
var _local6 = 0;
var _local3 = NUM_ROWS;
while (_local3 >= 0) {
var _local2 = bags_[_local3][_local4];
if (_local2.isRemoved()) {
_local6++;
}
_local3--;
}
var _local5 = 0;
_local3 = NUM_ROWS;
while (_local3 >= 1) {
var _local2 = bags_[_local3][_local4];
if (_local2.isRemoved()) {
_local2.setY((-_local5) * com.midasplayer.game.fashionfactory.Bag.HEIGHT);
_local2.setFallHeight(_local6);
_local5++;
_local2.setShapeNum(getNextShapeNum());
_local2.show();
} else {
_local2.setFallHeight(_local5);
}
_local3--;
}
_local4++;
}
}
function updateBags() {
var _local6 = new Array();
var _local4 = 1;
while (_local4 <= NUM_COLS) {
var _local7 = 0;
var _local3 = 1;
while (_local3 <= NUM_ROWS) {
var _local2 = bags_[_local3][_local4];
_local6[_local3] = _local2;
_local3++;
}
_local3 = 1;
while (_local3 <= NUM_ROWS) {
var _local2 = _local6[_local3];
var _local5 = Math.floor(_local2.getY() / com.midasplayer.game.fashionfactory.Bag.HEIGHT);
bags_[_local5][_local4] = _local2;
_local3++;
}
_local4++;
}
var _local3 = 1;
while (_local3 <= NUM_ROWS) {
bags_[_local3][0].setShapeNum(bags_[_local3][NUM_COLS].getShapeNum());
bags_[_local3][NUM_COLS + 1].setShapeNum(bags_[_local3][1].getShapeNum());
_local3++;
}
_local4 = 1;
while (_local4 <= NUM_COLS) {
bags_[0][_local4].setShapeNum(bags_[NUM_ROWS][_local4].getShapeNum());
bags_[NUM_ROWS + 1][_local4].setShapeNum(bags_[1][_local4].getShapeNum());
_local4++;
}
createNewBags();
}
function createNewBags() {
var _local3 = 0;
while (_local3 < 5) {
var _local2 = wantedBags_[_local3];
if (_local2 && (!_local2.isRemoved())) {
return(undefined);
}
_local3++;
}
newBagsCreated_ = true;
var _local7 = 3;
if (numCombo_ >= 3) {
numCombo_ = 0;
com.midasplayer.fx.SoundManager.play("snd_frenzy");
_local7 = 5;
}
_local3 = 0;
while (_local3 < _local7) {
var _local2 = wantedBags_[_local3];
if ((_local2 == undefined) || (_local2.isRemoved())) {
var _local4 = getNextBag();
var _local5 = Math.floor(_local4 / 1000);
var _local6 = _local4 % 1000;
_local2.setPatternNum(_local6);
_local2.setShapeNum(_local5);
_local2.setPrize(com.midasplayer.game.fashionfactory.Game.getRandomBagPrize());
_local2.show();
}
_local3++;
}
}
function reducePrizes() {
if (newBagsCreated_) {
return(undefined);
}
var _local3 = 0;
while (_local3 < 5) {
var _local2 = wantedBags_[_local3];
if (!_local2.isRemoved()) {
var _local4 = _local2.getPrize() - 25;
_local4 = Math.max(_local4, 50);
_local2.setPrize(_local4);
}
_local3++;
}
}
function xToCol(x) {
var _local1 = com.midasplayer.game.fashionfactory.Bag.WIDTH * NUM_COLS;
var _local2 = ((x % _local1) + _local1) % _local1;
var _local3 = (Math.round(_local2 / com.midasplayer.game.fashionfactory.Bag.WIDTH) % NUM_COLS) + 1;
return(_local3);
}
function yToRow(y) {
var _local1 = com.midasplayer.game.fashionfactory.Bag.HEIGHT * NUM_ROWS;
var _local3 = ((y % _local1) + _local1) % _local1;
var _local2 = (Math.round(_local3 / com.midasplayer.game.fashionfactory.Bag.HEIGHT) % NUM_ROWS) + 1;
return(_local2);
}
function getPattern(x, y) {
var _local3 = xToCol(x);
var _local2 = yToRow(y);
return(patternNums_[_local2][_local3]);
}
static function getPatternShade(x, y) {
var _local4 = x % com.midasplayer.game.fashionfactory.Bag.WIDTH;
var _local3 = y % com.midasplayer.game.fashionfactory.Bag.HEIGHT;
var _local2 = (Math.abs(_local4) / com.midasplayer.game.fashionfactory.Bag.WIDTH) - 0.5;
_local2 = 1 - (Math.abs(_local2) * 2);
_local2 = ((((80 * _local2) * _local2) * _local2) * _local2) * _local2;
_local2 = ((_local2 < 0) ? 0 : (_local2));
var _local1 = (Math.abs(_local3) / com.midasplayer.game.fashionfactory.Bag.HEIGHT) - 0.5;
_local1 = 1 - (Math.abs(_local1) * 2);
_local1 = ((((80 * _local1) * _local1) * _local1) * _local1) * _local1;
_local1 = ((_local1 < 0) ? 0 : (_local1));
return(Math.max(_local2, _local1));
}
function dragBag(bag) {
if (moveState_ == MOVE_STATE_WAITING_FOR_CLICK) {
dragBag_ = bag;
dragCol_ = bag.getX() / com.midasplayer.game.fashionfactory.Bag.WIDTH;
dragRow_ = bag.getY() / com.midasplayer.game.fashionfactory.Bag.HEIGHT;
xStart_ = _root._xmouse;
yStart_ = _root._ymouse;
moveState_++;
}
}
function clickBag(bag) {
if (moveState_ == MOVE_STATE_WAITING_FOR_CLICK) {
var _local4 = Math.floor(bag.getY() / com.midasplayer.game.fashionfactory.Bag.HEIGHT);
var _local3 = Math.floor(bag.getX() / com.midasplayer.game.fashionfactory.Bag.WIDTH);
com.midasplayer.util.GameBase.reportPlayData(8, (("" + _local4) + " ") + _local3, "0");
if (clickBag_ == undefined) {
com.midasplayer.fx.SoundManager.play("snd_mark");
clickBag_ = bag;
clickBag_.markClick();
} else if ((clickBag_ != bag) && (clickBag_.getNum() == bag.getNum())) {
com.midasplayer.fx.SoundManager.play("snd_pair", 50);
clickBag_.remove();
bag.remove();
com.midasplayer.game.fashionfactory.Game.addScore(com.midasplayer.game.fashionfactory.Game.getMatchScore());
newBagsCreated_ = false;
moveState_ = MOVE_STATE_FALL_DOWN;
clickBag_.unmarkClick();
clickBag_ = undefined;
} else if (clickBag_ == bag) {
com.midasplayer.fx.SoundManager.play("snd_mark");
clickBag_.unmarkClick();
clickBag_ = undefined;
} else {
com.midasplayer.fx.SoundManager.play("snd_mark");
clickBag_.unmarkClick();
clickBag_ = bag;
clickBag_.markClick();
}
}
}
function onMouseUp() {
if (moveState_ == MOVE_STATE_MOVING) {
moveState_ = MOVE_STATE_MOVED;
}
if (moveState_ == MOVE_STATE_DECIDING_DIRECTION) {
moveState_ = MOVE_STATE_WAITING_FOR_CLICK;
}
}
function tick(tick) {
if (stopped_) {
return(undefined);
}
if ((moveState_ == MOVE_STATE_WAITING_FOR_CLICK) && (numBagsRemoved_ < com.midasplayer.game.fashionfactory.Game.getBagsNeeded())) {
var _local11 = tick / TPS;
com.midasplayer.game.fashionfactory.Game.setTime(_local11);
if (_local11 > com.midasplayer.game.fashionfactory.Game.getMaxTime()) {
gameOver();
return(undefined);
}
}
if (moveState_ == MOVE_STATE_DECIDING_DIRECTION) {
var _local13 = Math.abs(_root._xmouse - xStart_);
var _local12 = Math.abs(_root._ymouse - yStart_);
var _local14 = 5;
if ((_local13 > _local14) || (_local12 > _local14)) {
if (_local13 > _local12) {
xDirection_ = 1;
yDirection_ = 0;
var _local8 = 1;
while (_local8 <= NUM_COLS) {
tempNumbers_[_local8 - 1] = bags_[dragRow_][_local8].getShapeNum();
_local8++;
}
} else {
xDirection_ = 0;
yDirection_ = 1;
var _local8 = 1;
while (_local8 <= NUM_ROWS) {
tempNumbers_[_local8 - 1] = bags_[_local8][dragCol_].getShapeNum();
_local8++;
}
}
dx_ = 0;
dy_ = 0;
moveState_++;
}
}
if (moveState_ == MOVE_STATE_MOVING) {
var _local15 = _root._xmouse;
var _local16 = _root._ymouse;
if (xDirection_ > 0) {
dx_ = _root._xmouse - xStart_;
moveBagRow(dragRow_, dx_);
} else {
dy_ = _root._ymouse - yStart_;
moveBagCol(dragCol_, dy_);
}
}
if (moveState_ == MOVE_STATE_MOVED) {
if (anyMatch()) {
if (xDirection_ > 0) {
xTarget_ = xStart_ + (Math.round(dx_ / com.midasplayer.game.fashionfactory.Bag.WIDTH) * com.midasplayer.game.fashionfactory.Bag.WIDTH);
yTarget_ = yStart_;
} else {
xTarget_ = xStart_;
yTarget_ = yStart_ + (Math.round(dy_ / com.midasplayer.game.fashionfactory.Bag.HEIGHT) * com.midasplayer.game.fashionfactory.Bag.HEIGHT);
}
} else {
xTarget_ = xStart_;
yTarget_ = yStart_;
}
moveState_ = MOVE_STATE_MOVE_TO_TARGET;
}
if (moveState_ == MOVE_STATE_MOVE_TO_TARGET) {
if (xDirection_ > 0) {
var _local6 = xStart_ + dx_;
var _local13 = xTarget_ - _local6;
var _local10 = Math.abs(_local13) / 10;
_local10 = ((_local10 < 5) ? 5 : (_local10));
_local10 = ((_local10 > 20) ? 20 : (_local10));
if (_local13 > 0) {
if ((_local6 + _local10) > xTarget_) {
_local10 = xTarget_ - _local6;
}
} else if (_local13 < 0) {
_local10 = -_local10;
if ((_local6 + _local10) < xTarget_) {
_local10 = xTarget_ - _local6;
}
} else {
_local10 = 0;
moveState_ = MOVE_STATE_DISPLAY_PAIRS;
}
dx_ = dx_ + _local10;
moveBagRow(dragRow_, dx_);
} else {
var _local4 = yStart_ + dy_;
var _local12 = yTarget_ - _local4;
var _local10 = Math.abs(_local12) / 10;
_local10 = ((_local10 < 5) ? 5 : (_local10));
_local10 = ((_local10 > 20) ? 20 : (_local10));
if (_local12 > 0) {
if ((_local4 + _local10) > yTarget_) {
_local10 = yTarget_ - _local4;
}
} else if (_local12 < 0) {
_local10 = -_local10;
if ((_local4 + _local10) < yTarget_) {
_local10 = yTarget_ - _local4;
}
} else {
_local10 = 0;
moveState_ = MOVE_STATE_DISPLAY_PAIRS;
}
dy_ = dy_ + _local10;
moveBagCol(dragCol_, dy_);
}
}
if (moveState_ == MOVE_STATE_DISPLAY_PAIRS) {
if (!anyMatch()) {
if (numBagsRemoved_ >= com.midasplayer.game.fashionfactory.Game.getBagsNeeded()) {
endRound();
return(undefined);
}
if (_local11 > com.midasplayer.game.fashionfactory.Game.getMaxTime()) {
gameOver();
return(undefined);
}
reducePrizes();
moveState_ = MOVE_STATE_WAITING_FOR_CLICK;
counter_ = 0;
} else {
if (counter_ == 5) {
displayPairs();
}
counter_++;
if (counter_ >= 25) {
moveState_++;
counter_ = 0;
}
}
}
if (moveState_ == MOVE_STATE_REMOVE_PAIRS) {
if (counter_ == 0) {
removePairs();
}
counter_++;
if (counter_ >= 1) {
moveState_++;
counter_ = 0;
}
}
if (moveState_ == MOVE_STATE_FALL_DOWN) {
if (counter_ == 0) {
updateFallHeights();
}
counter_++;
if (counter_ <= 15) {
var _local7 = 1;
while (_local7 <= NUM_ROWS) {
var _local5 = 1;
while (_local5 <= NUM_COLS) {
var _local3 = bags_[_local7][_local5];
var _local9 = (_local3.getFallHeight() * com.midasplayer.game.fashionfactory.Bag.HEIGHT) / 15;
var _local6 = _local3.getX();
var _local4 = _local3.getOrigY() + (_local9 * counter_);
_local3.setY(_local4);
_local3.setPatternNum(getPattern(_local6, _local4));
_local3.setPatternShade(getPatternShade(_local6, _local4));
_local5++;
}
_local7++;
}
} else {
updateBags();
moveState_ = MOVE_STATE_DISPLAY_PAIRS;
counter_ = 0;
}
}
lastTick_ = tick;
}
function render(tick, alpha) {
var _local3 = 0;
while (_local3 <= (NUM_ROWS + 1)) {
var _local2 = 0;
while (_local2 <= (NUM_COLS + 1)) {
bags_[_local3][_local2].render();
_local2++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < 5) {
wantedBags_[_local4].render();
_local4++;
}
}
static var NUM_COLS = 6;
static var NUM_ROWS = 6;
static var NUM_PATTERNS = 14;
static var NUM_SHAPES = 12;
static var TPS = 25;
static var BOARD_X = 285;
static var BOARD_Y = 16;
var allShapes_ = null;
var availableShapes_ = null;
var availableShapesLeft_ = null;
var allPatterns_ = null;
var availablePatterns_ = null;
var availablePatternsLeft_ = null;
static var MOVE_STATE_WAITING_FOR_CLICK = 0;
static var MOVE_STATE_DECIDING_DIRECTION = 1;
static var MOVE_STATE_MOVING = 2;
static var MOVE_STATE_MOVE_TO_TARGET = 3;
static var MOVE_STATE_MOVED = 4;
static var MOVE_STATE_DISPLAY_PAIRS = 5;
static var MOVE_STATE_REMOVE_PAIRS = 6;
static var MOVE_STATE_FALL_DOWN = 7;
static var counter_ = 0;
var moveState_ = MOVE_STATE_WAITING_FOR_CLICK;
var numBagsRemoved_ = 0;
var newBagsCreated_ = false;
var numCombo_ = 0;
}
Symbol 203 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 setTps(gameTicksPerSecond) {
this.gameTicksPerSecond = gameTicksPerSecond;
millisPerGameTick = 1000 / gameTicksPerSecond;
}
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 204 MovieClip [__Packages.com.midasplayer.game.fashionfactory.Bag] Frame 0
class com.midasplayer.game.fashionfactory.Bag
{
var board_, clip_, patternClip_, shapeClip_, poffClip_, prizetag_, origY_, shapeNum_, patternNum_;
function Bag (board, layer, shapeNum, patternNum, x, y) {
board_ = board;
var _local2 = layer.getNextHighestDepth();
clip_ = layer.createEmptyMovieClip("bag" + _local2, _local2);
patternClip_ = clip_.attachMovie("pattern", "pattern", clip_.getNextHighestDepth());
shapeClip_ = clip_.attachMovie("shape", "shape", clip_.getNextHighestDepth());
poffClip_ = clip_.attachMovie("poff", "poff", clip_.getNextHighestDepth());
poffClip_._x = WIDTH / 2;
poffClip_._y = HEIGHT / 2;
poffClip_._visible = false;
poffClip_.gotoAndStop(1);
shapeClip_.prizetagleft._visible = false;
shapeClip_.prizetagright._visible = false;
if ((_local2 % 2) == 1) {
prizetag_ = shapeClip_.prizetagleft;
} else {
prizetag_ = shapeClip_.prizetagright;
}
setShapeNum(shapeNum);
setPatternNum(patternNum);
setPatternShade(0);
setX(x);
setY(y);
render();
}
function setX(x) {
clip_._x = x;
}
function setY(y) {
clip_._y = y;
}
function getX() {
return(clip_._x);
}
function getY() {
return(clip_._y);
}
function getOrigY() {
return(origY_);
}
function setShapeNum(shapeNum) {
shapeNum_ = shapeNum;
shapeClip_.gotoAndStop(shapeNum_);
}
function setPatternNum(patternNum) {
patternNum_ = patternNum;
patternClip_.gotoAndStop(patternNum_);
}
function getShapeNum() {
return(shapeNum_);
}
function getPatternNum() {
return(patternNum_);
}
function getNum() {
return((shapeNum_ * 1000) + patternNum_);
}
function setPatternShade(a) {
if (a > 0) {
patternClip_.black._visible = true;
patternClip_.black._alpha = a;
} else {
patternClip_.black._visible = false;
}
}
function displayPair() {
visible_ = false;
poffClip_._visible = true;
poffClip_.play();
}
function isVisible() {
return(visible_);
}
function markClick() {
patternClip_.white._alpha = 50;
}
function unmarkClick() {
patternClip_.white._alpha = 0;
}
function show() {
removed_ = false;
visible_ = true;
render();
}
function remove() {
patternClip_.white._alpha = 0;
removed_ = true;
visible_ = false;
}
function isRemoved() {
return(removed_);
}
function setDragable(t) {
if (t) {
clip_.me = this;
clip_.onPress = function () {
this.me.onPress();
};
} else {
clip_.onPress = undefined;
}
}
function setFallHeight(h) {
fallHeight_ = h;
origY_ = getY();
}
function getFallHeight() {
return(fallHeight_);
}
function getPrize() {
return(prize_);
}
function setPrize(p) {
prize_ = p;
prizetag_.prize.text = prize_;
prizetag_._visible = true;
}
function onPress() {
board_.clickBag(this);
}
function render() {
if (patternClip_._visible != visible_) {
patternClip_._visible = visible_;
shapeClip_._visible = visible_;
}
}
static var WIDTH = 75;
static var HEIGHT = 65;
var visible_ = false;
var removed_ = false;
var fallHeight_ = 0;
var prize_ = 0;
}
Symbol 205 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 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 stop(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);
}
static function setTps(animId, tps) {
timers_.get(animId).setTps(tps);
}
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 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 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 206 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 207 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 208 MovieClip [__Packages.com.midasplayer.game.fashionfactory.Girl] Frame 0
class com.midasplayer.game.fashionfactory.Girl
{
var clip_, animId_;
function Girl (layer) {
var _local2 = layer.getNextHighestDepth();
clip_ = layer.attachMovie("girl", "girl", _local2);
clip_.gotoAndStop(1);
clip_.level.gotoAndStop(1);
clip_._x = X_START;
clip_._y = Y_START;
}
function idle() {
clip_._x = X_IDLE;
clip_._y = Y_IDLE;
clip_.gotoAndStop(4);
}
function walkIn(level) {
isWalking_ = true;
clip_.level.gotoAndStop(level);
animId_ = com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:walkInAnim}], callback:endWalkIn, callback_scope:this, tps:15});
}
function walkFaster() {
com.midasplayer.util.AnimPlayer.setTps(animId_, 45);
}
function walkInAnim(tick, alpha) {
var _local3 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 100);
var _local5 = ((X_IDLE - X_START) * _local2) + X_START;
var _local4 = ((Y_IDLE - Y_START) * _local2) + Y_START;
clip_._x = _local5;
clip_._y = _local4;
clip_.gotoAndStop((tick % 3) + 1);
if (_local2 == 1) {
_local3 = true;
}
return(_local3);
}
function endWalkIn() {
clip_.gotoAndStop(4);
isWalking_ = false;
}
function isWalking() {
return(isWalking_);
}
function walkOut() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:walkOutAnim}], callback:endWalkOut, callback_scope:this, tps:15});
}
function walkOutAnim(tick, alpha) {
var _local3 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 30);
var _local5 = ((X_END - X_IDLE) * _local2) + X_IDLE;
var _local4 = ((Y_END - Y_IDLE) * _local2) + Y_IDLE;
clip_._x = _local5;
clip_._y = _local4;
clip_.gotoAndStop((tick % 3) + 1);
if (_local2 == 1) {
_local3 = true;
}
return(_local3);
}
function endWalkOut() {
}
function blink() {
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:blinkAnim}], callback:endBlink, callback_scope:this, tps:15});
}
function blinkAnim(tick, alpha) {
var _local2 = false;
var _local3 = com.midasplayer.util.AnimPlayer.tickToPercent(tick, 0, 10);
clip_.gotoAndStop(5);
if (_local3 == 1) {
_local2 = true;
}
return(_local2);
}
function endBlink() {
clip_.gotoAndStop(4);
}
static var X_START = 780;
static var Y_START = 333;
static var X_IDLE = 55;
static var Y_IDLE = 300;
static var X_END = -142;
static var Y_END = 311;
var isWalking_ = false;
}
Symbol 209 MovieClip [__Packages.com.midasplayer.game.fashionfactory.IntroPlate] Frame 0
class com.midasplayer.game.fashionfactory.IntroPlate
{
var clip_, box, plateBorder_, arm1, arm2, arm3, plateTop_;
function IntroPlate (layer) {
clip_ = layer.attachMovie("smallplate", "plate", layer.getNextHighestDepth());
box = new com.midasplayer.util.AnimClip(clip_);
plateBorder_ = new com.midasplayer.util.AnimClip(clip_.border);
arm1 = new com.midasplayer.util.AnimClip(clip_.arm1);
arm2 = new com.midasplayer.util.AnimClip(clip_.arm2);
arm3 = new com.midasplayer.util.AnimClip(clip_.arm3);
plateTop_ = new com.midasplayer.util.AnimClip(clip_.top);
clip_.number.autoSize = true;
clip_.header.autoSize = true;
clip_.text.autoSize = true;
clip_.skip.autoSize = true;
setNumber("");
setHeader("");
setText("");
setSkipText("");
}
function setNumber(t) {
clip_.number.text = t;
if ((t == "") || (t == null)) {
clip_.number._visible = false;
clip_.header._x = clip_.text._x;
} else {
clip_.number._visible = true;
clip_.header._x = (clip_.number._x + clip_.number._width) + 5;
}
}
function setHeader(t) {
clip_.header.text = t;
if ((t == "") || (t == null)) {
clip_.header._visible = false;
} else {
clip_.header._visible = true;
}
}
function setText(t) {
clip_.text.text = t;
if ((t == "") || (t == null)) {
clip_.text._visible = false;
} else {
clip_.text._visible = true;
}
}
function setSkipText(t) {
clip_.skip.text = t;
if ((t == "") || (t == null)) {
clip_.skip._visible = false;
clip_.btn._visible = false;
clip_.btn.onPress = undefined;
} else {
clip_.skip._y = plateTop_.clip._height - 15;
clip_.btn._x = clip_.skip._x;
clip_.btn._y = clip_.skip._y;
clip_.btn._visible = true;
clip_.btn.onPress = function () {
this.onPress = undefined;
com.midasplayer.game.fashionfactory.Game.skipIntro();
};
clip_.skip._visible = true;
}
}
function setStartPos(x, y) {
box.setStartPos(x, y);
}
function setStopPos(x, y) {
box.setStopPos(x, y);
}
function setStartScale(x, y) {
plateBorder_.setStartScale(x, y);
var _local5 = (100 * (((x * 280) / 100) - 16.4)) / 263.6;
var _local3 = (100 * (((y * 239) / 100) - 16.5)) / 222.5;
plateTop_.setStartScale(_local5, _local3);
setStopScale(x, y);
}
function setStopScale(x, y) {
plateBorder_.setStopScale(x, y);
var _local3 = (100 * (((x * 280) / 100) - 16.4)) / 263.6;
var _local2 = (100 * (((y * 239) / 100) - 16.5)) / 222.5;
plateTop_.setStopScale(_local3, _local2);
}
function anim(cb) {
var _local2 = {callback:null, callback_scope:this, start:cb.start, stop:cb.stop};
plateBorder_.anim(cb);
plateTop_.anim(_local2);
box.anim(_local2);
}
}
Symbol 210 MovieClip [__Packages.com.midasplayer.util.AnimClip] Frame 0
class com.midasplayer.util.AnimClip
{
var x1, y1, x2, y2, xscale1, yscale1, xscale2, yscale2;
function AnimClip (mc) {
clip = mc;
}
function setStartPos(x, y) {
x1 = x;
y1 = y;
setStopPos(x, y);
}
function setStopPos(x, y) {
x2 = x;
y2 = y;
}
function setStartScale(x, y) {
xscale1 = x;
yscale1 = y;
setStopScale(x, y);
}
function setStopScale(x, y) {
xscale2 = x;
yscale2 = y;
}
function anim(cb) {
var _local6 = cb.start;
var _local4 = cb.stop;
var _local7 = cb.tps;
if (_local6 == undefined) {
_local6 = 0;
}
if (_local4 == undefined) {
_local4 = 50;
}
if (_local7 == undefined) {
_local7 = 50;
}
var _local9 = {startTick:_local6, stopTick:_local4};
com.midasplayer.util.AnimPlayer.play({playlist:[{obj:this, func:doAnim, params:_local9}], callback:cb.callback, callback_scope:cb.callback_scope, tps:_local7});
}
function doAnim(tick, alpha, params) {
var _local3 = false;
var _local2 = com.midasplayer.util.AnimPlayer.tickToPercent(tick + alpha, params.startTick, params.stopTick);
var _local5 = x2 - x1;
var _local4 = y2 - y1;
var _local7 = xscale2 - xscale1;
var _local6 = yscale2 - yscale1;
clip._visible = true;
clip._x = x1 + (_local5 * _local2);
clip._y = y1 + (_local4 * _local2);
clip._xscale = xscale1 + (_local7 * _local2);
clip._yscale = yscale1 + (_local6 * _local2);
if (_local2 == 1) {
_local3 = true;
x1 = x2;
y1 = y2;
xscale1 = xscale2;
yscale1 = yscale2;
}
return(_local3);
}
var clip = null;
}