Frame 1
stop();
var totalBytes = this.getBytesTotal();
this.onEnterFrame = function () {
var _local3 = this.getBytesLoaded();
var _local2 = Math.round((_local3 / totalBytes) * 100);
load_mc.gotoAndStop(_local2);
perc_txt.text = _local2 + "%";
if (_local2 >= 100) {
play();
delete this.onEnterFrame;
}
};
Frame 9
stop();
perc_txt.text = "0%";
_global.controlPanel.onDone = function () {
trace("All panels loaded");
_root.play();
};
_global.controlPanel.Init();
_global.soundPanel.onProgress = function ($loaded, $total, $name) {
load_txt.text = "SOUNDS";
var _local1 = Math.round(($loaded / $total) * 100);
perc_txt.text = _local1 + "%";
};
_global.bmpPanel.onProgress = function ($loaded, $total, $name) {
load_txt.text = "TEXTURES";
var _local1 = Math.round(($loaded / $total) * 100);
perc_txt.text = _local1 + "%";
};
_global.xmlPanel.onProgress = function ($loaded, $total) {
load_txt.text = "XML";
var _local1 = Math.round(($loaded / $total) * 100);
perc_txt.text = _local1 + "%";
trace(_local1);
};
Instance of Symbol 119 MovieClip [jBitmap Panel] in Frame 9
//component parameters
onClipEvent (construct) {
picFolder = "runtimeAssets/Pics/";
searchKey = 86;
_searchKey = 36091;
Name_array = [];
Name_array[0] = "badCut.png";
Name_array[1] = "bunny.png";
Name_array[2] = "bunny_mask.png";
Name_array[3] = "bunnybig.png";
Name_array[4] = "bunnybig_mask.png";
Name_array[5] = "bunnymed.png";
Name_array[6] = "bunnymed_mask.png";
Name_array[7] = "cat.png";
Name_array[8] = "catbig.png";
Name_array[9] = "catbig_mask.png";
Name_array[10] = "catmed.png";
Name_array[11] = "catmed_mask.png";
Name_array[12] = "cat_mask.png";
Name_array[13] = "dog.png";
Name_array[14] = "dog_mask.png";
Name_array[15] = "dogbig.png";
Name_array[16] = "dogbig_mask.png";
Name_array[17] = "dogmed.png";
Name_array[18] = "dogmed_mask.png";
Name_array[19] = "dough0.jpg";
Name_array[20] = "dough1.jpg";
Name_array[21] = "dough2.jpg";
Name_array[22] = "dough3.jpg";
Name_array[23] = "dough3.png";
Name_array[24] = "doughMask.png";
Name_array[25] = "flourMask.png";
Name_array[26] = "parrot.png";
Name_array[27] = "parrot_mask.png";
Name_array[28] = "parrotbig.png";
Name_array[29] = "parrotbig_mask.png";
Name_array[30] = "parrotmed.png";
Name_array[31] = "parrotmed_mask.png";
Name_array[32] = "snake.png";
Name_array[33] = "snake_mask.png";
Name_array[34] = "snakebig.png";
Name_array[35] = "snakebig_mask.png";
Name_array[36] = "snakemed.png";
Name_array[37] = "snakemed_mask.png";
Name_array[38] = "dough4.jpg";
onDemand_array = [];
onDemand_array[0] = false;
onDemand_array[1] = false;
onDemand_array[2] = false;
onDemand_array[3] = false;
onDemand_array[4] = false;
onDemand_array[5] = false;
onDemand_array[6] = false;
onDemand_array[7] = false;
onDemand_array[8] = false;
onDemand_array[9] = false;
onDemand_array[10] = false;
onDemand_array[11] = false;
onDemand_array[12] = false;
onDemand_array[13] = false;
onDemand_array[14] = false;
onDemand_array[15] = false;
onDemand_array[16] = false;
onDemand_array[17] = false;
onDemand_array[18] = false;
onDemand_array[19] = false;
onDemand_array[20] = false;
onDemand_array[21] = true;
onDemand_array[22] = false;
onDemand_array[23] = false;
onDemand_array[24] = false;
onDemand_array[25] = false;
onDemand_array[26] = false;
onDemand_array[27] = false;
onDemand_array[28] = false;
onDemand_array[29] = false;
onDemand_array[30] = false;
onDemand_array[31] = false;
onDemand_array[32] = false;
onDemand_array[33] = false;
onDemand_array[34] = false;
onDemand_array[35] = false;
onDemand_array[36] = false;
onDemand_array[37] = false;
onDemand_array[38] = false;
autoInitialize = false;
isExternal_array = [];
isExternal_array[0] = false;
isExternal_array[1] = false;
isExternal_array[2] = false;
isExternal_array[3] = false;
isExternal_array[4] = false;
isExternal_array[5] = false;
isExternal_array[6] = false;
isExternal_array[7] = false;
isExternal_array[8] = false;
isExternal_array[9] = false;
isExternal_array[10] = false;
isExternal_array[11] = false;
isExternal_array[12] = false;
isExternal_array[13] = false;
isExternal_array[14] = false;
isExternal_array[15] = false;
isExternal_array[16] = false;
isExternal_array[17] = false;
isExternal_array[18] = false;
isExternal_array[19] = false;
isExternal_array[20] = false;
isExternal_array[21] = false;
isExternal_array[22] = false;
isExternal_array[23] = false;
isExternal_array[24] = false;
isExternal_array[25] = false;
isExternal_array[26] = false;
isExternal_array[27] = false;
isExternal_array[28] = false;
isExternal_array[29] = false;
isExternal_array[30] = false;
isExternal_array[31] = false;
isExternal_array[32] = false;
isExternal_array[33] = false;
isExternal_array[34] = false;
isExternal_array[35] = false;
isExternal_array[36] = false;
isExternal_array[37] = false;
isExternal_array[38] = false;
}
Instance of Symbol 129 MovieClip [jControl Panel 1.1] in Frame 9
//component parameters
onClipEvent (construct) {
searchKey = 70;
xmlInit = false;
soundInit = true;
bitmapInit = true;
_searchKey = 4684;
}
Instance of Symbol 132 MovieClip [jSound Panel] in Frame 9
//component parameters
onClipEvent (construct) {
loadFromXML = false;
searchKey = 133;
_searchKey = 10224;
sndName_array = [];
sndName_array[0] = "beep";
sndName_array[1] = "click";
sndName_array[2] = "cutCookie";
sndName_array[3] = "error";
sndName_array[4] = "levelLost";
sndName_array[5] = "levelWon";
sndName_array[6] = "rollOver";
sndName_array[7] = "rollingPin";
sndName_array[8] = "tick";
sndName_array[9] = "timeWarning";
file_array = [];
file_array[0] = "beep";
file_array[1] = "click";
file_array[2] = "cutCookie";
file_array[3] = "error";
file_array[4] = "levelLost";
file_array[5] = "levelWon";
file_array[6] = "rollOver";
file_array[7] = "rollingPin";
file_array[8] = "tick";
file_array[9] = "timeWarning";
group_array = [];
group_array[0] = "global";
group_array[1] = "global";
group_array[2] = "global";
group_array[3] = "global";
group_array[4] = "global";
group_array[5] = "global";
group_array[6] = "global";
group_array[7] = "global";
group_array[8] = "global";
group_array[9] = "global";
mult_array = [];
mult_array[0] = false;
mult_array[1] = true;
mult_array[2] = true;
mult_array[3] = true;
mult_array[4] = true;
mult_array[5] = true;
mult_array[6] = true;
mult_array[7] = true;
mult_array[8] = true;
mult_array[9] = true;
ext_array = [];
ext_array[0] = false;
ext_array[1] = false;
ext_array[2] = false;
ext_array[3] = false;
ext_array[4] = false;
ext_array[5] = false;
ext_array[6] = false;
ext_array[7] = false;
ext_array[8] = false;
ext_array[9] = false;
isSound_array = [];
isSound_array[0] = true;
isSound_array[1] = true;
isSound_array[2] = true;
isSound_array[3] = true;
isSound_array[4] = true;
isSound_array[5] = true;
isSound_array[6] = true;
isSound_array[7] = true;
isSound_array[8] = true;
isSound_array[9] = true;
radGroupSnd_array = [];
radGroupSnd_array[0] = "_level0.snd_mc";
radGroupSnd_array[1] = "undefined";
radGroupSnd_array[2] = "undefined";
radGroupSnd_array[3] = "undefined";
radGroupSnd_array[4] = "undefined";
radGroupSnd_array[5] = "undefined";
radGroupSnd_array[6] = "undefined";
radGroupSnd_array[7] = "undefined";
radGroupSnd_array[8] = "_level0.snd_mc";
radGroupSnd_array[9] = "undefined";
vol_array = [];
vol_array[0] = 100;
vol_array[1] = 100;
vol_array[2] = 100;
vol_array[3] = 100;
vol_array[4] = 100;
vol_array[5] = 100;
vol_array[6] = 100;
vol_array[7] = 100;
vol_array[8] = 100;
vol_array[9] = 100;
loops_array = [];
loops_array[0] = 0;
loops_array[1] = 0;
loops_array[2] = 0;
loops_array[3] = 0;
loops_array[4] = 0;
loops_array[5] = 0;
loops_array[6] = 0;
loops_array[7] = 0;
loops_array[8] = 0;
loops_array[9] = 0;
offset_array = [];
offset_array[0] = 0;
offset_array[1] = 0;
offset_array[2] = 0;
offset_array[3] = 0;
offset_array[4] = 0;
offset_array[5] = 0;
offset_array[6] = 0;
offset_array[7] = 0;
offset_array[8] = 0;
offset_array[9] = 0;
pan_array = [];
pan_array[0] = 0;
pan_array[1] = 0;
pan_array[2] = 0;
pan_array[3] = 0;
pan_array[4] = 0;
pan_array[5] = 0;
pan_array[6] = 0;
pan_array[7] = 0;
pan_array[8] = 0;
pan_array[9] = 0;
dur_array = [];
dur_array[0] = "NaN";
dur_array[1] = 0.55;
dur_array[2] = 0.08;
dur_array[3] = 0.65;
dur_array[4] = 0.08;
dur_array[5] = 0.31;
dur_array[6] = 0.18;
dur_array[7] = 0.08;
dur_array[8] = "NaN";
dur_array[9] = 0.65;
error_array = [];
error_array[0] = false;
error_array[1] = false;
error_array[2] = false;
error_array[3] = false;
error_array[4] = false;
error_array[5] = false;
error_array[6] = false;
error_array[7] = false;
error_array[8] = false;
error_array[9] = false;
Size_array = [];
Size_array[0] = 7.23;
Size_array[1] = 9.93;
Size_array[2] = 5.48;
Size_array[3] = 8.77;
Size_array[4] = 5.48;
Size_array[5] = 3.8;
Size_array[6] = 3.14;
Size_array[7] = 5.48;
Size_array[8] = 3.24;
Size_array[9] = 8.77;
onDemand_array = [];
onDemand_array[0] = false;
onDemand_array[1] = false;
onDemand_array[2] = false;
onDemand_array[3] = false;
onDemand_array[4] = false;
onDemand_array[5] = false;
onDemand_array[6] = false;
onDemand_array[7] = false;
onDemand_array[8] = false;
onDemand_array[9] = false;
stream_array = [];
stream_array[0] = false;
stream_array[1] = false;
stream_array[2] = false;
stream_array[3] = false;
stream_array[4] = false;
stream_array[5] = false;
stream_array[6] = false;
stream_array[7] = false;
stream_array[8] = false;
stream_array[9] = false;
}
Frame 16
Frame 36
stop();
Frame 41
Frame 46
stop();
Frame 48
play();
Frame 59
stop();
Frame 82
nextFrame();
Frame 83
stop();
game_mc.Run();
Symbol 37 MovieClip [jEngine 2.0 (AG)] Frame 1
#initclip 52
Object.registerClass("jEngine 2.0 (AG)", com.jjcorreia.Package);
#endinitclip
Symbol 48 MovieClip Frame 1
stop();
Symbol 325 MovieClip [__Packages.com.Games.cookieCutter.ui.ProgressBar] Frame 0
class com.Games.cookieCutter.ui.ProgressBar extends MovieClip
{
var _currentframe, onEnterFrame, gotoAndStop, nextFrame, prevFrame;
function ProgressBar () {
super();
}
function setProgress(a, b) {
targetFrame = Math.floor((a / b) * 100) + 1;
if (targetFrame != _currentframe) {
onEnterFrame = main;
}
}
function reset() {
gotoAndStop(1);
delete onEnterFrame;
}
function main() {
if (_currentframe < targetFrame) {
nextFrame();
} else if (_currentframe > targetFrame) {
prevFrame();
} else {
gotoAndStop(targetFrame);
delete onEnterFrame;
}
}
var targetFrame = 0;
}
Symbol 16 MovieClip [__Packages.com.jjcorreia.application.ui.HUDBase] Frame 0
class com.jjcorreia.application.ui.HUDBase extends MovieClip
{
static var _instance;
var _visible;
function HUDBase () {
super();
_instance = this;
}
static function getInstance() {
return(_instance);
}
function show() {
_visible = true;
}
function hide() {
_visible = false;
}
}
Symbol 326 MovieClip [__Packages.com.Games.cookieCutter.ui.GameHUD] Frame 0
class com.Games.cookieCutter.ui.GameHUD extends com.jjcorreia.application.ui.HUDBase
{
static var introText;
var stop, gotoAndStop, l_txt, level_txt, play_btn, ins_txt, roll_btn, retry_btn, goal_txt, yes_btn, no_btn, cookies_txt, t_txt, sc_txt, tc_txt, ts_txt, acc_txt, continue_btn, baker_mc;
function GameHUD () {
super();
stop();
com.jjcorreia.application.AppBase.__get__clip().HUD = this;
}
function showPage($page) {
gotoAndStop($page);
initPage($page);
}
function initPage($page) {
switch ($page) {
case "round" :
l_txt.text = com.jjcorreia.application.AppBase.__get__clip().Prefs.level;
trace("Game.clip.Prefs.level: " + com.jjcorreia.application.AppBase.__get__clip().Prefs.level);
trace(level_txt.text);
play_btn.onRelease = com.jjcorreia.utils.Delegate.create(com.jjcorreia.application.AppBase.__get__clip(), com.jjcorreia.application.AppBase.__get__clip().levelStart);
var txt = introText;
txt = com.jjcorreia.utils.Strings.replace(txt, "$goal$", com.jjcorreia.application.AppBase.__get__clip().Prefs.levelData.goal);
txt = com.jjcorreia.utils.Strings.replace(txt, "$rerolls$", com.jjcorreia.application.AppBase.__get__clip().Prefs.levelData.rerolls);
ins_txt.text = txt;
roll_btn.onRelease = com.jjcorreia.utils.Delegate.create(com.jjcorreia.application.AppBase.__get__clip(), com.jjcorreia.application.AppBase.__get__clip().reroll);
retry_btn.onRelease = com.jjcorreia.utils.Delegate.create(this, showPage, "retry");
return;
case "level" :
level_txt.text = com.jjcorreia.application.AppBase.__get__clip().Prefs.level;
goal_txt.text = com.jjcorreia.application.AppBase.__get__clip().Prefs.levelData.goal + " cookies";
return;
case "retry" :
com.jjcorreia.application.AppBase.__get__clip().pause();
yes_btn.onRelease = com.jjcorreia.utils.Delegate.create(com.jjcorreia.application.AppBase.__get__clip(), com.jjcorreia.application.AppBase.__get__clip().levelRetry);
no_btn.onRelease = com.jjcorreia.utils.Delegate.create(this, close);
return;
case "summary" :
var levelCookies = com.jjcorreia.application.scoring.ScoreBank.getValue("LevelCookies");
var timeBonus = Math.round(com.jjcorreia.application.AppBase.__get__clip().levelTimer.secondsLeft * com.jjcorreia.application.AppBase.__get__clip().Prefs.secondBonusValue);
var levelScore = com.jjcorreia.application.scoring.ScoreBank.getValue("LevelScore");
var levelGoal = com.jjcorreia.application.AppBase.__get__clip().Prefs.levelData.goal;
var perfectCuts = com.jjcorreia.application.scoring.ScoreBank.getValue("PerfectCuts");
var accuracy = (Math.round((com.jjcorreia.application.scoring.ScoreBank.getValue("PerfectCuts") / levelGoal) * 1000) / 10);
var totalCookies = com.jjcorreia.application.scoring.ScoreBank.getValue("Cookies");
var totalScore = com.jjcorreia.application.scoring.ScoreBank.getValue("Score");
com.jjcorreia.application.scoring.ScoreBank.add("Score", timeBonus);
com.jjcorreia.application.scoring.ScoreBank.add("LevelScore", timeBonus);
with (this) {
cookies_txt.text = 0;
t_txt.text = 0;
sc_txt.text = 0;
tc_txt.text = totalCookies - levelCookies;
ts_txt.text = totalScore - levelScore;
acc_txt.text = ((((accuracy + "% (") + perfectCuts) + " out of ") + levelGoal) + ")";
}
var levelScore_count = (new com.jjcorreia.application.scoring.LinkedTextCounter(sc_txt, ts_txt, null, 0, levelScore, 1, true));
var bonus_count = (new com.jjcorreia.application.scoring.LinkedTextCounter(t_txt, ts_txt, levelScore_count, 0, timeBonus, 1, true));
var levelCookies_count = (new com.jjcorreia.application.scoring.LinkedTextCounter(cookies_txt, tc_txt, bonus_count, 0, levelCookies, 1, false));
levelCookies_count.start(0.5);
continue_btn.onRelease = function () {
levelScore_count.destroy();
bonus_count.destroy();
levelCookies_count.destroy();
com.jjcorreia.application.AppBase.__get__clip().levelNext();
};
return;
case "gameOver" :
tc_txt.text = com.jjcorreia.application.scoring.ScoreBank.getValue("Cookies");
ts_txt.text = com.jjcorreia.application.scoring.ScoreBank.getValue("Score");
return;
case "timesUp" :
var tween_handler = (new mx.transitions.Tween(baker_mc, "_alpha", mx.transitions.easing.None.easeOut, 0, 100, 0.2, true));
}
}
function close() {
gotoAndStop(1);
com.jjcorreia.application.AppBase.__get__clip().resume();
}
function checkRollButton() {
if (com.jjcorreia.application.scoring.ScoreBank.getValue("Rerolls") > 0) {
roll_btn.enabled = true;
roll_btn._alpha = 100;
} else {
roll_btn.enabled = false;
roll_btn._alpha = 50;
}
}
}
Symbol 2 MovieClip [__Packages.com.jjcorreia.application.AppBase] Frame 0
class com.jjcorreia.application.AppBase extends MovieClip
{
static var gameStarted;
var Prefs, Cursor, moveMap, Sounds, Skin, onEnterFrame, Main, onMouseDown, MouseDownMain, onMouseMove, currentLevel;
function AppBase ($pref) {
super();
_instance = this;
Prefs = new $pref[undefined]();
Init();
}
function Init() {
Cursor = new com.jjcorreia.input.MouseCursor();
moveMap = new com.jjcorreia.input.KeyManager();
com.jjcorreia.application.PauseControl.Init();
com.jjcorreia.display.jObject.MainApp = this;
com.jjcorreia.display.jObject.App = this;
Sounds = _global.soundPanel;
timesRun++;
}
function initConfigs() {
}
function Run() {
}
function makeHolders() {
if (!Skin) {
Skin = new com.jjcorreia.application.ui.SkinBase(this);
}
var _local2 = Prefs.holderList_array;
for (var _local3 in _local2) {
Skin.makeHolder(_local2[_local3][0], _local2[_local3][1], _local2[_local3][2], _local2[_local3][3]);
}
}
function startLoop() {
onEnterFrame = Main;
onMouseDown = MouseDownMain;
}
function stopLoop() {
delete onEnterFrame;
delete onMouseMove;
}
function onLevelStart() {
if (noMoreLevels) {
EndGame();
return(undefined);
}
}
function onPlayGame() {
if (gameStarted) {
return(false);
}
gameStarted = true;
}
function EndGame() {
trace("AppBase.EndGame");
}
function setSkin($val) {
Skin = $val;
com.jjcorreia.display.jObject.Skin = $val;
}
static function get clip() {
return(_instance);
}
function get noMoreLevels() {
return(currentLevel >= (Prefs.totalLevels - 1));
}
function get isLastLevel() {
return(currentLevel == (Prefs.totalLevels - 1));
}
static var _instance = null;
static var timesRun = 0;
}
Symbol 3 MovieClip [__Packages.com.jjcorreia.display.jObject] Frame 0
class com.jjcorreia.display.jObject extends MovieClip
{
var initialPosition, oID, MainLoop, Main, data, clip, holder, x, y, markedVector, __get__onRelease, __get__onPress, _width, p_bounds;
function jObject ($x, $y, $holder, $Class) {
super();
position($x, $y);
initialPosition = new com.jjcorreia.geom.Vector($x, $y);
Class = $Class;
obstacleID++;
oID = obstacleID;
setHolder($holder);
MainLoop = Main;
data = new Object();
}
function create() {
if ((!Class) || (clip)) {
return(undefined);
}
clip = holder.attachMovie(Class, (Class + "_") + oID, -100);
setDepth();
saveShapeData();
render();
}
function attach($mc) {
if (clip) {
destroy();
}
setHolder($mc);
create();
}
function setDepth() {
var _local2 = holder.getNextHighestDepth();
clip.swapDepths(_local2);
return(_local2);
}
function saveShapeData() {
}
function position($newX, $newY) {
x = $newX;
y = $newY;
}
function moveStep() {
x = x + vx;
y = y + vy;
}
function render() {
clip._x = x;
clip._y = y;
}
function moveNow($x, $y) {
position($x, $y);
render();
}
function moveNowByDistance($xs, $ys) {
vx = $xs;
vy = $ys;
moveStep();
render();
}
function set _x($val) {
x = $val;
clip._x = $val;
//return(_x);
}
function set _y($val) {
y = $val;
clip._y = $val;
//return(_y);
}
function getPosition() {
return(new com.jjcorreia.geom.Vector(x, y));
}
function markPosition() {
return((markedVector = new com.jjcorreia.geom.Vector(x, y)));
}
function get markedX() {
return(markedVector.x);
}
function get markedY() {
return(markedVector.y);
}
function getDistanceVector($abs) {
var _local2 = getPosition();
return(_local2.difference(markedVector, $abs));
}
function getSpeedVector() {
return(new com.jjcorreia.geom.Vector(vx, vy));
}
function setSpeedVector($v) {
vx = $v.x;
vy = $v.y;
}
function addVelocity($x, $y) {
vx = vx + $x;
vy = vy + $y;
}
function halt() {
vx = 0;
vy = 0;
}
function destroy() {
pause();
remove();
if (pauseEnabled) {
pauseEnabled = false;
com.jjcorreia.application.PauseControl.unregisterPausableObject(this);
}
}
function remove() {
clip.removeMovieClip();
clip.unloadMovie();
delete clip;
}
function setClip($clip) {
clip = $clip;
}
function setHolder($holder) {
holder = ((typeof($holder) == "string") ? (com.jjcorreia.application.ui.SkinBase.getInstance().getHolder($holder)) : ($holder));
if (holder == undefined) {
holder = _root;
if (Class != undefined) {
trace(((("Holder '" + $holder) + "' for ") + Class) + " not found. Attaching to _root");
}
}
}
function resume() {
clip.onEnterFrame = com.jjcorreia.utils.Delegate.create(this, MainLoop);
}
function pause() {
delete clip.onEnterFrame;
}
function setMain($method) {
MainLoop = $method;
resume();
}
function makePauseable() {
pauseEnabled = true;
com.jjcorreia.application.PauseControl.registerPausableObject(this);
}
function set onRelease($method) {
clip.onRelease = $method;
//return(__get__onRelease());
}
function set onPress($method) {
clip.onPress = $method;
//return(__get__onPress());
}
function hide() {
if (!clip._visible) {
return(undefined);
}
clip._visible = false;
}
function show() {
if (clip._visible) {
return(undefined);
}
clip._visible = true;
}
function get isHidden() {
return(!clip._visible);
}
function rotate($val) {
clip._rotation = clip._rotation + $val;
}
function doRotate() {
clip._rotation = clip._rotation + rSpeed;
rSpeed = rSpeed * friction;
}
function get _radius() {
return(_width / 2);
}
function resize($x, $y) {
clip._xscale = $x;
clip._yscale = $y;
}
function get width() {
return(clip._width);
}
function get height() {
return(clip._height);
}
function get rotation() {
return(clip._rotation);
}
function get scaleX() {
return(clip._xscale);
}
function get scaleY() {
return(clip._yscale);
}
function get alpha() {
return(clip._alpha);
}
function get _x() {
return(clip._x);
}
function get _y() {
return(clip._y);
}
function set width($val) {
clip._width = $val;
//return(width);
}
function set height($val) {
clip._height = $val;
//return(height);
}
function set rotation($val) {
clip._rotation = $val;
//return(rotation);
}
function set scaleX($val) {
clip._xscale = $val;
//return(scaleX);
}
function set scaleY($val) {
clip._yscale = $val;
//return(scaleY);
}
function set alpha($val) {
clip._alpha = $val;
//return(alpha);
}
function get bounds() {
p_bounds = clip.getBounds(holder);
return(p_bounds);
}
function get Left() {
return(bounds.xMin);
}
function get Right() {
return(bounds.xMax);
}
function get Top() {
return(bounds.yMin);
}
function get Bottom() {
return(bounds.yMax);
}
function get hitClip() {
return(clip.hit_mc);
}
var vx = 0;
var vy = 0;
var rSpeed = 0;
static var friction = 0.95;
static var gravity = 1;
static var elasticity = 0.1;
var Class = "GameObject";
static var obstacleID = 0;
static var stageWidth = Stage.width;
static var stageRadius = stageWidth / 2;
var pauseEnabled = false;
}
Symbol 38 MovieClip [__Packages.com.jjcorreia.geom.AABB] Frame 0
class com.jjcorreia.geom.AABB
{
var xMin, yMin, xMax, yMax;
function AABB ($xMin, $yMin, $xMax, $yMax) {
xMin = $xMin;
yMin = $yMin;
xMax = $xMax;
yMax = $yMax;
}
function intersect($bounds) {
if (xMin > $bounds.xMax) {
return(false);
}
if (yMin > $bounds.yMax) {
return(false);
}
if (xMax < $bounds.xMin) {
return(false);
}
if (yMax < $bounds.yMin) {
return(false);
}
return(true);
}
}
Symbol 5 MovieClip [__Packages.com.jjcorreia.geom.Vector] Frame 0
class com.jjcorreia.geom.Vector
{
var x, y;
function Vector ($x, $y) {
x = $x;
y = $y;
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function add(v) {
return(new com.jjcorreia.geom.Vector(x + v.x, y + v.y));
}
function subtract(that) {
return(new com.jjcorreia.geom.Vector(x - that.x, y - that.y));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function multiply($factor) {
x = x * $factor;
y = y * $factor;
}
function divide($factor) {
x = x / $factor;
y = y / $factor;
}
function difference(that) {
return(new com.jjcorreia.geom.Vector(x - that.x, y - that.y));
}
static function distance(a, b) {
var _local1 = new com.jjcorreia.geom.Vector(a.x - b.x, a.y - b.y);
return(_local1.__get__length());
}
function differenceAbs(that) {
return(new com.jjcorreia.geom.Vector(Math.abs(x - that.x), Math.abs(y - that.y)));
}
function makeAbsolute() {
x = Math.abs(x);
y = Math.abs(y);
}
function dotProduct(that) {
return((x * that.x) + (y * that.y));
}
function crossProductLength(that) {
return((x + that.y) - (that.x * y));
}
function getReverse() {
return(new com.jjcorreia.geom.Vector(-x, -y));
}
function get angle() {
return(Math.atan2(y, x));
}
function get angleDeg() {
return(Math.atan2(y, x) * rtd);
}
function get angle2() {
return(Math.atan2(x, -y));
}
function get angle2_deg() {
return(Math.atan2(x, -y) * rtd);
}
function angleBetween(that) {
return(Math.acos(dotProduct(that) / (length * that.__get__length())));
}
function angleTo_Deg(that) {
var _local2 = x - that.x;
var _local3 = y - that.y;
return(Math.atan2(_local3, _local2) * rtd);
}
function angleTo_Rad(that) {
var _local2 = x - that.x;
var _local3 = y - that.y;
return(Math.atan2(_local3, _local2));
}
function reverse() {
x = -x;
y = -y;
}
function getNegate() {
return(new com.jjcorreia.geom.Vector(-x, -y));
}
function normalize() {
var _local2 = length;
if (_local2 == 0) {
return(undefined);
}
x = x / _local2;
y = y / _local2;
}
function normal() {
var _local2 = length;
var _local3 = (-y) / _local2;
y = x / _local2;
x = _local3;
}
function rotateBy($angle) {
var _local3 = $angle + angle;
var _local2 = length;
x = Math.cos(_local3) * _local2;
y = Math.sin(_local3) * _local2;
}
function rotateTo($angle) {
var _local2 = length;
x = _local2 * Math.cos($angle);
y = _local2 * Math.sin($angle);
}
function getRotateTo($angle) {
var _local2 = length;
return(new com.jjcorreia.geom.Vector(Math.cos($angle) * _local2, Math.sin($angle) * _local2));
}
function newLength(len) {
var _local2 = length;
x = x / (_local2 / len);
y = y / (_local2 / len);
}
function project(that) {
var _local2 = dotProduct(that) / length;
return(new com.jjcorreia.geom.Vector(_local2 * that.x, _local2 * that.y));
}
function getOrientation(v1, v2) {
return(((v1.x - x) * (v1.y - y)) - ((v1.y - y) * (v2.x - x)));
}
function unitVector() {
var _local2 = length;
return(new com.jjcorreia.geom.Vector(x / _local2, y / _local2));
}
function clone() {
return(new com.jjcorreia.geom.Vector(x, y));
}
function toString() {
return(((("(x=" + x) + ", y=") + y) + ")");
}
function getMinus(v) {
return(new com.jjcorreia.geom.Vector(x - v.x, y - v.y));
}
function getMultiply(f) {
return(new com.jjcorreia.geom.Vector(x * f, y * f));
}
function getDivide(d) {
return(new com.jjcorreia.geom.Vector(x / d, y / d));
}
function getPlus(v) {
return(new com.jjcorreia.geom.Vector(x + v.x, y + v.y));
}
function getNewLength(len) {
var _local2 = length;
return(new com.jjcorreia.geom.Vector((x / _local2) * len, (y / _local2) * len));
}
function getRotateBy($angle) {
var _local3 = $angle + angle;
var _local2 = length;
return(new com.jjcorreia.geom.Vector(Math.cos(_local3) * _local2, Math.sin(_local3) * _local2));
}
function getNormalize() {
var _local2 = length;
return(new com.jjcorreia.geom.Vector(x / _local2, y / _local2));
}
function getReflect(normal) {
var _local2 = 2 * dotProduct(normal);
return(new com.jjcorreia.geom.Vector(x - (normal.x * _local2), y - (normal.y * _local2)));
}
function getNormal() {
return(new com.jjcorreia.geom.Vector(-y, x));
}
static var dtr = (Math.PI/180);
static var rtd = 57.2957795130823;
}
Symbol 4 MovieClip [__Packages.com.jjcorreia.input.MouseCursor] Frame 0
class com.jjcorreia.input.MouseCursor extends com.jjcorreia.display.jObject
{
var holder, clip, __get__onMouseMove, x, y, render, create, mouseListener, __get__onMouseWheel, __get__onMouseDown, __get__onMouseUp, boundObject;
function MouseCursor () {
super();
holder = _root;
}
function resume() {
onMouseMove = (Main);
}
function pause() {
delete clip.onMouseMove;
}
function set onMouseMove($method) {
clip.onMouseMove = com.jjcorreia.utils.Delegate.create(this, $method);
//return(__get__onMouseMove());
}
function Main() {
x = holder._xmouse;
y = holder._ymouse;
render();
}
function setClip($holder, $clip) {
super(x, y, $holder, $clip);
create();
clip.cacheAsBitmap = true;
resume();
Mouse.hide();
__get__onMouseMove()();
}
function set onMouseWheel($val) {
mouseListener = new Object();
mouseListener.objRef = this;
mouseListener.onMouseWheel = $val;
trace("onMouseWheel: " + mouseListener.onMouseWheel);
Mouse.addListener(mouseListener);
//return(__get__onMouseWheel());
}
function get _x() {
return(holder._xmouse);
}
function get _y() {
return(holder._ymouse);
}
function setHolder($holder) {
holder = $holder;
}
function getAngleFromPoint($x, $y) {
return(com.jjcorreia.math.Math2D.Trig.getAngle_deg2(_x, _y, $x, $y));
}
function getPosition() {
return(new com.jjcorreia.geom.Vector(_x, _y));
}
function set onMouseDown($method) {
clip.onMouseDown = $method;
//return(__get__onMouseDown());
}
function set onMouseUp($method) {
clip.onMouseUp = $method;
//return(__get__onMouseUp());
}
function bindObject($object) {
boundObject = $object;
}
function unbindObject() {
delete boundObject;
}
function get isBusy() {
return(boundObject != undefined);
}
function hide() {
super.hide();
Mouse.show();
}
function show() {
super.show();
Mouse.hide();
}
function destroy() {
Mouse.show();
super.destroy();
}
var isDown = false;
}
Symbol 10 MovieClip [__Packages.com.jjcorreia.input.KeyManager] Frame 0
class com.jjcorreia.input.KeyManager
{
static var asciiCodes, modifierCodes, keyListener;
var cmd_array, macro_array, macroPresses_array, downKeys_array, modifier_array, lastKey, schedule_int, macro_int;
function KeyManager () {
asciiCodes = new Object();
modifierCodes = new Object();
com.jjcorreia.input.KeyManagerConfig.Init();
cmd_array = new Array();
macro_array = new Array();
macroPresses_array = new Array();
downKeys_array = new Array();
modifier_array = new Array();
Key.removeListener(keyListener);
keyListener = new Object();
keyListener.onKeyDown = com.jjcorreia.utils.Delegate.create(this, keyDown);
keyListener.onKeyUp = com.jjcorreia.utils.Delegate.create(this, keyUp);
Resume();
}
function keyDown() {
var _local2 = Key.getAscii();
if (_local2 == 0) {
_local2 = Key.getCode();
var _local3 = modifier_array[_local2];
} else {
if (!(isDown && (_local2 == lastKey))) {
macroPresses_array.push(_local2);
checkMacros();
loopMacro();
}
var _local3 = cmd_array[_local2];
}
isDown = true;
lastKey = _local2;
if ((_local3.isDown && (!_local3.repeat)) || (_local3 == undefined)) {
return(undefined);
}
if (!_local3.isDown) {
downKeys_array.push(_local2);
}
_local3.Down();
}
function keyUp() {
clearInterval(schedule_int);
var _local2 = 0;
while (_local2 < downKeys_array.length) {
var _local3 = downKeys_array[_local2];
if (!Key.isDown(_local3)) {
downKeys_array.splice(_local2, 1);
var _local4 = cmd_array[_local3];
if (_local4 == undefined) {
_local4 = modifier_array[_local3];
}
_local4.Up();
}
_local2++;
}
if (downKeys_array.length > 0) {
clearInterval(schedule_int);
schedule_int = setInterval(this, "keyUp", 100);
}
isDown = false;
}
function clearMacroList() {
clearInterval(macro_int);
macroPresses_array = new Array();
}
function loopMacro() {
clearInterval(macro_int);
if (macroPresses_array.length > 0) {
macro_int = setInterval(this, "clearMacroList", macroLife);
}
}
function checkMacros() {
if (macroPresses_array.length > 1) {
var _local4 = macroPresses_array.length;
for (var _local7 in macro_array) {
var _local2 = macro_array[_local7];
var _local3 = _local2.length;
if (_local4 >= _local3) {
var _local5 = _local2.ID;
var _local6 = macroPresses_array.slice(_local4 - _local3, _local4).join("_");
if (_local6 == _local5) {
_local2.Run();
return(undefined);
}
}
}
}
}
function bindKey($key, $Class, $upMethod, $downMethod, $repeatAble) {
var _local4 = arguments.slice(5);
var _local3 = getASCIICode($key);
if (_local3 == undefined) {
_local3 = modifierCodes[$key.toUpperCase()];
modifier_array[_local3] = new com.jjcorreia.input.KeyObject(_local3, $Class, $upMethod, $downMethod, $repeatAble, _local4);
} else {
cmd_array[_local3] = new com.jjcorreia.input.KeyObject(_local3, $Class, $upMethod, $downMethod, $repeatAble, _local4);
}
}
function unbindKey($key) {
var _local2 = getASCIICode($key);
if (_local2 == undefined) {
_local2 = modifierCodes[$key.toUpperCase()];
delete modifier_array[_local2];
} else {
delete cmd_array[_local2];
}
}
function bindMacro($macro, $Class, $Method) {
var _local6 = arguments.slice(3);
$macro = $macro.split("");
var _local3 = 0;
while (_local3 < $macro.length) {
$macro[_local3] = getASCIICode($macro[_local3]);
_local3++;
}
var _local5 = $macro.join("_");
macro_array[_local5] = new com.jjcorreia.input.KeyMacro($macro, $Class, $Method, _local6);
}
function unbindMacro($macro) {
$macro = $macro.split("");
var _local2 = 0;
while (_local2 < $macro.length) {
$macro[_local2] = getASCIICode($macro[_local2]);
_local2++;
}
var _local4 = $macro.join("_");
delete macro_array[_local4];
}
static function getASCIICode($key) {
return(asciiCodes[$key]);
}
static function setCode($key, $val) {
asciiCodes[$key] = $val;
}
static function setModifierCode($key, $val) {
modifierCodes[$key] = $val;
}
function Pause() {
clearMacroList();
Key.removeListener(keyListener);
}
function Resume() {
Key.addListener(keyListener);
}
function Destroy() {
Pause();
delete keyListener;
}
function setMacroLife($val) {
macroLife = $val;
}
static var macroLife = 1000;
var isDown = false;
}
Symbol 327 MovieClip [__Packages.com.Games.cookieCutter.apps.Game] Frame 0
class com.Games.cookieCutter.apps.Game extends com.jjcorreia.application.AppBase
{
static var leftKey, rotationSpeed, rightKey;
var setSkin, moveMap, makeHolders, HUD, Skin, Cursor, Prefs, onMouseDown, levelTimer;
function Game ($prefs) {
super($prefs);
setSkin(new com.Games.cookieCutter.ui.Interface(this));
moveMap.bindKey("1", this, null, levelNext, false);
}
function Run($levelData) {
makeHolders();
Skin.HUD = HUD;
com.Games.cookieCutter.scoring.Score.Init();
com.jjcorreia.application.scoring.ScoreBank.addBank("Score", HUD.score_txt, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("LevelScore", null, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("Cookies", null, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("LevelCookies", HUD.cut_txt, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("Rerolls", HUD.rolls_txt, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("Credit", null, null, 1, true);
com.jjcorreia.application.scoring.ScoreBank.addBank("PerfectCuts", null, null, 1, true);
levelNext();
}
function cutCookie() {
if (Cursor.__get__isHidden()) {
return(undefined);
}
Cursor.down();
var _local3 = Skin.cutCookie();
if (isNaN(_local3)) {
_global.soundPanel.start("error");
com.jjcorreia.application.scoring.ScoreBank.add("Credit", -1);
return(undefined);
}
if (_local3 >= Prefs.minimumCutToScore) {
com.jjcorreia.application.scoring.ScoreBank.add("Cookies", 1);
com.jjcorreia.application.scoring.ScoreBank.add("LevelCookies", 1);
var _local6 = Math.round((com.jjcorreia.application.scoring.ScoreBank.getValue("LevelCookies") / Prefs.levelData.goal) * 100);
HUD.progressBar_mc.setProgress(com.jjcorreia.application.scoring.ScoreBank.getValue("LevelCookies"), Prefs.levelData.goal);
var _local4 = Math.floor(_local3 * Prefs.levelData.cookieValue);
com.jjcorreia.application.scoring.ScoreBank.add("Score", _local4);
com.jjcorreia.application.scoring.ScoreBank.add("LevelScore", _local4);
com.jjcorreia.application.scoring.ScoreBank.add("Credit", _local3);
if (_local3 == 1) {
com.jjcorreia.application.scoring.ScoreBank.add("PerfectCuts", 1);
var _local5 = Math.round((_local3 * Prefs.levelData.cookieValue) / 2);
new com.Games.cookieCutter.ui.BonusText(Cursor.x, Cursor.y, (Prefs.goodCutMessage + " \n+") + (_local4 + _local5), true);
com.jjcorreia.application.scoring.ScoreBank.add("Score", _local5);
com.jjcorreia.application.scoring.ScoreBank.add("LevelScore", _local5);
} else {
new com.Games.cookieCutter.ui.BonusText(Cursor.x, Cursor.y, "+" + _local4, true);
}
_global.soundPanel.start("cutCookie");
}
if (com.jjcorreia.application.scoring.ScoreBank.getValue("LevelCookies") >= Prefs.levelData.goal) {
levelWin();
}
}
function levelRetry() {
com.jjcorreia.application.scoring.ScoreBank.add("Score", -com.jjcorreia.application.scoring.ScoreBank.getValue("LevelScore"));
clearCache();
levelStart();
}
function levelNext() {
clearCache();
Prefs.level++;
if (Prefs.level > Prefs.totalLevels) {
gameEnd();
return(undefined);
}
levelIntro();
}
function levelIntro() {
HUD.showPage("round");
}
function levelStart() {
onMouseDown = null;
Cursor = new com.Games.cookieCutter.input.CutterCursor();
Cursor.setCursor(Prefs.levelData.cutter);
moveMap.bindKey(leftKey, Cursor, null, Cursor.rotate, true, -rotationSpeed);
moveMap.bindKey(rightKey, Cursor, null, Cursor.rotate, true, rotationSpeed);
Skin.reset();
HUD.showPage("level");
com.jjcorreia.application.scoring.ScoreBank.reset("Rerolls");
com.jjcorreia.application.scoring.ScoreBank.update("Score");
com.jjcorreia.application.scoring.ScoreBank.update("Cookies");
com.jjcorreia.application.scoring.ScoreBank.update("LevelScore");
com.jjcorreia.application.scoring.ScoreBank.update("LevelCookies");
com.jjcorreia.application.scoring.ScoreBank.add("Rerolls", Number(Prefs.levelData.rerolls));
HUD.checkRollButton();
levelTimer = new com.jjcorreia.utils.TimerBase(Prefs.levelData.time, HUD.time_txt, 5, null);
levelTimer.onTimeUp = com.jjcorreia.utils.Delegate.create(this, levelLose);
levelTimer.start();
}
function levelWin() {
_global.soundPanel.start("levelWon");
Cursor.destroy();
levelTimer.destroy();
var _local3 = new com.Games.cookieCutter.ui.EndLevelText(Stage.width / 2, com.Games.cookieCutter.ui.Interface.dHeight / 2, Prefs.winLevelMessage);
_local3.onDone = com.jjcorreia.utils.Delegate.create(HUD, HUD.showPage, "summary");
}
function levelLose() {
_global.soundPanel.start("levelLost");
Cursor.destroy();
levelTimer.destroy();
var _local3 = new com.Games.cookieCutter.ui.EndLevelText(Stage.width / 2, 280, Prefs.loseLevelMessage);
HUD.showPage("timesUp");
com.jjcorreia.application.scoring.ScoreBank.add("Score", -com.jjcorreia.application.scoring.ScoreBank.getValue("LevelScore"));
_local3.onDone = com.jjcorreia.utils.Delegate.create(this, levelRestart);
}
function levelRestart() {
clearCache();
levelIntro();
}
function pause() {
levelTimer.pause();
Cursor.pause();
}
function resume() {
levelTimer.resume();
Cursor.resume();
Cursor.show();
Cursor.canCut = true;
}
function reroll() {
if (com.jjcorreia.application.scoring.ScoreBank.getValue("Rerolls") > 0) {
_global.soundPanel.start("rollingPin");
com.jjcorreia.application.scoring.ScoreBank.add("Rerolls", -1);
Skin.reroll();
HUD.checkRollButton();
}
}
function clearCache() {
Cursor.destroy();
levelTimer.destroy();
com.jjcorreia.application.scoring.ScoreBank.reset("LevelCookies");
com.jjcorreia.application.scoring.ScoreBank.reset("LevelScore");
com.jjcorreia.application.scoring.ScoreBank.reset("Credit");
com.jjcorreia.application.scoring.ScoreBank.reset("PerfectCuts");
Skin.destroyDough();
HUD.progressBar_mc.reset();
}
function gameEnd() {
clearCache();
HUD.showPage("gameOver");
}
}
Symbol 22 MovieClip [__Packages.com.jjcorreia.utils.TimerBase] Frame 0
class com.jjcorreia.utils.TimerBase
{
var dispHooks, tField, warningClip, totalSeconds, time_int, elapsed_secs, remaining_secs, onTick, onTimeUp, onWarn, SoundWarning;
function TimerBase ($time, $field, $warningTime, $warningClip) {
dispHooks = new Object();
setTime($time);
warningTime = $warningTime;
tField = $field;
warningClip = $warningClip;
reset();
com.jjcorreia.application.PauseControl.registerPausableObject(this);
}
function setTime($time) {
totalSeconds = $time;
}
function start() {
reset();
resume();
displayTime();
}
function resume() {
pause();
time_int = ((totalSeconds > 0) ? (setInterval(com.jjcorreia.utils.Delegate.create(this, tickTimer), timerSpeed)) : (setInterval(com.jjcorreia.utils.Delegate.create(this, tickTimerInf), timerSpeed)));
running = true;
}
function pause() {
clearInterval(time_int);
running = false;
}
function reset() {
pause();
elapsed_secs = 0;
remaining_secs = totalSeconds;
displayTime();
}
function tickTimer() {
elapsed_secs = elapsed_secs + (timerSpeed / 1000);
remaining_secs = totalSeconds - elapsed_secs;
displayTime();
onTick();
checkWarn();
if (remaining_secs <= 0) {
timeUp();
}
}
function tickTimerInf() {
elapsed_secs = elapsed_secs + (timerSpeed / 1000);
displayTime();
onTick();
checkWarn();
}
function timeUp() {
warningClip.gotoAndStop(1);
pause();
remaining_secs = 0;
onTimeUp();
}
function displayTime() {
var _local3 = Math.floor(remaining_secs / 60);
var _local2 = remaining_secs % 60;
if (_local2 < 10) {
_local2 = "0" + _local2;
}
tField.text = (_local3 + ":") + _local2;
}
function checkWarn() {
if (remaining_secs <= warningTime) {
if (remaining_secs == warningTime) {
onWarn();
warningClip.lastTime = tField.text;
warningClip.play();
}
SoundWarning();
}
}
function get secondsLeft() {
return(remaining_secs);
}
function destroy() {
if (!destroyed) {
destroyed = true;
pause();
com.jjcorreia.application.PauseControl.unregisterPausableObject(this);
}
}
var warningTime = 0;
var timerSpeed = 1000;
static var SEC2DEG = 0.5;
var debug = false;
var Class = "Timer";
var running = false;
var destroyed = false;
}
Symbol 328 MovieClip [__Packages.com.Games.cookieCutter.input.CutterCursor] Frame 0
class com.Games.cookieCutter.input.CutterCursor extends com.jjcorreia.input.MouseCursor
{
static var wheelRotationFactor, totalCursors;
var setClip, clip, resume, __set__onMouseWheel, bFilter, sFilter, show, __set__onMouseDown, hide, __get__onMouseUp, __set__onMouseUp, x, holder, y, getPosition, markedVector, __set__rotation, cutterBmp, maskBmp, oWidth, oHeight, rotate, __set__onMouseMove, warning;
function CutterCursor () {
super();
setClip(com.jjcorreia.display.jObject.App._parent, "Cursor");
clip.cacheAsBitmap = false;
setCursor(0);
resume();
__set__onMouseWheel(wheelRot);
var _local8 = 1;
var _local3 = 45;
var _local15 = 14540253 /* 0xDDDDDD */;
var _local11 = 1;
var _local7 = 9342606 /* 0x8E8E8E */;
var _local5 = 1;
var _local12 = 0;
var _local10 = 0;
var _local13 = 2;
var _local4 = 5;
var _local16 = "inner";
var _local14 = false;
bFilter = new flash.filters.BevelFilter(_local8, _local3, _local15, _local11, _local7, _local5, _local12, _local10, _local13, _local4, _local16, _local14);
_local8 = 4;
_local3 = 45;
var _local6 = 0;
var _local17 = 0.5;
_local12 = 5;
_local10 = 5;
_local13 = 1;
_local4 = 2;
var _local9 = false;
sFilter = new flash.filters.DropShadowFilter(_local8, _local3, _local6, _local17, _local12, _local10, _local13, _local4, _local9);
clip.filters = [bFilter, sFilter];
activate();
}
function activate() {
show();
__set__onMouseDown(com.jjcorreia.utils.Delegate.create(com.jjcorreia.display.jObject.App, com.jjcorreia.display.jObject.App.cutCookie));
}
function deactivate() {
hide();
__set__onMouseDown(null);
}
function up() {
clip.filters = [bFilter, sFilter];
delete eval (__get__onMouseUp());
}
function down() {
clip.filters = [bFilter];
__set__onMouseUp(com.jjcorreia.utils.Delegate.create(this, up));
}
function wheelRot($delta) {
var _local2 = this;
_local2.objRef.rotate((-$delta) * wheelRotationFactor);
}
function rotateCutter() {
x = holder._xmouse;
y = holder._ymouse;
var _local2 = getPosition().difference(markedVector);
__set__rotation(_local2.__get__angle() * com.jjcorreia.geom.Vector.rtd);
}
function changeCursor() {
cursorIndex++;
if (cursorIndex >= totalCursors) {
cursorIndex = 0;
}
setCursor(cursorIndex);
}
function setCursor($cutter) {
cutterBmp = _global.bmpPanel.getObject($cutter + ".png").bitmap;
maskBmp = _global.bmpPanel.getObject($cutter + "_mask.png").bitmap;
clip.cutter.removeMovieClip();
var _local3 = clip.createEmptyMovieClip("cutter", 1);
_local3.attachBitmap(cutterBmp, 1, "never", true);
oWidth = maskBmp.width;
oHeight = maskBmp.height;
_local3._x = _local3._x - (oWidth / 2);
_local3._y = _local3._y - (oHeight / 2);
}
function spin() {
clip.onEnterFrame = com.jjcorreia.utils.Delegate.create(this, Main_rot);
}
function stopSpin() {
delete clip.onEnterFrame;
}
function Main_rot() {
rotate(5);
}
function Main() {
super.Main();
if (y > com.Games.cookieCutter.ui.Interface.dHeight) {
__set__onMouseMove(Main_off);
canCut = false;
hide();
}
}
function Main_off() {
super.Main();
if (y < com.Games.cookieCutter.ui.Interface.dHeight) {
canCut = true;
__set__onMouseMove(Main);
show();
}
}
function hideTillMove() {
clip._visible = false;
warning.clip.onMouseMove = com.jjcorreia.utils.Delegate.create(this, unHide);
}
function unHide() {
delete warning.clip.onMouseMove;
if (canCut) {
clip._visible = true;
}
}
function warn() {
warning.destroy();
new com.Games.cookieCutter.ui.BonusText(x, y - 15, "Bad cut, try again!", false);
warning = new com.Games.cookieCutter.objects.CutWarning(x, y);
warning.onDone = com.jjcorreia.utils.Delegate.create(this, unHide);
hideTillMove();
}
static var cursorIndex = 0;
var canCut = true;
}
Symbol 329 MovieClip [__Packages.com.Games.cookieCutter.objects.CutWarning] Frame 0
class com.Games.cookieCutter.objects.CutWarning extends com.jjcorreia.display.jObject
{
var _instance, create, clip, x, __get__width, render, onDone, destroy;
function CutWarning ($x, $y) {
super($x + xOffset, $y + yOffset, "cursor", "blank");
if (_instance) {
_instance.destroy();
}
trace(_instance.clip);
_instance = this;
create();
init();
}
function init() {
clip.attachBitmap(_global.bmpPanel.getObject("badCut.png").bitmap, 1, "always", true);
x = x - (__get__width() / 2);
render();
var _local3 = new mx.transitions.Tween(this, "alpha", mx.transitions.easing.None.easeOut, 450, 0, lifeTime, true);
_local3.onMotionFinished = com.jjcorreia.utils.Delegate.create(this, done);
}
function done() {
onDone();
destroy();
}
static var xOffset = 0;
static var yOffset = 0;
static var lifeTime = 1;
}
Symbol 330 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 331 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 332 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 333 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 8 MovieClip [__Packages.com.jjcorreia.utils.Delegate] Frame 0
class com.jjcorreia.utils.Delegate extends Object
{
function Delegate () {
super();
}
static function create($target, $method) {
function myFunction() {
var _local2 = arguments.callee;
return(_local2.method.apply(_local2.target, addedParams));
}
var addedParams = arguments.slice(2);
myFunction.addedParams = addedParams;
myFunction.method = $method;
myFunction.target = $target;
return(myFunction);
}
}
Symbol 7 MovieClip [__Packages.com.jjcorreia.application.ui.SkinBase] Frame 0
class com.jjcorreia.application.ui.SkinBase extends MovieClip
{
static var _instance, clip_mc;
var Holders;
function SkinBase ($Clip) {
super();
Init($Clip);
Holders = new Object();
_instance = this;
}
static function Init($Clip) {
clip_mc = $Clip;
com.jjcorreia.display.jObject.SkinClip = $Clip;
}
function makeHolder($name, $depth, $x, $y, $clip) {
if (!$clip) {
$clip = clip_mc;
}
var _local2 = $clip.createEmptyMovieClip($name + "Holder", $depth);
if ($x != undefined) {
_local2._x = $x;
}
if ($y != undefined) {
_local2._y = $y;
}
registerHolder(_local2);
return(_local2);
}
function makeEmptyHolder($clip, $x, $y) {
var _local2 = $clip.getNextHighestDepth();
return(makeHolder("mc" + _local2, _local2, 0, 0, $clip));
}
function registerHolder($holder) {
Holders[$holder._name] = $holder;
}
function unregisterHolder($holder, $remove) {
if ($remove) {
$holder.removeMovieClip();
}
delete Holders[$holder._name];
}
function removeHolders() {
for (var _local2 in Holders) {
unregisterHolder(Holders[_local2], true);
}
}
function HideAll() {
for (var _local2 in Holders) {
Holders[_local2]._visible = false;
}
}
function ShowAll() {
for (var _local2 in Holders) {
Holders[_local2]._visible = true;
}
}
function get clip() {
return(clip_mc);
}
static function getInstance() {
return(_instance);
}
function getHolder($name) {
return(Holders[$name + "Holder"]);
}
}
Symbol 334 MovieClip [__Packages.com.Games.cookieCutter.ui.Interface] Frame 0
class com.Games.cookieCutter.ui.Interface extends com.jjcorreia.application.ui.SkinBase
{
static var flourBrightness, flourMask, doughMask;
var HUD, Cursor, doughBmp, overlayBmp, flourBmp, flourTopBmp, getHolder, doughDup, maskBmp, maskFactor, totalDough, bFilter, sFilter, blFilter, pin, __get__clip;
function Interface ($Clip, $HUD) {
super($Clip);
HUD = $HUD;
}
function reset() {
Cursor = com.jjcorreia.application.AppBase.__get__clip().Cursor;
doughBmp = new flash.display.BitmapData(dWidth, dHeight, true, 0);
overlayBmp = doughBmp.clone();
flourBmp = doughBmp.clone();
flourTopBmp = doughBmp.clone();
flourBmp.perlinNoise(150, 150, 5, Math.random() * 10, false, true, 1, true);
flourBmp.colorTransform(flourBmp.rectangle, new flash.geom.ColorTransform(1, 1, 1, 1, flourBrightness, flourBrightness, flourBrightness, 0));
flourBmp.copyChannel(flourBmp, flourBmp.rectangle, new flash.geom.Point(), 1, 8);
flourBmp.applyFilter(flourBmp, flourBmp.rectangle, new flash.geom.Point(), new flash.filters.BlurFilter(2, 2, 1));
var _local4 = _global.bmpPanel.getObject(flourMask).bitmap;
flourBmp.copyPixels(flourBmp, flourBmp.rectangle, new flash.geom.Point(), _local4, new flash.geom.Point());
_local4.dispose();
getHolder("flour").attachBitmap(flourBmp, 1, "never", true);
getHolder("dough").attachBitmap(doughBmp, 2, "never", true);
getHolder("cut").attachBitmap(overlayBmp, 1, "never", true);
doughDup = new flash.display.BitmapData(dWidth, dHeight, true, 0);
getHolder("tempdough").attachBitmap(doughDup, 1, "never", true);
doughDup.dispose();
textureDough(doughBmp, doughBmp.rectangle);
var _local21 = getDoughLeft();
maskBmp = _global.bmpPanel.getObject(doughMask).bitmap;
doughBmp.copyChannel(maskBmp, maskBmp.rectangle, new flash.geom.Point(), 8, 8);
var _local3 = maskBmp.clone();
var _local15 = _local3.threshold(_local3, _local3.rectangle, new flash.geom.Point(), ">", 0, 0, 4294967295, true);
maskFactor = (maskBmp.width * maskBmp.height) / _local15;
_local3.dispose();
totalDough = getDoughLeft();
var _local10 = 2;
var _local5 = 45;
var _local18 = 16777215 /* 0xFFFFFF */;
var _local13 = 0.5;
var _local9 = 0;
var _local7 = 0.2;
var _local14 = 6;
var _local12 = 6;
var _local16 = 3;
var _local6 = 3;
var _local19 = "inner";
var _local17 = false;
bFilter = new flash.filters.BevelFilter(_local10, _local5, _local18, _local13, _local9, _local7, _local14, _local12, _local16, _local6, _local19, _local17);
_local10 = 1;
_local5 = 45;
var _local8 = 0;
var _local20 = 0.3;
_local14 = 2;
_local12 = 2;
_local16 = 1;
_local6 = 3;
var _local11 = false;
sFilter = new flash.filters.DropShadowFilter(_local10, _local5, _local8, _local20, _local14, _local12, _local16, _local6, _local11);
blFilter = new flash.filters.BlurFilter(2, 2, 1);
getHolder("dough").filters = [bFilter, sFilter];
getHolder("tempdough").filters = [bFilter, sFilter];
}
function textureDough($bmp, $rect) {
var _local3 = _global.bmpPanel.getObject(("dough" + com.jjcorreia.application.AppBase.__get__clip().Prefs.levelData.dough) + ".jpg").bitmap;
var _local4 = $rect.x;
while (_local4 < dWidth) {
var _local2 = $rect.y;
while (_local2 < dHeight) {
$bmp.copyPixels(_local3, _local3.rectangle, new flash.geom.Point(_local4, _local2));
_local2 = _local2 + _local3.height;
}
_local4 = _local4 + _local3.width;
}
}
function doneRolling() {
pin.destroy();
delete pin;
doughBmp.copyPixels(doughDup, doughBmp.rectangle, new flash.geom.Point());
doughDup.dispose();
getHolder("tempdough").setMask(null);
if (Cursor.canCut) {
Cursor.show();
}
}
function reroll() {
if (pin) {
return(undefined);
}
Cursor.hide();
var _local8 = getDoughLeft() * maskFactor;
var _local9 = Math.sqrt(_local8);
var _local3 = Math.min(_local9, dHeight);
var _local5 = _local8 / _local3;
if ((_local5 < Cursor.oWidth) || (_local3 < Cursor.oHeight)) {
return(undefined);
}
pin = new com.jjcorreia.display.jObject(0, 0, __get__clip()._parent, "rollingPinClip");
pin.create();
pin.clip.objRef = this;
getHolder("tempdough").setMask(pin.clip.maskLeft);
getHolder("dough").setMask(pin.clip.maskRight);
var _local6 = new flash.geom.Rectangle((Stage.width / 2) - (_local5 / 2), (dHeight / 2) - (_local3 / 2), _local5, _local3);
var _local2 = __get__clip().createEmptyMovieClip("maskHolder", 1000);
_local2.attachBitmap(maskBmp, 1, "never", true);
_local2._width = _local5;
_local2._height = _local3;
var _local4 = new flash.display.BitmapData(dWidth, dHeight, true, 0);
var _local7 = _local2.transform.matrix;
_local7.translate(_local6.x, _local6.y);
_local4.draw(_local2, _local7);
doughDup = new flash.display.BitmapData(dWidth, dHeight, true, 0);
textureDough(doughDup, _local6);
doughDup.copyChannel(_local4, _local4.rectangle, new flash.geom.Point(), 8, 8);
getHolder("tempdough").attachBitmap(doughDup, 1, "never", true);
_local4.dispose();
_local2.removeMovieClip();
}
function cutCookie() {
var _local15 = Cursor.maskBmp.clone();
var _local9 = Cursor.clip._rotation * dtr;
var _local5 = __get__clip().createEmptyMovieClip("maskHolder", 1000);
var _local6 = _local5.createEmptyMovieClip("bitmapHolder", 1);
_local6.attachBitmap(_local15, 9, "never", true);
_local6._x = _local6._x - (_local6._width / 2);
_local6._y = _local6._y - (_local6._height / 2);
var _local3 = Cursor.clip.getBounds(__get__clip());
var _local7 = new flash.geom.Rectangle(_local3.xMin, _local3.yMin, _local3.xMax - _local3.xMin, _local3.yMax - _local3.yMin);
var _local4 = new flash.geom.Matrix();
_local4.rotate(_local9);
_local4.translate(Cursor.clip._x - _local3.xMin, Cursor.clip._y - _local3.yMin);
var _local2 = new flash.display.BitmapData(_local7.width, _local7.height, false);
_local2.draw(_local5, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, 120));
var _local11 = _local2.threshold(_local2, _local2.rectangle, new flash.geom.Point(), "==", 4294901760, 4294901760);
_local4 = new flash.geom.Matrix();
_local4.tx = (-Cursor.clip._x) + (_local7.width / 2);
_local4.ty = (-Cursor.clip._y) + (_local7.height / 2);
_local2.draw(doughBmp, _local4, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, 120), "difference");
var _local13 = _local2.threshold(_local2, _local2.rectangle, new flash.geom.Point(), "==", 4278255615, 4278255615);
var _local8 = _local13 / _local11;
_local2.dispose();
if (_local8 < com.jjcorreia.application.AppBase.__get__clip().Prefs.minimumCutToScore) {
Cursor.warn();
_local5.removeMovieClip();
return(undefined);
}
var _local10 = new flash.geom.Matrix();
_local10.rotate(_local9);
_local10.translate(Cursor.x, Cursor.y);
_local5._rotation = _local9 / dtr;
doughBmp.draw(_local5, _local10, null, "erase", doughBmp.rectangle, true);
_local5.removeMovieClip();
var _local14 = Math.round((getDoughLeft() / totalDough) * 100);
HUD.dough_txt.text = _local14 + "%";
var _local12 = Math.floor(_local8 * 100);
HUD.cred_txt.text = _local12 + "%";
return(_local8);
}
function getDoughLeft() {
var _local2 = doughBmp.clone();
var _local3 = _local2.threshold(_local2, _local2.rectangle, new flash.geom.Point(), ">", 0, 0, 4294967295, true);
_local2.dispose();
return(_local3);
}
function destroyDough() {
doughBmp.dispose();
flourBmp.dispose();
overlayBmp.dispose();
}
static var dtr = (Math.PI/180);
static var dWidth = Stage.width;
static var dHeight = 340;
}
Symbol 335 MovieClip [__Packages.com.Games.cookieCutter.ui.BonusText] Frame 0
class com.Games.cookieCutter.ui.BonusText extends com.jjcorreia.display.jObject
{
var value, create, clip, birth, y, moveNow, x;
function BonusText ($x, $y, $text, $good) {
super($x, $y, "text", "BonusText");
value = $text;
create();
clip.text_txt.autoSize = "center";
clip.text_txt.text = value;
birth = getTimer();
var _local4 = new flash.filters.GlowFilter(($good ? 39168 : 16711680), 1, 4, 4, 10);
clip.filters = [_local4];
clip.cacheAsBitmap = true;
new mx.transitions.Tween(clip, "_y", Normal.easeOut, y, y - 40, lifeTime, true);
var _local3 = new mx.transitions.Tween(this, "alpha", mx.transitions.easing.None.easeOut, 350, 0, lifeTime, true);
_local3.onMotionFinished = function () {
this.destroy();
};
}
function Main() {
moveNow(x, y - 2);
}
static var lifeTime = 1;
}
Symbol 15 MovieClip [__Packages.com.jjcorreia.application.scoring.ScoreBank] Frame 0
class com.jjcorreia.application.scoring.ScoreBank
{
static var data, totalSlots, onAdd;
function ScoreBank () {
}
static function Init() {
resetAll();
}
static function resetAll() {
data = new Object();
totalSlots = 0;
}
static function reset($name) {
data[$name].value = 0;
update($name);
}
static function addBank($name, $field, $anim, $frame, $positive) {
if (!data) {
resetAll();
}
var _local1 = new Object();
_local1.value = 0;
_local1.field = $field;
_local1.anim = $anim;
_local1.frame = $frame;
_local1.positive = $positive;
data[$name] = _local1;
totalSlots++;
update($name);
}
static function removeBank($name) {
delete data[$name];
totalSlots--;
}
static function add($name, $change, $reverse, $below) {
var _local1 = data[$name].value;
($reverse ? (_local1 = _local1 - $change) : (_local1 = _local1 + $change));
animate($change.toString(), _local1.toString());
if ((_local1 < 0) && (data[$name].positive)) {
_local1 = 0;
}
data[$name].value = _local1;
update($name);
onAdd($change.toString(), _local1.toString());
}
static function animate($change, $total) {
}
static function update($name) {
var _local1 = data[$name];
_local1.anim.gotoAndPlay(_local1.frame);
_local1.field.text = _local1.value;
}
static function get highestSlot() {
return(0);
}
static function get highestValue() {
return(0);
}
static function getValue($name) {
var _local1 = data[$name];
return(_local1.value);
}
}
Symbol 336 MovieClip [__Packages.com.Games.cookieCutter.scoring.Score] Frame 0
class com.Games.cookieCutter.scoring.Score extends com.jjcorreia.application.scoring.ScoreBank
{
function Score () {
super();
}
static function Init() {
com.jjcorreia.application.scoring.ScoreBank.Init();
}
static function scoreAnimation($val) {
}
}
Symbol 337 MovieClip [__Packages.com.Games.cookieCutter.ui.EndLevelText] Frame 0
class com.Games.cookieCutter.ui.EndLevelText extends com.jjcorreia.display.jObject
{
var value, create, clip, birth, onDone, destroy;
function EndLevelText ($x, $y, $text) {
super($x, $y, "text", "BonusText");
value = $text;
create();
clip.text_txt.autoSize = "center";
clip.text_txt.text = value;
birth = getTimer();
var _local3 = new flash.filters.DropShadowFilter(3, 45, 0, 1, 6, 6, 0.3);
var _local5 = new flash.filters.GlowFilter(13209, 1, 4, 4, 10);
clip.filters = [_local5, _local3];
clip.cacheAsBitmap = true;
new mx.transitions.Tween(this, "scaleX", mx.transitions.easing.Strong.easeOut, 350, 200, 0.5, true);
new mx.transitions.Tween(this, "scaleY", mx.transitions.easing.Strong.easeOut, 350, 200, 0.5, true);
var _local4 = new mx.transitions.Tween(this, "alpha", mx.transitions.easing.None.easeOut, 400, 0, lifeTime, true);
_local4.onMotionFinished = com.jjcorreia.utils.Delegate.create(this, done);
}
function done() {
onDone();
destroy();
}
static var lifeTime = 2.5;
}
Symbol 338 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 24 MovieClip [__Packages.com.jjcorreia.utils.Strings] Frame 0
class com.jjcorreia.utils.Strings
{
function Strings () {
}
static function replace($text, $before, $after) {
return($text.split($before).join($after));
}
static function initProto() {
String.prototype.replace = function ($before, $after) {
return(this.split($before).join($after));
};
}
}
Symbol 25 MovieClip [__Packages.com.jjcorreia.application.scoring.LinkedTextCounter] Frame 0
class com.jjcorreia.application.scoring.LinkedTextCounter
{
var field, dumpField, nextObject, current, end, incAmount, myDelay, myTimer, dumpCurrent, onTick, onDone;
function LinkedTextCounter ($field, $dumpField, $nextObject, $start, $end, $incAmount, $useTime) {
field = $field;
dumpField = $dumpField;
nextObject = $nextObject;
current = $start;
end = $end;
incAmount = $incAmount;
if ($useTime) {
useTime = $useTime;
}
}
function start($delay) {
if ($delay) {
myDelay = new com.jjcorreia.utils.Delay($delay, this, resume);
} else {
resume();
}
}
function resume() {
if (useTime) {
incAmount = ((end - current) * (speed / 1000)) / incAmount;
trace(speed / 1000);
}
if (myTimer) {
myTimer.destroy();
}
origDumpFieldValue = Number(dumpField.text);
dumpCurrent = Number(dumpField.text);
myTimer = new com.jjcorreia.utils.Timer(0);
myTimer.__set__speed(speed);
myTimer.onTick = com.jjcorreia.utils.Delegate.create(this, tickTimer);
myTimer.start();
}
function tickTimer() {
update(incAmount);
onTick();
if (current >= end) {
current = end;
dumpCurrent = origDumpFieldValue + end;
render();
myTimer.destroy();
delete myTimer;
onDone();
nextObject.start();
return(undefined);
}
render();
}
function update($value) {
current = current + $value;
if (dumpField) {
dumpCurrent = dumpCurrent + $value;
}
}
function render() {
field.text = Math.round(current).toString();
dumpField.text = Math.round(dumpCurrent).toString();
}
function destroy() {
myDelay.destroy();
myTimer.destroy();
}
var speed = 30;
var origDumpFieldValue = 0;
var useTime = false;
}
Symbol 17 MovieClip [__Packages.com.jjcorreia.utils.Timer] Frame 0
class com.jjcorreia.utils.Timer
{
var totalSeconds, lastTime, time_int, elapsed_secs, remaining_secs, onTick, onTimeUp, __get__speed;
function Timer ($time) {
setTime($time);
reset();
com.jjcorreia.application.PauseControl.registerPausableObject(this);
}
function setTime($time) {
totalSeconds = $time;
}
function start() {
lastTime = getTimer();
reset();
resume();
}
function resume() {
pause();
time_int = ((totalSeconds > 0) ? (setInterval(com.jjcorreia.utils.Delegate.create(this, tickTimer), timerSpeed)) : (setInterval(com.jjcorreia.utils.Delegate.create(this, tickTimerInf), timerSpeed)));
running = true;
}
function pause() {
clearInterval(time_int);
running = false;
}
function reset() {
pause();
elapsed_secs = 0;
remaining_secs = totalSeconds;
}
function tickTimer() {
var _local2 = (getTimer() - lastTime) / 1000;
lastTime = getTimer();
elapsed_secs = elapsed_secs + _local2;
remaining_secs = totalSeconds - elapsed_secs;
onTick();
if (remaining_secs <= 0) {
timeUp();
}
}
function tickTimerInf() {
var _local2 = (getTimer() - lastTime) / 1000;
lastTime = getTimer();
elapsed_secs = elapsed_secs + _local2;
onTick();
}
function timeUp() {
pause();
remaining_secs = 0;
onTimeUp();
}
function get secondsLeft() {
return(remaining_secs);
}
function set speed($val) {
timerSpeed = $val;
//return(__get__speed());
}
function destroy() {
if (!destroyed) {
destroyed = true;
pause();
com.jjcorreia.application.PauseControl.unregisterPausableObject(this);
}
}
var timerSpeed = 1000;
var running = false;
var destroyed = false;
var Class = "Timer";
}
Symbol 21 MovieClip [__Packages.com.jjcorreia.utils.Delay] Frame 0
class com.jjcorreia.utils.Delay extends com.jjcorreia.utils.Timer
{
var ClassObject, onTimeUp, timerSpeed, addedParams, start, elapsed_secs, remaining_secs, totalSeconds, onTick, pause, destroy;
function Delay ($time, $Class, $timeUp) {
super($time);
ClassObject = $Class;
onTimeUp = $timeUp;
timerSpeed = $time * 1000;
addedParams = arguments.slice(3);
start();
}
function tickTimer() {
elapsed_secs = elapsed_secs + (timerSpeed / 1000);
remaining_secs = totalSeconds - elapsed_secs;
onTick();
if (remaining_secs <= 0) {
timeUp();
}
}
function timeUp() {
pause();
remaining_secs = 0;
onTimeUp.apply(ClassObject, addedParams);
destroy();
}
function displayTime() {
}
var Class = "Delay";
}
Symbol 339 MovieClip [__Packages.com.Games.cookieCutter.apps.GamePets] Frame 0
class com.Games.cookieCutter.apps.GamePets extends com.Games.cookieCutter.apps.Game
{
function GamePets () {
super(com.Games.cookieCutter.config.PreferencesPets);
}
}
Symbol 11 MovieClip [__Packages.com.jjcorreia.application.config.PrefsBase] Frame 0
class com.jjcorreia.application.config.PrefsBase
{
static var classProps, extraProps, myURL, myFile, myDir, configsXML, ClassPath, GameID, levelProps, onConfigsLoad;
var stageW, stageH, holderList_array;
function PrefsBase ($useExtPrefs) {
if ($useExtPrefs != false) {
for (var _local2 in classProps) {
parseClassProperties(classProps[_local2]);
}
for (var _local2 in extraProps) {
this["parse" + _local2](extraProps[_local2]);
}
}
stageW = Stage.width;
stageH = Stage.height;
}
static function InitClass() {
trace("InitClass");
myURL = com.jjcorreia.utils.FileInfo.getFormattedURL();
myFile = com.jjcorreia.utils.FileInfo.getFileName();
myDir = com.jjcorreia.utils.FileInfo.getDirectory();
return(true);
}
function addHolder($name, $depth) {
holderList_array.push([$name, $depth]);
}
static function loadConfigs() {
configsXML = new com.jjcorreia.assets.runtimeXML(configFile, com.jjcorreia.application.config.PrefsBase, parseConfigXML);
configsXML.load();
}
static function parseConfigXML($my_xml) {
trace("parseConfigXML " + $my_xml);
extraProps = new Object();
var _local3 = $my_xml.firstChild.childNodes;
trace("children: " + _local3);
debugPrefs = (($my_xml.firstChild.attributes.debugPrefs == "true") ? true : false);
var _local2 = 0;
while (_local2 < _local3.length) {
var _local1 = _local3[_local2];
trace("cNode: " + _local1);
trace("cNode.nodeName: " + _local1.nodeName);
trace("$my_xml.nodeName: " + $my_xml.nodeName);
switch (_local1.nodeName) {
case "ClassPreferences" :
ClassPath = _local1.attributes.Path;
GameID = _local1.attributes.GameID;
if (!classProps) {
classProps = new Array();
}
classProps.push(_local1.childNodes);
break;
case "LevelData" :
levelProps = ((!levelProps) ? (_local1.childNodes) : (levelProps.concat(_local1.childNodes)));
trace("levelProps: " + levelProps);
break;
default :
extraProps[_local1.nodeName] = _local1.childNodes;
}
_local2++;
}
onConfigsLoad();
}
static function parseRatings() {
}
function parseClassProperties($nodes) {
if (!$nodes) {
queueParse = true;
return(undefined);
}
queueParse = false;
var i = 0;
while (i < $nodes.length) {
var cNode = $nodes[i];
var cAtts = cNode.attributes;
var ClassName = ((((cAtts.usePath == "false") || (!ClassPath)) || (!GameID)) ? (cAtts.Class) : ((((ClassPath + ".") + GameID) + ".") + cAtts.Class));
var Class = eval (ClassName);
var classProperties = cNode.childNodes;
if (debugPrefs) {
trace(newline + ClassName);
}
var classPresent = (Class != undefined);
if (!classPresent) {
if (debugPrefs) {
trace((" " + ClassName) + " class not found");
}
} else {
var j = 0;
while (j < classProperties.length) {
var ccNode = classProperties[j];
var Atts = ccNode.attributes;
var ccProperty = Atts.name;
var cctype = Atts.type;
var nodeVal = Atts.value;
var itemType = cctype.toLowerCase();
switch (itemType) {
case "number" :
nodeVal = Number(nodeVal);
break;
case "array" :
nodeVal = nodeVal.split(",");
break;
case "boolean" :
nodeVal = ((nodeVal == "true") ? true : false);
}
if (debugPrefs) {
trace((((((" " + ccProperty) + " = ") + nodeVal) + " (") + typeof(nodeVal)) + ")");
}
if (nodeVal) {
Class[ccProperty] = nodeVal;
}
j++;
}
}
i++;
}
if (debugPrefs) {
trace(newline);
}
}
static function set Directory($val) {
//return(Directory);
}
static function get File() {
return(com.jjcorreia.utils.FileInfo.__get__File());
}
static function get Directory() {
return(com.jjcorreia.utils.FileInfo.__get__Directory());
}
static function get URL() {
return(com.jjcorreia.utils.FileInfo.__get__URL());
}
var totalLevels = 1;
var totalPlayers = 1;
var level = 0;
var vsComp = false;
static var configFile = "Inits.xml";
static var queueParse = false;
static var classInitialized = InitClass();
static var debugPrefs = false;
}
Symbol 12 MovieClip [__Packages.com.jjcorreia.assets.runtimeAsset] Frame 0
class com.jjcorreia.assets.runtimeAsset
{
var _file, _Loaded, _Used, mclListener, clip, onLoadComplete, __get__onLoadStart, __get__onLoadInit, __get__onLoadError;
function runtimeAsset ($file, $hostDir, $subDir) {
if ($subDir == undefined) {
$subDir = "";
}
_file = ((!$hostDir) ? ((com.jjcorreia.application.config.PrefsBase.__get__Directory() + $subDir) + $file) : (($hostDir + $subDir) + $file));
_Loaded = false;
_Used = false;
mclListener = new Object();
mclListener.parent = this;
}
function load($clip) {
if ($clip) {
clip = $clip;
}
newLoader();
}
function flagAsLoaded() {
_Loaded = true;
}
function newLoader() {
mclListener.onLoadComplete = com.jjcorreia.utils.Delegate.create(this, loadComplete);
var _local2 = new MovieClipLoader();
_local2.addListener(mclListener);
_local2.loadClip(file, clip);
}
function loadComplete($target) {
flagAsLoaded();
onLoadComplete($target);
}
function set onLoadStart($method) {
mclListener.onLoadStart = $method;
//return(__get__onLoadStart());
}
function set onLoadInit($method) {
mclListener.onLoadInit = $method;
//return(__get__onLoadInit());
}
function set onLoadError($method) {
mclListener.onLoadError = $method;
//return(__get__onLoadError());
}
function destroy() {
_Loaded = false;
remove();
}
function remove() {
clip.removeMovieClip();
clip.unloadMovie();
delete clip;
}
function get file() {
return(_file);
}
function get isLoaded() {
return(_Loaded);
}
function get Loaded() {
return(_Loaded);
}
function get x() {
return(clip._x);
}
function get y() {
return(clip._y);
}
static var folder = "runtimeAssets/";
static var xmlFolder = folder + "XML/";
static var picFolder = folder + "Pics/";
static var audioFolder = folder + "Audio/";
static var swfFolder = folder + "SWFs/";
static var skinFolder = folder + "Skins/";
}
Symbol 13 MovieClip [__Packages.com.jjcorreia.assets.runtimeXML] Frame 0
class com.jjcorreia.assets.runtimeXML extends com.jjcorreia.assets.runtimeAsset
{
var Class, parseMethod, my_xml, __get__file, flagAsLoaded;
function runtimeXML ($file, $Class, $parseMethod, $hostDir, $subDir) {
super($file, $hostDir, (($subDir == undefined) ? (com.jjcorreia.assets.runtimeAsset.xmlFolder) : ($subDir)));
Class = $Class;
parseMethod = $parseMethod;
}
function newLoader() {
my_xml = new XML();
my_xml.ignoreWhite = ignoreWhite;
my_xml.onLoad = com.jjcorreia.utils.Delegate.create(this, loadComplete);
my_xml.load(__get__file());
}
function loadComplete() {
flagAsLoaded();
parseMethod.apply(Class, [my_xml]);
}
var ignoreWhite = true;
}
Symbol 340 MovieClip [__Packages.com.Games.cookieCutter.config.PreferencesGame] Frame 0
class com.Games.cookieCutter.config.PreferencesGame extends com.jjcorreia.application.config.PrefsBase
{
var holderList_array, winLevelMessage, loseLevelMessage, minimumCutToScore, level;
function PreferencesGame () {
super();
holderList_array = [["flour", 10], ["tempdough", 11], ["dough", 12], ["flourTop", 13], ["cut", 20], ["assets", 50], ["cursor", 70], ["text", 90]];
winLevelMessage = "Oven Fresh!";
loseLevelMessage = "Oops, time's up!";
minimumCutToScore = 0.94;
com.Games.cookieCutter.apps.Game.rotationSpeed = 10;
com.Games.cookieCutter.apps.Game.leftKey = "z";
com.Games.cookieCutter.apps.Game.rightKey = "x";
com.Games.cookieCutter.apps.Game.rerollKey = "SPACE";
com.Games.cookieCutter.ui.Interface.dHeight = 340;
com.Games.cookieCutter.ui.Interface.flourBrightness = 0;
com.Games.cookieCutter.ui.Interface.flourMask = "flourMask.png";
com.Games.cookieCutter.ui.Interface.doughMask = "doughMask.png";
com.Games.cookieCutter.input.CutterCursor.wheelRotationFactor = 3;
com.Games.cookieCutter.input.CutterCursor.totalCursors = 3;
com.Games.cookieCutter.ui.GameHUD.introText = "Cut $goal$ cookies using $rerolls$ reroll(s)";
}
function get levelData() {
var _local2 = com.jjcorreia.application.config.PrefsBase.levelProps[level - 1].firstChild.attributes;
return(_local2);
}
function get goodCutMessage() {
return(goodCutMessages[random(goodCutMessages.length)]);
}
var gameMode = "";
var secondBonusValue = 10;
var goodCutMessages = ["Perfect!", "Perfect!", "Awesome!", "Nice Cutting!", "Good Job!"];
}
Symbol 341 MovieClip [__Packages.com.Games.cookieCutter.config.PreferencesPets] Frame 0
class com.Games.cookieCutter.config.PreferencesPets extends com.Games.cookieCutter.config.PreferencesGame
{
var totalLevels;
function PreferencesPets () {
super();
totalLevels = 36;
com.jjcorreia.application.config.PrefsBase.levelProps = new Array();
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"15\" goal=\"4\" cutter=\"bunnybig\" dough=\"0\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"10\" goal=\"4\" cutter=\"parrotbig\" dough=\"3\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"10\" goal=\"4\" cutter=\"dogbig\" dough=\"1\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"10\" goal=\"4\" cutter=\"snakebig\" dough=\"4\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"13\" goal=\"5\" cutter=\"bunnybig\" dough=\"0\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"13\" goal=\"5\" cutter=\"parrotbig\" dough=\"3\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"13\" goal=\"5\" cutter=\"dogbig\" dough=\"1\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"13\" goal=\"5\" cutter=\"catbig\" dough=\"4\" rerolls=\"0\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"20\" goal=\"10\" cutter=\"bunnymed\" dough=\"0\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"20\" goal=\"9\" cutter=\"catmed\" dough=\"3\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"20\" goal=\"12\" cutter=\"dogmed\" dough=\"1\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"20\" goal=\"10\" cutter=\"snakemed\" dough=\"4\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"35\" goal=\"19\" cutter=\"cat\" dough=\"0\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"35\" goal=\"22\" cutter=\"dog\" dough=\"1\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"35\" goal=\"24\" cutter=\"parrot\" dough=\"1\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"35\" goal=\"20\" cutter=\"bunny\" dough=\"4\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"45\" goal=\"12\" cutter=\"bunnymed\" dough=\"0\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"45\" goal=\"17\" cutter=\"parrotmed\" dough=\"3\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"45\" goal=\"14\" cutter=\"dogmed\" dough=\"4\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"35\" goal=\"12\" cutter=\"catmed\" dough=\"1\" rerolls=\"0\" cookieValue=\"100\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"60\" goal=\"29\" cutter=\"dog\" dough=\"0\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"60\" goal=\"32\" cutter=\"parrot\" dough=\"4\" rerolls=\"0\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"60\" goal=\"32\" cutter=\"bunny\" dough=\"1\" rerolls=\"1\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"60\" goal=\"37\" cutter=\"snake\" dough=\"0\" rerolls=\"1\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"75\" goal=\"27\" cutter=\"parrotmed\" dough=\"0\" rerolls=\"1\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"55\" goal=\"23\" cutter=\"dogmed\" dough=\"3\" rerolls=\"1\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"60\" goal=\"16\" cutter=\"bunnymed\" dough=\"1\" rerolls=\"1\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"55\" goal=\"16\" cutter=\"snakemed\" dough=\"4\" rerolls=\"1\" cookieValue=\"150\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"75\" goal=\"40\" cutter=\"cat\" dough=\"3\" rerolls=\"1\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"100\" goal=\"49\" cutter=\"parrot\" dough=\"1\" rerolls=\"1\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"100\" goal=\"53\" cutter=\"dog\" dough=\"0\" rerolls=\"2\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"100\" goal=\"40\" cutter=\"bunny\" dough=\"3\" rerolls=\"2\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"90\" goal=\"45\" cutter=\"snake\" dough=\"4\" rerolls=\"2\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"140\" goal=\"75\" cutter=\"parrot\" dough=\"0\" rerolls=\"3\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"130\" goal=\"44\" cutter=\"cat\" dough=\"4\" rerolls=\"3\" cookieValue=\"75\" />"));
com.jjcorreia.application.config.PrefsBase.levelProps.push(new XML("<level time=\"140\" goal=\"61\" cutter=\"dog\" dough=\"0\" rerolls=\"3\" cookieValue=\"75\" />"));
}
}
Symbol 6 MovieClip [__Packages.com.jjcorreia.application.PauseControl] Frame 0
class com.jjcorreia.application.PauseControl
{
static var pausableItems, total, lastID, onPause, onResume;
function PauseControl () {
}
static function setPausable($pauseStatus) {
pausable = $pauseStatus;
}
static function Init() {
pausableItems = new Object();
total = 0;
lastID = 0;
}
static function Pause() {
if (!pausable) {
return(false);
}
isPaused = true;
com.jjcorreia.application.AppBase.__get__clip().stopLoop();
PauseObjects();
onPause();
return(true);
}
static function Resume() {
isPaused = false;
com.jjcorreia.application.AppBase.__get__clip().startLoop();
ResumeObjects();
onResume();
return(true);
}
static function togglePause() {
if (!pausable) {
return(false);
}
isPaused = !isPaused;
(isPaused ? (Pause()) : (Resume()));
return(isPaused);
}
static function PauseObjects() {
trace("PauseObjects: " + total);
for (var _local1 in pausableItems) {
pausableItems[_local1].Pause();
trace((_local1 + ": ") + pausableItems[_local1].Class);
}
}
static function ResumeObjects() {
for (var _local1 in pausableItems) {
pausableItems[_local1].Resume();
}
}
static function registerPausableObject($Item) {
if (pausableItems[lastID] != undefined) {
trace(lastID + " exists!");
}
pausableItems[lastID] = $Item;
$Item.pauseID = lastID;
total++;
lastID++;
}
static function unregisterPausableObject($Item) {
var _local2 = false;
if (pausableItems[$Item.pauseID] != undefined) {
delete pausableItems[$Item.pauseID];
total--;
} else {
trace(" - unregister ERROR");
}
}
static var isPaused = false;
static var pausable = true;
}
Symbol 9 MovieClip [__Packages.com.jjcorreia.math.Math2D.Trig] Frame 0
class com.jjcorreia.math.Math2D.Trig
{
function Trig () {
}
static function init() {
Math.prototype.getRadians = getRadians;
Math.prototype.getDegrees = getDegrees;
Math.prototype.getXYforces = getXYforces;
Math.prototype.placeOnArc = placeOnArc;
}
static function getRadians($num) {
return($num * dtr);
}
static function getDegrees($num) {
return($num / dtr);
}
static function getXYforces($force, $angleRad) {
var _local1 = $force * Math.sin($angleRad);
var _local2 = $force * Math.cos($angleRad);
return(new com.jjcorreia.geom.Vector(_local1, -_local2));
}
static function get2Dforces($force, $angle) {
$angle = $angle * dtr;
var _local3 = $force * Math.sin($angle);
var _local2 = $force * Math.cos($angle);
return(new com.jjcorreia.geom.Vector(_local3, _local2));
}
static function placeOnArc($x, $y, $radius, $rotation, $offset) {
var _local1 = ($rotation + $offset) * com.jjcorreia.geom.Vector.dtr;
var _local3 = Math.sin(_local1);
var _local2 = Math.cos(_local1);
var _local5 = $x + ($radius * _local3);
var _local4 = $y + ((-$radius) * _local2);
return(new com.jjcorreia.geom.Vector(_local5, _local4));
}
static function getAngle($x_leg, $y_leg) {
return(Math.atan2($x_leg, -$y_leg));
}
static function getAngle2(startX, startY, endX, endY) {
var _local1 = startX - endX;
var _local2 = startY - endY;
return(Math.atan2(_local1, -_local2));
}
static function getAngle_deg($x_leg, $y_leg) {
return(Math.atan2($x_leg, -$y_leg) * rad2Deg);
}
static function getAngle_deg2(startX, startY, endX, endY) {
var _local1 = startX - endX;
var _local2 = startY - endY;
return(Math.atan2(_local1, -_local2) * rad2Deg);
}
static function getHypotSQ(startX, startY, endX, endY) {
var _local2 = startX - endX;
var _local1 = startY - endY;
var _local3 = Math.abs((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
static function getHypot(startX, startY, endX, endY) {
return(Math.sqrt(getHypotSQ(startX, startY, endX, endY)));
}
static function speedCalc(x_leg, y_leg, hypotenuse, $xSpeed, $ySpeed) {
var _local2 = x_leg / hypotenuse;
var _local1 = y_leg / hypotenuse;
var _local4 = -((_local2 * $xSpeed) + (_local1 * $xSpeed));
var _local3 = -((_local2 * $ySpeed) - (_local1 * $ySpeed));
var _local6 = (_local2 * _local4) + (_local1 * _local3);
var _local5 = -((_local2 * _local3) - (_local1 * _local4));
return({vx:_local6, vy:_local5});
}
static function speedCalc2($x_leg, $y_leg, hypotenuse, $vx0, $vy0, $vx1, $vy1) {
var _local2 = $x_leg / hypotenuse;
var _local1 = $y_leg / hypotenuse;
var _local5 = ((_local2 * $vx1) + (_local1 * $vy1)) - ((_local2 * $vx0) + (_local1 * $vy0));
var _local4 = _local2 * _local5;
var _local3 = _local1 * _local5;
var _local14 = $vx0 + _local4;
var _local12 = $vy0 + _local3;
var _local13 = $vx1 - _local4;
var _local11 = $vy1 - _local3;
return({vx0:_local14, vy0:_local12, vx1:_local13, vy1:_local11});
}
static var dtr = (Math.PI/180);
static var rad2Deg = 57.2957795130823;
}
Symbol 14 MovieClip [__Packages.com.jjcorreia.utils.FileInfo] Frame 0
class com.jjcorreia.utils.FileInfo
{
static var myURL, myFile, myDir;
function FileInfo () {
}
static function InitClass() {
myURL = getFormattedURL();
myFile = getFileName();
myDir = getDirectory();
return(true);
}
static function set Directory($val) {
//return(Directory);
}
static function get File() {
return(myFile);
}
static function get Directory() {
return(myDir);
}
static function get URL() {
return(myURL);
}
static function getFormattedURL() {
return(unescape(_url.split("\\").join("/")));
}
static function getFileName() {
var _local1 = myURL.split("/");
return(unescape(_local1[_local1.length - 1]));
}
static function getDirectory() {
var _local1 = myURL.lastIndexOf("/");
return(unescape(myURL.substr(0, _local1 + 1)));
}
static var classInitialized = InitClass();
}
Symbol 18 MovieClip [__Packages.com.jjcorreia.display.DisplayTimer] Frame 0
class com.jjcorreia.display.DisplayTimer extends com.jjcorreia.utils.Timer
{
var tField, warningClip, remaining_secs, onWarn;
function DisplayTimer ($time, $field, $warningTime, $warningClip) {
super($time);
warningTime = $warningTime;
tField = $field;
warningClip = $warningClip;
}
function start() {
super.start();
displayTime();
}
function reset() {
super.reset();
displayTime();
}
function tickTimer() {
super.tickTimer();
displayTime();
}
function tickTimerInf() {
super.tickTimerInf();
displayTime();
}
function timeUp() {
warningClip.gotoAndStop(1);
super.timeUp();
}
function displayTime() {
var _local3 = Math.floor(remaining_secs / 60);
var _local2 = remaining_secs % 60;
if (_local2 < 10) {
_local2 = "0" + _local2;
}
tField.text = (_local3 + ":") + _local2;
if (remaining_secs <= warningTime) {
if (remaining_secs == warningTime) {
warningClip.lastTime = tField.text;
warningClip.play();
onWarn();
}
SoundWarning();
}
}
function SoundWarning() {
}
var warningTime = 0;
static var sec2Deg = 0.5;
var Class = "DisplayTimer";
}
Symbol 19 MovieClip [__Packages.com.jjcorreia.math.MiscMath] Frame 0
class com.jjcorreia.math.MiscMath
{
function MiscMath () {
}
static function randomValueBetween(min, max) {
var _local1 = (Math.random() * (max - min)) + min;
if (_local1 > max) {
_local1 = max;
}
return(_local1);
}
}
Symbol 20 MovieClip [__Packages.com.jjcorreia.utils.Arrays] Frame 0
class com.jjcorreia.utils.Arrays
{
function Arrays () {
}
static function shuffle(a, b) {
return(Math.round(Math.random()));
}
static function upperCaseSort(a, b) {
return(a.toUpperCase() > b.toUpperCase());
}
static function ASC(a, b) {
return(a > b);
}
static function DESC(a, b) {
return(a < b);
}
static function makeRandom($min, $max) {
var _local2 = new Array();
var _local1 = $min;
while (_local1 <= $max) {
_local2.push(_local1);
_local1++;
}
return(_local2.sort(shuffle));
}
}
Symbol 23 MovieClip [__Packages.com.jjcorreia.utils.prefs.jCookie] Frame 0
class com.jjcorreia.utils.prefs.jCookie
{
var my_so, userName;
function jCookie ($name, $folder, $userName) {
my_so = SharedObject.getLocal($name, $folder);
my_so.onStatus = callBack;
setUser($userName);
}
function callBack(infoObject) {
for (var _local2 in infoObject) {
trace((_local2 + ":") + infoObject[_local2]);
}
}
function setUser($userName) {
if ($userName != undefined) {
userName = $userName;
hasUser = true;
if (userData == undefined) {
my_so.data[$userName] = new Object();
}
} else {
hasUser = false;
}
}
function save($targ, $val, $topLevel) {
($topLevel ? ((Data[$targ] = $val)) : ((userData[$targ] = $val)));
return(my_so.flush());
}
function load($targ, $defaultReturn, $topLevel) {
var _local3;
var _local2;
($topLevel ? (_local2 = Data[$targ]) : (_local2 = userData[$targ]));
(((_local2 == undefined) && ($defaultReturn != undefined)) ? (_local3 = $defaultReturn) : (_local3 = _local2));
return(_local3);
}
function remove($targ) {
delete userData[$targ];
}
function get userData() {
if (hasUser) {
return(my_so.data[userName]);
}
return(my_so.data);
}
function get Data() {
return(my_so.data);
}
function Debug() {
trace("Debug:");
for (var _local3 in Data) {
trace(((" " + _local3) + ": ") + Data[_local3]);
for (var _local2 in Data[_local3]) {
trace(((((" " + _local3) + ".") + _local2) + ": ") + Data[_local3][_local2]);
}
}
}
function Destroy() {
my_so.clear();
}
function get size() {
return(my_so.getSize());
}
var hasUser = false;
}
Symbol 26 MovieClip [__Packages.com.jjcorreia.Package] Frame 0
class com.jjcorreia.Package
{
function Package () {
}
static var a = com.jjcorreia.application.AppBase;
static var b = com.jjcorreia.application.PauseControl;
static var pref = com.jjcorreia.application.config.PrefsBase;
static var d = com.jjcorreia.application.scoring.ScoreBank;
static var e = com.jjcorreia.application.ui.HUDBase;
static var f = com.jjcorreia.application.ui.SkinBase;
static var g = com.jjcorreia.assets.runtimeAsset;
static var k = com.jjcorreia.assets.runtimeXML;
static var l = com.jjcorreia.display.DisplayTimer;
static var m = com.jjcorreia.display.jObject;
static var n = com.jjcorreia.geom.Vector;
static var p = com.jjcorreia.input.KeyManager;
static var q = com.jjcorreia.input.MouseCursor;
static var r = com.jjcorreia.math.Math2D.Trig;
static var s = com.jjcorreia.math.MiscMath;
static var t = com.jjcorreia.utils.Arrays;
static var u = com.jjcorreia.utils.Delay;
static var v = com.jjcorreia.utils.Delegate;
static var w = com.jjcorreia.utils.Timer;
static var x = com.jjcorreia.utils.TimerBase;
static var y = com.jjcorreia.utils.prefs.jCookie;
static var z = com.jjcorreia.utils.FileInfo;
static var aa = com.jjcorreia.utils.Strings;
static var bb = com.jjcorreia.application.scoring.LinkedTextCounter;
}
Symbol 39 MovieClip [__Packages.com.jjcorreia.input.KeyManagerConfig] Frame 0
class com.jjcorreia.input.KeyManagerConfig
{
function KeyManagerConfig () {
}
static function Init() {
setCode("TAB", 9);
setCode("ENTER", 13);
setCode(" ", 32);
setCode("SPACE", 32);
setCode("!", 33);
setCode("\"", 34);
setCode("#", 35);
setCode("$", 36);
setCode("%", 37);
setCode("&", 38);
setCode("'", 39);
setCode("(", 40);
setCode(")", 41);
setCode("*", 42);
setCode("+", 43);
setCode(",", 44);
setCode("-", 45);
setCode(".", 46);
setCode("/", 47);
setCode("0", 48);
setCode("1", 49);
setCode("2", 50);
setCode("3", 51);
setCode("4", 52);
setCode("5", 53);
setCode("6", 54);
setCode("7", 55);
setCode("8", 56);
setCode("9", 57);
setCode(":", 58);
setCode(";", 59);
setCode("<", 60);
setCode("=", 61);
setCode(">", 62);
setCode("?", 63);
setCode("@", 64);
setCode("A", 65);
setCode("B", 66);
setCode("C", 67);
setCode("D", 68);
setCode("E", 69);
setCode("F", 70);
setCode("G", 71);
setCode("H", 72);
setCode("I", 73);
setCode("J", 74);
setCode("K", 75);
setCode("L", 76);
setCode("M", 77);
setCode("N", 78);
setCode("O", 79);
setCode("P", 80);
setCode("Q", 81);
setCode("R", 82);
setCode("S", 83);
setCode("T", 84);
setCode("U", 85);
setCode("V", 86);
setCode("W", 87);
setCode("X", 88);
setCode("Y", 89);
setCode("Z", 90);
setCode("[", 91);
setCode("\\", 92);
setCode("]", 93);
setCode("^", 94);
setCode("_", 95);
setCode("`", 96);
setCode("a", 97);
setCode("b", 98);
setCode("c", 99);
setCode("d", 100);
setCode("e", 101);
setCode("f", 102);
setCode("g", 103);
setCode("h", 104);
setCode("i", 105);
setCode("j", 106);
setCode("k", 107);
setCode("l", 108);
setCode("m", 109);
setCode("n", 110);
setCode("o", 111);
setCode("p", 112);
setCode("q", 113);
setCode("r", 114);
setCode("s", 115);
setCode("t", 116);
setCode("u", 117);
setCode("v", 118);
setCode("w", 119);
setCode("x", 120);
setCode("y", 121);
setCode("z", 122);
setCode("{", 123);
setCode("|", 124);
setCode("}", 125);
setCode("~", 126);
setModifierCode("BACKSPACE", 8);
setModifierCode("CAPSLOCK", 20);
setModifierCode("CONTROL", 17);
setModifierCode("DELETEKEY", 46);
setModifierCode("DOWN", 40);
setModifierCode("END", 35);
setModifierCode("ENTER", 13);
setModifierCode("ESCAPE", 27);
setModifierCode("HOME", 36);
setModifierCode("INSERT", 45);
setModifierCode("LEFT", 37);
setModifierCode("PGDN", 34);
setModifierCode("PGUP", 33);
setModifierCode("RIGHT", 39);
setModifierCode("SHIFT", 16);
setModifierCode("SPACE", 32);
setModifierCode("TAB", 9);
setModifierCode("UP", 38);
return(true);
}
static function setCode($key, $val) {
com.jjcorreia.input.KeyManager.setCode($key, $val);
}
static function setModifierCode($key, $val) {
com.jjcorreia.input.KeyManager.setModifierCode($key, $val);
}
}
Symbol 40 MovieClip [__Packages.com.jjcorreia.input.KeyObject] Frame 0
class com.jjcorreia.input.KeyObject
{
var key, up, down, Class, addedParams, __get__repeatable;
function KeyObject ($key, $Class, $upMethod, $downMethod, $repeatAble, $addedParams) {
key = $key;
up = $upMethod;
down = $downMethod;
repeatable = ($repeatAble);
Class = $Class;
addedParams = $addedParams;
}
function set repeatable($val) {
if ($val || (!$val)) {
repeat = $val;
}
//return(__get__repeatable());
}
function Up() {
isDown = false;
up.apply(Class, addedParams);
}
function Down() {
isDown = true;
down.apply(Class, addedParams);
}
var repeat = true;
var isDown = false;
}
Symbol 41 MovieClip [__Packages.com.jjcorreia.input.KeyMacro] Frame 0
class com.jjcorreia.input.KeyMacro extends com.jjcorreia.input.KeyObject
{
var keys, Method, Class, __set__repeatable, length, ID, addedParams;
function KeyMacro ($keys, $Class, $Method, $addedParams) {
super();
keys = $keys;
Method = $Method;
Class = $Class;
__set__repeatable(false);
length = $keys.length;
ID = $keys.join("_");
addedParams = $addedParams;
}
function getMacroKey($id) {
return(keys[$id]);
}
function Run() {
Method.apply(Class, addedParams);
}
}
Symbol 112 MovieClip [__Packages.com.jjcorreia.panels.jBitmapPanel] Frame 0
class com.jjcorreia.panels.jBitmapPanel extends MovieClip
{
var picFolder, swapDepths, autoInitialize, dataHolder, loadIndex, Name_array, isExternal_array, onDemand_array, createEmptyMovieClip, getNextHighestDepth, onProgress, onDone;
function jBitmapPanel () {
super();
_global.bmpPanel = this;
com.jjcorreia.assets.runtimeAsset.picFolder = picFolder;
swapDepths(559988);
if (autoInitialize) {
Init();
}
}
function Init() {
if (initialized) {
return(false);
}
if (debug) {
trace("bmpPanel.Init()");
}
initialized = true;
dataHolder = new Object();
loadIndex = 0;
createAllObjects();
return(true);
}
function createAllObjects() {
var _local3 = Name_array.length;
var _local2 = 0;
while (_local2 < _local3) {
createRuntimeBMP(Name_array[_local2], isExternal_array[_local2], onDemand_array[_local2]);
_local2++;
}
loadNext();
}
function createRuntimeBMP($file, $isExternal, $onDemand) {
if (!$file) {
return(null);
}
if (debug) {
trace("createRuntimeBMP: " + arguments);
}
return((dataHolder[$file] = new com.jjcorreia.assets.runtimePic($file, null, null, $isExternal, $onDemand)));
}
function objectLoaded($pic) {
$pic.writeData();
$pic.remove();
if (!finished) {
var _local3 = new com.jjcorreia.utils.Delay(0.01, this, loadNext);
}
}
function loadNext() {
var _local3 = createEmptyMovieClip("toLoad", getNextHighestDepth());
var _local2 = getObject(Name_array[loadIndex]);
if (loadIndex < Name_array.length) {
onProgress(loadIndex, Name_array.length, Name_array[loadIndex]);
_local2.__set__onLoadInit(com.jjcorreia.utils.Delegate.create(this, objectLoaded, _local2));
_local2.load(_local3);
loadIndex++;
}
if (loadIndex >= Name_array.length) {
if (finished) {
return(undefined);
}
finished = true;
onProgress(1, 1, "");
onDone();
}
}
function getObject($Name) {
return(dataHolder[$Name]);
}
function removeObject($Name) {
delete dataHolder[$Name];
}
function destroyObject($Name) {
getObject($Name).destroy();
removeObject($Name);
}
var initialized = false;
var finished = false;
var debug = false;
}
Symbol 120 MovieClip [__Packages.com.jjcorreia.assets.runtimePic] Frame 0
class com.jjcorreia.assets.runtimePic extends com.jjcorreia.assets.runtimeAsset
{
var handle, bitmap, clip, flagAsLoaded, mclListener, __get__file;
function runtimePic ($file, $hostDir, $subDir, $ext, $onDemand) {
super($file, $hostDir, (($subDir == undefined) ? (com.jjcorreia.assets.runtimeAsset.picFolder) : ($subDir)));
totalPics++;
handle = $file;
if ($ext) {
_ext = $ext;
}
if ($onDemand) {
_onDemand = $onDemand;
}
}
function writeData() {
if (_ext) {
bitmap.dispose();
bitmap = new flash.display.BitmapData(clip._width, clip._height, true, 0);
bitmap.draw(clip);
return(bitmap);
}
return(null);
}
function newLoader() {
if (_ext) {
super.newLoader();
} else {
bitmap = flash.display.BitmapData.loadBitmap(handle);
flagAsLoaded();
mclListener.onLoadInit();
}
}
function toString() {
var _local2 = "[runtimePic ";
_local2 = _local2 + (" file:" + __get__file());
_local2 = _local2 + (" Handle:" + __get__file());
_local2 = _local2 + (" ext:" + ext);
_local2 = _local2 + (" onDemand:" + onDemand);
_local2 = _local2 + "]";
return(_local2);
}
function destroy() {
bitmap.dispose();
super.destroy();
}
function get ext() {
return(_ext);
}
function get onDemand() {
return(_ext);
}
static var totalPics = 0;
var _ext = false;
var _onDemand = false;
}
Symbol 121 MovieClip [__Packages.com.jjcorreia.panels.jControlPanel] Frame 0
class com.jjcorreia.panels.jControlPanel extends MovieClip
{
var Sounds, xmlPanel, bmpPanel, onDone;
function jControlPanel () {
super();
_global.controlPanel = this;
}
function Init() {
if (initialized) {
return(false);
}
initialized = true;
Sounds = _global.soundPanel;
xmlPanel = _global.xmlPanel;
bmpPanel = _global.bmpPanel;
if (((!xmlPanel) || (!Sounds)) || (!bmpPanel)) {
errors = true;
}
InitXML();
}
function InitXML() {
if (xmlInit && (xmlPanel)) {
xmlPanel.onDone = com.jjcorreia.utils.Delegate.create(this, InitSound);
xmlPanel.Init();
} else {
InitSound();
}
}
function InitSound() {
if (soundInit && (Sounds)) {
Sounds.onDone = com.jjcorreia.utils.Delegate.create(this, InitBitmap);
Sounds.Init();
} else {
InitBitmap();
}
}
function InitBitmap() {
if (bitmapInit && (bmpPanel)) {
bmpPanel.onDone = com.jjcorreia.utils.Delegate.create(this, Done);
bmpPanel.Init();
} else {
Done();
}
}
function Done() {
onDone(errors);
}
var soundInit = false;
var xmlInit = false;
var bitmapInit = false;
var initialized = false;
var errors = false;
}
Symbol 130 MovieClip [__Packages.com.jjcorreia.panels.jSoundPanel] Frame 0
class com.jjcorreia.panels.jSoundPanel extends MovieClip
{
var swapDepths, buffTime, _soundbuftime, soundObjects, masterSound, sndName_array, file_array, ext_array, mult_array, group_array, isSound_array, vol_array, loops_array, offset_array, pan_array, onDemand_array, stream_array, onProgress, onDone;
function jSoundPanel () {
super();
_global.soundPanel = this;
swapDepths(999555);
if (buffTime != undefined) {
_soundbuftime = buffTime;
}
if (autoInitialize) {
Init();
}
}
function Init() {
if (initialized) {
return(false);
}
initialized = true;
soundObjects = new Object();
masterSound = new Sound();
loadIndex = 0;
createAllSounds();
return(true);
}
function createAllSounds() {
var _local2 = 0;
while (_local2 < sndName_array.length) {
createSound(file_array[_local2], sndName_array[_local2], ext_array[_local2], mult_array[_local2], group_array[_local2], isSound_array[_local2], vol_array[_local2], loops_array[_local2], offset_array[_local2], pan_array[_local2], onDemand_array[_local2], stream_array[_local2]);
_local2++;
}
loadNextSound();
}
function createSound($file, $handle, $ext, $mult, $group, $isSound, $vol, $loops, $offset, $pan, $onDemand, $stream) {
if ((!$file) || (!$handle)) {
return(null);
}
if (debug) {
trace("createSound: " + arguments);
}
return((soundObjects[$handle] = new com.jjcorreia.assets.runtimeAudio(this, $file, null, $handle, $ext, $mult, $group, $isSound, $vol, $loops, $offset, $pan, $onDemand, $stream)));
}
function loadNextSound() {
if (loadIndex < sndName_array.length) {
var _local3 = sndName_array[loadIndex];
onProgress(loadIndex, sndName_array.length, _local3);
var _local2 = getObject(_local3);
_local2.onLoad = com.jjcorreia.utils.Delegate.create(this, soundLoaded);
loadIndex++;
_local2.Load();
} else {
onProgress(1, 1, "");
onDone();
}
}
function soundLoaded() {
var _local2 = new com.jjcorreia.utils.Delay(0.01, this, loadNextSound);
}
function start($handle, $props) {
var _local3 = getObject($handle);
if (debug) {
trace("start: " + $handle);
}
if (_local3) {
delete _local3.onSoundComplete;
for (var _local5 in $props) {
_local3[_local5] = $props[_local5];
}
_local3.start();
} else {
if (debug) {
trace($handle + " doesnt exist. creating...");
}
createSound($handle, $handle);
return(start($handle, $props));
}
return(_local3);
}
function stopSound($name) {
getObject($name).stop();
}
function setSoundVolume($name, $vol) {
getObject($name).__set__vol($vol);
}
function getSoundVolume($name) {
return(getObject($name).__get__vol());
}
function muteAudio($Name) {
getObject($Name).Mute();
}
function unMuteAudio($Name) {
getObject($Name).unMute();
}
function muteSounds() {
soundsMuted = true;
for (var _local2 in soundObjects) {
if (soundObjects[_local2].isSound) {
muteAudio(soundObjects[_local2].Name);
}
}
}
function unMuteSounds() {
soundsMuted = false;
for (var _local2 in soundObjects) {
if (soundObjects[_local2].isSound) {
unMuteAudio(soundObjects[_local2].Name);
}
}
}
function toggleSound() {
(soundsMuted ? (unMuteSounds()) : (muteSounds()));
return(soundsMuted);
}
function muteMusic() {
musicMuted = true;
for (var _local2 in soundObjects) {
if (!soundObjects[_local2].isSound) {
muteAudio(soundObjects[_local2].Name);
}
}
}
function unMuteMusic() {
musicMuted = false;
for (var _local2 in soundObjects) {
if (!soundObjects[_local2].isSound) {
unMuteAudio(soundObjects[_local2].Name);
}
}
}
function toggleMusic() {
(musicMuted ? (unMuteMusic()) : (muteMusic()));
return(musicMuted);
}
function muteAll() {
muteMusic();
muteSounds();
}
function unMuteAll() {
unMuteMusic();
unMuteSounds();
}
function toggleGlobalMute() {
(globallyMuted ? (unMuteGlobal()) : (muteGlobal()));
return(globallyMuted);
}
function muteGlobal() {
if (!globallyMuted) {
globallyMuted = true;
lastGlobalVolume = globalVolume;
globalVolume = (0);
}
}
function unMuteGlobal() {
globallyMuted = false;
globalVolume = (lastGlobalVolume);
}
function set globalVolume($vol) {
masterSound.setVolume($vol);
//return(globalVolume);
}
function get globalVolume() {
return(masterSound.getVolume());
}
function set globalPan($num) {
masterSound.setPan($num);
//return(globalPan);
}
function get globalPan() {
return(masterSound.getPan());
}
function getSound($Name) {
return(soundObjects[$Name]);
}
function getObject($Name) {
return(soundObjects[$Name]);
}
function get SoundOff() {
return(soundsMuted);
}
function get MusicOff() {
return(musicMuted);
}
function get GlobalOff() {
return(globallyMuted);
}
function removeSound($Name) {
delete soundObjects[$Name];
}
function destroySound($Name) {
getObject($Name).destroy();
removeSound($Name);
}
var queuedMusic_array = new Array();
var loadIndex = 0;
var lastGlobalVolume = 100;
var globallyMuted = false;
var soundsMuted = false;
var musicMuted = false;
var initialized = false;
var autoInitialize = false;
var debug = false;
}
Symbol 133 MovieClip [__Packages.com.jjcorreia.assets.runtimeAudio] Frame 0
class com.jjcorreia.assets.runtimeAudio extends com.jjcorreia.assets.runtimeAsset
{
var _myParent, _myName, lastVol, initialVol, lastPan, initialPan, onLoad, _Loaded, holder_mc, _my_sound, __get__file, progress_int, __get__Loaded, onSoundComplete;
function runtimeAudio ($parent, $file, $hostDir, $handle, ext, mult, $group, isSound, vol, loops, offset, pan, onDemand, isStreaming) {
super((com.jjcorreia.assets.runtimeAsset.audioFolder + $file) + ".mp3", $hostDir);
_myParent = $parent;
_total++;
_myName = $handle;
if (mult) {
_mult = mult;
}
if (ext) {
_ext = ext;
}
if (isSound) {
_isSound = isSound;
}
if (loops) {
_loops = (oLoops = loops);
}
if (offset) {
_offset = (oOffset = offset);
}
if (vol) {
_vol = (oVol = vol);
}
if (pan) {
_pan = (oPan = pan);
}
if (onDemand) {
_onDemand = onDemand;
}
if (isStreaming) {
_isStreaming = isStreaming;
}
if ($group) {
_group = $group;
}
lastVol = (initialVol = _vol);
lastPan = (initialPan = _pan);
if (onDemand) {
onLoad();
return;
}
}
function Load() {
if ((!_Loaded) && (!_onDemand)) {
initLoad();
}
}
function initLoad() {
makeHolder();
newLoader();
}
function makeHolder() {
var _local2 = _myParent.getNextHighestDepth();
holder_mc = _myParent.createEmptyMovieClip("holder_" + _local2, _local2);
}
function newLoader() {
_my_sound = new Sound(holder_mc);
var _local2 = _my_sound;
_local2.host = this;
_my_sound.onLoad = function ($success) {
this.host.soundLoaded($success);
};
if (_ext) {
_my_sound.loadSound(__get__file(), _isStreaming);
} else {
_my_sound.attachSound(name);
soundLoaded(true);
}
}
function soundLoaded($success) {
_Loaded = $success;
clearInterval(progress_int);
if (isQueued) {
start();
unQueue();
}
onLoad($success);
}
function playAgain() {
playCount++;
if (_isStreaming && (playCount < _loops)) {
start(true);
}
}
function start($recursive) {
if (Queue()) {
initLoad();
return(undefined);
}
if (onDemand && (!__get__Loaded())) {
initLoad();
return(undefined);
}
if (!_mult) {
stop();
}
applyProps();
if (_isStreaming) {
if ($recursive != true) {
playCount = 0;
}
_my_sound.onSoundComplete = com.jjcorreia.utils.Delegate.create(this, playAgain);
}
_my_sound.start(_offset, _loops);
}
function applyProps() {
_my_sound.setVolume(vol);
_my_sound.setPan(pan);
_my_sound.onSoundComplete = onSoundComplete;
}
function stop() {
_Queued = false;
_my_sound.stop();
}
function Queue() {
if ((!isStreaming) && (!_Loaded)) {
_Queued = true;
return(true);
}
return(false);
}
function unQueue() {
_Queued = false;
}
function Mute() {
_muted = true;
lastVol = _vol;
vol = (0);
}
function unMute() {
_muted = false;
vol = (lastVol);
}
function toggleMute() {
(_muted ? (unMute()) : (Mute()));
}
function Pause() {
}
function Resume() {
}
function destroy() {
delete _my_sound;
_Loaded = false;
_myParent.removeSound(Name);
}
function get mySound() {
return(_my_sound);
}
function get Name() {
return(_myName);
}
function get name() {
return(_myName);
}
function get mult() {
return(_mult);
}
function get ext() {
return(_ext);
}
function get isSound() {
return(_isSound);
}
function get vol() {
return(_vol);
}
function get volume() {
return(_vol);
}
function get loops() {
return(_loops);
}
function get offset() {
return(_offset);
}
function get pan() {
return(_pan);
}
function get onDemand() {
return(_onDemand);
}
function get isQueued() {
return(_Queued);
}
function get isStreaming() {
return(_isStreaming);
}
function get duration() {
return(_my_sound.duration);
}
function get position() {
return(_my_sound.position);
}
function get id3() {
return(_my_sound.id3);
}
function getBytesLoaded() {
return(_my_sound.getBytesLoaded());
}
function getBytesTotal() {
return(_my_sound.getBytesTotal());
}
function toString() {
var _local2 = "[runtimeAudio ";
_local2 = _local2 + (" file:" + __get__file());
_local2 = _local2 + (" Handle:" + Name);
_local2 = _local2 + (" ext:" + ext);
_local2 = _local2 + (" mult:" + mult);
_local2 = _local2 + (" isSound:" + isSound);
_local2 = _local2 + (" vol:" + vol);
_local2 = _local2 + (" loops:" + loops);
_local2 = _local2 + (" offset:" + offset);
_local2 = _local2 + (" pan:" + pan);
_local2 = _local2 + (" onDemand:" + onDemand);
_local2 = _local2 + (" isQueued:" + isQueued);
_local2 = _local2 + "]";
return(_local2);
}
function set vol($val) {
_vol = $val;
_my_sound.setVolume($val);
//return(vol);
}
function set pan($val) {
_pan = $val;
_my_sound.setPan($val);
//return(pan);
}
function set loops($val) {
_loops = $val;
//return(loops);
}
function set offset($val) {
_offset = $val;
//return(offset);
}
static var _total = 0;
var _mult = true;
var _ext = false;
var _isSound = true;
var _group = "global";
var _vol = 100;
var _loops = 0;
var _offset = 0;
var _pan = 0;
var _onDemand = false;
var _isStreaming = false;
var oVol = 100;
var oLoops = 0;
var oPan = 0;
var oOffset = 0;
var _Queued = false;
var _muted = false;
var playCount = 0;
}
Symbol 95 MovieClip [rollingPinClip] Frame 28
objRef.doneRolling();
Symbol 110 MovieClip Frame 1
stop();
Symbol 119 MovieClip [jBitmap Panel] Frame 1
#initclip 53
Object.registerClass("jBitmap Panel", com.jjcorreia.panels.jBitmapPanel);
#endinitclip
Symbol 129 MovieClip [jControl Panel 1.1] Frame 1
#initclip 54
Object.registerClass("jControl Panel 1.1", com.jjcorreia.panels.jControlPanel);
#endinitclip
list_mc._visible = false;
Symbol 132 MovieClip [jSound Panel] Frame 1
#initclip 55
Object.registerClass("jSound Panel", com.jjcorreia.panels.jSoundPanel);
#endinitclip
Symbol 143 Button
on (release) {
_parent.play();
}
Symbol 154 Button
on (release) {
getURL ("http://www.addictinggames.com", _blank);
}
Symbol 155 MovieClip Frame 65
_parent.play();
Symbol 157 Button
on (release) {
gotoAndStop ("end");
}
Symbol 165 Button
on (release) {
getURL ("http://www.jacobcorreia.com/jEngine/", "_blank");
}
Symbol 170 MovieClip Frame 1
skip_btn.useHandCursor = false;
Symbol 170 MovieClip Frame 3
Symbol 170 MovieClip Frame 123
stop();
delete onMouseDown;
delete onEnterFrame;
_parent.play();
Symbol 180 Button
on (release) {
_global.soundPanel.start("click");
_parent.gotoAndStop("game");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 183 Button
on (release) {
_global.soundPanel.start("click");
_parent.gotoAndStop("help");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 186 Button
on (release) {
_global.soundPanel.start("click");
_parent.gotoAndStop("credits");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 189 Button
on (release) {
_global.soundPanel.start("click");
getURL ("mailto:cookies@addictinggames.com");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 196 Button
on (release) {
getURL ("http://www.addictinggames.com", "_blank");
}
Symbol 210 Button
on (release) {
gotoAndStop ("menu");
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 225 Button
on (release) {
getURL ("http://www.addictinggames.com", "_blank");
}
Symbol 228 MovieClip [GameView] Frame 1
#initclip 58
Object.registerClass("GameView", com.Games.cookieCutter.apps.GamePets);
#endinitclip
stop();
Symbol 256 MovieClip [ProgressBar] Frame 1
#initclip 56
Object.registerClass("ProgressBar", com.Games.cookieCutter.ui.ProgressBar);
#endinitclip
stop();
Symbol 265 Button
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 271 Button
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 274 MovieClip Frame 1
this.onPress = function () {
};
this.useHandCursor = false;
Symbol 280 Button
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 283 Button
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 290 Button
on (release) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 293 Button
on (release) {
_parent.gotoAndStop("menu");
}
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 297 Button
on (release) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 313 Button
on (release) {
stopAllSounds();
_parent.gotoAndStop("menu");
}
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 316 Button
on (release) {
stopAllSounds();
_parent.gotoAndPlay("restart");
}
on (press) {
_global.soundPanel.start("click");
}
on (rollOver) {
_global.soundPanel.start("rollOver");
}
Symbol 324 MovieClip [HUD] Frame 1
#initclip 57
Object.registerClass("HUD", com.Games.cookieCutter.ui.GameHUD);
#endinitclip