Frame 1
function fPlaySnd(n, n0) {
if (n0 == undefined) {
n0 = 1;
}
_root.SoundEng.play(n, 0, n0, false);
_root.SoundEng.setVolume(n, _root.SndVol);
}
function fPlayMus(n) {
_root.MusicEng.play(n, 0, 999);
_root.MusicEng.setVolume(n, _root.SndVol);
}
function fStopSnd(n) {
_root.SoundEng.stop(n);
}
function fStopAllSnd() {
_root.SoundEng.stopAll();
_root.MusicEng.stopAll();
}
function onLoadConfig(bSuccess) {
if (bSuccess) {
_quality = _root.Quality;
} else {
DisTips = 0;
FallSpeed = 6;
SndVol = 100;
DownloadURL = "http://www.hipsoft.com";
DownloadWindowType = "_blank";
BuyNowButton = 1;
BuyNowURL = "http://www.hipsoft.com";
BuyNowWindowType = "_blank";
UpsellText = "More game modes and fun features are available in the download version of Digby's Donuts!";
DownWndFreq = 2;
_quality = "HIGH";
}
_root.b2G = true;
}
var SoundEng = new WaveEngine(1);
var nSndBadClick = SoundEng.addStream("BadClick", false);
var nSndBtnClick = SoundEng.addStream("ButtonClick", false);
var nSndPopUp = SoundEng.addStream("PopUp", false);
var nSndGarbage = SoundEng.addStream("Garbage", false);
var nSndBlunderLose = SoundEng.addStream("BlunderLose", false);
var nSndLvlLose = SoundEng.addStream("LevelFail", false);
var nSndCount = SoundEng.addStream("Counter", false);
var nSndBCount = SoundEng.addStream("BCounter", false);
var nSndScreenSlide = SoundEng.addStream("ScreenSlide", false);
var nSndDonutBinDown = SoundEng.addStream("DonutBinDown", false);
var nSndDonutBinUp = SoundEng.addStream("DonutBinUp", false);
var nSndDonutRoll = SoundEng.addStream("DonutRolling", false);
var nSndDonutDown = SoundEng.addStream("ShortDown", false);
var nSndBDonutDown = SoundEng.addStream("BurntDonut", false);
var nSndDonutKiss = SoundEng.addStream("DonutKiss", false);
var nSndDonutLand = SoundEng.addStream("DonutLand", false);
var nSndDonutHit = SoundEng.addStream("DonutHit", false);
var nSndDonutDrop = SoundEng.addStream("DropDonut", false);
var nSndDonutMatch = SoundEng.addStream("DonutMatch1", false);
var nSndSuperMatch = SoundEng.addStream("DonutMatch3", false);
var nSndCorrect = SoundEng.addStream("Correct", false);
var nSndBScoreBad = SoundEng.addStream("BonusScoreBad", false);
var nSndBScoreGood = SoundEng.addStream("BonusScoreGood", false);
var nSndBScoreGreat = SoundEng.addStream("BonusScoreGreat", false);
var nSndSlide1 = SoundEng.addStream("Slide1", false);
var nSndSlide2 = SoundEng.addStream("Slide2", false);
var nSndSlide3 = SoundEng.addStream("Slide3", false);
var nSndSlide4 = SoundEng.addStream("Slide4", false);
var nSndMeterUp = SoundEng.addStream("MeterUp", false);
var aSndSlide = [nSndSlide1, nSndSlide2, nSndSlide3, nSndSlide4];
var b2G = false;
var bPause = false;
var bSnd = true;
var DisTips;
var FallSpeed;
var SndVol;
var DownloadURL;
var DownloadWindowType;
var BuyNowButton;
var BuyNowURL;
var BuyNowWindowType;
var UpsellText;
var DownWndFreq;
var nAlpha = 1;
var nGameStatus = 0;
stop();
var cfgLoader = new CConfigLoader("DigbysDonuts.xml", onLoadConfig);
Symbol 55 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 2
stop();
Symbol 59 MovieClip [Options] Frame 1
#initclip 62
Object.registerClass("Options", COptions);
#endinitclip
Symbol 92 MovieClip [don8000] Frame 1
#initclip 16
Object.registerClass("don8000", CDonut);
#endinitclip
Symbol 119 MovieClip [don8001] Frame 1
#initclip 17
Object.registerClass("don8001", CDonut);
#endinitclip
Symbol 119 MovieClip [don8001] Frame 7
gotoAndPlay (1);
Symbol 119 MovieClip [don8001] Frame 13
this.removeMovieClip();
Symbol 119 MovieClip [don8001] Frame 18
this.removeMovieClip();
Symbol 122 MovieClip [don1000] Frame 1
#initclip 18
Object.registerClass("don1000", CDonut);
#endinitclip
Symbol 127 MovieClip [don1010] Frame 1
#initclip 19
Object.registerClass("don1010", CDonut);
#endinitclip
Symbol 132 MovieClip [don1100] Frame 1
#initclip 20
Object.registerClass("don1100", CDonut);
#endinitclip
Symbol 155 MovieClip [don1001] Frame 1
#initclip 21
Object.registerClass("don1001", CDonut);
#endinitclip
stop();
Symbol 155 MovieClip [don1001] Frame 7
this.removeMovieClip();
Symbol 155 MovieClip [don1001] Frame 11
this.removeMovieClip();
Symbol 160 MovieClip [don1011] Frame 1
#initclip 22
Object.registerClass("don1011", CDonut);
#endinitclip
Symbol 160 MovieClip [don1011] Frame 7
gotoAndPlay (1);
Symbol 160 MovieClip [don1011] Frame 13
this.removeMovieClip();
Symbol 160 MovieClip [don1011] Frame 17
this.removeMovieClip();
Symbol 165 MovieClip [don1101] Frame 1
#initclip 23
Object.registerClass("don1101", CDonut);
#endinitclip
Symbol 165 MovieClip [don1101] Frame 7
gotoAndPlay (1);
Symbol 165 MovieClip [don1101] Frame 13
this.removeMovieClip();
Symbol 165 MovieClip [don1101] Frame 17
this.removeMovieClip();
Symbol 168 MovieClip [don6000] Frame 1
#initclip 24
Object.registerClass("don6000", CDonut);
#endinitclip
Symbol 183 MovieClip [don6001] Frame 1
#initclip 25
Object.registerClass("don6001", CDonut);
#endinitclip
stop();
Symbol 183 MovieClip [don6001] Frame 7
this.removeMovieClip();
Symbol 183 MovieClip [don6001] Frame 11
this.removeMovieClip();
Symbol 186 MovieClip [don2000] Frame 1
#initclip 26
Object.registerClass("don2000", CDonut);
#endinitclip
Symbol 191 MovieClip [don2100] Frame 1
#initclip 27
Object.registerClass("don2100", CDonut);
#endinitclip
Symbol 206 MovieClip [don2001] Frame 1
#initclip 28
Object.registerClass("don2001", CDonut);
#endinitclip
stop();
Symbol 206 MovieClip [don2001] Frame 7
this.removeMovieClip();
Symbol 206 MovieClip [don2001] Frame 11
this.removeMovieClip();
Symbol 211 MovieClip [don2101] Frame 1
#initclip 29
Object.registerClass("don2101", CDonut);
#endinitclip
Symbol 211 MovieClip [don2101] Frame 7
gotoAndPlay (1);
Symbol 211 MovieClip [don2101] Frame 13
this.removeMovieClip();
Symbol 211 MovieClip [don2101] Frame 17
this.removeMovieClip();
Symbol 214 MovieClip [don3000] Frame 1
#initclip 30
Object.registerClass("don3000", CDonut);
#endinitclip
Symbol 219 MovieClip [don3010] Frame 1
#initclip 31
Object.registerClass("don3010", CDonut);
#endinitclip
Symbol 234 MovieClip [don3001] Frame 1
#initclip 32
Object.registerClass("don3001", CDonut);
#endinitclip
stop();
Symbol 234 MovieClip [don3001] Frame 7
this.removeMovieClip();
Symbol 234 MovieClip [don3001] Frame 11
this.removeMovieClip();
Symbol 239 MovieClip [don3011] Frame 1
#initclip 33
Object.registerClass("don3011", CDonut);
#endinitclip
Symbol 239 MovieClip [don3011] Frame 7
gotoAndPlay (1);
Symbol 239 MovieClip [don3011] Frame 13
this.removeMovieClip();
Symbol 239 MovieClip [don3011] Frame 17
this.removeMovieClip();
Symbol 242 MovieClip [don4000] Frame 1
#initclip 34
Object.registerClass("don4000", CDonut);
#endinitclip
Symbol 247 MovieClip [don4010] Frame 1
#initclip 35
Object.registerClass("don4010", CDonut);
#endinitclip
Symbol 252 MovieClip [don4100] Frame 1
#initclip 36
Object.registerClass("don4100", CDonut);
#endinitclip
Symbol 267 MovieClip [don4001] Frame 1
#initclip 37
Object.registerClass("don4001", CDonut);
#endinitclip
stop();
Symbol 267 MovieClip [don4001] Frame 7
this.removeMovieClip();
Symbol 267 MovieClip [don4001] Frame 11
this.removeMovieClip();
Symbol 272 MovieClip [don4011] Frame 1
#initclip 38
Object.registerClass("don4011", CDonut);
#endinitclip
Symbol 272 MovieClip [don4011] Frame 7
gotoAndPlay (1);
Symbol 272 MovieClip [don4011] Frame 13
this.removeMovieClip();
Symbol 272 MovieClip [don4011] Frame 17
this.removeMovieClip();
Symbol 277 MovieClip [don4101] Frame 1
#initclip 39
Object.registerClass("don4101", CDonut);
#endinitclip
Symbol 277 MovieClip [don4101] Frame 7
gotoAndPlay (1);
Symbol 277 MovieClip [don4101] Frame 13
this.removeMovieClip();
Symbol 277 MovieClip [don4101] Frame 17
this.removeMovieClip();
Symbol 280 MovieClip [don5000] Frame 1
#initclip 40
Object.registerClass("don5000", CDonut);
#endinitclip
Symbol 285 MovieClip [don5010] Frame 1
#initclip 41
Object.registerClass("don5010", CDonut);
#endinitclip
Symbol 290 MovieClip [don5100] Frame 1
#initclip 42
Object.registerClass("don5100", CDonut);
#endinitclip
Symbol 305 MovieClip [don5001] Frame 1
#initclip 43
Object.registerClass("don5001", CDonut);
#endinitclip
stop();
Symbol 305 MovieClip [don5001] Frame 7
this.removeMovieClip();
Symbol 305 MovieClip [don5001] Frame 11
this.removeMovieClip();
Symbol 310 MovieClip [don5011] Frame 1
#initclip 44
Object.registerClass("don5011", CDonut);
#endinitclip
Symbol 310 MovieClip [don5011] Frame 7
gotoAndPlay (1);
Symbol 310 MovieClip [don5011] Frame 13
this.removeMovieClip();
Symbol 310 MovieClip [don5011] Frame 17
this.removeMovieClip();
Symbol 315 MovieClip [don5101] Frame 1
#initclip 45
Object.registerClass("don5101", CDonut);
#endinitclip
Symbol 315 MovieClip [don5101] Frame 7
gotoAndPlay (1);
Symbol 315 MovieClip [don5101] Frame 13
this.removeMovieClip();
Symbol 315 MovieClip [don5101] Frame 17
this.removeMovieClip();
Symbol 318 MovieClip [don0000] Frame 1
#initclip 46
Object.registerClass("don0000", CDonut);
#endinitclip
Symbol 323 MovieClip [don0100] Frame 1
#initclip 47
Object.registerClass("don0100", CDonut);
#endinitclip
Symbol 338 MovieClip [don0001] Frame 1
#initclip 48
Object.registerClass("don0001", CDonut);
#endinitclip
stop();
Symbol 338 MovieClip [don0001] Frame 7
this.removeMovieClip();
Symbol 338 MovieClip [don0001] Frame 11
this.removeMovieClip();
Symbol 343 MovieClip [don0101] Frame 1
#initclip 49
Object.registerClass("don0101", CDonut);
#endinitclip
Symbol 343 MovieClip [don0101] Frame 7
gotoAndPlay (1);
Symbol 343 MovieClip [don0101] Frame 13
this.removeMovieClip();
Symbol 343 MovieClip [don0101] Frame 17
this.removeMovieClip();
Symbol 346 MovieClip [don7000] Frame 1
#initclip 50
Object.registerClass("don7000", CDonut);
#endinitclip
Symbol 351 MovieClip [don7010] Frame 1
#initclip 51
Object.registerClass("don7010", CDonut);
#endinitclip
Symbol 366 MovieClip [don7001] Frame 1
#initclip 52
Object.registerClass("don7001", CDonut);
#endinitclip
stop();
Symbol 366 MovieClip [don7001] Frame 7
this.removeMovieClip();
Symbol 366 MovieClip [don7001] Frame 11
this.removeMovieClip();
Symbol 369 MovieClip [don7011] Frame 1
#initclip 53
Object.registerClass("don7011", CDonut);
#endinitclip
stop();
Symbol 369 MovieClip [don7011] Frame 7
this.removeMovieClip();
Symbol 369 MovieClip [don7011] Frame 11
this.removeMovieClip();
Symbol 403 MovieClip [Menu] Frame 1
#initclip 54
Object.registerClass("Menu", CMenu);
#endinitclip
Symbol 443 MovieClip [mc2Click] Frame 20
gotoAndPlay (10);
Symbol 465 MovieClip [Recycle] Frame 1
stop();
Symbol 484 MovieClip [Trash] Frame 1
stop();
Symbol 536 MovieClip [BonusRes] Frame 1
#initclip 55
Object.registerClass("BonusRes", CBonusRes);
#endinitclip
Symbol 839 MovieClip Frame 1
stop();
Symbol 840 MovieClip [LevelShower] Frame 1
#initclip 56
Object.registerClass("LevelShower", CLeveler);
#endinitclip
Symbol 861 MovieClip Frame 1
stop();
Symbol 862 MovieClip [ScoreShower] Frame 1
#initclip 57
Object.registerClass("ScoreShower", CScores);
#endinitclip
Symbol 889 MovieClip [Dude] Frame 1
#initclip 58
Object.registerClass("Dude", CDude);
#endinitclip
stop();
Symbol 894 MovieClip [mcLife] Frame 1
stop();
Symbol 894 MovieClip [mcLife] Frame 2
stop();
Symbol 932 MovieClip Frame 1
stop();
Symbol 941 MovieClip Frame 1
stop();
Symbol 941 MovieClip Frame 8
gotoAndPlay ("nc");
Symbol 944 MovieClip [Game] Frame 1
#initclip 59
Object.registerClass("Game", CGame);
#endinitclip
Symbol 970 MovieClip [MainMenu] Frame 1
#initclip 60
Object.registerClass("MainMenu", CMMenu);
#endinitclip
Symbol 976 MovieClip [PreLoader] Frame 1
#initclip 61
Object.registerClass("PreLoader", CPreLoader);
#endinitclip
Symbol 977 MovieClip [__Packages.WaveEngine] Frame 0
class WaveEngine
{
var type, stack, debugOn, mute, _mc;
function WaveEngine (type, debugOn) {
this.type = ((type == undefined) ? 1 : (type));
stack = new Object();
this.debugOn = ((type == undefined) ? false : (debugOn));
mute = false;
init();
}
function init() {
_numClass++;
_mc = _root.createEmptyMovieClip((("WaveEngine_" + _numClass) + "_") + type, _root.getNextHighestDepth());
}
function soundOff() {
if (!mute) {
debug("soundOff()");
for (var _local2 in stack) {
stack[_local2]._oldVolume = stack[_local2].getVolume();
setVolume(_local2, 0);
}
mute = true;
}
}
function soundOn() {
if (mute) {
mute = false;
debug("soundOn()");
for (var _local3 in stack) {
var _local2 = ((stack[_local3]._oldVolume == undefined) ? 100 : (stack[_local3]._oldVolume));
setVolume(_local3, _local2);
}
}
}
function getSoundStatus() {
return(!mute);
}
function play(id, secondsOffset, loops, autoDelete) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
if (type == 2) {
stopAll();
}
secondsOffset = ((secondsOffset == undefined) ? 0 : (secondsOffset));
loops = ((loops == undefined) ? 1 : (loops));
autoDelete = ((autoDelete == undefined) ? true : (autoDelete));
var _local3 = stack[id];
if (mute) {
_local3.setVolume(0);
} else {
_local3.setVolume(100);
}
if (type == 2) {
loops = 65536;
}
_local3.start(secondsOffset, loops);
debug(((((("play(" + _local3.__link) + ", ") + secondsOffset) + ", ") + loops) + ")");
}
function playAll(secondsOffset, loops, autoDelete) {
for (var _local5 in stack) {
play(_local5, secondsOffset, loops, autoDelete);
}
}
function addStream(link_name, autoDelete) {
if (link_name == undefined) {
return(0);
}
autoDelete = ((autoDelete == undefined) ? true : (autoDelete));
var _local4 = _mc.createEmptyMovieClip("attachS_" + (++_numSound), _mc.getNextHighestDepth());
var _local2 = new Sound(_local4);
_local2.attachSound(link_name);
_local2.__parent = this;
_local2.__link = link_name;
_local2.__num = _numSound;
_local2.__mc = _local4;
_local2.__autoDelete = autoDelete;
_local2.onSoundComplete = function () {
if (this.__autoDelete) {
this.__parent.deleteSound(this.__num);
}
};
debug(("addStream(" + link_name) + ")");
stack[_numSound] = _local2;
return(_local2.__num);
}
function deleteSound(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
debug("Stack deletes a " + _local2.__link);
delete stack[id];
removeMovieClip(_local2.__mc);
}
function deleteAllSound() {
debug("deleteAllSound()");
for (var _local2 in stack) {
deleteSound(_local2);
}
}
function stop(id) {
if ((id == undefined) || (stack[id] == undefined)) {
return(0);
}
var _local3 = stack[id];
_local3.stop();
debug(("stop(" + _local3.__link) + ")");
if (_local3.__autoDelete) {
if ((id != _numSound) || (type != 2)) {
deleteSound(id);
}
}
}
function stopAll() {
debug("stopAll()");
for (var _local2 in stack) {
stop(_local2);
}
}
function setVolume(id, volume) {
if (((id == undefined) || (volume == undefined)) || (stack[id] == undefined)) {
return(0);
}
var _local2 = stack[id];
if (mute) {
_local2._oldVolume = volume;
return(0);
}
debug(((("setVolume(" + _local2.__link) + ", ") + volume) + ")");
if (_local2 != undefined) {
_local2.setVolume(volume);
}
}
function setAllVolume(volume) {
for (var _local2 in stack) {
setVolume(_local2, volume);
}
}
function debug(msg) {
if (debugOn) {
trace((type + " ") + msg);
}
}
function toString() {
return(("[class WaveEngine::" + ((type == 1) ? "Sound" : "Music")) + "]");
}
var _numSound = 0;
static var _numClass = 0;
}
Symbol 978 MovieClip [__Packages.CConfigLoader] Frame 0
class CConfigLoader
{
var myXML, cbfunc;
function CConfigLoader (sConfigFile, cbFunc) {
myXML = new CXML();
myXML.cbfunc = mx.utils.Delegate.create(this, onXMLLoad);
myXML.load(((sConfigFile == undefined) ? "config.xml" : (sConfigFile)));
cbfunc = cbFunc;
}
function parse() {
for (var i in myXML.oResult.config.static) {
for (var j in myXML.oResult.config.static[i]) {
var parent = eval (i);
parent[j] = myXML.oResult.config.static[i][j];
}
}
}
function onXMLLoad(bSuccess) {
if (bSuccess) {
parse();
}
cbfunc(bSuccess);
}
}
Symbol 979 MovieClip [__Packages.CXML] Frame 0
class CXML extends XML
{
var oResult, cbfunc;
function CXML () {
super();
}
function onLoad(bSuccess) {
if (bSuccess) {
parse(this, (oResult = new Object()));
}
return(cbfunc(bSuccess));
}
function parse(node, oRes) {
node.ignoreWhite = true;
var _local2 = 0;
while (_local2 < node.childNodes.length) {
if (node.childNodes[_local2].childNodes.length > 1) {
parse(node.childNodes[_local2], (oRes[node.childNodes[_local2].nodeName] = new Object()));
} else if (node.childNodes[_local2].hasChildNodes()) {
switch (node.childNodes[_local2].attributes.type) {
case "Number" :
var _local6 = Number(node.childNodes[_local2].firstChild.nodeValue);
break;
case "nArray" :
_local6 = conv2NumAr(node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.separator));
break;
case "sArray" :
_local6 = node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.separator);
break;
case "sMatrix" :
var _local5 = node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.row_separator);
var _local4 = 0;
while (_local4 < _local5.length) {
_local5[_local4] = _local5[_local4].split(node.childNodes[_local2].attributes.col_separator);
_local4++;
}
_local6 = _local5;
break;
case "nMatrix" :
_local5 = node.childNodes[_local2].firstChild.nodeValue.split(node.childNodes[_local2].attributes.row_separator);
_local4 = 0;
while (_local4 < _local5.length) {
_local5[_local4] = conv2NumAr(_local5[_local4].split(node.childNodes[_local2].attributes.col_separator));
_local4++;
}
_local6 = _local5;
break;
default :
_local6 = node.childNodes[_local2].firstChild.nodeValue;
}
oRes[node.childNodes[_local2].nodeName] = _local6;
}
_local2++;
}
}
function conv2NumAr(ar) {
var _local1 = 0;
while (_local1 < ar.length) {
ar[_local1] = Number(ar[_local1]);
_local1++;
}
return(ar);
}
}
Symbol 980 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 981 MovieClip [__Packages.CDonut] Frame 0
class CDonut extends MovieClip
{
var nCount;
function CDonut () {
super();
nCount = 0;
}
}
Symbol 982 MovieClip [__Packages.CMenu] Frame 0
class CMenu extends MovieClip
{
var btnResumeG, btnOptions, btnEndG, btnHelp, stopDrag, _parent, Options, removeMovieClip, attachMovie, getNextHighestDepth, fon, endGameWnd, help;
function CMenu () {
super();
_root.fPlaySnd(_root.nSndPopUp);
_root.bPause = true;
fAssL();
btnResumeG.onRelease = mx.utils.Delegate.create(this, fResumeG);
btnOptions.onRelease = mx.utils.Delegate.create(this, fOptions);
btnEndG.onRelease = mx.utils.Delegate.create(this, fEndG);
btnHelp.onRelease = mx.utils.Delegate.create(this, fHelp);
(stopDrag());// not popped
Mouse.show();
}
function fAssL() {
_parent.keyListener.onKeyDown = mx.utils.Delegate.create(this, fMenuKeyDown);
}
function fMenuKeyDown() {
if ((Key.isDown(32) || (Key.isDown(27))) || (Key.isDown(13))) {
var _local2 = mx.utils.Delegate.create(this, fResumeG);
_local2();
}
}
function fOptKeyDown() {
if (Key.isDown(32) || (Key.isDown(27))) {
Options.fCancel();
}
if (Key.isDown(13)) {
Options.fOk();
}
}
function fEndGKeyDown() {
if (Key.isDown(32) || (Key.isDown(27))) {
var _local2 = mx.utils.Delegate.create(this, fEGNo);
_local2();
fAssL();
}
if (Key.isDown(13)) {
var _local2 = mx.utils.Delegate.create(this, fEGYes);
_local2();
}
}
function fHelpKeyDown() {
if ((Key.isDown(32) || (Key.isDown(27))) || (Key.isDown(13))) {
var _local2 = mx.utils.Delegate.create(this, fHOk);
_local2();
fAssL();
}
}
function fResumeG() {
_parent.fRegListener();
_root.fPlaySnd(_root.nSndBtnClick);
_root.bPause = false;
if ((_parent.bGame || (_parent.bLvlBegin)) && (!_parent.bTip)) {
_parent.fStartDragFlipper();
Mouse.hide();
}
_parent.fon.removeMovieClip();
removeMovieClip();
}
function fOptions() {
_parent.keyListener.onKeyDown = mx.utils.Delegate.create(this, fOptKeyDown);
_root.fPlaySnd(_root.nSndBtnClick);
attachMovie("fon", "fon", _parent.getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha});
attachMovie("Options", "Options", getNextHighestDepth(), {_x:-50, _y:10.5});
fon.useHandCursor = false;
fon.onPress = undefined;
}
function fEndG() {
_parent.keyListener.onKeyDown = mx.utils.Delegate.create(this, fEndGKeyDown);
_root.fPlaySnd(_root.nSndBtnClick);
attachMovie("fon", "fon", _parent.getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha});
fon.useHandCursor = false;
fon.onPress = undefined;
attachMovie("endGameWnd", "endGameWnd", getNextHighestDepth(), {_x:-48.5, _y:42});
endGameWnd.btnYes.onRelease = mx.utils.Delegate.create(this, fEGYes);
endGameWnd.btnNo.onRelease = mx.utils.Delegate.create(this, fEGNo);
}
function fEGYes() {
_root.fPlaySnd(_root.nSndBtnClick);
fon.removeMovieClip();
endGameWnd.removeMovieClip();
CProcess.killAll();
_root.gotoAndStop("MMenu");
}
function fEGNo() {
_root.fPlaySnd(_root.nSndBtnClick);
fon.removeMovieClip();
endGameWnd.removeMovieClip();
}
function fHelp() {
_parent.keyListener.onKeyDown = mx.utils.Delegate.create(this, fHelpKeyDown);
_root.fPlaySnd(_root.nSndBtnClick);
attachMovie("fon", "fon", _parent.getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha});
fon.useHandCursor = false;
fon.onPress = undefined;
attachMovie("help", "help", getNextHighestDepth(), {_x:-167, _y:-43.5});
help.btnOk.onRelease = mx.utils.Delegate.create(this, fHOk);
}
function fHOk() {
_root.fPlaySnd(_root.nSndBtnClick);
fon.removeMovieClip();
help.removeMovieClip();
}
}
Symbol 983 MovieClip [__Packages.CProcess] Frame 0
class CProcess
{
function CProcess () {
}
static function main() {
var _local1 = 0;
while (_local1 < PROCESSES.length) {
var _local2 = PROCESSES[_local1][0].apply(null, PROCESSES[_local1][1]);
if (_local2 == 0) {
kill(PROCESSES[_local1][0], PROCESSES[_local1][2]);
} else if (_local2 == -1) {
return(undefined);
}
_local1++;
}
}
static function start(ps, args, id, priority) {
id = ((id == undefined) ? -1 : (id));
if (priority == undefined) {
PROCESSES.push([ps, args, id]);
} else {
PROCESSES.splice(priority, 0, [ps, args, id]);
}
}
static function kill(ps, id) {
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || ((PROCESSES[_local1][0].func == ps.func) && (ps.func != undefined))) && (PROCESSES[_local1][2] == id)) {
PROCESSES.splice(_local1, 1);
}
_local1++;
}
}
static function killAll() {
PROCESSES = new Array();
}
static function is(ps, id) {
id = ((id == undefined) ? -1 : (id));
var _local1 = 0;
while (_local1 < PROCESSES.length) {
if (((PROCESSES[_local1][0] == ps) || (PROCESSES[_local1][0].func == ps.func)) && (PROCESSES[_local1][2] == id)) {
return(true);
}
_local1++;
}
return(false);
}
static function toString() {
return("[com.itpremium.games.Process]");
}
static function keepId() {
return(lastId++);
}
static var PROCESSES = new Array();
static var lastId = 1;
}
Symbol 984 MovieClip [__Packages.CBonusRes] Frame 0
class CBonusRes extends MovieClip
{
var mcTitle, nnn, n0, n1, n2, removeMovieClip;
function CBonusRes () {
super();
fShowRes(0);
mcTitle._visible = false;
nnn = 0;
}
function fShowRes(n) {
n0._visible = true;
n1._visible = true;
n2._visible = true;
n0.gotoAndStop((n % 10) + 1);
n = n - (n % 10);
if (n == 0) {
n1._visible = false;
n2._visible = false;
return(undefined);
}
n = n / 10;
n1.gotoAndStop((n % 10) + 1);
n = n - (n % 10);
if (n == 0) {
n2._visible = false;
return(undefined);
}
n2.gotoAndStop(2);
}
function fShowTitle(nPerc) {
var _local4;
if (nPerc == 100) {
_local4 = 11;
} else if ((nPerc < 100) && (nPerc >= 95)) {
_local4 = 10;
} else if ((nPerc < 95) && (nPerc >= 88)) {
_local4 = 9;
} else if ((nPerc < 88) && (nPerc >= 79)) {
_local4 = 8;
} else if ((nPerc < 79) && (nPerc >= 68)) {
_local4 = 7;
} else if ((nPerc < 68) && (nPerc >= 58)) {
_local4 = 6;
} else if ((nPerc < 58) && (nPerc >= 48)) {
_local4 = 5;
} else if ((nPerc < 48) && (nPerc >= 38)) {
_local4 = 4;
} else if ((nPerc < 38) && (nPerc >= 28)) {
_local4 = 3;
} else if ((nPerc < 28) && (nPerc >= 18)) {
_local4 = 2;
} else {
_local4 = 1;
}
mcTitle.gotoAndStop(_local4);
mcTitle._visible = true;
if (nPerc <= 40) {
_root.fPlaySnd(_root.nSndBScoreBad);
} else if (nPerc <= 80) {
_root.fPlaySnd(_root.nSndBScoreGood);
} else {
_root.fPlaySnd(_root.nSndBScoreGreat);
}
CProcess.start(mx.utils.Delegate.create(this, fShutDownThis), [], random(999999));
}
function fShutDownThis() {
nnn++;
if (nnn >= 60) {
removeMovieClip();
return(0);
}
}
}
Symbol 985 MovieClip [__Packages.CLeveler] Frame 0
class CLeveler extends MovieClip
{
var mcLN0, mcLN1, mcLN2;
function CLeveler () {
super();
fShowLevel(0);
}
function fShowLevel(n) {
var _local2 = 0;
while (_local2 < 3) {
this["mcLN" + _local2]._visible = true;
this["mcLN" + _local2]._x = aLNX[2][2 - _local2];
_local2++;
}
mcLN0.gotoAndStop((n % 10) + 1);
n = n - (n % 10);
if (n == 0) {
mcLN1._visible = false;
mcLN2._visible = false;
mcLN0._x = aLNX[0][2];
mcLN1._x = aLNX[0][1];
mcLN2._x = aLNX[0][0];
return(undefined);
}
n = n / 10;
mcLN1.gotoAndStop((n % 10) + 1);
n = n - (n % 10);
if (n == 0) {
mcLN2._visible = false;
mcLN0._x = aLNX[1][2];
mcLN1._x = aLNX[1][1];
mcLN2._x = aLNX[1][0];
return(undefined);
}
n = n / 10;
mcLN2.gotoAndStop((n % 10) + 1);
}
var aLNX = [[-12, 0, 12], [-6.5, 5.5, 17.5], [0, 12, 24]];
}
Symbol 986 MovieClip [__Packages.CScores] Frame 0
class CScores extends MovieClip
{
function CScores () {
super();
fShowScore(0);
}
function fShowScore(n) {
var _local4 = 0;
while (_local4 < 7) {
this["mcSN" + _local4]._visible = true;
this["mcSN" + _local4]._x = aSNXd[6] + ((6 - _local4) * 17);
_local4++;
}
_local4 = 0;
while (_local4 < 7) {
this["mcSN" + _local4].gotoAndStop((n % 10) + 1);
n = n - (n % 10);
if (n == 0) {
var _local3 = _local4 + 1;
while (_local3 < 7) {
this["mcSN" + _local3]._visible = false;
_local3++;
}
var _local2 = 0;
while (_local2 < 7) {
this["mcSN" + _local2]._x = aSNXd[_local4] + ((6 - _local2) * 17);
_local2++;
}
break;
}
n = n / 10;
_local4++;
}
}
var aSNXd = [-52, -44, -35, -27, -18, -9, 0];
}
Symbol 987 MovieClip [__Packages.CDude] Frame 0
class CDude extends MovieClip
{
var nC, _parent, gotoAndStop;
function CDude () {
super();
nC = 0;
}
function fDTell(s, n) {
var _local2 = "";
if (s != null) {
switch (s) {
case -1 :
_local2 = sDownload;
break;
case 0 :
_local2 = aFirstFrases[random(2)];
break;
case 1 :
_local2 = aSecondFrases[random(2)];
break;
case 2 :
_local2 = aAfterLevel[random(2)];
break;
case 3 :
_local2 = sLoseLevel;
break;
case 4 :
_local2 = sLoseDonut;
break;
case 5 :
_local2 = sCaseOverflow;
break;
case 6 :
_local2 = aBonusLevel[random(2)];
}
_parent.mcPhrase.dtPhrase = _local2;
_parent.mcPhrase._visible = true;
}
if (n == 0) {
gotoAndStop("Angry");
} else if (n == 1) {
gotoAndStop("Happy");
} else if (n == 2) {
gotoAndStop("Conf");
} else {
gotoAndStop("Talk");
}
nC = 0;
if (!CProcess.is(mx.utils.Delegate.create(this, fDShutUp), 5)) {
CProcess.start(mx.utils.Delegate.create(this, fDShutUp), [], 5);
}
}
function fDShutUp() {
nC++;
if (nC >= 75) {
gotoAndStop("Normal");
_parent.mcPhrase._visible = false;
nC = 0;
return(0);
}
}
var sDownload = "Try the download version for more great features!";
var aFirstFrases = ["Hi, I'm Digby! Employees can earn lots of tips selling my donuts.", "Hi, I'm Digby! As an employee you will earn lots of tips selling my donuts."];
var aSecondFrases = ["Let's sell some donuts!!!", "Our customers are waiting, let's go!!!"];
var aAfterLevel = ["The shop was sure busy today.", "Great work!!!"];
var sLoseLevel = "We'll need to practice more before we re-open the donut shop.";
var sLoseDonut = "You must catch all my tasty donuts...don't let them go to waste!";
var sCaseOverflow = "Please don't put donuts on my beautiful display case.";
var aBonusLevel = ["There's a surprise donut shop test today... bonus round!", "I continuously test all my employees to improve quality... bonus round!"];
}
Symbol 988 MovieClip [__Packages.CGame] Frame 0
class CGame extends MovieClip
{
var nLevel, nBLevel, nFullScore, nCurrScore, nLvlScore, nScore2Put, nLifesLosed, nLifes, nCount, nDonCount, nPauseTime, mcLife2, mcLevel, mcScore, bGame, bBonus, mcPhrase, attachMovie, getNextHighestDepth, help, bLvlEnd, mc2Click, fon, stopDrag, mcDude, mcInfo, mcMeter, bLvlBegin, b2Check, b2Drop, nBDonDropped, nBDonLosed, nBThrows, bBonusEnd, nDonSpeed, mcBlunders, bAccBlunder, mcLife0, mcLife1, mcPlank, bTip, downloadWnd, getURL, mcFlipper, nBPerc, BonusRes;
function CGame () {
super();
_root.fStopAllSnd();
_root.bPause = false;
_root.nGameStatus = 1;
nLevel = 1;
nBLevel = 1;
nFullScore = 0;
nCurrScore = 0;
nLvlScore = 0;
nScore2Put = 0;
nLifesLosed = 0;
nLifes = 3;
nCount = 0;
nDonCount = 1;
nPauseTime = 0;
mcLife2._visible = false;
mcLevel.fShowLevel(nLevel);
mcScore.fShowScore(nFullScore);
bGame = false;
bBonus = false;
mcPhrase._visible = false;
attachMovie("mcPlank", "mcPlank", getNextHighestDepth(), {_x:142, _y:293});
attachMovie("help", "help", getNextHighestDepth(), {_x:35, _y:40});
var f = mx.utils.Delegate.create(this, fStart);
help.btnOk.onRelease = function () {
_root.fPlaySnd(_root.nSndBtnClick);
f();
};
}
function onEnterFrame() {
((!_root.bPause) ? (CProcess.main()) : null);
}
function fRegListener() {
Key.removeListener(keyListener);
keyListener.onKeyDown = mx.utils.Delegate.create(this, fKeyDown);
Key.addListener(keyListener);
(((!bGame) && (bLvlEnd)) ? ((mc2Click.onMouseDown = mx.utils.Delegate.create(this, fStart))) : null);
}
function fKeyDown() {
if ((!_root.bPause) && (Key.isDown(32) || (Key.isDown(27)))) {
attachMovie("fon", "fon", getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha + 20});
attachMovie("Menu", "mcMenu", getNextHighestDepth(), {_x:200, _y:86});
fon.useHandCursor = false;
fon.onPress = undefined;
(((!bGame) && (bLvlEnd)) ? ((mc2Click.onMouseDown = undefined)) : null);
}
if (Key.getCode() == 83) {
if (_root.bSnd) {
_root.SoundEng.soundOff();
_root.bSnd = false;
} else {
_root.SoundEng.soundOn();
_root.bSnd = true;
}
}
if ((!_root.bPause) && (Key.getCode() == 112)) {
_root.bPause = true;
(stopDrag());// not popped
Mouse.show();
attachMovie("help", "help", getNextHighestDepth(), {_x:35, _y:40});
help.btnOk.onRelease = mx.utils.Delegate.create(this, fHKD2);
keyListener.onKeyDown = mx.utils.Delegate.create(this, fHKD1);
(((!bGame) && (bLvlEnd)) ? ((mc2Click.onMouseDown = undefined)) : null);
}
}
function fHKD1() {
if ((((Key.getCode() == 112) || (Key.isDown(32))) || (Key.isDown(27))) || (Key.isDown(13))) {
var _local2 = mx.utils.Delegate.create(this, fHKD2);
_local2();
}
}
function fHKD2() {
_root.fPlaySnd(_root.nSndBtnClick);
if (bGame) {
fStartDragFlipper();
Mouse.hide();
} else {
}
_root.bPause = false;
help.removeMovieClip();
fRegListener();
}
function fStart() {
fRegListener();
_root.fStopAllSnd();
CProcess.killAll();
if (nLevel == 1) {
mcDude.fDTell(0);
mcInfo.gotoAndStop("Intro");
help.removeMovieClip();
}
mc2Click.removeMovieClip();
mcMeter._y = 339.5;
mcMeter._height = 2;
nCurrScore = nFullScore;
nLvlScore = 0;
nScore2Put = 0;
mcLevel.fShowLevel(nLevel);
mcScore.fShowScore(nFullScore);
bLvlEnd = false;
bLvlBegin = true;
b2Check = false;
b2Drop = true;
nCount = 0;
nDonCount = 1;
nBDonDropped = 0;
nBDonLosed = 0;
nBThrows = 0;
bBonusEnd = false;
nDonSpeed = ((((nLevel / 4) + _root.FallSpeed) > 10) ? 10 : ((nLevel / 4) + _root.FallSpeed));
mcBlunders._visible = false;
var _local3 = 0;
while (_local3 < 3) {
this["mcLife" + _local3].gotoAndStop(1);
this["mcLife" + _local3]._visible = false;
_local3++;
}
bAccBlunder = false;
if (bBonus) {
mcDude.fDTell(6);
var _local4 = Array();
if (nBLevel == 1) {
_local4 = [0, 1, 2, 3, 4];
} else if (nBLevel == 2) {
_local4 = [0, 1, 2, 3, 4, 5, 6];
} else {
_local4 = [0, 1, 2, 3, 4, 5, 6, 7];
}
aLvlInfo = [[-1, -1, 0, 0, 0, 0, 0, -1, -1], _local4, ((nBLevel > 1) ? -1 : 3), 0, 0, ((nBLevel > 2) ? 6 : 5), 1];
} else {
if (nLevel > 1) {
bAccBlunder = true;
mcBlunders._visible = true;
mcLife0._visible = true;
mcLife1._visible = true;
}
nLifesLosed = 0;
nLifes = ((nLevel < 7) ? 2 : 3);
mcLife2._visible = ((nLifes == 3) ? true : false);
_local3 = 0;
while (_local3 < 3) {
this["mcLife" + _local3].gotoAndStop(1);
_local3++;
}
aLvlInfo = fChooseLvlInfo(nLevel);
}
var _local5 = mx.utils.Delegate.create(this, fPreLevel);
_local5();
}
function fChooseLvlInfo(nLvl) {
var _local3 = Array();
if (nLvl < 3) {
_local3 = [-1, 0, 0, 0, 0, 0, 0, 0, -1];
} else if (nLvl < 6) {
_local3 = [0, 0, 0, 0, 1, 0, 0, 0, 0];
} else if (nLvl < 9) {
_local3 = [1, 0, 0, 0, 0, 0, 0, 0, 1];
} else {
_local3 = (random(2) ? ([1, 0, 0, 0, 0, 0, 0, 0, random(2)]) : ([random(2), 0, 0, 0, 0, 0, 0, 0, 1]));
}
var _local2 = Array();
if (nLvl < 2) {
_local2 = [0, 1, 2];
} else if (nLvl < 4) {
_local2 = [0, 1, 2, 3];
} else if (nLvl < 6) {
_local2 = [0, 1, 2, 3, 4];
} else if (nLvl < 7) {
_local2 = [0, 1, 2, 3, 4, 5];
} else if (nLvl < 8) {
_local2 = [0, 1, 2, 3, 4, 5, 6];
} else {
_local2 = [0, 1, 2, 3, 4, 5, 6, 7];
}
((nLvl > 2) ? (_local2.push(8)) : null);
var _local4 = 1.5;
if (nLvl >= 4) {
_local4 = 1.25;
} else if (nLvl >= 8) {
_local4 = 1;
} else if (nLvl >= 12) {
_local4 = 0.75;
} else if (nLvl >= 16) {
_local4 = 0.5;
}
return([_local3, _local2, ((nLvl <= 6) ? (nLvl - 1) : -1), ((nLvl >= 5) ? 1 : 0), ((nLvl >= 6) ? 1 : 0), ((nLvl > 6) ? 5 : 4), _local4]);
}
function fPreLevel() {
var _local2 = 0;
while (_local2 < 9) {
aTable[_local2] = [aLvlInfo[0][_local2], new Array()];
if (aTable[_local2][0] == -1) {
aTable[_local2][1] = [attachMovie("Busy", "Busy" + _local2, getNextHighestDepth(), {_x:aTableX[_local2], _y:nTableTopY})];
} else if ((aTable[_local2][0] == 0) && (!bBonus)) {
var _local6 = random(aLvlInfo[5]);
var _local4 = 0;
while (_local4 < _local6) {
var _local3 = 8;
if (true) {
_local3 = aLvlInfo[1][random(aLvlInfo[1].length)];
if ((((_local3 == 8) || ((_local3 == aTable[_local2][1][_local4 - 1].nColor) && (_local3 == aTable[_local2][1][_local4 - 2].nColor))) || (_local3 == aTable[_local2 - 1][1][_local4].nColor)) || (_local3 == aTable[_local2 + 1][1][_local4].nColor)) {
// unexpected jump
}
}
var _local5 = attachMovie(("don" + _local3) + "001", (("don" + _local3) + "001") + ((_local2 * _local4) + random(9999999)), getNextHighestDepth(), {_x:aTableX[_local2] + 2.5, _y:nTableBottomY - (_local4 * nTableYDiff)});
_local5.nColor = _local3;
_local5.nCombo = 1;
_local5.nSuper = 0;
aTable[_local2][1][_local4] = _local5;
_local4++;
}
} else if (aTable[_local2][0] == 1) {
aTable[_local2][1] = [attachMovie("Trash", "Trash", getNextHighestDepth(), {_x:aTableX[_local2] + 2.5, _y:nTableTopY - 2})];
} else if (aTable[_local2][0] == 2) {
aTable[_local2][1] = [attachMovie("Recycle", "Recycle", getNextHighestDepth(), {_x:aTableX[_local2] + 2.5, _y:nTableTopY - 1})];
}
_local2++;
}
aSpoon = Array();
mcPlank.swapDepths(getNextHighestDepth());
attachMovie("mcFlipper", "mcFlipper", getNextHighestDepth(), {_x:294, _y:272});
fActFlip();
fStartDragFlipper();
Mouse.hide();
mcPlank._y = 293;
CProcess.start(mx.utils.Delegate.create(this, fMovePlank), [1], getTimer());
}
function fMovePlank(n) {
if (n == 0) {
if (mcPlank._y == 400) {
mcPlank._visible = true;
mcPlank.swapDepths(getNextHighestDepth());
_root.fPlaySnd(_root.nSndDonutBinUp);
}
mcPlank._y = mcPlank._y - 5;
if (mcPlank._y <= 293) {
mcPlank._y = 293;
nLevel++;
(bBonus ? (nBLevel++) : null);
attachMovie("mc2Click", "mc2Click", getNextHighestDepth(), {_x:217, _y:268});
bBonus = (((nLevel % 4) == 0) ? true : false);
bGame = false;
mc2Click.onMouseDown = mx.utils.Delegate.create(this, fStart);
return(0);
}
} else {
if (mcPlank._y == 293) {
mcPlank.swapDepths(getNextHighestDepth());
_root.fPlaySnd(_root.nSndDonutBinDown);
}
mcPlank._y = mcPlank._y + 5;
if (mcPlank._y >= 400) {
mcPlank._y = 400;
mcPlank._visible = false;
mcInfo.gotoAndStop("Off" + (random(4) + 1));
if ((nLevel % _root.DownWndFreq) == 0) {
fShowDown();
} else {
(((_root.DisTips == 0) && (aLvlInfo[2] != -1)) ? (fShowTip()) : (fGame()));
}
return(0);
}
}
}
function fShowDown() {
bTip = true;
Mouse.show();
(stopDrag());// not popped
attachMovie("downloadWnd", "downloadWnd", getNextHighestDepth(), {_x:186, _y:117});
downloadWnd.btnBuyNow.onRelease = mx.utils.Delegate.create(this, fDownBuy);
downloadWnd.btnLater.onRelease = mx.utils.Delegate.create(this, fDownLater);
downloadWnd.btnDownNow.onRelease = mx.utils.Delegate.create(this, fDown);
downloadWnd.dtText = _root.UpsellText;
if (_root.BuyNowButton != 1) {
downloadWnd.btnLater._y = (downloadWnd.btnDownNow._y = downloadWnd.btnDownNow._y + 15);
downloadWnd.btnBuyNow._visible = false;
}
}
function fDownBuy() {
_root.fPlaySnd(_root.nSndBtnClick);
(getURL(_root.BuyNowURL, _root.BuyNowWindowType));// not popped
downloadWnd.removeMovieClip();
if ((_root.DisTips == 0) && (aLvlInfo[2] != -1)) {
fShowTip();
} else {
fStartDragFlipper();
Mouse.hide();
fGame();
}
}
function fDown() {
_root.fPlaySnd(_root.nSndBtnClick);
(getURL(_root.DownloadURL, _root.DownloadWindowType));// not popped
downloadWnd.removeMovieClip();
if ((_root.DisTips == 0) && (aLvlInfo[2] != -1)) {
fShowTip();
} else {
fStartDragFlipper();
Mouse.hide();
fGame();
}
}
function fDownLater() {
_root.fPlaySnd(_root.nSndBtnClick);
downloadWnd.removeMovieClip();
if ((_root.DisTips == 0) && (aLvlInfo[2] != -1)) {
fShowTip();
} else {
fStartDragFlipper();
Mouse.hide();
fGame();
}
}
function fShowTip() {
bTip = true;
Mouse.show();
(stopDrag());// not popped
_root.fPlaySnd(_root.nSndPing);
attachMovie("RT" + aLvlInfo[2], "RT" + aLvlInfo[2], getNextHighestDepth(), {_x:154.5, _y:59.5});
this["RT" + aLvlInfo[2]].btnResume.onRelease = mx.utils.Delegate.create(this, fUnShowTip);
this["RT" + aLvlInfo[2]].btnDisTips.onRelease = mx.utils.Delegate.create(this, fUnShowTip2);
}
function fUnShowTip() {
_root.fPlaySnd(_root.nSndBtnClick);
this["RT" + aLvlInfo[2]].removeMovieClip();
fStartDragFlipper();
Mouse.hide();
fGame();
}
function fUnShowTip2() {
_root.fPlaySnd(_root.nSndBtnClick);
_root.DisTips = 1;
this["RT" + aLvlInfo[2]].removeMovieClip();
fStartDragFlipper();
Mouse.hide();
fGame();
}
function fGame() {
bTip = false;
bLvlBegin = false;
bGame = true;
if (bBonus) {
CProcess.start(mx.utils.Delegate.create(this, fStartBDonThrow), [], getTimer());
} else {
mcDude.fDTell(1);
CProcess.start(mx.utils.Delegate.create(this, fStartDonFall), [], getTimer());
}
}
function fStartDonFall() {
nCount++;
if ((nDonCount <= aLvlInfo[5]) && ((nCount % Math.floor(aLvlInfo[6] * 20)) == (Math.floor(aLvlInfo[6] * 20) - 1))) {
var _local2 = aLvlInfo[1][random(aLvlInfo[1].length)];
var _local4 = 0;
if (aLvlInfo[3] == 1) {
_local4 = ((random(6) == 0) ? 1 : 0);
}
if ((_local4 == 1) && ((((_local2 == 3) || (_local2 == 6)) || (_local2 == 7)) || (_local2 == 8))) {
_local4 = 0;
}
var _local5 = 0;
if (aLvlInfo[4] == 1) {
_local5 = ((random(12) == 0) ? 1 : 0);
}
if ((_local5 == 1) && (((((_local2 == 0) || (_local2 == 2)) || (_local2 == 6)) || (_local2 == 8)) || (_local4 == 1))) {
_local5 = 0;
}
var _local6 = random(9);
this["mcCL" + _local6].gotoAndPlay("r");
var _local3 = attachMovie(((((("don" + _local2) + "") + _local4) + "") + _local5) + "0", (((((("don" + _local2) + "") + _local4) + "") + _local5) + "0") + getTimer(), getNextHighestDepth(), {_x:aRoofX[_local6], _y:nRoofY, _visible:false});
_local3.nColor = _local2;
_local3.nCombo = 1;
if (_local4 == 1) {
if (((_local2 == 0) || (_local2 == 1)) || (_local2 == 5)) {
_local3.nCombo = 2;
} else if (_local2 == 4) {
_local3.nCombo = 3;
} else if (_local2 == 2) {
_local3.nCombo = 4;
}
}
_local3.nSuper = _local5;
aFallEls.push(_local3);
CProcess.start(mx.utils.Delegate.create(this, fDonPreFall), [getTimer(), _local6, _local3], getTimer());
nDonCount++;
nCount = 0;
} else if ((nDonCount > aLvlInfo[5]) && ((nCount % Math.floor(aLvlInfo[6] * 40)) == (Math.floor(aLvlInfo[6] * 40) - 1))) {
nDonCount = 1;
nCount = 0;
CProcess.start(mx.utils.Delegate.create(this, fStartDonFall), [], getTimer());
return(0);
}
}
function fDonPreFall(n0, place, mc) {
if ((getTimer() - n0) >= 500) {
this["mcCL" + place].gotoAndStop("g");
_root.fPlaySnd(_root.nSndDonutRoll);
CProcess.start(mx.utils.Delegate.create(this, fDonFall), [getTimer(), place, mc], getTimer());
return(0);
}
}
function fDonFall(n0, place, mc) {
if ((getTimer() - n0) >= 300) {
mc._visible = true;
this["mcCL" + place].gotoAndStop("n");
((mc.nColor == 8) ? (_root.fPlaySnd(_root.nSndBDonutDown)) : (_root.fPlaySnd(_root.nSndDonutDown)));
CProcess.start(mx.utils.Delegate.create(this, fDonFalling), [mc, place, 0], random(99999) + 20);
return(0);
}
}
function fDonFalling(mc, place, xSpeed) {
if (bBonus) {
var _local4 = (mc._y - 40) / 10;
if (place == 0) {
mc._x = mc._x + xSpeed;
((mc._x < 145) ? ((mc._y = mc._y - _local4)) : ((mc._y = mc._y + _local4)));
} else {
mc._x = mc._x - xSpeed;
((mc._x < 475) ? ((mc._y = mc._y + _local4)) : ((mc._y = mc._y - _local4)));
}
} else {
mc._y = mc._y + nDonSpeed;
}
if (aSpoon.length == 0) {
if (mc.hitTest(mcFlipper)) {
_root.fPlaySnd(_root.nSndDonutKiss);
var _local5 = mcFlipper.attachMovie(((((("don" + mc.nColor) + "") + ((mc.nCombo == 1) ? 0 : 1)) + "") + mc.nSuper) + "1", (((((("don" + mc.nColor) + "") + ((mc.nCombo == 1) ? 0 : 1)) + "") + mc.nSuper) + "1") + getTimer(), mcFlipper.getNextHighestDepth(), {_x:0, _y:-nTableYDiff});
_local5.nColor = mc.nColor;
_local5.nCombo = mc.nCombo;
_local5.nSuper = mc.nSuper;
aSpoon[0] = _local5;
fRemFall(mc);
mc.removeMovieClip();
return(0);
}
} else if (mc.hitTest(aSpoon[aSpoon.length - 1])) {
_root.fPlaySnd(_root.nSndDonutKiss);
var _local5 = mcFlipper.attachMovie(((((("don" + mc.nColor) + "") + ((mc.nCombo == 1) ? 0 : 1)) + "") + mc.nSuper) + "1", (((((("don" + mc.nColor) + "") + ((mc.nCombo == 1) ? 0 : 1)) + "") + mc.nSuper) + "1") + getTimer(), mcFlipper.getNextHighestDepth(), {_x:0, _y:(-nTableYDiff) * (aSpoon.length + 1)});
_local5.nColor = mc.nColor;
_local5.nCombo = mc.nCombo;
_local5.nSuper = mc.nSuper;
aSpoon.push(_local5);
fRemFall(mc);
mc.removeMovieClip();
return(0);
}
if (mc._y >= 400) {
fRemFall(mc);
mc.removeMovieClip();
(bAccBlunder ? (fBlunder()) : null);
nBDonLosed++;
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
}
function fStartBDonThrow() {
nCount++;
if ((nDonCount <= aLvlInfo[5]) && ((nCount % Math.floor(aLvlInfo[6] * 20)) == (Math.floor(aLvlInfo[6] * 20) - 1))) {
var _local5 = aLvlInfo[1][random(aLvlInfo[1].length)];
var _local4 = random(2);
var _local3 = ("don" + _local5) + "000";
var _local2 = attachMovie(_local3, _local3 + getTimer(), getNextHighestDepth(), {_x:((_local4 == 0) ? -40 : 610), _y:290});
_local2.nColor = _local5;
_local2.nCombo = 1;
_local2.nSuper = 0;
aFallEls.push(_local2);
nBDonDropped++;
CProcess.start(mx.utils.Delegate.create(this, fBDonPreThrow), [getTimer(), _local4, _local2], getTimer());
nDonCount++;
nCount = 0;
return(undefined);
}
if ((nDonCount > aLvlInfo[5]) && ((nCount % Math.floor(aLvlInfo[6] * 40)) == (Math.floor(aLvlInfo[6] * 40) - 1))) {
nDonCount = 1;
nCount = 0;
nBThrows++;
if (nBThrows < 5) {
CProcess.start(mx.utils.Delegate.create(this, fStartBDonThrow), [], getTimer());
return(0);
}
bBonusEnd = true;
return(0);
}
}
function fBDonPreThrow(n0, place, mc) {
if ((getTimer() - n0) >= 400) {
var _local3 = random(151) + 150;
((place == 0) ? ((mc._x = 145 - _local3)) : ((mc._x = 475 + _local3)));
_root.fPlaySnd(_root.aSndSlide[random(4)]);
CProcess.start(mx.utils.Delegate.create(this, fDonFalling), [mc, place, 2 + Math.floor(_local3 / 25)], getTimer());
return(0);
}
}
function fDropDon() {
if (((!_root.bPause) && (aSpoon.length > 0)) && (b2Drop)) {
var _local6;
var _local3 = 0;
while (_local3 < 9) {
if (((mcFlipper._x + 16) > aTableX[_local3]) && ((mcFlipper._x + 16) <= aTableX[_local3 + 1])) {
_local6 = _local3;
break;
}
_local3++;
}
var _local7 = aSpoon.length;
var _local4 = aSpoon.pop();
var _local5 = attachMovie(((((("don" + _local4.nColor) + "") + ((_local4.nCombo == 1) ? 0 : 1)) + "") + _local4.nSuper) + "1", (((((("don" + _local4.nColor) + "") + ((_local4.nCombo == 1) ? 0 : 1)) + "") + _local4.nSuper) + "1") + getTimer(), getNextHighestDepth(), {_x:aTableX[_local6] + 2.5, _y:272 - (_local7 * nTableYDiff)});
_local5.nColor = _local4.nColor;
_local5.nCombo = _local4.nCombo;
_local5.nSuper = _local4.nSuper;
aFallEls.push(_local5);
_local4.removeMovieClip();
_root.fPlaySnd(_root.nSndDonutDrop);
b2Drop = false;
b2Check = false;
((_local5.nColor != 8) ? ((nPauseTime = 17)) : null);
if ((!CProcess.is(mx.utils.Delegate.create(this, fDelay), 1)) && (_local5.nColor != 8)) {
CProcess.start(mx.utils.Delegate.create(this, fDelay), [], 1);
}
CProcess.start(mx.utils.Delegate.create(this, f2DropCounter), [_local5], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fDonDropp), [_local5, _local6], getTimer());
}
}
function fDelay(n) {
nPauseTime--;
if (nPauseTime <= 0) {
b2Check = true;
return(0);
}
}
function f2DropCounter(mc) {
mc.nCount++;
if (mc.nCount >= 4) {
b2Drop = true;
mc.nCount = 0;
return(0);
}
}
function fDonDropp(mc, dropPlace) {
mc._y = mc._y + 8;
if (aTable[dropPlace][0] == 0) {
if (aTable[dropPlace][1].length == 0) {
if (mc._y >= nTableBottomY) {
_root.fPlaySnd(_root.nSndDonutLand);
mc._y = nTableBottomY;
fRemFall(mc);
if (mc.nColor == 8) {
mc.gotoAndPlay("Flash");
(bAccBlunder ? (fBlunder()) : null);
return(0);
}
if (mc.nSuper == 1) {
CProcess.start(mx.utils.Delegate.create(this, fSuperDon), [mc, dropPlace, 0], getTimer());
return(0);
}
aTable[dropPlace][1][0] = mc;
CProcess.start(mx.utils.Delegate.create(this, fCheckDon), [dropPlace, 0], getTimer());
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
} else if (mc._y >= (aTable[dropPlace][1][aTable[dropPlace][1].length - 1]._y - 12)) {
mc._y = nTableBottomY - (aTable[dropPlace][1].length * nTableYDiff);
fRemFall(mc);
if (aTable[dropPlace][1].length == 7) {
mc.gotoAndPlay("Crumble");
_root.fPlaySnd(_root.nSndDonutHit);
(bAccBlunder ? (fBlunder()) : null);
(bBonus ? (nBDonLosed++) : null);
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
_root.fPlaySnd(_root.nSndDonutLand);
if (mc.nColor == 8) {
mc.gotoAndPlay("Flash");
(bAccBlunder ? (fBlunder()) : null);
return(0);
}
if (mc.nSuper == 1) {
CProcess.start(mx.utils.Delegate.create(this, fSuperDon), [mc, dropPlace, aTable[dropPlace][1].length], getTimer());
return(0);
}
aTable[dropPlace][1].push(mc);
CProcess.start(mx.utils.Delegate.create(this, fCheckDon), [dropPlace, aTable[dropPlace][1].length - 1], getTimer());
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
} else if (aTable[dropPlace][0] == -1) {
if (mc._y >= (aTable[dropPlace][1][0]._y - 10)) {
_root.fPlaySnd(_root.nSndDonutHit);
fRemFall(mc);
mc._y = aTable[dropPlace][1][0]._y - nTableYDiff;
mc.gotoAndPlay("Crumble");
(bAccBlunder ? (fBlunder()) : null);
(bBonus ? (nBDonLosed++) : null);
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
} else if (aTable[dropPlace][0] == 1) {
if (mc._y >= (aTable[dropPlace][1][0]._y - 8)) {
_root.fPlaySnd(_root.nSndGarbage);
fRemFall(mc);
var _local5 = mc.nColor;
mc.removeMovieClip();
aTable[dropPlace][1][0].gotoAndPlay(2);
(((_local5 != 8) && (bAccBlunder)) ? (fBlunder()) : null);
return(0);
}
}
if (mc._y >= 410) {
fRemFall(mc);
mc.removeMovieClip();
(((bBonusEnd && (aFallEls.length == 0)) && (aSpoon.length == 0)) ? (CProcess.start(mx.utils.Delegate.create(this, fBonusCheck), [getTimer()], getTimer())) : null);
return(0);
}
}
function fSuperDon(mc, nx, ny) {
if (b2Check) {
mc.gotoAndPlay("Flash");
var _local5 = 0;
var _local6 = 2;
_root.fPlaySnd(_root.nSndSuperMatch);
var _local3 = 0;
while (_local3 < 9) {
if (aTable[_local3][0] == 0) {
var _local4 = 0;
while (true) {
if (aTable[_local3][1][_local4].nColor == mc.nColor) {
_local5 = _local5 + ((aTable[_local3][1][_local4].nCombo > 1) ? (aTable[_local3][1][_local4].nCombo) : 0);
_local6++;
aTable[_local3][1][_local4].gotoAndPlay("Flash");
((_local4 == 0) ? (aTable[_local3][1].shift()) : (aTable[_local3][1].splice(_local4, 1)));
continue;
}
if (aTable[_local3][1][_local4] == undefined) {
break;
}
_local4++;
}
}
_local3++;
}
var _local8 = (50 * _local6) * ((_local5 == 0) ? 1 : (_local5));
(random(2) ? (mcDude.fDTell(null, 1)) : null);
fAddScore(_local8, _local5, nx, ny);
CProcess.start(mx.utils.Delegate.create(this, fAlignTable), [getTimer()], getTimer());
return(0);
}
}
function fCheckDon(nX, nY) {
if (b2Check && (aTable[nX][1][nY] != undefined)) {
fChkDons(nX, nY);
if (aDonsFinded.length >= 3) {
(bBonus ? (_root.fPlaySnd(_root.nSndCorrect)) : (_root.fPlaySnd(_root.nSndDonutMatch)));
var _local7 = 0;
var _local11 = aDonsFinded.length;
var _local3 = 0;
while (_local3 < 9) {
if (aTable[_local3][0] == 0) {
var _local4 = 0;
while (aTable[_local3][1][_local4] != undefined) {
var _local6 = false;
var _local5 = 0;
while (_local5 < aDonsFinded.length) {
if (aTable[_local3][1][_local4] == aDonsFinded[_local5]) {
aDonsFinded.splice(_local5, 1);
_local6 = true;
break;
}
_local5++;
}
if (_local6) {
_local7 = _local7 + ((aTable[_local3][1][_local4].nCombo > 1) ? (aTable[_local3][1][_local4].nCombo) : 0);
aTable[_local3][1][_local4].gotoAndPlay("Flash");
((_local4 == 0) ? (aTable[_local3][1].shift()) : (aTable[_local3][1].splice(_local4, 1)));
continue;
}
_local4++;
}
}
_local3++;
}
var _local8 = (50 * _local11) * ((_local7 == 0) ? 1 : (_local7));
((!random(3)) ? (mcDude.fDTell(null, 2)) : null);
((!bBonus) ? (fAddScore(_local8, _local7, nX, nY)) : null);
CProcess.start(mx.utils.Delegate.create(this, fAlignTable), [getTimer()], getTimer());
}
aDonsFinded = Array();
return(0);
}
}
function fGCheck(n0) {
if ((getTimer() - n0) >= 200) {
var _local9 = 0;
while (_local9 < 9) {
var _local8 = 0;
while (_local8 < aTable[_local9][1].length) {
if (aTable[_local9][0] == 0) {
fChkDons(_local9, _local8);
if (aDonsFinded.length >= 3) {
(bBonus ? (_root.fPlaySnd(_root.nSndCorrect)) : (_root.fPlaySnd(_root.nSndDonutMatch)));
var _local7 = 0;
var _local11 = aDonsFinded.length;
var _local3 = 0;
while (_local3 < 9) {
if (aTable[_local3][0] == 0) {
var _local4 = 0;
while (aTable[_local3][1][_local4] != undefined) {
var _local6 = false;
var _local5 = 0;
while (_local5 < aDonsFinded.length) {
if (aTable[_local3][1][_local4] == aDonsFinded[_local5]) {
aDonsFinded.splice(_local5, 1);
_local6 = true;
break;
}
_local5++;
}
if (_local6) {
_local7 = _local7 + ((aTable[_local3][1][_local4].nCombo > 1) ? aTable[_local3][1][_local4].nCombo : 0);
aTable[_local3][1][_local4].gotoAndPlay("Flash");
((_local4 == 0) ? aTable[_local3][1].shift() : aTable[_local3][1].splice(_local4, 1));
continue;
}
_local4++;
}
}
_local3++;
}
var _local10 = (50 * _local11) * ((_local7 == 0) ? 1 : (_local7));
((!random(3)) ? (mcDude.fDTell(null, 2)) : null);
((!bBonus) ? (fAddScore(_local10, _local7, _local9, _local8)) : null);
CProcess.start(mx.utils.Delegate.create(this, fAlignTable), [getTimer()], getTimer());
aDonsFinded = Array();
return(0);
}
aDonsFinded = [];
}
_local8++;
}
_local9++;
}
return(0);
}
}
function fChkDons(nX, nY) {
if (fIsNotFinded(aDonsFinded, aTable[nX][1][nY])) {
aDonsFinded.push(aTable[nX][1][nY]);
((aTable[nX][1][nY].nColor == aTable[nX][1][nY + 1].nColor) ? (fChkDons(nX, nY + 1)) : null);
((aTable[nX][1][nY].nColor == aTable[nX][1][nY - 1].nColor) ? (fChkDons(nX, nY - 1)) : null);
((aTable[nX][1][nY].nColor == aTable[nX + 1][1][nY].nColor) ? (fChkDons(nX + 1, nY)) : null);
((aTable[nX][1][nY].nColor == aTable[nX - 1][1][nY].nColor) ? (fChkDons(nX - 1, nY)) : null);
}
}
function fIsNotFinded(aWhereSearch, mc2Find) {
var _local1 = 0;
while (_local1 < aWhereSearch.length) {
if (mc2Find == aWhereSearch[_local1]) {
return(false);
}
_local1++;
}
return(true);
}
function fAlignTable(n0) {
if ((getTimer() - n0) > 200) {
var _local3 = 0;
while (_local3 < 9) {
if (aTable[_local3][0] == 0) {
var _local2 = 0;
while (_local2 < aTable[_local3][1].length) {
aTable[_local3][1][_local2]._y = nTableBottomY - (_local2 * nTableYDiff);
aTable[_local3][1][_local2].nPlaceX = _local3;
aTable[_local3][1][_local2].nPlaceY = _local2;
_local2++;
}
}
_local3++;
}
CProcess.start(mx.utils.Delegate.create(this, fGCheck), [getTimer()], getTimer());
return(0);
}
}
function fBonusCheck(n0) {
if ((getTimer() - n0) >= 600) {
attachMovie("BonusRes", "BonusRes", getNextHighestDepth(), {_x:200, _y:108});
var _local3 = Math.floor(((nBDonDropped - nBDonLosed) / nBDonDropped) * 100);
_root.fPlaySnd(_root.nSndBCount, 999);
nBPerc = 0;
nCount = 0;
CProcess.start(mx.utils.Delegate.create(this, fBCount), [_local3], getTimer());
return(0);
}
}
function fBCount(nPerc) {
nBPerc++;
BonusRes.fShowRes(nBPerc);
if (nBPerc >= nPerc) {
BonusRes.fShowTitle(nBPerc);
var _local3 = Math.floor(((2000 + (nBLevel * 1000)) * nPerc) / 100);
_root.fStopSnd(_root.nSndBCount);
nFullScore = nFullScore + _local3;
nScore2Put = nScore2Put + _local3;
_root.fPlaySnd(_root.nSndCount, 999);
BonusRes.useHandCursor = false;
mcDude.onMouseDown = mx.utils.Delegate.create(this, fSkipBCount);
CProcess.start(mx.utils.Delegate.create(this, fScoreCounter), [nLevel], 2);
return(0);
}
}
function fSkipBCount() {
bLvlEnd = true;
(stopDrag());// not popped
mcFlipper.removeMovieClip();
CProcess.killAll();
nCount = 0;
mcScore.fShowScore(nFullScore);
_root.fStopSnd(_root.nSndCount);
mcDude.fDTell(2);
BonusRes.removeMovieClip();
mcDude.onMouseDown = undefined;
CProcess.start(mx.utils.Delegate.create(this, fRemoveFall), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveDons), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveSpoon), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fPrep4NextLvl), [], getTimer());
}
function fAddScore(n, nm, nX, nY) {
var _local2 = attachMovie("mcFlyScore", "mcFly" + random(9999999), getNextHighestDepth(), {_x:aTableX[nX], _y:nTableBottomY - (nY * nTableYDiff)});
_local2.mcScore.gotoAndStop("n" + n);
if (nm > 1) {
_local2.attachMovie("mcCombo", "mcCombo", _local2.getNextHighestDepth(), {_x:-10, _y:-12});
_local2.mcCombo.gotoAndStop(nm);
}
aFallEls.push(_local2);
CProcess.start(mx.utils.Delegate.create(this, fFlyScore), [_local2, n, aTableX[nX] + ((485 - aTableX[nX]) / 2), 10 - Math.floor((aTableX[nX] - 155) / 35)], random(999999));
}
function fFlyScore(mc, n, nMid, dx) {
var _local4 = (mc._y - 130) / 8;
mc._x = mc._x + dx;
((mc._x < nMid) ? ((mc._y = mc._y - _local4)) : ((mc._y = mc._y + _local4)));
if (mc._x >= 485) {
fRemFall(mc);
mc.removeMovieClip();
nFullScore = nFullScore + n;
nScore2Put = nScore2Put + n;
_root.fPlaySnd(_root.nSndMeterUp);
if (!CProcess.is(mx.utils.Delegate.create(this, fScoreCounter), 2)) {
_root.fPlaySnd(_root.nSndCount, 999);
CProcess.start(mx.utils.Delegate.create(this, fScoreCounter), [nLevel], 2);
}
return(0);
}
}
function fScoreCounter(nL) {
if (nScore2Put >= 1000) {
nScore2Put = nScore2Put - 50;
nCurrScore = nCurrScore + 50;
nLvlScore = nLvlScore + 50;
} else if (nScore2Put >= 100) {
nScore2Put = nScore2Put - 20;
nCurrScore = nCurrScore + 20;
nLvlScore = nLvlScore + 20;
} else if (nScore2Put > 10) {
nScore2Put = nScore2Put - 10;
nCurrScore = nCurrScore + 10;
nLvlScore = nLvlScore + 10;
}
var _local3 = nLvlScore / (1000 + ((nL - 1) * 200));
if (!bBonus) {
mcMeter._y = 340 - Math.floor(192 * _local3);
mcMeter._height = Math.floor(192 * _local3);
}
mcScore.fShowScore(nCurrScore);
if (nScore2Put <= 10) {
nCurrScore = nCurrScore + nScore2Put;
nLvlScore = nLvlScore + nScore2Put;
nScore2Put = 0;
mcScore.fShowScore(nCurrScore);
_root.fStopSnd(_root.nSndCount);
if ((!bBonus) && (nLvlScore != (1000 + ((nL - 1) * 200)))) {
return(0);
}
}
if ((((nLvlScore >= (1000 + ((nL - 1) * 200))) && (!bLvlEnd)) && (!bBonus)) || (bBonus && (nScore2Put == 0))) {
bLvlEnd = true;
(stopDrag());// not popped
mcFlipper.removeMovieClip();
CProcess.killAll();
nCount = 0;
((nScore2Put > 0) ? (CProcess.start(mx.utils.Delegate.create(this, fScoreCounter), [nL], 2)) : null);
mcDude.fDTell(2);
mcDude.onMouseDown = undefined;
CProcess.start(mx.utils.Delegate.create(this, fRemoveFall), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveDons), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveSpoon), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fPrep4NextLvl), [], getTimer());
}
}
function fPrep4NextLvl() {
if (nCount >= 8) {
BonusRes.removeMovieClip();
mcInfo.gotoAndStop(mcInfo._currentframe + 1);
CProcess.start(mx.utils.Delegate.create(this, fMovePlank), [0], getTimer());
return(0);
}
}
function fRemoveFall() {
if (aFallEls.length == 0) {
var _local2 = 0;
while (_local2 <= 8) {
this["mcCL" + _local2].gotoAndStop("n");
_local2++;
}
return(0);
}
var _local3 = aFallEls.pop();
_local3.removeMovieClip();
}
function fRemoveDons() {
if (aTable[nCount][1].length == 0) {
nCount++;
if (nCount > 8) {
nCount = 0;
return(0);
}
}
var _local2 = aTable[nCount][1].pop();
_local2.removeMovieClip();
}
function fRemoveSpoon() {
if (aSpoon.length == 0) {
return(0);
}
var _local2 = aSpoon.pop();
_local2.removeMovieClip();
}
function fBlunder() {
_root.bPause = true;
(stopDrag());// not popped
_root.fPlaySnd(_root.nSndBlunderLose);
nLifesLosed++;
nLifes--;
this["mcLife" + (nLifesLosed - 1)].gotoAndStop(2);
if (nLifes == 0) {
Mouse.show();
_root.bPause = false;
mcInfo.gotoAndStop("Over");
mcDude.fDTell(3, 0);
_root.fPlaySnd(_root.nSndLvlLose);
CProcess.killAll();
attachMovie("mc2Click", "mc2Click", getNextHighestDepth(), {_x:217, _y:268});
mcFlipper.onMouseDown = undefined;
mc2Click.onMouseDown = mx.utils.Delegate.create(this, fClickOnLoseLvl);
nCount = 0;
CProcess.start(mx.utils.Delegate.create(this, fRemoveFall), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveDons), [], getTimer());
CProcess.start(mx.utils.Delegate.create(this, fRemoveSpoon), [], getTimer());
} else {
mcDude.fDTell(4, 0);
attachMovie("mc2Click", "mc2Click", getNextHighestDepth(), {_x:217, _y:268});
mcFlipper.onMouseDown = undefined;
mc2Click.onMouseDown = mx.utils.Delegate.create(this, fClickOnLoseDon);
}
}
function fClickOnLoseDon() {
mc2Click.removeMovieClip();
fStartDragFlipper();
CProcess.start(mx.utils.Delegate.create(this, fActFlip), [getTimer(), 1], getTimer());
_root.bPause = false;
}
function fClickOnLoseLvl() {
mc2Click.removeMovieClip();
_root.bPause = false;
CProcess.killAll();
_root.gotoAndStop("MMenu");
}
function fStartDragFlipper() {
mcFlipper.startDrag(true, 153, 272, 433, 272);
}
function fActFlip() {
mcFlipper.onMouseDown = mx.utils.Delegate.create(this, fDropDon);
}
function fRemFall(mc) {
var _local2 = 0;
while (_local2 < aFallEls.length) {
if (aFallEls[_local2] == mc) {
((_local2 == 0) ? (aFallEls.shift()) : (aFallEls.splice(_local2, 1)));
break;
}
_local2++;
}
}
var nRoofY = 10;
var aRoofX = [152.5, 188, 223.5, 260, 295, 330, 364.5, 400.5, 435.5];
var nTableYDiff = 12;
var nTableTopY = 301;
var nTableBottomY = 379;
var aTableX = [150.5, 185.5, 221, 256.5, 291.5, 326.5, 362, 397.5, 433.5, 469];
var aTable = Array([Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()]), Array([0, Array()])]);
var aSpoon = Array();
var aLvlInfo = Array();
var aFallEls = Array();
var aDonsFinded = Array();
var keyListener = new Object();
}
Symbol 989 MovieClip [__Packages.CMMenu] Frame 0
class CMMenu extends MovieClip
{
var btnNewGame, btnOptions, attachMovie, getNextHighestDepth, fon, exitWnd;
function CMMenu () {
super();
btnNewGame.onRelease = mx.utils.Delegate.create(this, fNewGame);
btnOptions.onRelease = mx.utils.Delegate.create(this, fOptions);
_root.nGameStatus = 0;
}
function fNewGame() {
_root.fPlaySnd(_root.nSndBtnClick);
_root.gotoAndStop("Game");
}
function fOptions() {
_root.fPlaySnd(_root.nSndBtnClick);
attachMovie("fon", "fon", getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha + 20});
attachMovie("Options", "Options", getNextHighestDepth(), {_x:140, _y:103});
fon.useHandCursor = false;
fon.onPress = undefined;
}
function fScores() {
_root.gotoAndStop("Scores");
}
function fExit() {
attachMovie("fon", "fon", getNextHighestDepth(), {_x:-500, _y:-500, _width:2000, _height:2000, _alpha:_root.nAlpha + 20});
attachMovie("exitWnd", "exitWnd", getNextHighestDepth(), {_x:140, _y:140});
fon.useHandCursor = false;
exitWnd.btnNo.onRelease = mx.utils.Delegate.create(this, fExitNo);
exitWnd.btnYes.onRelease = function () {
fscommand ("quit");
};
}
function fExitNo() {
exitWnd.removeMovieClip();
fon.removeMovieClip();
}
}
Symbol 990 MovieClip [__Packages.CPreLoader] Frame 0
class CPreLoader extends MovieClip
{
var t, mcLoad;
function CPreLoader () {
super();
t = _root.getBytesTotal();
}
function onEnterFrame() {
var _local3 = _root.getBytesLoaded();
var _local4 = (_local3 / t) * 100;
mcLoad.gotoAndStop(Math.floor(_local4));
if ((_local3 >= t) && (_root.b2G)) {
_root.gotoAndStop("MMenu");
}
}
}
Symbol 991 MovieClip [__Packages.COptions] Frame 0
class COptions extends MovieClip
{
var mcTip, mcSlider, btnOk, btnCancel, nSOld, nTipOld, nDelta, _parent, removeMovieClip;
function COptions () {
super();
mcTip.gotoAndStop(((_root.DisTips == 0) ? 1 : 2));
mcTip.useHandCursor = false;
mcTip.onRelease = mx.utils.Delegate.create(this, fTip);
mcSlider.useHandCursor = false;
mcSlider.onPress = mx.utils.Delegate.create(this, fDragStart);
mcSlider.onRelease = mx.utils.Delegate.create(this, fDragStop);
mcSlider.onReleaseOutside = mx.utils.Delegate.create(this, fDragStop);
btnOk.onRelease = mx.utils.Delegate.create(this, fOk);
btnCancel.onRelease = mx.utils.Delegate.create(this, fCancel);
nSOld = _root.SndVol;
nTipOld = _root.DisTips;
nDelta = ((nSliderXMax - nSliderXMin) * _root.SndVol) / 100;
mcSlider._x = nSliderXMin + nDelta;
}
function fTip() {
_root.fPlaySnd(_root.nSndBtnClick);
(_root.DisTips ? ((_root.DisTips = 0)) : ((_root.DisTips = 1)));
mcTip.gotoAndStop(_root.DisTips + 1);
}
function fDragStart() {
mcSlider.startDrag(false, nSliderXMin, nSliderY, nSliderXMax, nSliderY);
_root.fPlaySnd(_root.nSndBDonutDown, 999);
mcSlider.onMouseMove = mx.utils.Delegate.create(this, fSeek);
}
function fDragStop() {
_root.fStopAllSnd();
mcSlider.onMouseMove = undefined;
mcSlider.stopDrag();
}
function fSeek() {
nDelta = mcSlider._x - nSliderXMin;
_root.SndVol = Math.round((nDelta / (nSliderXMax - nSliderXMin)) * 100);
_root.SoundEng.setVolume(_root.nSndBDonutDown, _root.SndVol);
}
function fOk() {
_root.fPlaySnd(_root.nSndBtnClick);
((_root.nGameStatus == 1) ? (_parent.fAssL()) : null);
fRemove();
}
function fCancel() {
_root.SndVol = nSOld;
_root.DisTips = nTipOld;
_root.fPlaySnd(_root.nSndBtnClick);
((_root.nGameStatus == 1) ? (_parent.fAssL()) : null);
fRemove();
}
function fRemove() {
_parent.fon.removeMovieClip();
removeMovieClip();
}
var nSliderXMin = 53;
var nSliderXMax = 184;
var nSliderY = 112;
}