Frame 1
function nextZ() {
return(topZ++);
}
function fsMoney(str1, str2) {
trace((str1 + ",") + str2);
}
function fs(str1, str2) {
trace((str1 + ",") + str2);
fscommand (str1, str2);
}
function nextZ() {
return(topZ++);
}
function doBreak() {
var x = 5;
}
MovieClip.prototype.tween = (TextField.prototype.tween = function (prop, propDest, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local3 = this;
if (timeSeconds < 0.001) {
timeSeconds = 2;
}
if ((animType == undefined) || (animType == "")) {
animType = "easeOutExpo";
}
if (delay == undefined) {
delay = 0;
}
if (typeof(prop) == "string") {
var properties = [prop];
var oldProperties = [_local3[prop]];
var newProperties = [propDest];
} else {
var properties = [];
var oldProperties = [];
var newProperties = [];
for (var i in prop) {
oldProperties.push(_local3[prop[i]]);
}
for (var i in prop) {
properties.push(prop[i]);
}
for (var i in propDest) {
newProperties.push(propDest[i]);
}
}
var $_callback_assigned = false;
if (_root.__tweenController__ == undefined) {
var tweenHolder = _root.createEmptyMovieClip("__tweenController__", 123432);
tweenHolder.$_tweenPropList = new Array();
tweenHolder.$_tTime = getTimer();
tweenHolder.onEnterFrame = function () {
var _local3 = this;
var tTime = ((_local3.$_tTime = getTimer()));
var _local2 = 0;
while (_local2 < _local3.$_tweenPropList.length) {
var _local1 = _local3.$_tweenPropList[_local2];
if ((_local1._timeStart + (_local1._delay * 1000)) <= tTime) {
if ((_local1._timeDest + (_local1._delay * 1000)) <= tTime) {
_local1._targ[_local1._prop] = _local1._propDest;
_local3.$_tweenPropList.splice(_local2, 1);
_local2--;
_local1._targ.$_tweenCount--;
if (_local1._targ.$_tweenCount == 0) {
delete _local1._targ.$_tweenCount;
}
if (_local1._callback != undefined) {
if (_global.backwardCallbackTweening) {
var childMC = _local1._targ.createEmptyMovieClip("__child__", 122344);
_local1._callback.apply(childMC, _local3.callbackargs);
childMC.removeMovieClip();
} else {
_local1._callback.context[_local1._callback.method](_local1._callback.args);
}
}
if (_local3.$_tweenPropList.length == 0) {
_local3.removeMovieClip();
}
} else {
if (_local1._propStart == undefined) {
_local1._propStart = _local1._targ[_local1._prop];
}
_local1._targ[_local1._prop] = _global.findTweenValue(_local1._propStart, _local1._propDest, _local1._timeStart, tTime - (_local1._delay * 1000), _local1._timeDest, _local1._animType, _local1._extra1, _local1._extra2);
if ((typeof(_local1._targ) != "movieclip") && (_local1._prop == "__special_text_b__")) {
_local1._targ.textColor = ((_local1._targ.__special_text_r__ << 16) + (_local1._targ.__special_text_g__ << 8)) + _local1._targ.__special_text_b__;
}
}
}
_local2++;
}
};
}
MovieClip.prototype.addArgs = (TextField.prototype.addArgs = function () {
this.callbackargs = arguments;
});
var tweenPropList = _root.__tweenController__.$_tweenPropList;
var tTime = _root.__tweenController__.$_tTime;
for (var i in oldProperties) {
if ((newProperties[i] != undefined) && (!_local3.$_isTweenLocked)) {
if (_local3.$_tweenCount > 0) {
var _local2 = 0;
while (_local2 < tweenPropList.length) {
if ((tweenPropList[_local2]._targ == _local3) && (tweenPropList[_local2]._prop == properties[i])) {
if ((tTime + (delay * 1000)) < tweenPropList[_local2]._timeDest) {
tweenPropList.splice(_local2, 1);
_local2--;
_local3.$_tweenCount--;
}
}
_local2++;
}
}
tweenPropList.push({_prop:properties[i], _targ:_local3, _propStart:undefined, _propDest:newProperties[i], _timeStart:tTime, _timeDest:tTime + (timeSeconds * 1000), _animType:animType, _extra1:extra1, _extra2:extra2, _delay:delay, _callback:($_callback_assigned ? undefined : (callback))});
_local3.$_tweenCount = ((_local3.$_tweenCount > 0) ? (_local3.$_tweenCount + 1) : 1);
$_callback_assigned = true;
}
}
ASSetPropFlags(_local3, "$_tweenCount", 1, 0);
});
ASSetPropFlags(MovieClip.prototype, "tween", 1, 0);
ASSetPropFlags(TextField.prototype, "tween", 1, 0);
MovieClip.prototype.lockTween = (TextField.prototype.lockTween = function () {
this.$_isTweenLocked = true;
ASSetPropFlags(this, "this.$_isTweenLocked", 1, 0);
});
ASSetPropFlags(MovieClip.prototype, "lockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "lockTween", 1, 0);
MovieClip.prototype.unlockTween = (TextField.prototype.unlockTween = function () {
delete this.$_isTweenLocked;
});
ASSetPropFlags(MovieClip.prototype, "unlockTween", 1, 0);
ASSetPropFlags(TextField.prototype, "unlockTween", 1, 0);
MovieClip.prototype.getTweens = (TextField.prototype.getTweens = function () {
return(this.$_tweenCount);
});
ASSetPropFlags(MovieClip.prototype, "getTweens", 1, 0);
ASSetPropFlags(TextField.prototype, "getTweens", 1, 0);
MovieClip.prototype.isTweening = (TextField.prototype.isTweening = function () {
return(((this.$_tweenCount > 0) ? true : false));
});
ASSetPropFlags(MovieClip.prototype, "isTweening", 1, 0);
ASSetPropFlags(TextField.prototype, "isTweening", 1, 0);
MovieClip.prototype.stopTween = (TextField.prototype.stopTween = function (props) {
var _local2 = this;
var _local3 = props;
var _local1 = _root.__tweenController__.$_tweenPropList;
switch (typeof(_local3)) {
case "string" :
_local3 = [_local3];
case "object" :
for (var i in _local3) {
for (var pti in _local1) {
if ((_local1[pti]._targ == _local2) && (_local1[pti]._prop == _local3[i])) {
_local1.splice(pti, 1);
}
}
}
_local2.$_tweenCount = 0;
for (var pti in _local1) {
if (_local1[pti]._targ == _local2) {
_local2.$_tweenCount++;
}
}
if (_local2.$_tweenCount == 0) {
delete _local2.$_tweenCount;
}
break;
default :
for (var pti in _local1) {
if (_local1[pti]._targ == _local2) {
_local1.splice(pti, 1);
}
}
delete _local2.$_tweenCount;
}
if (_local1.length == 0) {
_root.__tweenController__.removeMovieClip();
_local2.__tweenController_ADVhelper__.removeMovieClip();
}
});
ASSetPropFlags(MovieClip.prototype, "stopTween", 1, 0);
ASSetPropFlags(TextField.prototype, "stopTween", 1, 0);
MovieClip.prototype.alphaTo = (TextField.prototype.alphaTo = function (propDest_a, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_alpha", propDest_a, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "alphaTo", 1, 0);
ASSetPropFlags(TextField.prototype, "alphaTo", 1, 0);
MovieClip.prototype.rotateTo = (TextField.prototype.rotateTo = function (propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("_rotation", propDest_rotation, timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "rotateTo", 1, 0);
ASSetPropFlags(TextField.prototype, "rotateTo", 1, 0);
MovieClip.prototype.scaleTo = (TextField.prototype.scaleTo = function (propDest_scale, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_xscale", "_yscale"], [propDest_scale, propDest_scale], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "scaleTo", 1, 0);
ASSetPropFlags(TextField.prototype, "scaleTo", 1, 0);
TextField.prototype.scrollTo = function (propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween("scroll", propDest_scroll, timeSeconds, animType, delay, callback, extra1, extra2);
};
ASSetPropFlags(TextField.prototype, "scrollTo", 1, 0);
MovieClip.prototype.slideTo = (TextField.prototype.slideTo = function (propDest_x, propDest_y, timeSeconds, animType, delay, callback, extra1, extra2) {
this.tween(["_x", "_y"], [propDest_x, propDest_y], timeSeconds, animType, delay, callback, extra1, extra2);
});
ASSetPropFlags(MovieClip.prototype, "slideTo", 1, 0);
ASSetPropFlags(TextField.prototype, "slideTo", 1, 0);
MovieClip.prototype.colorTo = (TextField.prototype.colorTo = function (propDest_color, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local1 = this;
var _local2 = propDest_color >> 16;
var new_g = ((propDest_color & 65280) >> 8);
var _local3 = propDest_color & 255;
if (typeof(_local1) == "movieclip") {
_local1.colorTransformTo(0, _local2, 0, new_g, 0, _local3, undefined, undefined, timeSeconds, animType, delay, callback, extra1, extra2);
} else {
_local1.__special_text_r__ = _local1.textColor >> 16;
_local1.__special_text_g__ = (_local1.textColor & 65280) >> 8;
_local1.__special_text_b__ = _local1.textColor & 255;
_local1.tween(["__special_text_r__", "__special_text_g__", "__special_text_b__"], [_local2, new_g, _local3], timeSeconds, animType, delay, callback, extra1, extra2);
}
});
ASSetPropFlags(MovieClip.prototype, "colorTo", 1, 0);
ASSetPropFlags(TextField.prototype, "colorTo", 1, 0);
MovieClip.prototype.colorTransformTo = function (propDest_ra, propDest_rb, propDest_ga, propDest_gb, propDest_ba, propDest_bb, propDest_aa, propDest_ab, timeSeconds, animType, delay, callback, extra1, extra2) {
var _local1 = this;
var $_clrTmp = new Color(_local1);
var _local3 = $_clrTmp.getTransform();
_local1.$_ADVsetter_ra = ((propDest_ra == undefined) ? undefined : (_local3.ra));
_local1.$_ADVsetter_rb = ((propDest_rb == undefined) ? undefined : (_local3.rb));
_local1.$_ADVsetter_ga = ((propDest_ga == undefined) ? undefined : (_local3.ga));
_local1.$_ADVsetter_gb = ((propDest_gb == undefined) ? undefined : (_local3.gb));
_local1.$_ADVsetter_ba = ((propDest_ba == undefined) ? undefined : (_local3.ba));
_local1.$_ADVsetter_bb = ((propDest_bb == undefined) ? undefined : (_local3.bb));
_local1.$_ADVsetter_aa = ((propDest_aa == undefined) ? undefined : (_local3.aa));
_local1.$_ADVsetter_ab = ((propDest_ab == undefined) ? undefined : (_local3.ab));
_local1.$_new_ra = propDest_ra;
_local1.$_new_rb = propDest_rb;
_local1.$_new_ga = propDest_ga;
_local1.$_new_gb = propDest_gb;
_local1.$_new_ba = propDest_ba;
_local1.$_new_bb = propDest_bb;
_local1.$_new_aa = propDest_aa;
_local1.$_new_ab = propDest_ab;
_local1.tween(["$_ADVsetter_ra", "$_ADVsetter_rb", "$_ADVsetter_ga", "$_ADVsetter_gb", "$_ADVsetter_ba", "$_ADVsetter_bb", "$_ADVsetter_aa", "$_ADVsetter_ab"], [_local1.$_new_ra, _local1.$_new_rb, _local1.$_new_ga, _local1.$_new_gb, _local1.$_new_ba, _local1.$_new_bb, _local1.$_new_aa, _local1.$_new_ab], timeSeconds, animType, delay, callback, extra1, extra2);
_local1.__tweenController_ADVhelper__.removeMovieClip();
_local1.createEmptyMovieClip("__tweenController_ADVhelper__", 123434);
_local1.__tweenController_ADVhelper__.onEnterFrame = function () {
var _local1 = this;
var _local3 = new Color(_local1._parent);
var _local2 = {};
if (_local1._parent.$_ADVsetter_ra != undefined) {
_local2.ra = _local1._parent.$_ADVsetter_ra;
}
if (_local1._parent.$_ADVsetter_rb != undefined) {
_local2.rb = _local1._parent.$_ADVsetter_rb;
}
if (_local1._parent.$_ADVsetter_ga != undefined) {
_local2.ga = _local1._parent.$_ADVsetter_ga;
}
if (_local1._parent.$_ADVsetter_gb != undefined) {
_local2.gb = _local1._parent.$_ADVsetter_gb;
}
if (_local1._parent.$_ADVsetter_ba != undefined) {
_local2.ba = _local1._parent.$_ADVsetter_ba;
}
if (_local1._parent.$_ADVsetter_bb != undefined) {
_local2.bb = _local1._parent.$_ADVsetter_bb;
}
if (_local1._parent.$_ADVsetter_aa != undefined) {
_local2.aa = _local1._parent.$_ADVsetter_aa;
}
if (_local1._parent.$_ADVsetter_ab != undefined) {
_local2.ab = _local1._parent.$_ADVsetter_ab;
}
_local3.setTransform(_local2);
if (_local1.$_toDelete) {
delete _local1._parent.$_ADVsetter_ra;
delete _local1._parent.$_ADVsetter_rb;
delete _local1._parent.$_ADVsetter_ga;
delete _local1._parent.$_ADVsetter_gb;
delete _local1._parent.$_ADVsetter_ba;
delete _local1._parent.$_ADVsetter_bb;
delete _local1._parent.$_ADVsetter_aa;
delete _local1._parent.$_ADVsetter_ab;
delete _local1._parent.$_new_ra;
delete _local1._parent.$_new_rb;
delete _local1._parent.$_new_ga;
delete _local1._parent.$_new_gb;
delete _local1._parent.$_new_ba;
delete _local1._parent.$_new_bb;
delete _local1._parent.$_new_aa;
delete _local1._parent.$_new_ab;
_local1.removeMovieClip();
}
if (((((((((_local1._parent.$_ADVsetter_ra == _local1._parent.$_new_ra) || (_local1._parent.$_new_ra == undefined)) && ((_local1._parent.$_ADVsetter_rb == _local1._parent.$_new_rb) || (_local1._parent.$_new_rb == undefined))) && ((_local1._parent.$_ADVsetter_ga == _local1._parent.$_new_ga) || (_local1._parent.$_new_ga == undefined))) && ((_local1._parent.$_ADVsetter_gb == _local1._parent.$_new_gb) || (_local1._parent.$_new_gb == undefined))) && ((_local1._parent.$_ADVsetter_ba == _local1._parent.$_new_ba) || (_local1._parent.$_new_ba == undefined))) && ((_local1._parent.$_ADVsetter_bb == _local1._parent.$_new_bb) || (_local1._parent.$_new_bb == undefined))) && ((_local1._parent.$_ADVsetter_aa == _local1._parent.$_new_aa) || (_local1._parent.$_new_aa == undefined))) && ((_local1._parent.$_ADVsetter_ab == _local1._parent.$_new_ab) || (_local1._parent.$_new_ab == undefined))) {
_local1.$_toDelete = true;
}
};
};
ASSetPropFlags(MovieClip.prototype, "colorTransformTo", 1, 0);
_global.findTweenValue = function (_propStart, _propDest, _timeStart, _timeNow, _timeDest, _animType, _extra1, _extra2) {
var _local1 = _timeNow - _timeStart;
var _local3 = _propStart;
var _local2 = _propDest - _propStart;
var d = (_timeDest - _timeStart);
var a = _extra1;
var p = _extra2;
var s = _extra1;
switch (_animType.toLowerCase()) {
case "linear" :
return(((_local2 * _local1) / d) + _local3);
case "easeinquad" :
_local1 = _local1 / d;
return(((_local2 * _local1) * _local1) + _local3);
case "easeoutquad" :
_local1 = _local1 / d;
return((((-_local2) * _local1) * (_local1 - 2)) + _local3);
case "easeinoutquad" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((_local2 / 2) * _local1) * _local1) + _local3);
}
_local1--;
return((((-_local2) / 2) * ((_local1 * (_local1 - 2)) - 1)) + _local3);
case "easeincubic" :
_local1 = _local1 / d;
return((((_local2 * _local1) * _local1) * _local1) + _local3);
case "easeoutcubic" :
_local1 = (_local1 / d) - 1;
return((_local2 * (((_local1 * _local1) * _local1) + 1)) + _local3);
case "easeinoutcubic" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((_local2 / 2) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * _local1) + 2)) + _local3);
case "easeinquart" :
_local1 = _local1 / d;
return(((((_local2 * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquart" :
_local1 = (_local1 / d) - 1;
return(((-_local2) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + _local3);
case "easeinoutquart" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return((((-_local2) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + _local3);
case "easeinquint" :
_local1 = _local1 / d;
return((((((_local2 * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
case "easeoutquint" :
_local1 = (_local1 / d) - 1;
return((_local2 * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + _local3);
case "easeinoutquint" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((_local2 / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + _local3);
case "easeinsine" :
return((((-_local2) * Math.cos((_local1 / d) * (Math.PI/2))) + _local2) + _local3);
case "easeoutsine" :
return((_local2 * Math.sin((_local1 / d) * (Math.PI/2))) + _local3);
case "easeinoutsine" :
return((((-_local2) / 2) * (Math.cos((Math.PI * _local1) / d) - 1)) + _local3);
case "easeinexpo" :
return(((_local1 == 0) ? (_local3) : ((_local2 * Math.pow(2, 10 * ((_local1 / d) - 1))) + _local3)));
case "easeoutexpo" :
return(((_local1 == d) ? (_local3 + _local2) : ((_local2 * ((-Math.pow(2, (-10 * _local1) / d)) + 1)) + _local3)));
case "easeinoutexpo" :
if (_local1 == 0) {
return(_local3);
}
if (_local1 == d) {
return(_local3 + _local2);
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local2 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local3);
}
_local1--;
return(((_local2 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local3);
case "easeincirc" :
_local1 = _local1 / d;
return(((-_local2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
case "easeoutcirc" :
_local1 = (_local1 / d) - 1;
return((_local2 * Math.sqrt(1 - (_local1 * _local1))) + _local3);
case "easeinoutcirc" :
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((-_local2) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + _local3);
case "easeinelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / d;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.3;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
_local1 = _local1 - 1;
return((-((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p))) + _local3);
case "easeoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / d;
if (_local1 == 1) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.3;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
return((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p)) + _local2) + _local3);
case "easeinoutelastic" :
if (_local1 == 0) {
return(_local3);
}
_local1 = _local1 / (d / 2);
if (_local1 == 2) {
return(_local3 + _local2);
}
if (!p) {
p = d * 0.45;
}
if (a < Math.abs(_local2)) {
a = _local2;
var s = (p / 4);
} else {
var s = ((p / (Math.PI*2)) * Math.asin(_local2 / a));
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p))) + _local3);
}
_local1 = _local1 - 1;
return(((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / p)) * 0.5) + _local2) + _local3);
case "easeinback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = _local1 / d;
return((((_local2 * _local1) * _local1) * (((s + 1) * _local1) - s)) + _local3);
case "easeoutback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = (_local1 / d) - 1;
return((_local2 * (((_local1 * _local1) * (((s + 1) * _local1) + s)) + 1)) + _local3);
case "easeinoutback" :
if (s == undefined) {
s = 1.70158;
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local2 / 2) * ((_local1 * _local1) * (((((s = s * 1.525)) + 1) * _local1) - s))) + _local3);
}
_local1 = _local1 - 2;
return(((_local2 / 2) * (((_local1 * _local1) * (((((s = s * 1.525)) + 1) * _local1) + s)) + 2)) + _local3);
case "easeinbounce" :
return((_local2 - findTweenValue(0, _local2, 0, d - _local1, d, "easeOutBounce")) + _local3);
case "easeoutbounce" :
_local1 = _local1 / d;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
case "easeinoutbounce" :
if (_local1 < (d / 2)) {
return((findTweenValue(0, _local2, 0, _local1 * 2, d, "easeInBounce") * 0.5) + _local3);
}
return(((findTweenValue(0, _local2, 0, (_local1 * 2) - d, d, "easeOutBounce") * 0.5) + (_local2 * 0.5)) + _local3);
}
return(undefined);
};
ASSetPropFlags(_global, "findTweenValue", 1, 0);
if (!initDone) {
var game = new KlickerKlacker2();
var sounds = (new util.SoundManager());
initDone = true;
var topZ = 100;
}
Instance of Symbol 168 MovieClip in Frame 1
on (press) {
_root.game.abortGame();
gotoAndStop (2);
}
on (release) {
gotoAndStop (1);
}
Symbol 127 MovieClip [sign] Frame 1
stop();
Symbol 127 MovieClip [sign] Frame 2
stop();
Symbol 131 MovieClip [scorePopUp] Frame 1
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 9
play();
Symbol 194 MovieClip Frame 11
gotoAndPlay (9);
Symbol 195 MovieClip [__Packages.util.SoundManager] Frame 0
class util.SoundManager
{
function SoundManager () {
_root.createEmptyMovieClip("soundMCs", 79564);
_root.doBreak();
}
function playLoop(soundName, id, volume) {
play(soundName, id, volume, true);
}
function play(soundName, id, volume, loop) {
var _local3 = id;
if (_local3 == null) {
_local3 = soundName;
}
if (_root.soundMCs[_local3] != undefined) {
} else {
var _local2 = _root.soundMCs.createEmptyMovieClip(_local3, depth++);
var _local1 = new Sound(_local2);
_local2.snd = _local1;
_local1.onSoundComplete = function () {
_root.sounds.removeMc(this);
};
_local1.attachSound(soundName);
if (volume) {
_local1.setVolume(volume);
}
if (turnOffSound) {
_local2.originalVolume = _local1.getVolume();
_local1.setVolume(0);
}
if (loop) {
_local1.start(0, 10000);
} else {
_local1.start(0, 1);
}
}
}
function playing(id) {
return(_root.soundMCs[id].playing);
}
function restart(id) {
var _local1 = _root.soundMCs[id];
_local1.stop();
_local1.start(0, 1);
}
function stop(id) {
_root.soundMCs[id].snd.stop();
_root.soundMCs[id].removeMovieClip();
}
function stopAll() {
var _local1 = _root;
for (var _local2 in _local1.soundMCs) {
_local1.soundMCs[_local2].snd.stop();
_local1.soundMCs[_local2].removeMovieClip();
}
}
function removeMc(sound) {
var _local2 = _root;
for (var _local3 in _local2.soundMCs) {
var _local1 = _local2.soundMCs[_local3];
if (_local1.snd == sound) {
_local1.removeMovieClip();
break;
}
}
}
function soundOff() {
var _local2 = _root;
if (turnOffSound) {
} else {
turnOffSound = true;
for (var _local3 in _local2.soundMCs) {
var _local1 = _local2.soundMCs[_local3];
_local1.originalVolume = _local1.snd.getVolume();
_local1.snd.setVolume(0);
}
}
}
function soundOn() {
var _local2 = _root;
turnOffSound = false;
for (var _local3 in _local2.soundMCs) {
var _local1 = _local2.soundMCs[_local3];
_local1.snd.setVolume(_local1.originalVolume);
}
}
function toggleSound() {
var _local1 = this;
if (_local1.turnOffSound) {
_local1.soundOn();
} else {
_local1.soundOff();
}
}
var depth = 1;
var turnOffSound = false;
}
Symbol 196 MovieClip [__Packages.KlickerKlacker2] Frame 0
class KlickerKlacker2
{
var score, levels, activeLevelIndex, texts;
function KlickerKlacker2 () {
var _local1 = this;
if (!DEBUG) {
util.Logger.state = util.Logger.QUIET;
}
util.Logger.log("creating game");
_local1.state = 0;
_local1.activeLevelIndex = 0;
_local1.levels = new Array();
_local1.texts = new Array();
_local1.xml = new XML();
_local1.xml.ignoreWhite = true;
if (DEBUG) {
_local1.xml.onLoad = function () {
_root.game.gameDataReceived();
};
_local1.xml.load("gamedata.xml");
} else {
_local1.intervalID = setInterval(_local1, "waitForGameData", 50);
}
_local1.score = 0;
}
function waitForGameData() {
var _local1 = this;
if (_root.gameData != undefined) {
clearInterval(_local1.intervalID);
_local1.xml.parseXML(_root.gameData);
_local1.gameDataReceived();
}
}
function updateScore(deltaScore) {
score = score + deltaScore;
score = Math.max(0, score);
var _local3 = "" + score;
var _local2 = 1;
var _local1 = _local3.length - 1;
while (_local1 >= 0) {
_root.mcGame["mcScoreNum" + _local2].gotoAndStop(Number(_local3.charAt(_local1)) + 2);
_local2++;
_local1--;
}
}
function gameDataReceived() {
var _local2 = this;
util.Logger.log("gameDataReceived()");
if (_local2.xml.status) {
util.Logger.log("Error occured parsing xml: " + _local2.xml.status);
}
var len = _local2.xml.firstChild.childNodes.length;
var _local3 = 0;
while (_local3 < len) {
var _local1 = _local2.xml.firstChild.childNodes[_local3];
if (_local1.nodeName == "level") {
var l = _local2.createLevel(_local1);
_local2.levels.push(l);
} else if (_local1.nodeName == "text") {
_local2.texts[_local1.attributes.id] = _local1.childNodes[0].nodeValue;
}
_local3++;
}
_local2.setGameTexts();
if (DEBUG) {
_root.doBreak();
_local2.intro();
} else {
_local2.intro();
}
}
function setGameTexts() {
var _local1 = this;
var _local2 = _root;
_local2.mcGame.txtLevel.text = _local1.getText("level");
_local2.mcGame.txtTimeLeft.text = _local1.getText("time_left");
_local2.mcGame.txtScore.text = _local1.getText("score");
_local2.mcGame.txtEndGame.text = _local1.getText("end_game");
_local2.mcGame.txtBlastoMeter.text = _local1.getText("column_blast");
}
function abortGame() {
var _local1 = this;
util.Logger.log("abortGame()");
if (!_local1.gameStarted) {
} else {
_local1.gameAborted = true;
_local1.activeLevel().stop();
}
}
function intro() {
util.Logger.log("intro()");
displayInstructions();
}
function displayInstructions() {
var _local2 = this;
var _local3 = _root;
util.Logger.log("displayInstructions()");
_local3.sounds.play("intro", "introSound");
var _local1 = _local3.attachMovie("sign", "mcSign", _local3.nextZ());
_local1._x = SIGN_X;
_local1._y = SIGN_Y;
_local1.txtGameInstructions.text = _local2.getText("instruction_headline");
_local1.txt1.text = _local2.getText("instruction_text_1");
_local1.txt2.text = _local2.getText("instruction_text_2");
_local1.txt3.text = _local2.getText("instruction_text_3");
_local1.txtStartIn.text = _local2.getText("start_in");
_local1.txtNumSecs.text = 10;
_local1.txtStartGame.text = _local2.getText("start_game");
_local1.onPress = function () {
_root.game.start();
};
_local2.intervalID = setInterval(_local2, "startInXSecs", 1000);
}
function startInXSecs() {
var _local1 = Number(_root.mcSign.txtNumSecs.text);
if (_local1 != -1) {
_root.mcSign.txtNumSecs.text = _local1;
} else {
start();
}
_local1 = _local1--;
}
function start() {
var _local1 = _root;
var _local2 = this;
_local1.sounds.stop("introSound");
clearInterval(_local2.intervalID);
util.Logger.log("startGame()");
_local1.fs("gameStart", "");
_local1.fs("playData", "13,1 0 0=0");
_local2.gameStarted = true;
_local2.updateScore(0);
_local1.mcSign.removeMovieClip();
_local1.mcGame.mcLevelNum.gotoAndStop(3);
_local2.activeLevel().start();
}
function createLevel(levelNode) {
var level = new Level(Number(levelNode.attributes.width), Number(levelNode.attributes.height));
level.clearLimit = levelNode.attributes.clear;
level.timeLimit = levelNode.attributes.timelimit;
level.activationLimit = levelNode.attributes.activation_limit;
_root.debugInfo = _root.debugInfo + (levelNode.attributes.symbols + "\n\n");
var _local2 = splitSymbols(levelNode.attributes.symbols);
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = _local2[_local1].charAt(0);
var type = _local2[_local1].charAt(1);
level.addBlock(_local3, type);
_local1++;
}
return(level);
}
function splitSymbols(symbols) {
var _local3 = symbols;
var arr = new Array();
var _local2 = "";
var _local1 = 0;
while (_local1 < _local3.length) {
if (_local3.charAt(_local1) != " ") {
_local2 = _local2 + _local3.charAt(_local1);
} else if (_local2.length > 0) {
arr.push(_local2);
_local2 = "";
}
_local1++;
}
if (_local2.length > 0) {
arr.push(_local2);
}
return(arr);
}
function levelFinished() {
var _local1 = this;
_local1.displayLevelScore();
var _local2 = ((_local1.lastLevel() || (_local1.gameAborted)) ? -1 : (_local1.activeLevelIndex + 2));
if (_local1.gameAborted) {
_root.fs("playData", "5788=0");
} else {
_root.fs("playData", ((((("13," + _local2) + " ") + _local1.score) + " ") + _local1.calcClearanceBonus()) + "=0");
}
}
function lastLevel() {
return((activeLevelIndex + 1) == levels.length);
}
function nextLevel() {
var _local1 = _root;
var _local2 = this;
if (!_local1.mcSign) {
} else {
_local1.mcSign.removeMovieClip();
_local2.activeLevelIndex++;
_local1.mcGame.mcLevelNum.gotoAndStop(_local2.activeLevelIndex + 3);
_local1.mcGame.gotoAndStop(_local2.activeLevelIndex + 1);
_local1.debugInfo = _local1.debugInfo + "\n\n";
_local2.activeLevel().start();
}
}
function displayLevelScore() {
var _local1 = this;
var _local3 = _root;
util.Logger.log("displayLevelScore()");
var _local2 = _local3.attachMovie("sign", "mcSign", _local3.nextZ());
_local2.onPress = undefined;
_local2._x = SIGN_X;
_local2._y = SIGN_Y;
_local2.gotoAndStop(2);
_local2.txtScore.text = _local1.getText("game_score");
_local2.txtClearBonus.text = _local1.getText("clearance_bonus");
_local2.txtTotal.text = _local1.getText("total_score");
var status = (_local1.activeLevel().timeout ? (_local1.getText("time_is_out")) : (_local1.getText("no_more_moves")));
_local1.displayer = new util.TextFieldDisplayer();
if (!_local1.gameAborted) {
_local1.displayer.addText(_local2.txtStatus, status);
_local1.displayer.addText(_local2.txtLevel, (((_local1.getText("level") + " ") + (_local1.activeLevelIndex + 1)) + " ") + _local1.getText("ended"));
_local1.displayer.addCountingText(_local2.txtClearedPercentage, _local1.getText("cleared_percentage") + " ", "%", 0, _local1.activeLevel().clearedPercentage * 100);
}
if ((!_local1.lastLevel()) && (!_local1.gameAborted)) {
var key = (_local1.activeLevel().passed() ? "qualified" : "not_qualified");
_local1.displayer.addText(_local2.txtQualified, _local1.getText(key));
}
if (_local1.gameAborted || (_local1.lastLevel())) {
_local1.displayer.addEvent({context:_local3.game, method:"displayGameOver"}, 50);
} else if (!_local1.activeLevel().passed()) {
_local1.displayer.addEvent({context:_local3.game, method:"displayGameOver"}, 1300);
}
_local1.displayer.addText(_local2.txtNumScore, "" + _local1.score);
if (!_local1.gameAborted) {
_local1.displayer.addText(_local2.txtNumClearBonus, "" + _local1.calcClearanceBonus());
_local1.updateScore(_local1.calcClearanceBonus());
}
_local1.displayer.addText(_local2.txtNumTotal, "" + _local1.score);
_local1.displayer.addEvent({context:_local3.game, method:"sendPlayData"});
if ((_local1.activeLevel().passed() && (!_local1.lastLevel())) && (!_local1.gameAborted)) {
_local1.displayer.addEvent({context:_local3.game, method:"addSignMouseEvent"}, 10);
_local1.displayer.addCountingText(_local2.txtCounter, "", "", 6, 0, 500, 10);
_local1.displayer.doWhenDone({context:_local3.game, method:"nextLevel"});
} else {
_local1.displayer.addEvent({context:_local3.game, method:"playSadSound"}, 2000);
_local1.intervalID = setInterval(_local1, "gameOver", 7000);
}
}
function playSadSound() {
_root.sounds.play("round over 1", "sadSound");
}
function gameOver() {
var _local1 = this;
util.Logger.log("gameOver()");
clearInterval(_local1.intervalID);
if (_local1.lastLevel() || (!_local1.activeLevel().passed())) {
_root.fs("gameOver", "" + _local1.score);
} else if (_local1.gameAborted) {
_root.fs("playData", "788=" + _local1.score);
}
}
function addSignMouseEvent() {
_root.mcSign.onPress = function () {
_root.game.nextLevel();
};
}
function sendPlayData() {
_root.fsMoney("playData", (activeLevel().timeout ? "4824=0" : "671=0"));
}
function displayGameOver() {
var _local1 = _root;
_local1.mcSign.txtLevel.text = (_local1.mcSign.txtStatus.text = "");
_local1.mcSign.txtGameOver.text = getText("game_over");
}
function calcClearanceBonus() {
return(Math.floor(activeLevel().clearedPercentage * (1000 + (activeLevelIndex * 500))));
}
function activeLevel() {
var _local1 = this;
if (_local1.activeLevelIndex < _local1.levels.length) {
return(_local1.levels[_local1.activeLevelIndex]);
}
return(null);
}
function getText(key) {
return(texts[key]);
}
var gameStarted = false;
var gameAborted = false;
static var DEBUG = false;
var intervalID = 0;
static var RESPONSE_TIMEOUT = 15;
static var SIGN_X = 70;
static var SIGN_Y = 35;
}
Symbol 197 MovieClip [__Packages.util.TextFieldDisplayer] Frame 0
class util.TextFieldDisplayer
{
var textFields, defaultDelay, callback;
function TextFieldDisplayer () {
textFields = new Array();
defaultDelay = 250;
}
function addText(textField, text, delay) {
var _local2 = this;
var _local1 = new Object();
_local1.textField = textField;
_local1.textField.text = "";
_local1.text = text;
_local1.delay = (delay ? (delay) : 500);
_local2.textFields.push(_local1);
if (_local2.textFields.length == 1) {
_local2.intervalID = setInterval(_local2, "nextTextField", _local2.textFields[0].delay);
}
}
function addCountingText(textField, preText, postText, from, to, countSpeed, delay) {
var _local2 = this;
var _local3 = from;
_local3 = Math.floor(_local3);
to = Math.floor(to);
var _local1 = new Object();
_local1.textField = textField;
_local1.textField.text = "";
_local1.preText = preText;
_local1.postText = postText;
_local1.delay = (delay ? (delay) : (_local2.defaultDelay));
_local1.counter = _local3;
_local1.countTo = to;
_local1.counting = true;
_local1.countSpeed = countSpeed;
_local2.textFields.push(_local1);
if (_local2.textFields.length == 1) {
_local2.prepareNextTextField();
}
}
function addEvent(callback, delay) {
var _local1 = this;
callback.delay = (delay ? (delay) : (_local1.defaultDelay));
_local1.textFields.push(callback);
if (_local1.textFields.length == 1) {
_local1.prepareNextTextField();
}
}
function prepareNextTextField() {
var _local1 = this;
if (_local1.textFields.length > 0) {
_local1.intervalID = setInterval(_local1, "nextTextField", _local1.textFields[0].delay);
} else if (_local1.callback) {
_local1.callback.context[_local1.callback.method]();
}
}
function nextTextField() {
var _local2 = this;
clearInterval(_local2.intervalID);
var _local1 = _local2.textFields.shift();
if (_local1.counting) {
_local2.countingField = _local1;
_local2.intervalID = setInterval(_local2, "count", (_local1.countSpeed ? (_local1.countSpeed) : 30));
} else if (_local1.context && (!_local1.textField)) {
_root.doBreak();
_local1.context[_local1.method]();
_local2.prepareNextTextField();
} else {
_local1.textField.text = _local1.text;
_local2.prepareNextTextField();
}
}
function count() {
var _local1 = this;
if (Math.abs(_local1.countingField.counter - _local1.countingField.countTo) < 0.5) {
clearInterval(_local1.intervalID);
_local1.countingField = null;
_local1.prepareNextTextField();
} else if (_local1.countingField.counter < _local1.countingField.countTo) {
_local1.countingField.counter++;
} else if (_local1.countingField.counter > _local1.countingField.countTo) {
_local1.countingField.counter--;
}
_local1.countingField.textField.text = (_local1.countingField.preText + _local1.countingField.counter) + _local1.countingField.postText;
}
function doWhenDone(callback) {
this.callback = callback;
}
}
Symbol 198 MovieClip [__Packages.util.Logger] Frame 0
class util.Logger
{
function Logger () {
}
static function log(text) {
var _local1 = text;
if (state == QUIET) {
} else if (state == TRACE) {
trace(_local1);
} else if (state == WEB) {
fscommand ("flashdebug", _local1);
} else if (state == TEXTFIELD) {
_root.txtDebug.text = _root.txtDebug.text + (_local1 + newline);
}
}
static var QUIET = 100;
static var TRACE = 101;
static var WEB = 102;
static var TEXTFIELD = 103;
static var state = TRACE;
}
Symbol 199 MovieClip [__Packages.Level] Frame 0
class Level
{
var blockW, blocks, clearLimit, clearedPercentage;
function Level (numCols, numRows) {
var _local2 = this;
var _local3 = numRows;
_local2.numCols = numCols;
_local2.numRows = _local3;
_local2.blocks = new Array();
var _local1 = 0;
while (_local1 < _local3) {
_local2.blocks.push(new Array());
_local1++;
}
_local2.numBlocks = 0;
_local2.movingBlocks = 0;
_local2.allowInteraction = false;
_local2.columnBlastPoints = 0;
_local2.clearedPercentage = 0;
_local2.animations = new Array();
_root.mcBlastometer.onPress = null;
}
function addBlock(color, type) {
var _local1 = this;
var _local2 = _root.attachMovie("blocks", "mcBlock" + _local1.numBlocks, _root.nextZ());
_root.debugger.output.text = _root.debugger.output.text + (color + newline);
if (!_local1.blockW) {
_local1.blockW = _local2._width;
_local1.blockH = _local2._height;
_local1.levelW = _local1.numCols * (_local1.blockW - 2);
_local1.levelH = _local1.numRows * (_local1.blockH - 2);
}
_local2._x = -1000;
var _local3 = new Block();
_local3.init(_local2, color, type);
var row = Math.floor(_local1.numBlocks / _local1.numCols);
var col = (_local1.numBlocks % _local1.numCols);
_local1.blocks[row][col] = _local3;
_local1.numBlocks++;
}
function start() {
var _local2 = this;
trace("start()");
_root.mcBlastometer.gotoAndStop(1);
_root.mcBlastometer.onPress = null;
var _local1 = 0;
while (_local1 < _local2.numBlocks) {
var _local3 = Math.floor(_local1 / _local2.numCols);
var col = (_local1 % _local2.numCols);
var b = _local2.blocks[_local3][col];
b.setPos(_local3, col);
_local1++;
}
_local2.createGroups();
_local2.allowInteraction = true;
_local2.intervalID = setInterval(_local2, "handleTime", 250);
_local2.startTime = getTimer();
_root.sounds.play("bombdetonation 3", "levelStart");
}
function handleTime() {
var _local1 = this;
var _local3 = _root;
var _local2 = _local1.timeLimit - Math.floor((getTimer() - _local1.startTime) / 1000);
_local3.mcGame.mcTimeNum1.gotoAndStop(2 + (_local2 % 10));
_local3.mcGame.mcTimeNum2.gotoAndStop(2 + Math.floor((_local2 % 100) / 10));
if (_local1.timeLimit >= 100) {
_local3.mcGame.mcTimeNum3.gotoAndStop(2 + Math.floor((_local2 % 1000) / 100));
}
if (_local2 <= 0) {
_local1.timeout = true;
_local1.stop();
} else if ((_local2 <= 5) && (!_local1.playingTickTock)) {
_local3.sounds.playLoop("clock", "clockSound");
_local1.playingTickTock = true;
}
}
function stop(pause) {
var _local1 = this;
var _local2 = _root;
util.Logger.log("stop()");
_local2.sounds.stop("clockSound");
clearInterval(_local1.intervalID);
if (_local1.stopped) {
} else {
_local1.stopped = true;
_local2.mcHitArea.removeMovieClip();
_local2.mcBlastColumn.removeMovieClip();
_local2.mcBlastometer.onPress = null;
_local2.sounds.play("round over 3", "roundOver");
_local1.playTime = getTimer() - _local1.startTime;
_local1.allowInteraction = false;
_local1.intervalID = setInterval(_local1, "cleanup", (pause ? 1000 : 100));
}
}
function cleanup() {
var _local2 = this;
clearInterval(_local2.intervalID);
var i = 0;
while (i < _local2.animations.length) {
_local2.animations[i].mc.removeMovieClip();
i++;
}
_local2.animations = null;
var _local3 = 0;
while (_local3 < _local2.numRows) {
var _local1 = 0;
while (_local1 < _local2.numCols) {
_local2.blocks[_local3][_local1].mc.removeMovieClip();
_local2.blocks[_local3][_local1] = null;
_local1++;
}
_local3++;
}
_root.game.levelFinished();
}
function createGroups() {
var _local1 = this;
var groupsCreated = false;
var i = 0;
while (i < _local1.numBlocks) {
var row = Math.floor(i / _local1.numCols);
var col = (i % _local1.numCols);
var b = _local1.blocks[row][col];
b.group = null;
i++;
}
var numLeft = 0;
var i = 0;
while (i < _local1.numBlocks) {
var row = Math.floor(i / _local1.numCols);
var col = (i % _local1.numCols);
var b = _local1.blocks[row][col];
if (b) {
numLeft++;
}
if (!b.group) {
var _local2 = new Array();
_local1.findGroup(row, col, b.color, _local2);
if (b.color == "X") {
_local2.push(b);
}
if (_local2.length >= 2) {
groupsCreated = true;
}
var _local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3].group = _local2;
_local3++;
}
}
i++;
}
_local1.clearedPercentage = 1 - (numLeft / _local1.numBlocks);
if (!groupsCreated) {
var foundActiveBomb = false;
var col = 0;
while (col < _local1.numCols) {
if (_local1.blocks[_local1.numRows - 1][col].type == "X") {
foundActiveBomb = true;
}
col++;
}
if (!foundActiveBomb) {
_local1.stop(true);
}
}
}
function findGroup(row, col, color, group) {
var _local1 = group;
var _local3 = this;
var _local2 = _local3.blocks[row][col];
if (((_local2.color == "X") || (_local2.color != color)) || (_local3.contains(_local1, _local2))) {
} else {
_local1.push(_local2);
_local3.findGroup(row - 1, col, color, _local1);
_local3.findGroup(row + 1, col, color, _local1);
_local3.findGroup(row, col - 1, color, _local1);
_local3.findGroup(row, col + 1, color, _local1);
}
}
function contains(arr, obj) {
var _local2 = arr;
var _local3 = obj;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == _local3) {
return(true);
}
_local1++;
}
return(false);
}
function removeGroup(group, activator) {
var _local2 = this;
if (((group.length == 1) && (activator != "columnBlast")) && (activator != "bomb")) {
_root.game.updateScore(-10);
_root.sounds.play("negative 3", "negative");
return(-10);
}
_root.sounds.play("clearblocks", "cubeClear");
var colsAffected = new Array();
var removeCols = new Array();
var numStarsInGroup = 0;
var i = 0;
while (i < group.length) {
var b = group[i];
if (!_local2.contains(colsAffected, b.col)) {
colsAffected.push(b.col);
}
_local2.blocks[b.row][b.col] = null;
if (b.type == "S") {
numStarsInGroup++;
}
b.mc.removeMovieClip();
i++;
}
if (activator != "columnBlast") {
_local2.columnBlastPoints = _local2.columnBlastPoints + (group.length * group.length);
if (_local2.columnBlastPoints >= _local2.activationLimit) {
_local2.createColumnBlaster();
}
} else {
_local2.columnBlastPoints = 0;
}
var percentage = Math.min(1, _local2.columnBlastPoints / _local2.activationLimit);
_root.mcBlastometer.gotoAndStop(Math.max(1, Math.floor(percentage * 9)));
var score = 0;
if (activator == "normal") {
score = (group.length * group.length) * 10;
var i = 0;
while (i < numStarsInGroup) {
score = score * 2;
i++;
}
} else if (activator == "bomb") {
score = 300;
} else if (activator == "columnBlast") {
score = group.length * 20;
}
score = score * (1 + (_root.game.activeLevelIndex / 10));
_root.game.updateScore(score);
if (_root.mcScore) {
mcScore.removeMovieClip();
}
var mcScore = _root.attachMovie("scorePopUp", "mcScore" + getTimer(), 888888);
mcScore._x = _root._xmouse - 20;
mcScore._y = _root._ymouse - 20;
mcScore.txtScore.text = score;
mcScore.slideTo(mcScore._x, mcScore._y - 15, 1, null, 0, {context:mcScore, method:"removeMovieClip"});
mcScore.gotoAndStop(((numStarsInGroup > 0) ? 2 : 1));
_local2.animations = new Array();
var i = 0;
while (i < colsAffected.length) {
var _local3 = colsAffected[i];
var fallToRow = 0;
var _local1 = _local2.numRows - 1;
while (_local1 >= 0) {
if (_local2.blocks[_local1][_local3] == null) {
fallToRow = _local1;
break;
}
_local1--;
}
var dropRows = 0;
var dropAnimation = new BlockDropAnimation();
var movingBlocksInCol = 0;
_local1 = fallToRow - 1;
while (_local1 >= 0) {
if (_local2.blocks[_local1][_local3] != null) {
if (!dropRows) {
dropRows = fallToRow - _local1;
}
dropAnimation.addBlock(_local2.blocks[_local1][_local3]);
_local2.blocks[_local1][_local3].mc._visible = false;
var fallRows = ((fallToRow - _local1) - movingBlocksInCol);
_local2.blocks[_local1 + fallRows][_local3] = _local2.blocks[_local1][_local3];
_local2.blocks[_local1][_local3].row = _local2.blocks[_local1][_local3].row + fallRows;
_local2.blocks[_local1][_local3].mc.row = _local2.blocks[_local1][_local3].mc.row + fallRows;
_local2.blocks[_local1][_local3] = null;
movingBlocksInCol++;
}
_local1--;
}
if (dropAnimation.active) {
dropAnimation.dropDistance = dropRows;
_local2.animations.push(dropAnimation);
}
i++;
}
if (_local2.animations.length > 0) {
var i = 0;
while (i < _local2.animations.length) {
_local2.animations[i].drop();
i++;
}
_local2.allowInteraction = false;
} else {
_local2.handleEmptyCols();
}
return(score);
}
function createColumnBlaster() {
var _local1 = _root;
if (_local1.mcBlastometer.onPress) {
} else {
_local1.mcBlastometer.onPress = function () {
var _local1 = _root;
if (!_local1.game.activeLevel().allowInteraction) {
} else {
var _local3 = _local1.attachMovie("blastcolumn", "mcBlastColumn", _local1.nextZ());
_local3._x = _local1.game.activeLevel().columnBlasterX(_local1._xmouse);
_local3._y = 40;
_local3.onMouseMove = function () {
this._x = _root.game.activeLevel().columnBlasterX(_root._xmouse);
updateAfterEvent();
};
var _local2 = _local1.attachMovie("hitArea", "mcHitArea", _local1.nextZ());
_local2._alpha = 0;
_local2._x = Level.LEVEL_X_OFFSET;
_local2._y = Level.LEVEL_Y_OFFSET;
_local2._width = _local1.game.activeLevel().levelW;
_local2._height = _local1.game.activeLevel().levelH;
_local2.onPress = function () {
var _local1 = _root;
_local1.game.activeLevel().blastCol(_local1._xmouse);
_local1.sounds.play("Electricity", "blast");
};
this.onPress = null;
}
};
}
}
function columnBlasterCol(mouseX) {
var _local2 = this;
var _local3 = mouseX;
var _local1 = LEVEL_X_OFFSET;
var mouseDist = (Math.abs(_local1 - _local3) + Math.abs((_local1 + _local2.levelW) - _local3));
var col = 0;
if (mouseDist > _local2.levelW) {
if (_local3 < _local1) {
col = 0;
} else {
col = _local2.numCols - 1;
}
} else {
var col = Math.floor(((_local3 - _local1) / _local2.levelW) * _local2.numCols);
}
return(col);
}
function columnBlasterX(mouseX) {
return((LEVEL_X_OFFSET + 15) + (columnBlasterCol(mouseX) * (blockW - 2)));
}
function blastCol(mouseX) {
var _local2 = this;
var col = _local2.columnBlasterCol(mouseX);
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.numRows) {
_local2.addIfNotNull(_local3, _local1, col);
_local1++;
}
_root.mcHitArea.removeMovieClip();
_root.mcBlastColumn.removeMovieClip();
_root.mcBlastometer.onPress = null;
var score = _local2.removeGroup(_local3, "columnBlast");
_root.fsMoney("playData", (((("198," + col) + " ") + _local3.length) + "=") + score);
}
function bombBlast(bomb) {
var _local1 = bomb;
var _local3 = this;
if (_local1.row != (_local3.numRows - 1)) {
return(0);
}
var _local2 = new Array();
_local2.push(_local1);
_local3.addIfNotNull(_local2, _local1.row - 1, _local1.col - 1);
_local3.addIfNotNull(_local2, _local1.row - 1, _local1.col);
_local3.addIfNotNull(_local2, _local1.row - 1, _local1.col + 1);
_local3.addIfNotNull(_local2, _local1.row, _local1.col - 1);
_local3.addIfNotNull(_local2, _local1.row, _local1.col + 1);
_root.sounds.play("bombdetonation 2", "bomb");
return(_local3.removeGroup(_local2, "bomb"));
}
function addIfNotNull(group, row, col) {
if (blocks[row][col] != null) {
group.push(blocks[row][col]);
}
}
function doneDropping(animation) {
var _local2 = this;
if (_local2.stopped) {
} else {
if (animation) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.animations.length) {
if (_local2.animations[_local1].col != animation.col) {
_local3.push(_local2.animations[_local1]);
}
_local1++;
}
_local2.animations = _local3;
animation.cleanup();
}
if (_local2.animations.length == 0) {
_local2.handleEmptyCols();
}
}
}
function doneSliding(animation) {
var _local2 = this;
if (_local2.stopped) {
} else {
if (animation) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.animations.length) {
if (_local2.animations[_local1] != animation) {
_local3.push(_local2.animations[_local1]);
}
_local1++;
}
_local2.animations = _local3;
animation.cleanup();
}
if (_local2.animations.length == 0) {
_local2.allowInteraction = true;
_local2.createGroups();
}
}
}
function handleEmptyCols() {
var _local1 = this;
var slideCols = new Array(_local1.numCols);
var emptyCols = false;
var i = 0;
while (i < _local1.numCols) {
slideCols[i] = 0;
i++;
}
var i = 0;
while (i < _local1.numCols) {
if (_local1.blocks[_local1.numRows - 1][i] == null) {
var j = (i + 1);
while (j < _local1.numCols) {
if (_local1.blocks[_local1.numRows - 1][j]) {
slideCols[j]++;
emptyCols = true;
}
j++;
}
}
i++;
}
_local1.animations = new Array();
var animation = null;
if (emptyCols) {
var movingBlocks = 0;
var _local2 = 0;
while (_local2 < _local1.numCols) {
if (!slideCols[_local2]) {
} else {
if ((!animation) || (animation.slideDistance != slideCols[_local2])) {
if (animation) {
_local1.animations.push(animation);
}
animation = new BlockSlideAnimation();
animation.slideDistance = slideCols[_local2];
}
var _local3 = 0;
while (_local3 < _local1.numRows) {
if (!_local1.blocks[_local3][_local2]) {
} else {
animation.addBlock(_local1.blocks[_local3][_local2]);
var colDist = slideCols[_local2];
if ((_local1.blocks[_local3][_local2] != null) && (colDist)) {
_local1.blocks[_local3][_local2].mc._visible = false;
_local1.blocks[_local3][_local2 - colDist] = _local1.blocks[_local3][_local2];
_local1.blocks[_local3][_local2 - colDist].col = _local1.blocks[_local3][_local2 - colDist].col - colDist;
_local1.blocks[_local3][_local2 - colDist].mc.col = _local1.blocks[_local3][_local2 - colDist].mc.col - colDist;
_local1.blocks[_local3][_local2] = null;
movingBlocks++;
}
}
_local3++;
}
}
_local2++;
}
}
if (animation && (animation.active)) {
_local1.animations.push(animation);
}
if (_local1.animations.length > 0) {
var i = 0;
while (i < _local1.animations.length) {
_local1.animations[i].slide();
i++;
}
_local1.allowInteraction = false;
} else {
_root.doBreak();
_local1.allowInteraction = true;
_local1.createGroups();
}
}
function passed() {
return((clearedPercentage * 100) >= clearLimit);
}
var columnBlastPoints = 0;
var playingTickTock = false;
static var LEVEL_X_OFFSET = 132;
static var LEVEL_Y_OFFSET = 38;
}
Symbol 200 MovieClip [__Packages.Block] Frame 0
class Block
{
var mc, colorFrame;
function Block () {
}
function init(mc, color, type) {
var _local1 = this;
var _local2 = mc;
var _local3 = _root;
_local1.mc = _local2;
_local2.onRollOver = function () {
_root.game.activeLevel().blocks[this.row][this.col].onRollOver();
};
_local2.onRollOut = function () {
_root.game.activeLevel().blocks[this.row][this.col].onRollOut();
};
_local2.onPress = function () {
_root.game.activeLevel().blocks[this.row][this.col].onPress();
};
_local1.color = color;
_local1.type = type;
switch (color) {
case "Y" :
_local1.colorFrame = 1;
break;
case "B" :
_local1.colorFrame = 8;
break;
case "G" :
_local1.colorFrame = 15;
break;
case "O" :
_local1.colorFrame = 22;
break;
case "P" :
_local1.colorFrame = 29;
break;
case "R" :
_local1.colorFrame = 36;
break;
case "X" :
_local1.colorFrame = 44;
}
if (type == "S") {
_local1.colorFrame = _local1.colorFrame + 5;
}
_local1.displayNormal();
}
function displayNormal() {
mc.gotoAndStop(colorFrame);
}
function update() {
var _local1 = this;
_local1.setPos(_local1.row, _local1.col);
}
function setPos(row, col) {
var _local1 = this;
var _local2 = row;
_local1.row = (_local1.mc.row = _local2);
_local1.col = (_local1.mc.col = col);
if (!_local1.mc._visible) {
_local1.mc._visible = true;
}
if ((_local1.color == "X") && (_local2 == (_root.game.activeLevel().numRows - 1))) {
_local1.mc.gotoAndStop(_local1.colorFrame - 1);
}
_local1.mc._x = (Level.LEVEL_X_OFFSET + 15) + (col * (_local1.mc._width - 2));
_local1.mc._y = (Level.LEVEL_Y_OFFSET + 15) + (_local2 * (_local1.mc._height - 2));
}
function displayHilite() {
var _local1 = this;
if (_local1.color == "X") {
} else {
_local1.mc.gotoAndStop(_local1.colorFrame + 1);
}
}
function onRollOver() {
var _local2 = this;
if (_root.game.activeLevel().allowInteraction == false) {
} else {
var _local1 = 0;
while (_local1 < _local2.group.length) {
_local2.group[_local1].displayHilite();
_local1++;
}
}
}
function onRollOut() {
var _local2 = this;
if ((!_root.game.activeLevel().allowInteraction) || (_local2.color == "X")) {
} else {
var _local1 = 0;
while (_local1 < _local2.group.length) {
_local2.group[_local1].displayNormal();
_local1++;
}
}
}
function onPress() {
var _local1 = this;
var _local2 = _root.game.activeLevel();
if ((!_local2.allowInteraction) || (_local2.stopped)) {
} else {
var data = ((((((("651," + _local1.color) + _local1.type) + " ") + _local1.col) + " ") + _local1.row) + "=");
var _local3;
if (_local1.type != "X") {
_local3 = _local2.removeGroup(_local1.group, "normal");
} else {
_local3 = _local2.bombBlast(_local1);
}
if (_local3 != 0) {
_root.fsMoney("playData", data + _local3);
}
}
}
}
Symbol 201 MovieClip [__Packages.BlockDropAnimation] Frame 0
class BlockDropAnimation
{
var active, blocks;
function BlockDropAnimation () {
active = false;
blocks = new Array();
}
function addBlock(block) {
var _local1 = this;
var _local2 = block;
_local1.blocks.push(_local2);
_local1.active = true;
if (!_local1.mc) {
_local1.mc = _root.createEmptyMovieClip("dropAnimation" + _local2.col, 777777 + _local2.col);
_local1.col = _local2.col;
_local1.mc._x = (_local1.mc._y = 0);
_local1.active = true;
}
var _local3 = _local1.mc.attachMovie("blocks", _local2.mc._name + "copy", _local1.depth++);
_local3.gotoAndStop(_local2.mc._currentFrame);
_local3._y = _local2.mc._y;
_local3._x = _local2.mc._x;
}
function drop() {
var _local1 = this;
var _local2 = _local1.mc._y + (_local1.dropDistance * (_root.game.activeLevel().blockH - 2));
_local1.mc.slideTo(_local1.mc._x, _local2, 0.3, "easeinquad", 0, {context:_root.game.activeLevel(), method:"doneDropping", args:_local1});
}
function cleanup() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.blocks.length) {
_local2.blocks[_local1].update();
_local1++;
}
_local2.mc.removeMovieClip();
_local2.mc = null;
}
var depth = 1;
}
Symbol 202 MovieClip [__Packages.BlockSlideAnimation] Frame 0
class BlockSlideAnimation
{
function BlockSlideAnimation () {
var _local1 = this;
_local1.active = false;
_local1.slideDistance = 0;
_local1.blocks = new Array();
}
function addBlock(block) {
var _local1 = this;
var _local2 = block;
_local1.blocks.push(_local2);
_local1.active = true;
if (!_local1.mc) {
_local1.mc = _root.createEmptyMovieClip("slideAnimation" + _local2.col, 777777 + _local2.col);
_local1.mc._x = (_local1.mc._y = 0);
_local1.active = true;
}
var _local3 = _local1.mc.attachMovie("blocks", _local2.mc._name + "copy", _local1.depth++);
_local3.gotoAndStop(_local2.mc._currentFrame);
_local3._y = _local2.mc._y;
_local3._x = _local2.mc._x;
}
function slide() {
var _local1 = this;
var _local2 = _x - (_local1.slideDistance * (_root.game.activeLevel().blockW - 2));
_local1.mc.slideTo(_local2, _local1.mc._y, 0.3, "easeinquad", 0, {context:_root.game.activeLevel(), method:"doneSliding", args:_local1});
}
function cleanup() {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.blocks.length) {
_local2.blocks[_local1].update();
_local1++;
}
_local2.mc.removeMovieClip();
_local2.mc = null;
}
var depth = 1;
}