Frame 2
stop();
var preload = setInterval(function () {
if (getBytesLoaded() == getBytesTotal()) {
gotoAndStop ("mainMenu");
clearInterval(preload);
}
var _local1 = Math.round((getBytesLoaded() / getBytesTotal()) * 100);
preloader.gotoAndStop(_local1);
}, 16, this);
Frame 4
gotoAndStop ("mainMenu");
Frame 5
new com.kaboose.games.flagbricks.Main(this);
stop();
_global.home = this;
var trackerVars_get = new LoadVars();
var trackerVars_send = new LoadVars();
trackerVars_send.gameID = home.gameID;
home.trackerVars_get.onLoad = function (success) {
if (success) {
}
};
addGamePlay = function () {
trace(msg.DEBUG + "addGameplay");
trackerVars_send.sendAndLoad(trackerURL, trackerVars_get, "POST");
};
Symbol 23 MovieClip Frame 1
stop();
Symbol 73 MovieClip [highScoresScreen] Frame 1
#initclip 35
Object.registerClass("highScoresScreen", com.kaboose.games.flagbricks.ui.highScoresScreen);
#endinitclip
Symbol 96 MovieClip [levelCompleteScreen] Frame 1
#initclip 28
Object.registerClass("levelCompleteScreen", com.kaboose.games.flagbricks.ui.levelCompleteScreen);
#endinitclip
Symbol 111 MovieClip [gameOverScreen] Frame 1
#initclip 29
Object.registerClass("gameOverScreen", com.kaboose.games.flagbricks.ui.gameOverScreen);
#endinitclip
Symbol 114 MovieClip [pausedScreen] Frame 1
#initclip 30
Object.registerClass("pausedScreen", com.kaboose.games.flagbricks.ui.PausedScreen);
#endinitclip
Symbol 120 MovieClip [confirmQuit] Frame 1
#initclip 31
Object.registerClass("confirmQuit", com.kaboose.games.flagbricks.ui.confimQuit);
#endinitclip
Symbol 129 MovieClip Frame 1
bForward = true;
stop();
Symbol 166 MovieClip [GameHud] Frame 1
#initclip 32
Object.registerClass("GameHud", com.kaboose.games.flagbricks.GameHud);
#endinitclip
Symbol 166 MovieClip [GameHud] Frame 10
stop();
introAnimationDone();
Symbol 255 MovieClip [MainMenu] Frame 1
#initclip 33
Object.registerClass("MainMenu", com.kaboose.games.flagbricks.ui.MainMenu);
#endinitclip
Symbol 255 MovieClip [MainMenu] Frame 284
initMainMenu();
Symbol 255 MovieClip [MainMenu] Frame 305
playAnimOut();
Symbol 255 MovieClip [MainMenu] Frame 329
spawnMenu(spawnMenuRef);
stop();
Symbol 255 MovieClip [MainMenu] Frame 347
gotoAndStop ("mainMenu");
Symbol 262 MovieClip [sparkle] Frame 21
stop();
this.removeMovieClip();
Symbol 277 MovieClip [instructionsPage] Frame 1
#initclip 34
Object.registerClass("instructionsPage", com.kaboose.games.flagbricks.ui.instructionsPage);
#endinitclip
stop();
initButtons();
Symbol 277 MovieClip [instructionsPage] Frame 2
stop();
initButtons();
btnRules.onPress = function () {
prevFrame();
playClickSound();
};
Symbol 279 MovieClip [gameOverTextAnim] Frame 26
stop();
var wait = setInterval(function () {
classRef.showGameOverScreen();
clearInterval(wait);
}, 2000, this);
Symbol 298 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 299 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.levelCompleteScreen] Frame 0
class com.kaboose.games.flagbricks.ui.levelCompleteScreen extends MovieClip
{
static var _instance;
var snd, sndTick, clickSnd, bonusZone, gI, currentLevel, levelScore, bonusZoneHeight, bonusX, finalX, bonusPoints, finalScore, enabled, useHandCursor, clickNotify, scoreCounter;
function levelCompleteScreen () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
sndTick = snd.createSound("TingSine");
clickSnd = snd.createSound("Maxim");
sndTick.setVolume(10);
bonusZone._height = 0;
gI = com.kaboose.games.flagbricks.GameInfo._instance;
currentLevel = gI.currentLevel;
levelScore = gI.playerScore;
var _local4 = gI.levelInfo.getMatchAreaBonus();
bonusZoneHeight = _local4 * 40;
bonusX = _local4 * 50;
finalX = levelScore + bonusX;
bonusPoints = 0;
finalScore = 0;
enabled = false;
useHandCursor = false;
clickNotify._visible = false;
scoreCounter = new mx.transitions.Tween(this, "", easeStyle, 0, 1, animTime, true);
scoreCounter.onMotionChanged = function () {
var _local2 = this._pos;
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.bonusPoints = Math.ceil(_local2 * com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.bonusX);
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.finalScore = Math.ceil(_local2 * com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.finalX);
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.gI.Hud.score = com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.levelScore + com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.bonusPoints;
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.bonusZone._height = _local2 * com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.bonusZoneHeight;
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.sndTick.stop();
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.sndTick.start();
};
scoreCounter.onMotionFinished = function () {
var _local1 = com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.snd.createSound("Bond");
_local1.start();
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.sndTick.stop();
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.enabled = true;
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.useHandCursor = true;
com.kaboose.games.flagbricks.ui.levelCompleteScreen._instance.clickNotify._visible = true;
};
}
function onPress() {
clickSnd.start();
gI.nextLevel();
_instance.removeMovieClip();
}
var easeStyle = mx.transitions.easing.None.easeNone;
var animTime = 3;
}
Symbol 300 MovieClip [__Packages.com.kaboose.games.flagbricks.SoundManager] Frame 0
class com.kaboose.games.flagbricks.SoundManager
{
static var _instance;
var soundRoot;
function SoundManager () {
_instance = this;
soundRoot = com.kaboose.games.flagbricks.GameLayers._instance.Sounds;
createSound("XurOutgoing");
createSound("XurIncoming");
createSound("Pickmeup1");
createSound("Pickmeup2");
createSound("Pickmeup3");
createSound("Pipe1");
createSound("Maxim");
createSound("Bond");
}
function setVolume(snd, value) {
if (typeof(snd) == "string") {
sndArray[snd].sndObj.setVolume(value);
} else {
snd.setVolume(value);
}
}
function playSound(libRef) {
sndArray[libRef].sndObj.start();
}
function createSound(libRef, id) {
if (id == undefined) {
id = "";
}
var _local6 = libRef + id;
var _local4 = soundRoot.createEmptyMovieClip(_local6, soundRoot.getNextHighestDepth());
var _local2 = new Sound(_local4);
_local2.attachSound(libRef);
sndArray[libRef] = {sndID:libRef, sndObj:_local2};
return(_local2);
}
function fadeOut(snd) {
var fade = setInterval(function () {
var _local1 = snd.getVolume();
snd.setVolume(_local1 - 3);
if (_local1 <= 0) {
clearInterval(fade);
snd.stop();
}
}, 16, snd);
}
var sndArray = [];
}
Symbol 301 MovieClip [__Packages.com.kaboose.games.flagbricks.GameLayers] Frame 0
class com.kaboose.games.flagbricks.GameLayers
{
static var _instance;
var appRoot, Sounds, Game, Menus, Hud, devLayer;
function GameLayers (targetMC) {
_instance = this;
appRoot = targetMC;
initLayers();
}
function initLayers() {
var _local2 = 0;
_local2++;
Sounds = appRoot.createEmptyMovieClip("Sounds", _local2);
_local2++;
Game = appRoot.createEmptyMovieClip("gameMC", _local2);
_local2++;
Menus = appRoot.createEmptyMovieClip("Menus", _local2);
_local2++;
Hud = appRoot.createEmptyMovieClip("hudMC", _local2);
_local2++;
devLayer = appRoot.createEmptyMovieClip("devLayerMC", _local2);
}
}
Symbol 302 MovieClip [__Packages.mx.utils.Delegate] Frame 0
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 303 MovieClip [__Packages.com.kaboose.games.flagbricks.GameInfo] Frame 0
class com.kaboose.games.flagbricks.GameInfo
{
static var _instance;
var snd, rowDrop, sndNextRow, gameMusic, Hud, matchPointTimer, spawnTile, nextRow, levelInfo;
function GameInfo () {
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
rowDrop = snd.createSound("Throw1");
sndNextRow = snd.createSound("Breathing1");
gameMusic = snd.createSound("Forever1");
gameMusic.setVolume(30);
gameMusic.start(0, 999);
Hud = com.kaboose.games.flagbricks.GameLayers._instance.Hud.attachMovie("GameHud", "GameHud", 1000);
Hud.subscribe(this);
Hud.setLevel(currentLevel);
com.kaboose.games.flagbricks.KeyEvents.subscribe(this);
matchPointTimer = new mx.transitions.Tween(matchPointTimerObj, "", mx.transitions.easing.None.easeNone, 100, 50, matchPointTimerTime, true);
matchPointTimer.onMotionChanged = delegate(this, matchPointTimerChanged);
matchPointTimer.stop();
spawnTile = new mx.transitions.Tween(spawnTileObj, "", mx.transitions.easing.None.easeNone, 0, 1, spawnTileTime, true);
spawnTile.onMotionFinished = delegate(this, spawnTileFinished);
spawnTile.stop();
nextRow = new mx.transitions.Tween(nextRowObj, "", mx.transitions.easing.None.easeNone, 0, 100, nextRowTime, true);
nextRow.onMotionFinished = delegate(this, nextRowDone);
nextRow.onMotionChanged = delegate(this, nextRowChange);
nextRow.stop();
levelInfo = new com.kaboose.games.flagbricks.LevelInfo(Hud);
}
function startGame() {
com.kaboose.games.flagbricks.MatchManager.reset();
bMatchPointTimerStarted = false;
Hud.enableButtons();
Hud.nextRowIndicator.gotoAndStop(1);
spawnTile.start();
}
function endGame() {
matchPointTimer.stop();
spawnTile.stop();
nextRow.stop();
levelInfo.disableFlags();
Hud.showGameOver();
snd.fadeOut(gameMusic);
playerScore = Hud.score;
}
function matchPointTimerChanged() {
Hud.setMatchPoints(Math.round(matchPointTimer._pos));
}
function restartMatchPointTimer() {
matchPointTimer.start();
}
function spawnTileFinished() {
if (levelInfo.insertNewTile()) {
nextRow.start();
sndNextRow.start();
bWaitingForNextRow = true;
if (levelInfo.bMatchAreaFull()) {
endGame();
}
return(undefined);
}
spawnTile.start();
}
function nextRowChange() {
var _local2 = Hud.nextRowIndicator;
if (bNextRowDir) {
_local2.gotoAndStop(100 + Math.round(nextRow._pos));
} else {
_local2.gotoAndStop(Math.round(nextRow._pos));
}
}
function nextRowDone() {
var _local2 = Hud.nextRowIndicator;
bWaitingForNextRow = false;
if (_local2._currentframe == 100) {
_local2.gotoAndStop(101);
bNextRowDir = true;
} else {
_local2.gotoAndStop(1);
bNextRowDir = false;
}
if (!bMatchPointTimerStarted) {
matchPointTimer.start();
bMatchPointTimerStarted = true;
}
levelInfo.resetPreview();
rowDrop.start();
spawnTile.start();
}
function levelCompleted() {
playerScore = Hud.score;
matchPointTimer.stop();
spawnTile.stop();
nextRow.stop();
Hud.showLevelCompleted();
}
function nextLevel() {
currentLevel = currentLevel + 1;
Hud.setLevel(currentLevel);
Hud.setMatchesLeft(2 + currentLevel);
levelInfo.destroy();
startGame();
}
function pause() {
matchPointTimer.stop();
spawnTile.stop();
nextRow.stop();
levelInfo.pause();
}
function resume() {
if (!bWaitingForNextRow) {
spawnTile.resume();
}
if (bWaitingForNextRow) {
nextRow.resume();
}
if (bMatchPointTimerStarted) {
matchPointTimer.resume();
}
levelInfo.resume();
}
function destroy() {
trace("destroying game.");
_global.flagbricksPlayerScore = playerScore;
levelInfo.destroy();
Hud.destroy();
for (var _local3 in this) {
delete this[_local3];
}
delete _instance;
}
var delegate = mx.utils.Delegate.create;
var bGamePaused = false;
var matchPointTimerObj = [];
var matchPointTimerTime = 20;
var bMatchPointTimerStarted = false;
var spawnTileObj = [];
var nextRowObj = [];
var spawnTileTime = 1.2;
var nextRowTime = 5;
var bWaitingForNextRow = false;
var bNextRowDir = false;
var currentLevel = 1;
var playerScore = 0;
}
Symbol 304 MovieClip [__Packages.com.kaboose.games.flagbricks.KeyEvents] Frame 0
class com.kaboose.games.flagbricks.KeyEvents
{
static var _instance;
function KeyEvents (subscriber) {
if (_instance == undefined) {
_instance = this;
AsBroadcaster.initialize(this);
subscribe(subscriber);
}
}
static function subscribe(obj) {
_instance.addListener(obj);
}
function levelCompleted() {
_instance.broadcastMessage("levelCompleted");
}
function togglePause() {
if (MovieClip.bGamePaused) {
_instance.broadcastMessage("resume");
MovieClip.bGamePaused = false;
return(undefined);
}
MovieClip.bGamePaused = true;
_instance.broadcastMessage("pause");
}
}
Symbol 305 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 306 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 307 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 308 MovieClip [__Packages.com.kaboose.games.flagbricks.LevelInfo] Frame 0
class com.kaboose.games.flagbricks.LevelInfo
{
var matchArray, previewArray;
function LevelInfo () {
com.kaboose.games.flagbricks.MatchManager.subscribe(this);
reset();
}
function bMatchAreaFull() {
var _local2 = 0;
while (_local2 < MAX_COLS) {
if (matchArray[_local2].length >= MAX_ROWS) {
return(true);
}
_local2++;
}
}
function insertNewTile() {
if (previewArray.length >= MAX_COLS) {
return(true);
}
previewArray.push(new com.kaboose.games.flagbricks.tiles.PreviewTile({index:previewArray.length, libRef:"brick_" + Math.round(Math.random() * 14)}));
}
function resetPreview() {
var _local3 = 0;
while (_local3 < MAX_COLS) {
var _local4 = new com.kaboose.games.flagbricks.tiles.MatchTile({col:0, row:_local3, libRef:previewArray[_local3].getLibRef()});
matchArray[_local3].unshift(_local4);
previewArray[_local3].destroy();
_local3++;
}
_local3 = 0;
while (_local3 < MAX_COLS) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
matchArray[_local3][_local2].anim.continueTo(_local2 * 40);
_local2++;
}
_local3++;
}
previewArray = [];
}
function removeMatch(tileObj) {
var _local3 = 0;
while (_local3 < matchArray.length) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
if (matchArray[_local3][_local2].mc._name == tileObj.mc._name) {
matchArray[_local3][_local2].destroy();
matchArray[_local3].splice(_local2, 1);
break;
}
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < MAX_COLS) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
matchArray[_local3][_local2].anim.continueTo(_local2 * 40);
_local2++;
}
_local3++;
}
}
function removeRows(tileA, tileB) {
var _local7 = [];
var _local8 = [];
var _local6 = 0;
while (_local6 < MAX_COLS) {
var _local2 = 0;
while (_local2 < matchArray[_local6].length) {
if (matchArray[_local6][_local2].mc == tileA.mc) {
_local7 = {r:_local6, c:_local2};
}
if (matchArray[_local6][_local2].mc == tileB.mc) {
_local8 = {r:_local6, c:_local2};
}
_local2++;
}
_local6++;
}
var _local4 = ((_local7.c < _local8.c) ? (_local7) : (_local8));
var _local12 = ((_local4 == _local7) ? (_local8) : (_local7));
var _local11 = _local4.r + (_local12.r - _local4.r);
trace((_local4.r + "/") + _local11);
_local6 = _local4.r;
while (_local4 < _local11) {
matchArray[_local4.c][_local6].mc._alpha = 10;
_local6++;
}
}
function getMatchAreaBonus() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < MAX_COLS) {
_local3 = ((matchArray[_local2].length > _local3) ? (matchArray[_local2].length) : (_local3));
_local2++;
}
return(MAX_ROWS - _local3);
}
function disableFlags() {
var _local3 = 0;
while (_local3 < matchArray.length) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
matchArray[_local3][_local2].slider.enabled = false;
_local2++;
}
_local3++;
}
}
function pause() {
var _local3 = 0;
while (_local3 < previewArray.length) {
previewArray[_local3].pause();
_local3++;
}
_local3 = 0;
while (_local3 < matchArray.length) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
matchArray[_local3][_local2].pause();
_local2++;
}
_local3++;
}
}
function resume() {
var _local3 = 0;
while (_local3 < previewArray.length) {
previewArray[_local3].resume();
_local3++;
}
_local3 = 0;
while (_local3 < matchArray.length) {
var _local2 = 0;
while (_local2 < matchArray[_local3].length) {
matchArray[_local3][_local2].resume();
_local2++;
}
_local3++;
}
}
function destroy() {
trace("destroying all tiles");
var _local3 = 0;
while (_local3 < MAX_COLS) {
previewArray[_local3].destroy();
_local3++;
}
_local3 = 0;
while (_local3 < MAX_COLS) {
var _local2 = 0;
while (_local2 < MAX_ROWS) {
matchArray[_local3][_local2].destroy();
_local2++;
}
_local3++;
}
reset();
}
function reset() {
trace("reset");
previewArray = Array();
matchArray = Array();
var _local2 = 0;
while (_local2 < MAX_COLS) {
matchArray[_local2] = Array();
_local2++;
}
}
var MAX_COLS = 6;
var MAX_ROWS = 9;
}
Symbol 309 MovieClip [__Packages.com.kaboose.games.flagbricks.MatchManager] Frame 0
class com.kaboose.games.flagbricks.MatchManager
{
static var _instance, tileB, tileA;
var consectiveMatch;
function MatchManager () {
_instance = this;
AsBroadcaster.initialize(this);
consectiveMatch = new mx.transitions.Tween(this, "", mx.transitions.easing.None.easeNone, 0, 1, matchTime, true);
consectiveMatch.stop();
consectiveMatch.onMotionFinished = function () {
com.kaboose.games.flagbricks.MatchManager.consectiveMatchID = 0;
};
}
static function subscribe(inObj) {
if (_instance == undefined) {
new com.kaboose.games.flagbricks.MatchManager();
}
_instance.addListener(inObj);
}
static function check(tile) {
if ((tileB != undefined) && (tileA != undefined)) {
return(false);
}
if ((tileB == undefined) && (tileA != undefined)) {
tileB = tile;
}
if (tileA == undefined) {
tileA = tile;
}
if (tilesOpen > 0) {
if (((tileA.flagName() == tileB.flagName()) || (tileA.flagName() == wildCard)) || (tileB.flagName() == wildCard)) {
_instance.consectiveMatch.start();
tileA.spawnSparkle();
tileB.spawnSparkle();
tileA.matchedTile(true, ++consectiveMatchID);
tileB.matchedTile();
return(true);
}
consectiveMatchID = 0;
tileA.close(undefined, true);
tileB.close();
}
tilesOpen++;
return(true);
}
static function reset() {
tileA = undefined;
tileB = undefined;
tilesOpen = 0;
}
static function clearMatch() {
_instance.broadcastMessage("removeMatch", tileA);
_instance.broadcastMessage("removeMatch", tileB);
reset();
}
static var tilesOpen = 0;
static var wildCard = "brick_0";
static var consectiveMatchID = 0;
static var matchTime = 3;
}
Symbol 310 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 311 MovieClip [__Packages.com.kaboose.games.flagbricks.tiles.TileGraphic] Frame 0
class com.kaboose.games.flagbricks.tiles.TileGraphic
{
function TileGraphic () {
}
static function tileMC(target, libRef) {
var _local2 = "brick";
var _local1;
var _local6 = 76;
var _local5 = 40;
if (clipcount > 400) {
clipcount = 0;
}
var _local3 = 52224 * Math.random();
_local1 = target.createEmptyMovieClip(_local2 + clipcount, ++clipcount);
_local1.libRef = libRef;
_local1.tabEnabled = false;
_local1.cacheAsBitmap = true;
_local1.attachMovie(libRef, "flag", 1);
_local1.attachMovie(_local2, "slider", 2);
return(_local1);
}
static var clipcount = 0;
}
Symbol 312 MovieClip [__Packages.com.kaboose.games.flagbricks.tiles.TileBase] Frame 0
class com.kaboose.games.flagbricks.tiles.TileBase
{
var snd, anim, updateposition, mc;
function TileBase () {
snd = com.kaboose.games.flagbricks.SoundManager._instance;
anim = new mx.transitions.Tween(this, "", easeStyle, begin, finish, animTime, true);
anim.onMotionChanged = delegate(this, updateposition);
anim.stop();
}
function continueTo(finish, duration) {
anim.continueTo(finish, duration);
}
function pause() {
anim.stop();
}
function resume() {
anim.resume();
}
function getLibRef() {
return(mc.libRef);
}
function destroy() {
anim.stop();
delete anim;
delete delegate;
mc.removeMovieClip();
}
var easeStyle = mx.transitions.easing.Strong.easeInOut;
var animTime = 1;
var begin = 0;
var finish = 1;
var tileW = 76;
var tileH = 40;
var delegate = mx.utils.Delegate.create;
var tileMC = com.kaboose.games.flagbricks.tiles.TileGraphic.tileMC;
}
Symbol 313 MovieClip [__Packages.com.kaboose.games.flagbricks.tiles.PreviewTile] Frame 0
class com.kaboose.games.flagbricks.tiles.PreviewTile extends com.kaboose.games.flagbricks.tiles.TileBase
{
var mc, tileMC, tileW, slider, flag, snd, anim;
function PreviewTile (tile) {
super();
mc = tileMC(com.kaboose.games.flagbricks.GameHud._instance.getPreviewContainer(), tile.libRef);
mc._x = -tileW;
slider = mc.slider;
flag = mc.flag;
slider._visible = false;
snd.playSound("Pipe1");
snd.setVolume("Pipe1", 20);
anim.begin = 456;
anim.finish = tileW * tile.index;
anim.start();
}
function updateposition() {
mc._x = anim._pos;
}
var easeStyle = mx.transitions.easing.Strong.easeOut;
var animTime = 0.75;
}
Symbol 314 MovieClip [__Packages.com.kaboose.games.flagbricks.GameHud] Frame 0
class com.kaboose.games.flagbricks.GameHud extends MovieClip
{
static var _instance;
var snd, btnPause, btnQuit, attachMovie, currentLevel, score, matchArea, matchPoints, matchesLeft, previewBar, removeMovieClip;
function GameHud () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
AsBroadcaster.initialize(this);
setScore(0);
setMatchPoints(100);
setMatchesLeft(2);
}
function introAnimationDone() {
var wait = setInterval(function () {
com.kaboose.games.flagbricks.GameHud._instance.broadcastMessage("startGame");
clearInterval(wait);
}, 1000, this);
}
function enableButtons() {
btnPause.onPress = function () {
com.kaboose.games.flagbricks.GameHud._instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.GameHud._instance.pauseGame();
};
btnQuit.onPress = function () {
com.kaboose.games.flagbricks.GameHud._instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.GameHud._instance.quitGame();
};
}
function subscribe(obj) {
_instance.addListener(obj);
}
function pauseGame() {
attachMovie("pausedScreen", "pausedScreen", 5);
com.kaboose.games.flagbricks.KeyEvents._instance.togglePause();
}
function quitGame() {
com.kaboose.games.flagbricks.KeyEvents._instance.togglePause();
attachMovie("confirmQuit", "gameOverScreen", 5);
}
function showLevelCompleted() {
attachMovie("levelCompleteScreen", "levelCompleteScreen", 5);
}
function showGameOver() {
attachMovie("gameOverTextAnim", "go", 5, {_x:260, _y:280, classRef:_instance});
}
function showGameOverScreen() {
attachMovie("gameOverScreen", "gameOverScreen", 5, getFinal());
}
function getFinal() {
return({finalScore:score, finalLevel:currentLevel});
}
function setLevel(value) {
currentLevel = value;
matchArea.currentLevel = value;
}
function setScore(value) {
if (value == 0) {
score = 0;
return(undefined);
}
score = score + (matchPoints * value);
_instance.broadcastMessage("restartMatchPointTimer");
updateMatches();
}
function updateMatches() {
matchesLeft = matchesLeft - 1;
if (matchesLeft == 0) {
_instance.broadcastMessage("levelCompleted");
}
}
function setMatchPoints(value) {
matchPoints = value;
}
function setMatchesLeft(value) {
matchesLeft = value;
}
function getPreviewContainer() {
return(previewBar.container);
}
function getMatchContainer() {
return(matchArea.container);
}
function destroy() {
removeMovieClip();
delete _instance;
}
}
Symbol 315 MovieClip [__Packages.com.kaboose.games.flagbricks.tiles.MatchTile] Frame 0
class com.kaboose.games.flagbricks.tiles.MatchTile extends com.kaboose.games.flagbricks.tiles.TileBase
{
var mc, tileMC, tileW, slider, flag, sliderAnim, anim, tileH, revert, snd, bReverting, pauseDelta, pauseStartTime;
function MatchTile (tile) {
super();
mc = tileMC(com.kaboose.games.flagbricks.GameHud._instance.getMatchContainer(), tile.libRef);
mc._x = tileW * tile.row;
slider = mc.slider;
flag = mc.flag;
sliderAnim = new mx.transitions.Tween(slider, "_width", easeStyle, tileW, 0, sliderAnimSpeed, true);
sliderAnim.continueTo(tileW, 0.01);
var instance = this;
slider.onPress = function () {
if (!com.kaboose.games.flagbricks.MatchManager.check(instance)) {
return(undefined);
}
instance.snd.playSound("XurIncoming");
this.enabled = false;
instance.flag._visible = true;
instance.pauseStartTime = getTimer();
instance.bReverting = true;
instance.sliderAnim.continueTo(0, instance.sliderAnimSpeed);
};
anim.begin = -40;
anim.finish = tileH * tile.col;
anim.start();
}
function flagName() {
return(mc.libRef);
}
function close(resumeTime, playCloseSnd) {
if (resumeTime == undefined) {
resumeTime = defaultWaitTime;
}
clearInterval(revert);
revert = setInterval(function (t) {
if (playCloseSnd) {
t.snd.playSound("XurOutgoing");
}
t.sliderAnim.continueTo(t.tileW, this.sliderAnimSpeed);
t.slider.enabled = true;
t.bReverting = false;
com.kaboose.games.flagbricks.MatchManager.reset();
clearInterval(t.revert);
}, resumeTime, this);
}
function matchedTile(bCall, sndID) {
if (sndID >= 3) {
sndID = 3;
}
if (bCall) {
switch (sndID) {
case 1 :
snd.playSound("Pickmeup1");
break;
case 2 :
snd.playSound("Pickmeup2");
break;
case 3 :
snd.playSound("Pickmeup3");
break;
}
}
var destroyClip = setInterval(function (mt) {
if (bCall) {
com.kaboose.games.flagbricks.GameHud._instance.setScore(sndID);
com.kaboose.games.flagbricks.MatchManager.clearMatch();
}
clearInterval(destroyClip);
}, 250, this);
}
function spawnSparkle() {
mc.attachMovie("sparkle", "sparkle", mc.getNextHighestDepth());
}
function pause() {
if (bReverting) {
clearInterval(revert);
pauseDelta = defaultWaitTime - (getTimer() - pauseStartTime);
}
sliderAnim.stop();
anim.stop();
}
function resume() {
if (bReverting) {
close(pauseDelta);
}
sliderAnim.resume();
anim.resume();
}
function destroy() {
super.destroy();
}
function updateposition() {
mc._y = anim._pos;
}
var easeStyle = mx.transitions.easing.Strong.easeOut;
var animTime = 0.75;
var sliderAnimSpeed = 0.25;
var defaultWaitTime = 500;
}
Symbol 316 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.gameOverScreen] Frame 0
class com.kaboose.games.flagbricks.ui.gameOverScreen extends MovieClip
{
static var _instance;
var snd, clickNotiy, useHandCursor, enabled;
function gameOverScreen () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
clickNotiy._visible = false;
useHandCursor = false;
enabled = false;
var waitA = setInterval(function (go) {
var _local1 = com.kaboose.games.flagbricks.ui.gameOverScreen._instance.snd.createSound("Bond");
_local1.start();
com.kaboose.games.flagbricks.ui.gameOverScreen._instance.clickNotiy._visible = true;
com.kaboose.games.flagbricks.ui.gameOverScreen._instance.useHandCursor = true;
com.kaboose.games.flagbricks.ui.gameOverScreen._instance.enabled = true;
clearInterval(waitA);
}, 2000, this);
}
function onPress() {
_instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.GameInfo._instance.destroy();
com.kaboose.games.flagbricks.ui.MenuBase._instance.showMainMenu();
_instance.removeMovieClip();
}
}
Symbol 317 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.MenuBase] Frame 0
class com.kaboose.games.flagbricks.ui.MenuBase
{
static var _instance;
function MenuBase () {
_instance = this;
showMainMenu();
}
function showMainMenu() {
com.kaboose.games.flagbricks.GameLayers._instance.Game.attachMovie(mainMenuLibRef, mainMenuLibRef, 0);
}
function showGameOverScreen(obj) {
com.kaboose.games.flagbricks.GameLayers._instance.Game.attachMovie("gameOverScreen", "gameOverScreen", 0, {finalScore:obj.finalScore, finalLevel:obj.finalLevel});
}
function playGame() {
new com.kaboose.games.flagbricks.KeyEvents();
new com.kaboose.games.flagbricks.GameInfo();
_root.addGamePlay();
}
var mainMenuLibRef = "MainMenu";
}
Symbol 318 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.PausedScreen] Frame 0
class com.kaboose.games.flagbricks.ui.PausedScreen extends MovieClip
{
static var _instance;
var snd;
function PausedScreen () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
}
function onPress() {
_instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.KeyEvents._instance.togglePause();
_instance.removeMovieClip();
}
}
Symbol 319 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.confimQuit] Frame 0
class com.kaboose.games.flagbricks.ui.confimQuit extends MovieClip
{
static var _instance;
var snd, btnYes, btnNo, bg;
function confimQuit () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
var mbase = com.kaboose.games.flagbricks.ui.MenuBase._instance;
var game = com.kaboose.games.flagbricks.GameInfo._instance;
btnYes.onPress = function () {
com.kaboose.games.flagbricks.ui.confimQuit._instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.ui.confimQuit._instance.snd.fadeOut(game.gameMusic);
com.kaboose.games.flagbricks.KeyEvents._instance.togglePause();
mbase.showGameOverScreen(game.Hud.getFinal());
game.destroy();
com.kaboose.games.flagbricks.ui.confimQuit._instance.removeMovieClip();
};
btnNo.onPress = function () {
com.kaboose.games.flagbricks.KeyEvents._instance.togglePause();
com.kaboose.games.flagbricks.ui.confimQuit._instance.snd.playSound("Maxim");
com.kaboose.games.flagbricks.ui.confimQuit._instance.removeMovieClip();
};
bg.onRollOver = function () {
this.useHandCursor = false;
};
}
}
Symbol 320 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.MainMenu] Frame 0
class com.kaboose.games.flagbricks.ui.MainMenu extends MovieClip
{
static var _instance;
var snd, menuMusic, rainSound, skipIntro, stop, btnPlayGame, btnHighScores, btnInstructions, btnTellAFriend, attachMovie, removeMovieClip;
function MainMenu () {
super();
_instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
menuMusic = snd.createSound("lounge_09_red_cat_L1");
rainSound = snd.createSound("Raining");
rainSound.start();
rainSound.setVolume(50);
skipIntro.onRollOver = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.playRollOverSound();
};
skipIntro.onPress = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.gotoAndStop("mainMenu");
com.kaboose.games.flagbricks.ui.MainMenu._instance.playClickSound();
};
}
function playClickSound() {
snd.playSound("Maxim");
}
function playRollOverSound() {
snd.playSound("Bond");
}
function initMainMenu() {
(stop());// not popped
var _local4 = com.kaboose.games.flagbricks.ui.MenuBase._instance;
snd.fadeOut(rainSound);
menuMusic.start(0, 999);
menuMusic.setVolume(50);
btnPlayGame.onRollOver = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.playRollOverSound();
};
btnPlayGame.onPress = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.spawnMenuRef = "playGame";
com.kaboose.games.flagbricks.ui.MainMenu._instance.gotoAndPlay("animOut");
com.kaboose.games.flagbricks.ui.MainMenu._instance.playClickSound();
};
btnHighScores.onRollOver = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.playRollOverSound();
};
btnHighScores.onPress = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.spawnMenu("highScoresScreen");
com.kaboose.games.flagbricks.ui.MainMenu._instance.playClickSound();
com.kaboose.games.flagbricks.ui.MainMenu._instance.enableButtons(false);
};
btnInstructions.onRollOver = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.playRollOverSound();
};
btnInstructions.onPress = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.spawnMenu("instructionsPage");
com.kaboose.games.flagbricks.ui.MainMenu._instance.playClickSound();
com.kaboose.games.flagbricks.ui.MainMenu._instance.enableButtons(false);
};
btnTellAFriend.onRollOver = function () {
com.kaboose.games.flagbricks.ui.MainMenu._instance.playRollOverSound();
};
btnTellAFriend.onPress = function () {
var _local2 = ("javascript:openTellAFriendWindow('" + _root.tellURL) + "',450,550)";
com.kaboose.games.flagbricks.ui.MainMenu._instance.getURL(_local2);
com.kaboose.games.flagbricks.ui.MainMenu._instance.playClickSound();
};
}
function enableButtons(bEnabled) {
btnPlayGame.enabled = bEnabled;
btnHighScores.enabled = bEnabled;
btnInstructions.enabled = bEnabled;
btnTellAFriend.enabled = bEnabled;
}
function playAnimOut() {
snd.fadeOut(menuMusic);
}
function spawnMenu(menuName) {
if (menuName == "playGame") {
_instance.destroy();
com.kaboose.games.flagbricks.ui.MenuBase._instance.playGame();
return(undefined);
}
attachMovie(menuName, menuName, 1);
}
function destroy() {
removeMovieClip();
}
}
Symbol 321 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.instructionsPage] Frame 0
class com.kaboose.games.flagbricks.ui.instructionsPage extends MovieClip
{
var snd, clickSnd, btnBack, btnPlayGame, btnPoints;
function instructionsPage () {
super();
initButtons();
snd = com.kaboose.games.flagbricks.SoundManager._instance;
clickSnd = snd.createSound("Maxim");
}
function initButtons() {
var instance = this;
btnBack.onRollOver = function () {
instance.snd.playSound("Bond");
};
btnBack.onPress = function () {
instance.playClickSound();
instance._parent.enableButtons(true);
instance.removeMovieClip();
};
btnPlayGame.onRollOver = function () {
instance.snd.playSound("Bond");
};
btnPlayGame.onPress = function () {
instance.playClickSound();
instance._parent.gotoAndPlay("animOut");
instance._parent.spawnMenuRef = "playGame";
instance.removeMovieClip();
};
btnPoints.onRollOver = function () {
instance.snd.playSound("Bond");
};
btnPoints.onPress = function () {
instance.playClickSound();
instance.nextFrame();
};
}
function playClickSound() {
clickSnd.start();
}
}
Symbol 322 MovieClip [__Packages.com.kaboose.games.flagbricks.ui.highScoresScreen] Frame 0
class com.kaboose.games.flagbricks.ui.highScoresScreen extends MovieClip
{
var snd, clickSnd, LogInMessage, btnLogin, btnBack;
function highScoresScreen () {
super();
var _instance = this;
snd = com.kaboose.games.flagbricks.SoundManager._instance;
clickSnd = snd.createSound("Maxim");
LogInMessage._visible = false;
btnLogin._visible = false;
trace(_global.flagbricksPlayerScore);
if (_global.home.loggedIn == 0) {
userNotLoggedIn();
_global.getScores(null, this);
} else if (_global.flagbricksPlayerScore == undefined) {
_global.getScores(null, this);
} else {
_global.getScores(_global.flagbricksPlayerScore, this);
}
btnBack.onRollOver = function () {
_instance.snd.playSound("Bond");
};
btnBack.onPress = function () {
_instance.playClickSound();
_instance._parent.enableButtons(true);
_instance.removeMovieClip();
};
btnLogin.onRollOver = function () {
_instance.snd.playSound("Bond");
};
btnLogin.onPress = function () {
var _local3 = ("javascript:openTellAFriendWindow('" + _root.tellURL) + "',450,550)";
(this.getURL(_local3));// not popped
};
}
function userNotLoggedIn() {
btnLogin._visible = true;
LogInMessage._visible = true;
}
function playClickSound() {
clickSnd.start();
}
}
Symbol 323 MovieClip [__Packages.com.kaboose.games.flagbricks.Main] Frame 0
class com.kaboose.games.flagbricks.Main
{
function Main (targetMC) {
mx.transitions.OnEnterFrameBeacon.init();
new com.kaboose.games.flagbricks.GameLayers(targetMC);
new com.kaboose.games.flagbricks.SoundManager();
new com.kaboose.games.flagbricks.ui.MenuBase();
com.kaboose.games.flagbricks.GameLayers._instance.Hud.attachMovie("gameBorder", "gameBorder", 0);
}
}
Symbol 324 MovieClip [__Packages.msg] Frame 0
class msg
{
function msg () {
}
static function isTypeof(obj) {
return(((_ + "is typeof '") + typeof(obj)) + _);
}
static function listListeners(obj) {
var _local4 = obj._listeners.length;
var _local1 = 0;
while (_local1 < _local4) {
trace(("Listener " + _local1) + " listens for these events:");
for (var _local3 in obj._listeners[_local1]) {
trace((("\t" + _local3) + " : ") + obj._listeners[_local1][_local3]);
}
_local1++;
}
}
static var ASSERT = "ASSERT: ";
static var DEBUG = "DEBUG: ";
static var INFO = "INFO: ";
static var WARN = "WARN: ";
static var ERROR = "ERROR: ";
static var _ = " ";
}