[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (382 B)
var config = (new com.xitex.tagame.TAConfig());
config.__set__introFormContainer(this.instructions);
config.__set__mainFormContainer(this.main);
config.__set__winFormContainer(this.win_window);
config.__set__looseFormContainer(this.loose_window);
config.__set__winGameFormContainer(this.win_game_window);
var game = (new com.xitex.tagame.TAGame(this, config));
game.start();
Symbol 573 MovieClip [__Packages.com.xitex.tagame.TAGame] Frame 0 (11.2 KiB) ● ●
class com.xitex.tagame.TAGame
{
var _container, _config, _gameData, _proxyCommander, _introForm, _winLevelForm, _winGameForm, _looseLevelForm, _looseGameForm, _mainForm, _level1, _level2, _bonusLevel, _state;
function TAGame (prmContainer, prmConfig) {
_container = prmContainer;
_config = prmConfig;
init();
}
function start() {
waitPlayData();
}
function init() {
com.xitex.xframework.utils.MCPlayer.__set__fps(50);
createProxyCommander();
createForms();
createLevels();
initButtons();
initLevels();
initPlayData();
}
function waitPlayData() {
_gameData.listen();
}
function initPlayData() {
_gameData = new com.xitex.tagame.proxy.TAGameData(_root);
var thisObj = this;
_gameData.onReceive = function () {
thisObj.localize();
thisObj._proxyCommander.execStartGameComm();
thisObj._proxyCommander.execVersionComm(thisObj.GAME_VERSION);
thisObj.startGame();
};
}
function createProxyCommander() {
_proxyCommander = new com.xitex.tagame.proxy.TAProxyCommander();
}
function localize() {
_introForm.localize(_gameData.__get__localeStrings().instructions_title, _gameData.__get__localeStrings().instructions_center, _gameData.__get__localeStrings().instructions_start_button, _gameData.__get__localeStrings().instructions_bottom);
_winLevelForm.localize(_gameData.__get__localeStrings().result_summary_title, _gameData.__get__localeStrings().result_score, _gameData.__get__localeStrings().result_card_bonus, _gameData.__get__localeStrings().result_scrap_bonus, _gameData.__get__localeStrings().result_time_bonus, _gameData.__get__localeStrings().result_total_score);
_winGameForm.localize(_gameData.__get__localeStrings().result_summary_title, _gameData.__get__localeStrings().result_score, _gameData.__get__localeStrings().result_card_bonus, _gameData.__get__localeStrings().result_scrap_bonus, _gameData.__get__localeStrings().result_time_bonus, _gameData.__get__localeStrings().result_total_score);
_looseLevelForm.localize(_gameData.__get__localeStrings().result_summary_title, _gameData.__get__localeStrings().result_score, _gameData.__get__localeStrings().result_card_bonus, _gameData.__get__localeStrings().result_scrap_bonus, _gameData.__get__localeStrings().result_time_bonus, _gameData.__get__localeStrings().result_total_score);
_looseGameForm.localize(_gameData.__get__localeStrings().result_summary_title, _gameData.__get__localeStrings().result_score, _gameData.__get__localeStrings().result_card_bonus, _gameData.__get__localeStrings().result_scrap_bonus, _gameData.__get__localeStrings().result_time_bonus, _gameData.__get__localeStrings().result_total_score, _gameData.__get__localeStrings().register_window_title);
_container.exit_button.standard.title_field.text = _gameData.__get__localeStrings().btn_quit_game;
_container.exit_button.insert.title_field.text = _gameData.__get__localeStrings().btn_quit_game;
_container.exit_button.press.title_field.text = _gameData.__get__localeStrings().btn_quit_game;
_container.sound_button.on_state.title_field.text = _gameData.__get__localeStrings().btn_sound_on;
_container.sound_button.off_state.title_field.text = _gameData.__get__localeStrings().btn_sound_off;
}
function startGame() {
com.xitex.tagame.TALevel.updateLevelsCompleteHistory();
_looseGameForm.setRegisterWindowEnable(_gameData.__get__openVersion());
_mainForm.setGameSeed(_gameData.__get__seed());
_level1.setTimeLimit(_gameData.__get__timeLimit());
_level2.setTimeLimit(_gameData.__get__timeLimit());
_bonusLevel.setTimeLimit(_gameData.__get__timeLimit());
_introForm.show();
_state = "intro";
}
function initButtons() {
initExitButton(_container.exit_button);
initSoundButton(_container.sound_button);
}
function initExitButton(prmButton) {
var thisObj = this;
prmButton.hit.onRollOver = function () {
prmButton.standard._visible = false;
prmButton.insert._visible = true;
prmButton.press._visible = false;
};
prmButton.hit.onRollOut = function () {
prmButton.standard._visible = true;
prmButton.insert._visible = false;
prmButton.press._visible = false;
};
prmButton.hit.onPress = function () {
prmButton.standard._visible = false;
prmButton.insert._visible = false;
prmButton.press._visible = true;
switch (thisObj._state) {
case "intro" :
thisObj._proxyCommander.execGameEndComm(thisObj._mainForm.getTotalScore());
var delayID = setInterval(function () {
thisObj._proxyCommander.execGameQuitComm();
clearInterval(delayID);
}, 1000);
return;
case "play" :
thisObj._proxyCommander.execQuitPressedComm();
com.xitex.tagame.TALevel.__set__isExitGamePressed(true);
thisObj._isExitButtonPressed = true;
thisObj._looseGameForm.setBottomText(thisObj._gameData.__get__localeStrings().bonus_game_end_bottom);
thisObj._mainForm.completeGame(false);
return;
case "result" :
thisObj._proxyCommander.execGameEndComm(thisObj._mainForm.getTotalScore());
var delayID = setInterval(function () {
thisObj._proxyCommander.execGameQuitComm();
clearInterval(delayID);
}, 1000);
return;
case "gamewin" :
thisObj._winGameForm.hide();
return;
case "gameloose" :
thisObj._looseGameForm.hide();
}
};
prmButton.hit.onRelease = prmButton.hit.onRollOver;
prmButton.hit.onRollOut();
}
function initSoundButton(prmButton) {
var globalSound = new Sound(_container);
prmButton.state = "off";
prmButton.hit.onPress = function () {
switch (prmButton.state) {
case "on" :
prmButton.on_state._visible = true;
prmButton.off_state._visible = false;
prmButton.state = "off";
globalSound.setVolume(0);
return;
case "off" :
prmButton.on_state._visible = false;
prmButton.off_state._visible = true;
prmButton.state = "on";
globalSound.setVolume(100);
}
};
prmButton.hit.onPress();
}
function createForms() {
_introForm = new com.xitex.tagame.forms.TAIntroForm(_config.__get__introFormContainer(), "top_ace_intro");
_mainForm = new com.xitex.tagame.forms.TAMainForm(_config.__get__mainFormContainer(), _proxyCommander, "new_balls", "top_ace_loop");
_winLevelForm = new com.xitex.tagame.forms.TAResultForm(_config.__get__winFormContainer(), "level_completed");
_winGameForm = new com.xitex.tagame.forms.TAResultForm(_config.__get__winGameFormContainer(), "level_completed");
_looseLevelForm = new com.xitex.tagame.forms.TAResultForm(_config.__get__looseFormContainer(), "level_completed_fail");
_looseGameForm = new com.xitex.tagame.forms.TAResultForm(_config.__get__looseFormContainer(), "level_completed_fail");
_winGameForm.setEnableTime(3500);
_looseGameForm.setEnableTime(3500);
}
function createLevels() {
com.xitex.tagame.TALevel.__set__mainForm(_mainForm);
com.xitex.tagame.TALevel.__set__winLevelForm(_winLevelForm);
com.xitex.tagame.TALevel.__set__winGameForm(_winGameForm);
com.xitex.tagame.TALevel.__set__looseLevelForm(_looseLevelForm);
com.xitex.tagame.TALevel.__set__looseGameForm(_looseGameForm);
_level1 = new com.xitex.tagame.TALevel("bg_1", "character_avatar_1");
_level2 = new com.xitex.tagame.TALevel("bg_2", "character_avatar_2");
_bonusLevel = new com.xitex.tagame.TALevel("bg_3", "character_avatar_3");
}
function initLevels() {
var thisObj = this;
_introForm.onHide = function () {
thisObj._state = "play";
thisObj._winLevelForm.setBG("level_result_1");
thisObj._looseLevelForm.setBG("level_result_1");
thisObj._looseGameForm.setBG("level_result_1");
thisObj._winLevelForm.setBottomText(thisObj._gameData.__get__localeStrings().result_bottom);
thisObj._looseLevelForm.setBottomText(thisObj._gameData.__get__localeStrings().result_bottom);
thisObj._proxyCommander.execAddLogComm("START LEVEL 1 at " + getTimer());
thisObj._proxyCommander.execStartLevelComm();
thisObj._level1.start();
};
_level1.onLevelComplete = function () {
thisObj._state = "result";
if (thisObj._isExitButtonPressed) {
thisObj._bonusLevel.onLevelComplete();
return(undefined);
}
};
_level1.onLevelEnd = function () {
thisObj._state = "play";
if (thisObj._isExitButtonPressed) {
thisObj._bonusLevel.onLevelEnd();
return(undefined);
}
thisObj._winLevelForm.setBG("level_result_2");
thisObj._looseLevelForm.setBG("level_result_2");
thisObj._looseGameForm.setBG("level_result_2");
if (thisObj._gameData.__get__openVersion()) {
thisObj._looseGameForm.setBottomText(thisObj._gameData.__get__localeStrings().bonus_game_end_bottom);
thisObj._proxyCommander.execAddLogComm("START LEVEL 2 at " + getTimer());
thisObj._proxyCommander.execStartLevelComm();
thisObj._level2.start();
thisObj._mainForm.completeGame(false);
} else {
if (this.isSuccessComplete) {
thisObj._winLevelForm.setBottomText(thisObj._gameData.__get__localeStrings().result_bottom);
thisObj._winLevelForm.setEnableTime(1);
} else {
thisObj._winLevelForm.setBottomText(thisObj._gameData.__get__localeStrings().standard_game_end_bottom);
thisObj._winLevelForm.setEnableTime(3500);
}
thisObj._looseLevelForm.setBottomText(thisObj._gameData.__get__localeStrings().result_bottom);
thisObj._looseGameForm.setBottomText(thisObj._gameData.__get__localeStrings().standard_game_end_bottom);
thisObj._proxyCommander.execAddLogComm("START LEVEL 2 at " + getTimer());
thisObj._proxyCommander.execStartLevelComm();
thisObj._level2.start();
}
};
_level2.onLevelComplete = function () {
if (thisObj._isExitButtonPressed) {
thisObj._bonusLevel.onLevelComplete();
return(undefined);
}
if (!com.xitex.tagame.TALevel.__get__isBonusLevel()) {
thisObj._state = "gameover";
thisObj._proxyCommander.execGameEndComm(thisObj._mainForm.getTotalScore());
} else {
thisObj._state = "result";
}
};
_level2.onLevelEnd = function () {
if (thisObj._isExitButtonPressed) {
thisObj._bonusLevel.onLevelEnd();
return(undefined);
}
if (com.xitex.tagame.TALevel.__get__isBonusLevel()) {
thisObj._state = "play";
thisObj._winGameForm.setBG("level_result_3");
thisObj._looseGameForm.setBG("level_result_3");
thisObj._winGameForm.setBottomText(thisObj._gameData.__get__localeStrings().bonus_game_end_bottom);
thisObj._looseGameForm.setBottomText(thisObj._gameData.__get__localeStrings().bonus_game_end_bottom);
thisObj._proxyCommander.execAddLogComm("START LEVEL 3 at " + getTimer());
thisObj._proxyCommander.execStartLevelComm();
thisObj._bonusLevel.start();
} else {
var delayID = setInterval(function () {
thisObj._proxyCommander.execGameQuitComm();
clearInterval(delayID);
}, 1000);
}
};
_bonusLevel.onLevelComplete = function () {
if (this.isSuccessComplete) {
thisObj._state = "gamewin";
} else {
thisObj._state = "gameloose";
}
thisObj._proxyCommander.execGameEndComm(thisObj._mainForm.getTotalScore());
};
_bonusLevel.onLevelEnd = function () {
var delayID = setInterval(function () {
thisObj._proxyCommander.execGameQuitComm();
clearInterval(delayID);
}, 1000);
};
}
var GAME_VERSION = "1";
}
Symbol 574 MovieClip [__Packages.com.xitex.tagame.forms.TAForm] Frame 0 (866 B)
class com.xitex.tagame.forms.TAForm
{
var _container, _introMusic, addEventListener, _visible, dispatchEvent, _enable;
function TAForm (prmContainer, prmIntroMusicLibID) {
_container = prmContainer;
_introMusic = new Sound(_root);
_introMusic.attachSound(prmIntroMusicLibID);
mx.events.EventDispatcher.initialize(this);
addEventListener("onShow", this);
addEventListener("onHide", this);
init();
}
function show() {
_introMusic.start();
_container._visible = true;
_visible = true;
dispatchEvent({type:"onShow"});
}
function hide() {
_introMusic.stop();
_container._visible = false;
_visible = false;
dispatchEvent({type:"onHide"});
}
function enable() {
_enable = true;
}
function disable() {
_enable = false;
}
function init() {
}
function get visible() {
return(_visible);
}
}
Symbol 575 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0 (2.17 KiB) ●
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 576 MovieClip [__Packages.com.xitex.tagame.forms.TAIntroForm] Frame 0 (2 KiB) ●
class com.xitex.tagame.forms.TAIntroForm extends com.xitex.tagame.forms.TAForm
{
var _timerID, _intro, _bottomText, _container, _curTime;
function TAIntroForm (prmContainer, prmIntroMusicLibID) {
super(prmContainer, prmIntroMusicLibID);
}
function hide() {
super.hide();
clearInterval(_timerID);
}
function show() {
super.show();
_intro.info_panel.seconds_field.text = getBottomText(20);
var _local3 = new com.xitex.xframework.utils.MCPlayer();
var thisObj = this;
_local3.onEndMovie = function () {
thisObj._intro.start_button._visible = true;
thisObj.initTimer();
};
_local3.play(_intro);
}
function localize(prmTitleFieldText, prmInstructionsText, prmStartButtonTitle, prmBottomText) {
_intro.start_button.standard.title_field.text = prmStartButtonTitle;
_intro.start_button.insert.title_field.text = prmStartButtonTitle;
_intro.info_panel.title_field.text = prmTitleFieldText;
_intro.info_panel.instructions_field.text = prmInstructionsText;
_bottomText = prmBottomText;
}
function init() {
_intro = _container.start.card_starts.smash_intro;
hide();
initStartButton();
}
function initStartButton() {
_intro.start_button._visible = false;
_intro.start_button.onRollOver = function () {
this.insert._visible = true;
this.standard._visible = false;
};
_intro.start_button.onRollOut = function () {
this.insert._visible = false;
this.standard._visible = true;
};
_intro.start_button.onPress = mx.utils.Delegate.create(this, hide);
_intro.start_button.onRollOut();
}
function initTimer() {
_curTime = TIME_LIMIT;
_timerID = setInterval(this, "updateTimer", 1000);
}
function updateTimer() {
if (_curTime == 0) {
hide();
}
_curTime = _curTime - 1000;
_intro.info_panel.seconds_field.text = getBottomText(_curTime / 1000);
}
function getBottomText(prmSeconds) {
var _local2 = _bottomText.split("{0}");
return((_local2[0] + String(prmSeconds)) + _local2[1]);
}
var TIME_LIMIT = 20000;
}
Symbol 577 MovieClip [__Packages.com.xitex.xframework.utils.MCPlayer] Frame 0 (1.54 KiB) ●
class com.xitex.xframework.utils.MCPlayer
{
static var _fps, __get__fps, _instance;
var _timeInterval, addEventListener, _eventFrame, _eventFunction, _content, _playID, dispatchEvent;
function MCPlayer () {
_timeInterval = Math.round(1000 / _fps);
mx.events.EventDispatcher.initialize(this);
addEventListener("onEndMovie", this);
addEventListener("onFrame", this);
}
function addEvent(prmFrameNum, prmFunction) {
_eventFrame = prmFrameNum;
_eventFunction = prmFunction;
}
function play(prmTargetMovie, prmFrame) {
_content = prmTargetMovie;
if (prmFrame == undefined) {
_content.gotoAndStop(1);
} else {
_content.gotoAndStop(prmFrame);
}
clearInterval(_playID);
_playID = setInterval(this, "shiftPlayHeader", _timeInterval);
}
function stop(prmTargetMovie, prmFrame) {
_content = prmTargetMovie;
clearInterval(_playID);
if (prmFrame == undefined) {
_content.stop();
} else {
_content.gotoAndStop(prmFrame);
}
}
function shiftPlayHeader() {
if (_content._currentframe == _content._totalframes) {
dispatchEvent({type:"onEndMovie"});
clearInterval(_playID);
} else {
dispatchEvent({type:"onFrame"});
_content.nextFrame();
}
if (_content._currentframe == _eventFrame) {
_eventFunction.apply(null, null);
}
}
static function set fps(prmValue) {
_fps = prmValue;
//return(__get__fps());
}
static function get instance() {
if (_instance == undefined) {
_instance = new com.xitex.xframework.utils.MCPlayer();
}
return(_instance);
}
}
Symbol 578 MovieClip [__Packages.mx.utils.Delegate] Frame 0 (458 B)
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 579 MovieClip [__Packages.com.xitex.tagame.forms.TAMainForm] Frame 0 (10.94 KiB) ● ●
class com.xitex.tagame.forms.TAMainForm extends com.xitex.tagame.forms.TAForm
{
var addEventListener, _bgMusic, _proxyCommander, _isGameComplete, enable, _curSelectedCard, _deck, _timer, _container, _score, _scrapPile, disable, dispatchEvent, hide, _cardColumns, _cardAnim, _cards, _clearCardSounds;
function TAMainForm (prmContainer, prmProxyCommander, prmIntroMusicLibID, prmBGMusicID) {
super(prmContainer, prmIntroMusicLibID);
addEventListener("onGameComplete", this);
_bgMusic = new Sound(_root);
_bgMusic.onSoundComplete = _bgMusic.start;
_bgMusic.attachSound(prmBGMusicID);
_proxyCommander = prmProxyCommander;
}
function start() {
_isGameComplete = false;
_bgMusic.start();
enable();
restoreColumns();
restoreScrapPile();
restoreScore();
restoreDeck();
_curSelectedCard = null;
_deck.onHitPress();
_timer.start();
}
function setBG(prmLibID) {
_container.bg.attachMovie(prmLibID, "container", 1);
}
function setOpponentAvatar(prmLibID) {
_container.character.avatar.attachMovie(prmLibID, "container", 1);
}
function setTimeLimit(prmValue) {
_timer.__set__timeLimit(prmValue);
}
function setGameSeed(prmSeed) {
_deck.setSeed(prmSeed);
}
function getTotalScore() {
return(_score.__get__totalScore());
}
function completeGame(prmSuccess) {
_isGameComplete = true;
_timer.stop();
if (prmSuccess) {
_score.setBonuses(_timer.getRestTimePercents(), _deck.getRestCardsNum(), _scrapPile.getEmtySlotsNum());
} else {
_score.setBonuses(0, 0, 0);
}
disable();
_deck.disableHit();
_proxyCommander.execAddLogComm("END LEVEL at " + getTimer());
_proxyCommander.execLevelAwardComm(prmSuccess);
_proxyCommander.execAddLogComm((((("BONUSES: curTime: " + _timer.getTimeDelta()) + " cards: ") + _deck.getRestCardsNum()) + " slots: ") + _scrapPile.getEmtySlotsNum());
_proxyCommander.execTimeDeltaComm(_timer.getTimeDelta());
_proxyCommander.execTimeBonusComm(_score.__get__timeBonusScore());
_proxyCommander.execTotalScoreComm(_score.__get__totalScore());
dispatchEvent({type:"onGameComplete", success:prmSuccess, standardScore:_score.__get__standardScore(), timeBonusScore:_score.__get__timeBonusScore(), cardBonusScore:_score.__get__cardBonusScore(), scrapBonusScore:_score.__get__scrapBonusScore(), totalScore:_score.__get__totalScore()});
}
function init() {
hide();
createCards();
createColumns();
createScrapPile();
createDeck();
createTimer();
createScore();
createCardAnim();
initCards();
initScore();
initColumns();
initScrapPile();
initDeck();
initGameField();
initSounds();
}
function restoreColumns() {
var _local3 = 4;
var _local2 = 0;
while (_local2 < _local3) {
_cardColumns[_local2].restore();
_local2++;
}
}
function restoreScrapPile() {
_scrapPile.restore();
}
function restoreScore() {
_score.restore();
}
function restoreDeck() {
_deck.restore();
}
function createCardAnim() {
_cardAnim = new com.xitex.tagame.anims.TAMoveCardAnim(_container, new flash.geom.Point(0, 0));
}
function createScore() {
var _local2 = this;
_score = new com.xitex.tagame.TAScore(_container.score);
}
function createScrapPile() {
_scrapPile = new com.xitex.tagame.areas.TAScrapPile(4, _container.scrap_pile.hit, _container.scrap_pile.cards_container, _container.scrap_pile.arrow);
_scrapPile.__set__size(4);
}
function createTimer() {
var thisObj = this;
_timer = new com.xitex.tagame.TATimer(_container.timer);
_timer.__set__timeInterval(1000);
_timer.onTimeOver = function () {
thisObj.completeGame(false);
};
}
function createCards() {
com.xitex.tagame.deck.TACard.__set__libID("card");
_cards = new Array();
var _local4 = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
var _local6 = 4;
var _local5 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
var _local2 = 0;
while (_local2 < _local5) {
_cards.push(new com.xitex.tagame.deck.TACard(_local3, _local4[_local2]));
_local2++;
}
_local3++;
}
}
function createColumns() {
_cardColumns = new Array();
var _local3 = 4;
var _local2 = 0;
while (_local2 < _local3) {
_cardColumns[_local2] = new com.xitex.tagame.areas.TACardColumn(_local2, _container["column_hit_" + _local2], _container["column_container_" + _local2]);
_local2++;
}
}
function createDeck() {
var _local2 = this;
_deck = new com.xitex.tagame.deck.TADeck(_container.deck, _cards, _cardColumns, _scrapPile);
}
function initGameField() {
var thisObj = this;
_container.bg.useHandCursor = false;
_container.bg.onPress = function () {
if (thisObj._enable) {
thisObj._curSelectedCard.unmark();
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
}
};
}
function initCards() {
var thisObj = this;
_curSelectedCard = null;
var _local5 = _cards.length;
var _local2 = 0;
while (_local2 < _local5) {
_cards[_local2].onSelect = function () {
if (thisObj._enable) {
switch (this.parentArea.type) {
case "TACardColumn" :
if (this.isToClear(thisObj._cardColumns)) {
thisObj._curSelectedCard.unmark();
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
thisObj.playCardClearSound();
this.remove();
this.parentArea.removeLastCard();
thisObj._score.addScore(this.value);
thisObj._proxyCommander.execDelComm(this.suite, this.value, this.parentArea.id, thisObj._score.__get__totalScore());
} else if (thisObj._curSelectedCard == this) {
this.unmark();
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
} else if (thisObj._curSelectedCard != null) {
thisObj._curSelectedCard.unmark();
this.mark();
thisObj._curSelectedCard = this;
thisObj._scrapPile.hideArrow();
if (!thisObj._scrapPile.isFull()) {
thisObj._scrapPile.showArrow("down");
}
} else if (thisObj._curSelectedCard == null) {
this.mark();
thisObj._curSelectedCard = this;
if (!thisObj._scrapPile.isFull()) {
thisObj._scrapPile.showArrow("down");
}
}
break;
case "TAScrapPile" :
if (thisObj._curSelectedCard == null) {
this.mark();
var _local3 = false;
var _local4 = thisObj._cardColumns.length;
var _local2 = 0;
while (_local2 < _local4) {
if ((!_local3) && (thisObj._cardColumns[_local2].isEmpty())) {
_local3 = true;
}
_local2++;
}
if (_local3) {
thisObj._scrapPile.showArrow("up");
}
thisObj._curSelectedCard = this;
} else if (thisObj._curSelectedCard == this) {
this.unmark();
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
} else if (!this.parentArea.isFull()) {
thisObj._proxyCommander.execMoveComm(thisObj._curSelectedCard.__get__suite(), thisObj._curSelectedCard.__get__value(), thisObj._curSelectedCard.__get__parentArea().__get__id(), this.parentArea.id);
thisObj._cardAnim.startMoving(thisObj._curSelectedCard, this.parentArea);
thisObj._scrapPile.slide("down");
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
} else {
if (thisObj._curSelectedCard == this) {
break;
}
thisObj._curSelectedCard.unmark();
thisObj._curSelectedCard = this;
this.mark();
var _local3 = false;
var _local4 = thisObj._cardColumns.length;
var _local2 = 0;
while (_local2 < _local4) {
if ((!_local3) && thisObj._cardColumns[_local2].isEmpty()) {
_local3 = true;
}
_local2++;
}
if (!_local3) {
break;
}
thisObj._scrapPile.showArrow("up");
}
}
thisObj._deck.updateDeckState();
}
};
_local2++;
}
}
function initScore() {
var thisObj = this;
_score.onAllTopAces = function () {
thisObj.completeGame(true);
};
}
function initColumns() {
var thisObj = this;
var _local3 = _cardColumns.length;
var _local2 = 0;
while (_local2 < _local3) {
_cardColumns[_local2].onEmptyHit = function () {
if (thisObj._enable) {
if (thisObj._curSelectedCard != null) {
thisObj._proxyCommander.execMoveComm(thisObj._curSelectedCard.__get__suite(), thisObj._curSelectedCard.__get__value(), thisObj._curSelectedCard.__get__parentArea().__get__id(), this.id);
if (thisObj._curSelectedCard.__get__parentArea().__get__type() == "TACardColumn") {
thisObj._curSelectedCard.move(this);
}
if (thisObj._curSelectedCard.__get__parentArea().__get__type() == "TAScrapPile") {
thisObj._scrapPile.slide("up");
thisObj._cardAnim.startMoving(thisObj._curSelectedCard, this);
}
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
}
thisObj._deck.updateDeckState();
}
};
_cardColumns[_local2].onTopAce = function () {
thisObj._score.addTopAce();
};
_local2++;
}
}
function initDeck() {
var thisObj = this;
_deck.onDeal = function () {
thisObj._deck.updateDeckState();
if (!thisObj._isGameComplete) {
thisObj.enable();
}
};
_deck.onHitPress = function () {
if (thisObj._enable) {
if (!this.isEmpty()) {
thisObj.disable();
thisObj._curSelectedCard.unmark();
thisObj._curSelectedCard = null;
thisObj._deck.dealCards();
thisObj._scrapPile.hideArrow();
thisObj._proxyCommander.execDealComm();
} else {
thisObj._proxyCommander.execAddLogComm("ROUND END pressed");
thisObj.completeGame(false);
}
}
};
}
function initScrapPile() {
var thisObj = this;
_scrapPile.onEmptyHit = function () {
if (thisObj._enable) {
if (thisObj._curSelectedCard != null) {
thisObj._proxyCommander.execMoveComm(thisObj._curSelectedCard.__get__suite(), thisObj._curSelectedCard.__get__value(), thisObj._curSelectedCard.__get__parentArea().__get__id(), this.id);
thisObj._cardAnim.startMoving(thisObj._curSelectedCard, thisObj._scrapPile);
thisObj._curSelectedCard = null;
thisObj._scrapPile.hideArrow();
}
}
};
_scrapPile.onNonEmptyHit = function () {
this.lastCard.onSelect();
};
_scrapPile.onCardReceive = function () {
if (thisObj._enable) {
thisObj._deck.updateDeckState();
}
};
}
function initSounds() {
_clearCardSounds = new Array();
var _local3 = 0;
while (_local3 < 5) {
_clearCardSounds[_local3] = new Sound(_root);
_clearCardSounds[_local3].attachSound("card_clear_" + Number(_local3 + 1));
_local3++;
}
}
function playCardClearSound() {
var _local2 = Math.round(Math.random() * 4);
_clearCardSounds[_local2].start();
}
}
Symbol 580 MovieClip [__Packages.com.xitex.tagame.deck.TADeck] Frame 0 (5.77 KiB) ● ●
class com.xitex.tagame.deck.TADeck
{
var _container, _patternCards, _cardColumns, _scrapPile, _isDealing, _prng, addEventListener, _curState, _useCards, _dealCards, _dealSound, _dealColumnNum, _enable, _dealAnimID, dispatchEvent, _isRollOver;
function TADeck (prmContainer, prmCards, prmColumns, prmScrapPile) {
_container = prmContainer;
_patternCards = prmCards;
_cardColumns = prmColumns;
_scrapPile = prmScrapPile;
_isDealing = false;
_prng = new com.xitex.tagame.prng.TARandomizer();
init();
mx.events.EventDispatcher.initialize(this);
addEventListener("onDeal", this);
addEventListener("onHitPress", this);
}
function updateDeckState() {
var _local4 = _cardColumns.length;
var _local3 = false;
var _local2 = 0;
while (_local2 < _local4) {
if (!_local3) {
_local3 = _cardColumns[_local2].isEmpty() || (_cardColumns[_local2].lastCard.isToClear(_cardColumns));
}
_local2++;
}
if (!_local3) {
_local3 = !_scrapPile.isFull();
}
if ((_local3 && (!isDealing)) && (!isRollOver)) {
setState("ready");
} else {
setState("deal");
}
if (isEmpty()) {
setState("take");
}
}
function setState(prmState) {
_curState = prmState.toLowerCase();
switch (_curState) {
case "take" :
_container.anim.state.take_points._visible = true;
_container.anim.state.ready._visible = false;
_container.anim.state.deal._visible = false;
break;
case "ready" :
_container.anim.state.take_points._visible = false;
_container.anim.state.ready._visible = true;
_container.anim.state.deal._visible = false;
break;
case "deal" :
_container.anim.state.take_points._visible = false;
_container.anim.state.ready._visible = false;
_container.anim.state.deal._visible = true;
}
}
function restore() {
enableHit();
_isDealing = false;
deleteDealAnim();
setCardsNum(_patternCards.length);
mix();
setState("ready");
}
function getRestCardsNum() {
return(_useCards.length);
}
function setSeed(prmSeed) {
_prng.seed(prmSeed);
}
function dealCards() {
if (!_isDealing) {
_dealCards = _useCards.slice(_useCards.length - 4, _useCards.length);
if (_useCards.length > 4) {
_useCards.length = _useCards.length - 4;
} else {
_useCards.length = 0;
}
_dealSound.start();
_isDealing = true;
_dealColumnNum = 1;
dealToNextColumn();
}
}
function enableHit() {
_enable = true;
}
function disableHit() {
_enable = false;
}
function mix() {
_useCards = new Array();
var _local3 = new Array();
var _local5 = new Array();
var _local4 = true;
while (_local4) {
var _local2 = _prng.randInt(51);
if (_local3[_local2] != "used") {
_useCards.push(_patternCards[_local2]);
_local3[_local2] = "used";
}
if (_useCards.length == _patternCards.length) {
_local4 = false;
}
}
}
function isEmpty() {
return(_useCards.length == 0);
}
function init() {
_dealSound = new Sound(_root);
_dealSound.attachSound("card_deal");
_container.hit.useHandCursor = true;
var thisObj = this;
_container.hit.onPress = function () {
thisObj.dispatchEvent({type:"onHitPress"});
};
_container.hit.onRollOver = function () {
thisObj._isRollOver = true;
thisObj.updateDeckState();
};
_container.hit.onRollOut = function () {
thisObj._isRollOver = false;
thisObj.updateDeckState();
};
}
function deleteDealAnim() {
clearInterval(_dealAnimID);
_container.anim.deal_anim._visible = false;
}
function dealToNextColumn() {
if (_dealCards.length > 0) {
startDealAnim(_cardColumns[_dealColumnNum - 1]);
_dealColumnNum++;
} else {
_isDealing = false;
dispatchEvent({type:"onDeal"});
}
}
function startDealAnim(prmColumn) {
_container.anim.deal_anim._visible = true;
var _local11 = (_container._x + _container.anim._x) + _container.anim.deal_anim._x;
var _local10 = (_container._y + _container.anim._y) + _container.anim.deal_anim._y;
var _local9 = new flash.geom.Point(_local11, _local10);
var _local7 = 9;
var _local8 = 1 / _local7;
var _local4 = 1;
var _local5;
var _local6;
var _local3;
var _local2 = 1;
while (_local2 <= _local7) {
_local4 = _local4 - _local8;
_local3 = flash.geom.Point.interpolate(_local9, prmColumn.getNextCardPoint(), _local4);
_local5 = ((_local3.x - _container._x) - _container.anim._x) - _container.anim.deal_anim._x;
_local6 = ((_local3.y - _container._y) - _container.anim._y) - _container.anim.deal_anim._y;
_container.anim.deal_anim["frame_" + Number(_local2)]._x = _local5;
_container.anim.deal_anim["frame_" + Number(_local2)]._y = _local6;
_container.anim.deal_anim["frame_" + Number(_local2)]._visible = false;
_local2++;
}
var curFrameNum = 1;
var dealCard;
var numFrames = 7;
var thisObj = this;
_dealAnimID = setInterval(function () {
thisObj._container.anim.deal_anim["frame_" + Number(curFrameNum - 1)]._visible = false;
thisObj._container.anim.deal_anim["frame_" + curFrameNum]._visible = true;
if ((++curFrameNum) > numFrames) {
thisObj.deleteDealAnim();
dealCard = thisObj._dealCards[thisObj._dealCards.length - 1];
thisObj._dealCards.length = thisObj._dealCards.length - 1;
prmColumn.addCard(dealCard);
thisObj.setCardsNum(thisObj._useCards.length + thisObj._dealCards.length);
if (thisObj._isDealing) {
thisObj.dealToNextColumn();
}
}
}, 20);
}
function setCardsNum(prmValue) {
_container.counter.counter_field.text = String(prmValue);
_container.anim.gotoAndStop((_patternCards.length - prmValue) + 1);
}
function get isDealing() {
return(_isDealing);
}
function get isRollOver() {
return(_isRollOver);
}
}
Symbol 581 MovieClip [__Packages.com.xitex.tagame.areas.TACardArea] Frame 0 (2.1 KiB) ●
class com.xitex.tagame.areas.TACardArea
{
var _id, _hit, _cardsContainer, _cards, addEventListener, _nextCardY, _isFull, _size, dispatchEvent, _enable, __get__size, _type;
function TACardArea (prmID, prmHit, prmCardsContainer) {
_id = prmID;
_hit = prmHit;
_cardsContainer = prmCardsContainer;
_cards = new Array();
mx.events.EventDispatcher.initialize(this);
addEventListener("onEmptyHit", this);
addEventListener("onNonEmptyHit", this);
addEventListener("onCardReceive", this);
init();
}
function getFreePoint() {
return(undefined);
}
function restore() {
_nextCardY = 0;
var _local3 = _cards.length;
var _local2 = 0;
while (_local2 < _local3) {
_cards[_local2].hide();
_local2++;
}
_cards = new Array();
unblockHit();
}
function addCard(prmCard) {
if (_cards.length == 0) {
blockHit();
}
prmCard.attach(_cardsContainer);
_cards[_cards.length - 1].disable();
_cards.push(prmCard);
prmCard.__set__parentArea(this);
_isFull = _size <= _cards.length;
dispatchEvent({type:"onCardReceive"});
}
function removeLastCard() {
_cards.length = _cards.length - 1;
_cards[_cards.length - 1].enable();
if (_cards.length == 0) {
unblockHit();
}
_isFull = _size <= _cards.length;
}
function isEmpty() {
return(_cards.length == 0);
}
function isFull() {
return(_isFull);
}
function init() {
_isFull = false;
_size = Number.POSITIVE_INFINITY;
initAreaHit();
}
function initAreaHit() {
var thisObj = this;
_hit.useHandCursor = true;
_hit.onPress = function () {
if (thisObj._enable) {
thisObj.dispatchEvent({type:"onEmptyHit"});
} else {
thisObj.dispatchEvent({type:"onNonEmptyHit"});
}
};
}
function blockHit() {
_enable = false;
}
function unblockHit() {
_enable = true;
}
function set size(prmValue) {
_size = prmValue;
//return(__get__size());
}
function get lastCard() {
return(_cards[_cards.length - 1]);
}
function get type() {
return(_type);
}
function get id() {
return(_id);
}
var _cardDistance = 35;
}
Symbol 582 MovieClip [__Packages.com.xitex.tagame.deck.TACard] Frame 0 (4 KiB) ●
class com.xitex.tagame.deck.TACard
{
static var _libID, __get__libID;
var _suite, _value, _markSound, _moveSound, addEventListener, _parentArea, _container, _blocking;
function TACard (prmSuiteID, prmCardValue) {
_suite = prmSuiteID;
_value = prmCardValue;
_markSound = new Sound(_root);
_markSound.attachSound("card_marked");
_moveSound = new Sound(_root);
_moveSound.attachSound("card_moved");
mx.events.EventDispatcher.initialize(this);
addEventListener("onSelect", this);
}
function move(prmCardArea) {
_moveSound.start();
hide();
_parentArea.removeLastCard();
prmCardArea.addCard(this);
}
function attach(prmCardContainer) {
_container = prmCardContainer.attachMovie(_libID, (("TACard_" + String(_suite)) + "_") + String(_value), prmCardContainer.getNextHighestDepth());
_container.points_anim._visible = false;
_container.points_anim.gotoAndStop(1);
_container._visible = false;
_container.static_card.gotoAndStop(getFrame());
unmark();
unblock();
enable();
_container.smash._visible = false;
_container.smash.gotoAndStop(1);
_container._visible = true;
createInteractive();
}
function remove() {
var obj = this;
disable();
var _local2 = new com.xitex.xframework.utils.MCPlayer();
var poitsAnimPlayer = (new com.xitex.xframework.utils.MCPlayer());
_local2.addEvent(12, function () {
obj._container.static_card._visible = false;
});
poitsAnimPlayer.onEndMovie = function () {
obj.hide();
};
_local2.onEndMovie = function () {
obj._container.points_anim.points_container.gotoAndStop(obj._value);
obj._container.points_anim._visible = true;
obj._container.smash._visible = false;
poitsAnimPlayer.play(obj._container.points_anim);
};
_local2.play(_container.smash);
_container.smash._visible = true;
}
function hide() {
_container.removeMovieClip();
}
function mark() {
_markSound.start();
_container.static_card.marker._visible = true;
}
function unmark() {
_container.static_card.marker._visible = false;
}
function block() {
_blocking = true;
_container.static_card.block._visible = true;
var _local2 = new com.xitex.xframework.utils.MCPlayer();
_local2.play(_container.static_card.block);
}
function unblock() {
_blocking = false;
_container.static_card.block._visible = false;
_container.static_card.block.gotoAndStop(1);
}
function enable() {
var thisObj = this;
_container.onPress = function () {
if (!thisObj._blocking) {
thisObj.dispatchEvent({type:"onSelect"});
}
};
}
function disable() {
delete _container.onPress;
}
function setCoordinates(prmX, prmY) {
_container._x = prmX;
_container._y = prmY;
}
function rotate(prmAngel) {
_container._rotation = prmAngel;
}
function isHigherThen(prmCard) {
return((prmCard.__get__suite() == suite) && (prmCard.__get__value() < value));
}
function isToClear(prmColumns) {
var _local4 = prmColumns.length;
var _local2 = 0;
while (_local2 < _local4) {
if ((prmColumns[_local2] != _parentArea) && (prmColumns[_local2].lastCard.isHigherThen(this))) {
return(true);
}
_local2++;
}
return(false);
}
function toString() {
return(String(((("{suite:" + _suite) + ", value:") + _value) + "}"));
}
function getFrame() {
return(_cardsIDs[_suite][_value - 2]);
}
function createInteractive() {
_container.useHandCursor = true;
}
static function set libID(prmValue) {
_libID = prmValue;
//return(__get__libID());
}
function set parentArea(prmValue) {
_parentArea = prmValue;
//return(parentArea);
}
function get parentArea() {
return(_parentArea);
}
function get suite() {
return(_suite);
}
function get value() {
return(_value);
}
static var _cardsIDs = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], [27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], [40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]];
}
Symbol 583 MovieClip [__Packages.com.xitex.tagame.areas.TAScrapPile] Frame 0 (1.9 KiB) ●
class com.xitex.tagame.areas.TAScrapPile extends com.xitex.tagame.areas.TACardArea
{
var _arrowContainer, _type, _cardsContainer, _cards, _cardDistance, _slideAnimID;
function TAScrapPile (prmID, prmHit, prmCardsContainer, prmArrowContainer) {
super(prmID, prmHit, prmCardsContainer);
_arrowContainer = prmArrowContainer;
_type = "TAScrapPile";
}
function getFreePoint() {
return(new flash.geom.Point(_cardsContainer._parent._x + _cardsContainer._x, _cardsContainer._parent._y + _cardsContainer._y));
}
function restore() {
super.restore();
hideArrow();
}
function getEmtySlotsNum() {
return(4 - _cards.length);
}
function slide(prmType) {
var numSteps = 4;
var curStepNum = 0;
var step = (_cardDistance / numSteps);
switch (prmType.toLowerCase()) {
case "up" :
step = -step;
break;
case "down" :
}
var thisObj = this;
clearInterval(_slideAnimID);
_slideAnimID = setInterval(function () {
var _local2 = thisObj._cards.length;
if (curStepNum == numSteps) {
clearInterval(thisObj._slideAnimID);
}
var _local1 = 0;
while (_local1 < _local2) {
thisObj._cards[_local1].setCoordinates(0, ((-((_local2 - _local1) - 1)) * thisObj._cardDistance) - (curStepNum * step));
_local1++;
}
curStepNum++;
}, SLIDE_INTERVAL_STEP);
}
function addCard(prmCard) {
super.addCard(prmCard);
prmCard.setCoordinates(0, 0);
}
function removeLastCard() {
super.removeLastCard();
}
function showArrow(prmType) {
switch (prmType.toLowerCase()) {
case "up" :
_arrowContainer.up._visible = true;
_arrowContainer.down._visible = false;
break;
case "down" :
_arrowContainer.up._visible = false;
_arrowContainer.down._visible = true;
}
}
function hideArrow() {
_arrowContainer.up._visible = false;
_arrowContainer.down._visible = false;
}
var SLIDE_INTERVAL_STEP = 20;
}
Symbol 584 MovieClip [__Packages.com.xitex.tagame.prng.TARandomizer] Frame 0 (1.98 KiB) ●
class com.xitex.tagame.prng.TARandomizer
{
var _states, _left, _pNext;
function TARandomizer (prmSeed) {
_states = new Array(N);
seed(prmSeed);
}
function randInt(prmN) {
var _local2 = prmN;
_local2 = _local2 | (_local2 >> 1);
_local2 = _local2 | (_local2 >> 2);
_local2 = _local2 | (_local2 >> 4);
_local2 = _local2 | (_local2 >> 8);
_local2 = _local2 | (_local2 >> 16);
var _local3;
do {
_local3 = pullInt() & _local2;
} while (_local3 > prmN);
return(_local3);
}
function seed(prmSeed) {
initialize(prmSeed);
reload();
}
function pullInt() {
if (_left == 0) {
reload();
}
_left--;
var _local2;
_local2 = _states[_pNext++];
_local2 = _local2 ^ 2514;
return(_local2);
}
function initialize(prmSeed) {
_states[0] = prmSeed & 268435455;
var _local4 = _states.length;
var _local3;
var _local2 = 1;
while (_local2 < _local4) {
_local3 = _states[_local2 - 1];
_states[_local2] = ((_local3 * a) + c) % d;
_local2++;
}
}
function reload() {
var _local2 = 0;
while (_local2 < (N - M)) {
_states[_local2] = twist(_states[(_local2 + N) - M], _states[_local2], _states[_local2 + 1]);
_local2++;
}
var _local3 = _states.length;
_local2 = N - M;
while (_local2 < (_local3 - 1)) {
_states[_local2] = twist(_states[_local2 - (N - M)], _states[_local2], _states[_local2 + 1]);
_local2++;
}
_left = N;
_pNext = 0;
}
function hiBit(prmU) {
return(prmU & 2147483648);
}
function loBit(prmU) {
return(prmU & 1);
}
function loBits(prmU) {
return(prmU & 2147483647);
}
function mixBits(prmU, prmV) {
return(hiBit(prmU) | loBits(prmV));
}
function twist(prmM, prmS0, prmS1) {
return((prmM ^ (mixBits(prmS0, prmS1) >> 1)) ^ ((-loBit(prmS1)) & 3039));
}
static var N = 624;
static var M = 397;
static var d = 714025;
static var a = 4096;
static var c = 150889;
}
Symbol 585 MovieClip [__Packages.com.xitex.tagame.areas.TACardColumn] Frame 0 (1.19 KiB) ●
class com.xitex.tagame.areas.TACardColumn extends com.xitex.tagame.areas.TACardArea
{
var addEventListener, _type, _cardsContainer, _nextCardY, _cards, dispatchEvent, _cardDistance, _hit;
function TACardColumn (prmID, prmHit, prmCardsContainer) {
super(prmID, prmHit, prmCardsContainer);
addEventListener("onTopAce", this);
_type = "TACardColumn";
}
function getFreePoint() {
return(new flash.geom.Point(_cardsContainer._parent._x + _cardsContainer._x, _cardsContainer._parent._y + _nextCardY));
}
function addCard(prmCard) {
super.addCard(prmCard);
if ((prmCard.__get__value() == 14) && (_cards.length == 1)) {
_cards[_cards.length - 1].block();
dispatchEvent({type:"onTopAce"});
}
prmCard.setCoordinates(0, _nextCardY);
_nextCardY = _nextCardY + _cardDistance;
}
function removeLastCard() {
super.removeLastCard();
_nextCardY = _nextCardY - _cardDistance;
}
function getNextCardPoint() {
return(new flash.geom.Point(_cardsContainer._x, (_cardsContainer._y + _nextCardY) + _cardDistance));
}
function blockHit() {
super.blockHit();
_hit.enabled = false;
}
function unblockHit() {
super.unblockHit();
_hit.enabled = true;
}
}
Symbol 586 MovieClip [__Packages.com.xitex.tagame.anims.TAMoveCardAnim] Frame 0 (1.44 KiB) ●
class com.xitex.tagame.anims.TAMoveCardAnim
{
var _container, _ancorPoint, _numSteps, _cardArea, _curCard, _curve, _curStepNum, _animID;
function TAMoveCardAnim (prmParentContainer, prmAncorPoint) {
_container = prmParentContainer.createEmptyMovieClip("TAMoveCardAnim", prmParentContainer.getNextHighestDepth());
_ancorPoint = prmAncorPoint;
_numSteps = 8;
}
function startMoving(prmCard, prmCardArea) {
_cardArea = prmCardArea;
_curCard = prmCard;
_curCard.hide();
_curCard.attach(_container);
var _local2 = _curCard.__get__parentArea().getFreePoint();
_curve = com.xitex.xframework.geom.BezierCurve.createQuadraticCurve(_numSteps, _local2, _ancorPoint, _cardArea.getFreePoint());
startAnim();
}
function startAnim() {
_curStepNum = 0;
nextAnimStep();
_animID = setInterval(this, "nextAnimStep", ANIM_TIME_INTERVAL);
}
function deleteAnim() {
clearInterval(_animID);
onEndAnim();
}
function onEndAnim() {
_curCard.move(_cardArea);
}
function nextAnimStep() {
_curStepNum++;
_curCard.setCoordinates(_curve[_curStepNum].x, _curve[_curStepNum].y);
if (_curStepNum == (_curve.length - 1)) {
deleteAnim();
}
if (_curStepNum == CARD_ROTATE_FRAME) {
_curCard.rotate(CARD_ROTATE_ANGEL);
}
if (_curStepNum == (_curve.length - 2)) {
_curCard.rotate(-CARD_ROTATE_ANGEL);
}
}
var ANIM_TIME_INTERVAL = 20;
var CARD_ROTATE_FRAME = 3;
var CARD_ROTATE_ANGEL = -10;
}
Symbol 587 MovieClip [__Packages.com.xitex.xframework.geom.BezierCurve] Frame 0 (808 B)
class com.xitex.xframework.geom.BezierCurve
{
function BezierCurve () {
}
static function createQuadraticCurve(prmNumCurvePoints, prmPoint0, prmPoint1, prmPoint2) {
var _local9 = 1 / prmNumCurvePoints;
var _local1 = 0;
var _local4;
var _local3;
var _local8 = new Array();
var _local2 = 0;
while (_local2 < (prmNumCurvePoints + 1)) {
_local1 = _local2 * _local9;
_local4 = ((((1 - _local1) * (1 - _local1)) * prmPoint0.x) + (((2 * _local1) * (1 - _local1)) * prmPoint1.x)) + ((_local1 * _local1) * prmPoint2.x);
_local3 = ((((1 - _local1) * (1 - _local1)) * prmPoint0.y) + (((2 * _local1) * (1 - _local1)) * prmPoint1.y)) + ((_local1 * _local1) * prmPoint2.y);
_local8.push(new flash.geom.Point(_local4, _local3));
_local2++;
}
return(_local8);
}
}
Symbol 588 MovieClip [__Packages.com.xitex.tagame.TATimer] Frame 0 (1.77 KiB) ●
class com.xitex.tagame.TATimer
{
var _container, _endTime, _warningSound, addEventListener, _sysTime, _currentTime, _timerId, _timeInterval, dispatchEvent, __get__timeInterval, __get__timeLimit;
function TATimer (prmContainer, prmTimeLimit) {
_container = prmContainer;
_endTime = prmTimeLimit;
_container.gotoAndStop(1);
_warningSound = new Sound(_container);
_warningSound.attachSound("warning_bell");
mx.events.EventDispatcher.initialize(this);
addEventListener("onInterval", this);
addEventListener("onTimeOver", this);
}
function start() {
_sysTime = getTimer();
_currentTime = 0;
clearInterval(_timerId);
_container.gotoAndStop(1);
_timerId = setInterval(this, "nexStep", _timeInterval);
}
function stop() {
_warningSound.stop();
clearInterval(_timerId);
}
function getRestTimePercents() {
var _local2 = (_endTime - (getTimer() - _sysTime)) / _endTime;
if (_local2 < 0) {
_local2 = 0;
}
return(_local2);
}
function getTimeDelta() {
var _local2 = _endTime - (getTimer() - _sysTime);
if (_local2 < 0) {
_local2 = 0;
}
return(_local2);
}
function nexStep() {
_currentTime = _currentTime + _timeInterval;
if (_currentTime == (_endTime - 5000)) {
_warningSound.start();
}
if ((_currentTime >= _endTime) && (!isNaN(_endTime))) {
_currentTime = _endTime;
stop();
dispatchEvent({type:"onTimeOver"});
}
dispatchEvent({type:"onInterval", value:_currentTime});
_container.gotoAndStop(Math.round((_currentTime / _endTime) * _container._totalframes));
}
function set timeInterval(prmValue) {
_timeInterval = prmValue;
//return(__get__timeInterval());
}
function set timeLimit(prmValue) {
_endTime = prmValue;
//return(__get__timeLimit());
}
}
Symbol 589 MovieClip [__Packages.com.xitex.tagame.TAScore] Frame 0 (2.5 KiB) ●
class com.xitex.tagame.TAScore
{
var _container, addEventListener, _standardScore, _totalScore, _numTopAces, dispatchEvent, _timeBonusScore, _cardBonusScore, _scrapBonusScore, _lockingAceSounds;
function TAScore (prmContainer) {
_container = prmContainer;
mx.events.EventDispatcher.initialize(this);
addEventListener("onAllTopAces", this);
init();
}
function restore() {
_standardScore = _totalScore;
_numTopAces = 0;
setNumBalls(0);
setScore(_standardScore);
}
function addTopAce() {
_numTopAces++;
setNumBalls(_numTopAces);
playLockingAceSound();
if (_numTopAces == 4) {
dispatchEvent({type:"onAllTopAces"});
}
}
function setNumBalls(prmValue) {
var _local5 = 4;
var _local3;
var _local2 = 0;
while (_local2 <= _local5) {
_local3 = _container["balls_" + _local2];
if (_local2 == prmValue) {
_local3._visible = true;
var _local4 = new com.xitex.xframework.utils.MCPlayer();
_local4.play(_local3, 1);
} else {
_local3._visible = false;
}
_local2++;
}
}
function addScore(prmValue) {
_standardScore = _standardScore + (prmValue * POINTS_MULTIPLAYER);
setScore(_standardScore);
_totalScore = _totalScore + (prmValue * POINTS_MULTIPLAYER);
}
function setBonuses(prmRestTimePercents, prmRestCards, prmRestScrapPileSlots) {
_timeBonusScore = Math.round(prmRestTimePercents * TIME_MULTIPLAYER);
_cardBonusScore = prmRestCards * CARDS_MULTIPLAYER;
_scrapBonusScore = prmRestScrapPileSlots * SCRAP_PILE_SLOT_MULTIPLAYER;
_totalScore = _totalScore + ((_timeBonusScore + _cardBonusScore) + _scrapBonusScore);
}
function setScore(prmValue) {
_container.score_field.text = String(prmValue);
}
function playLockingAceSound() {
_lockingAceSounds[_numTopAces - 1].start();
}
function init() {
_lockingAceSounds = new Array();
var _local3 = 0;
while (_local3 < 4) {
_lockingAceSounds[_local3] = new Sound(_root);
_lockingAceSounds[_local3].attachSound("locking_ace_" + Number(_local3 + 1));
_local3++;
}
_totalScore = 0;
}
function get standardScore() {
return(_standardScore);
}
function get timeBonusScore() {
return(_timeBonusScore);
}
function get cardBonusScore() {
return(_cardBonusScore);
}
function get scrapBonusScore() {
return(_scrapBonusScore);
}
function get totalScore() {
return(_totalScore);
}
var POINTS_MULTIPLAYER = 10;
var CARDS_MULTIPLAYER = 100;
var TIME_MULTIPLAYER = 500;
var SCRAP_PILE_SLOT_MULTIPLAYER = 250;
}
Symbol 590 MovieClip [__Packages.com.xitex.tagame.proxy.TAProxyCommander] Frame 0 (1.35 KiB) ●
class com.xitex.tagame.proxy.TAProxyCommander
{
function TAProxyCommander () {
}
function execStartGameComm() {
trace("TAProxyCommander.as LOG: gameStart");
fscommand ("gameStart");
}
function execPlayDataComm(prmCommCode, prmData, prmPoints) {
}
function execGameEndComm(prmPoints) {
trace("TAProxyCommander.as LOG: gameEnd " + prmPoints);
fscommand ("gameEnd", String(prmPoints));
}
function execGameQuitComm() {
trace("TAProxyCommander.as LOG: gameQuit");
fscommand ("gameQuit");
}
function execVersionComm(prmVersion) {
execPlayDataComm(1, prmVersion, 0);
}
function execMoveComm(prmCardSuiteID, prmCardValueID, prmFromAreaID, prmToAreaID) {
var _local1 = (((((String(prmCardSuiteID) + "_") + String(prmCardValueID)) + ":") + String(prmFromAreaID)) + "_") + String(prmToAreaID);
}
function execDelComm(prmCardSuiteID, prmCardValueID, prmFromAreaID, prmGettingScore) {
var _local1 = (((String(prmCardSuiteID) + "_") + String(prmCardValueID)) + ":") + String(prmFromAreaID);
}
function execQuitPressedComm() {
}
function execDealComm() {
}
function execTimeBonusComm(prmBonusScore) {
}
function execAddLogComm(prmLogText) {
}
function execStartLevelComm() {
}
function execTotalScoreComm(prmScore) {
}
function execLevelAwardComm(prmIsAward) {
}
function execTimeDeltaComm(prmTime) {
}
}
Symbol 591 MovieClip [__Packages.com.xitex.tagame.forms.TAResultForm] Frame 0 (5.05 KiB) ● ●
class com.xitex.tagame.forms.TAResultForm extends com.xitex.tagame.forms.TAForm
{
var _container, _registerWindowEnable, _enableTime, _bottomText, _timerID, _levelsCompleteHistory, _curLevelID, _cardBonusScore, _scrapBonusScore, _timeBonusScore, _totalScore, _prevTotalScore, _curTime;
function TAResultForm (prmContainer, prmIntroMusicLibID) {
super(prmContainer, prmIntroMusicLibID);
_container.register_window._visible = false;
_registerWindowEnable = false;
_enableTime = 1;
}
function localize(prmSummatyTitle, prmScoreTitle, prmCardBonusTitle, prmScrapBonusTitle, prmTimeBonusTitle, prmTotalScoreTitle, prmRegisterWindowTitle) {
_container.summary_field.text = prmSummatyTitle;
_container.score_title_field.text = prmScoreTitle + ":";
_container.card_bonus_title_field.text = prmCardBonusTitle + ":";
_container.scrap_bonus_title_field.text = prmScrapBonusTitle + ":";
_container.time_bonus_title_field.text = prmTimeBonusTitle + ":";
_container.total_score_title_field.text = prmTotalScoreTitle + ":";
_container.register_window.title_field.text = prmRegisterWindowTitle;
}
function setBottomText(prmValue) {
_bottomText = prmValue;
}
function setBG(prmLibID) {
_container.bg.attachMovie(prmLibID, "container", 1);
}
function hide() {
super.hide();
clearInterval(_timerID);
delete _container.onPress;
}
function setEnableTime(prmTime) {
_enableTime = prmTime;
}
function show() {
super.show();
_container.register_window._visible = _registerWindowEnable;
_container.seconds_field.text = getBottomText(TIME_LIMIT / 1000);
initTimer();
var thisObj = this;
var delayID = setInterval(function () {
thisObj.initClickEvent();
clearInterval(delayID);
}, _enableTime);
}
function setLevelsCompleteHistory(prmCurLevelId, prmValues) {
_levelsCompleteHistory = prmValues;
var _local3 = prmValues.length;
var _local2 = 0;
while (_local2 < _local3) {
_container["cup_" + Number(_local2 + 1)].gotoAndStop(10);
switch (prmValues[_local2]) {
case 0 :
_container["cup_" + Number(_local2 + 1)]._visible = false;
break;
case 1 :
if (prmCurLevelId != _local2) {
_container["cup_" + Number(_local2 + 1)]._visible = true;
_container["cup_" + Number(_local2 + 1)].gotoAndStop(_container["cup_" + Number(_local2 + 1)]._totalframes);
} else {
_container["cup_" + Number(_local2 + 1)]._visible = false;
}
}
_local2++;
}
_curLevelID = prmCurLevelId;
}
function startAnim() {
var numSteps = 10;
var curStep = 0;
var thisObj = this;
var bonusFieldAnimID = setInterval(function () {
thisObj._container.card_bonus_field.text = Math.round(thisObj._cardBonusScore * (curStep / numSteps));
thisObj._container.scrap_bonus_field.text = Math.round(thisObj._scrapBonusScore * (curStep / numSteps));
thisObj._container.time_bonus_field.text = Math.round(thisObj._timeBonusScore * (curStep / numSteps));
thisObj._container.total_score_fields.text = thisObj._prevTotalScore + Math.round((thisObj._totalScore - thisObj._prevTotalScore) * (curStep / numSteps));
curStep++;
if (curStep == numSteps) {
thisObj._container.card_bonus_field.text = thisObj._cardBonusScore;
thisObj._container.scrap_bonus_field.text = thisObj._scrapBonusScore;
thisObj._container.time_bonus_field.text = thisObj._timeBonusScore;
thisObj._container.total_score_fields.text = thisObj._totalScore;
clearInterval(bonusFieldAnimID);
if (thisObj._levelsCompleteHistory[thisObj._curLevelID] == 1) {
var _local1 = new com.xitex.xframework.utils.MCPlayer();
thisObj._container["cup_" + Number(thisObj._curLevelID + 1)]._visible = true;
_local1.play(thisObj._container["cup_" + Number(thisObj._curLevelID + 1)]);
}
}
}, 100);
}
function setScore(prmStandardScore, prmCardBonusScore, prmScrapBonusScore, prmTimeBonusScore, prmTotalScore, prmPreviousTotalScore) {
_container.score_field.text = prmStandardScore;
_cardBonusScore = prmCardBonusScore;
_scrapBonusScore = prmScrapBonusScore;
_timeBonusScore = prmTimeBonusScore;
_totalScore = prmTotalScore;
_prevTotalScore = prmPreviousTotalScore;
_container.card_bonus_field.text = "0";
_container.scrap_bonus_field.text = "0";
_container.time_bonus_field.text = "0";
_container.total_score_fields.text = String(_prevTotalScore);
}
function setRegisterWindowEnable(prmValue) {
_registerWindowEnable = prmValue;
}
function init() {
hide();
}
function initClickEvent() {
_container.useHandCursor = false;
_container.onPress = mx.utils.Delegate.create(this, hide);
}
function initTimer() {
_curTime = TIME_LIMIT;
_timerID = setInterval(this, "updateTimer", 1000);
}
function updateTimer() {
if (_curTime == 0) {
hide();
}
_curTime = _curTime - 1000;
_container.seconds_field.text = getBottomText(_curTime / 1000);
}
function getBottomText(prmSeconds) {
var _local2 = _bottomText.split("{0}");
return((_local2[0] + String(prmSeconds)) + _local2[1]);
}
var TIME_LIMIT = 10000;
}
Symbol 592 MovieClip [__Packages.com.xitex.tagame.TAConfig] Frame 0 (1.11 KiB) ●
class com.xitex.tagame.TAConfig
{
var _introFormContainer, _mainFormContainer, _winFormContainer, _looseFormContainer, _winGameFormContainer;
function TAConfig () {
}
function set introFormContainer(prmValue) {
_introFormContainer = prmValue;
//return(introFormContainer);
}
function set mainFormContainer(prmValue) {
_mainFormContainer = prmValue;
//return(mainFormContainer);
}
function set winFormContainer(prmValue) {
_winFormContainer = prmValue;
//return(winFormContainer);
}
function set looseFormContainer(prmValue) {
_looseFormContainer = prmValue;
//return(looseFormContainer);
}
function set winGameFormContainer(prmValue) {
_winGameFormContainer = prmValue;
//return(winGameFormContainer);
}
function get introFormContainer() {
return(_introFormContainer);
}
function get mainFormContainer() {
return(_mainFormContainer);
}
function get winFormContainer() {
return(_winFormContainer);
}
function get looseFormContainer() {
return(_looseFormContainer);
}
function get winGameFormContainer() {
return(_winGameFormContainer);
}
}
Symbol 593 MovieClip [__Packages.com.xitex.tagame.TALevel] Frame 0 (3.98 KiB) ●
class com.xitex.tagame.TALevel
{
static var _mainForm, _winLevelForm, _winGameForm, _looseLevelForm, _looseGameForm, _levelsCompleteHistory, __get__mainForm, __get__winLevelForm, __get__winGameForm, __get__looseLevelForm, __get__looseGameForm, _isExitGamePressed, __get__isExitGamePressed;
var _id, _bgLibID, _oppAvatarLibID, _timeLimit, addEventListener, _isSuccessComplete;
function TALevel (prmBGLibID, prmOpponentAvatarLibID, prmTimeLimit) {
_id = _numObj++;
_bgLibID = prmBGLibID;
_oppAvatarLibID = prmOpponentAvatarLibID;
_timeLimit = prmTimeLimit;
mx.events.EventDispatcher.initialize(this);
addEventListener("onLevelComplete", this);
addEventListener("onLevelEnd", this);
init();
}
function start() {
_mainForm.setBG(_bgLibID);
_mainForm.setOpponentAvatar(_oppAvatarLibID);
_mainForm.setTimeLimit(_timeLimit);
_mainForm.show();
_mainForm.start();
var thisObj = this;
_winLevelForm.onHide = function () {
thisObj.dispatchEvent({type:"onLevelEnd"});
};
_winGameForm.onHide = function () {
thisObj.dispatchEvent({type:"onLevelEnd"});
};
_looseLevelForm.onHide = function () {
thisObj.dispatchEvent({type:"onLevelEnd"});
};
_looseGameForm.onHide = function () {
thisObj.dispatchEvent({type:"onLevelEnd"});
};
var thisObj = this;
var resultForm;
var timeoutID;
_mainForm.onGameComplete = function (prmObjParams) {
thisObj._isSuccessComplete = prmObjParams.success;
com.xitex.tagame.TALevel._levelsCompleteHistory[thisObj._id] = (prmObjParams.success ? 1 : 0);
thisObj.dispatchEvent({type:"onLevelComplete"});
if (prmObjParams.success) {
if ((com.xitex.tagame.TALevel._numObj - 1) == thisObj._id) {
resultForm = com.xitex.tagame.TALevel._winGameForm;
} else {
resultForm = com.xitex.tagame.TALevel._winLevelForm;
}
} else if ((com.xitex.tagame.TALevel._isExitGamePressed || ((com.xitex.tagame.TALevel._numObj - 1) == thisObj._id)) || (((com.xitex.tagame.TALevel._numObj - 2) == thisObj._id) && (!com.xitex.tagame.TALevel.__get__isBonusLevel()))) {
resultForm = com.xitex.tagame.TALevel._looseGameForm;
} else {
resultForm = com.xitex.tagame.TALevel._looseLevelForm;
}
timeoutID = setInterval(function () {
clearInterval(timeoutID);
com.xitex.tagame.TALevel._mainForm.hide();
resultForm.setScore(prmObjParams.standardScore, prmObjParams.cardBonusScore, prmObjParams.scrapBonusScore, prmObjParams.timeBonusScore, prmObjParams.totalScore, com.xitex.tagame.TALevel._levelsScore);
com.xitex.tagame.TALevel._levelsScore = prmObjParams.totalScore;
resultForm.setLevelsCompleteHistory(thisObj._id, com.xitex.tagame.TALevel._levelsCompleteHistory);
resultForm.show();
resultForm.startAnim();
}, 2700);
};
}
static function updateLevelsCompleteHistory() {
_levelsCompleteHistory = [0, 0, 0];
}
function setTimeLimit(prmTime) {
_timeLimit = prmTime;
}
function toString() {
return(((("{bg: " + _bgLibID) + ", timelimit: ") + _timeLimit) + "}");
}
function init() {
}
static function set mainForm(prmValue) {
_mainForm = prmValue;
//return(__get__mainForm());
}
static function set winLevelForm(prmValue) {
_winLevelForm = prmValue;
//return(__get__winLevelForm());
}
static function set winGameForm(prmValue) {
_winGameForm = prmValue;
//return(__get__winGameForm());
}
static function set looseLevelForm(prmValue) {
_looseLevelForm = prmValue;
//return(__get__looseLevelForm());
}
static function set looseGameForm(prmValue) {
_looseGameForm = prmValue;
//return(__get__looseGameForm());
}
static function set isExitGamePressed(prmValue) {
_isExitGamePressed = prmValue;
//return(__get__isExitGamePressed());
}
function get isSuccessComplete() {
return(_isSuccessComplete);
}
static function get isBonusLevel() {
return(Boolean(_levelsCompleteHistory[0] && (_levelsCompleteHistory[1])));
}
static var _numObj = 0;
static var _levelsScore = 0;
}
Symbol 594 MovieClip [__Packages.com.xitex.tagame.proxy.TAGameData] Frame 0 (1.45 KiB) ●
class com.xitex.tagame.proxy.TAGameData
{
var _container, addEventListener, _timerID, _localeStrings, _openVersion, _timeLimit, _seed, dispatchEvent;
function TAGameData (prmContainer) {
_container = prmContainer;
mx.events.EventDispatcher.initialize(this);
addEventListener("onReceive", this);
}
function listen() {
_timerID = setInterval(this, "checkUpdate", 20);
}
function checkUpdate() {
if (_container.gameData != undefined) {
_localeStrings = new Array();
var _local2 = new XML();
_local2.ignoreWhite = true;
_local2.parseXML(_container.gameData);
var _local4 = new Array();
for (var _local5 in _local2.firstChild.attributes) {
_local4[_local5] = _local2.firstChild.attributes[_local5];
}
var _local3;
for (var _local5 in _local2.firstChild.childNodes) {
_local3 = _local2.firstChild.childNodes[_local5];
if (_local3.nodeName == "text") {
_localeStrings[_local3.attributes.id] = _local3.firstChild.nodeValue;
}
}
_openVersion = ((_local4.open_version == "true") ? true : false);
_timeLimit = parseInt(_local4.timelimit) * 1000;
_seed = parseInt(_local4.randomseed);
clearInterval(_timerID);
dispatchEvent({type:"onReceive"});
}
}
function get openVersion() {
return(_openVersion);
}
function get timeLimit() {
return(_timeLimit);
}
function get seed() {
return(_seed);
}
function get localeStrings() {
return(_localeStrings);
}
}