Frame 1
function __com_mochibot__(swfid, mc, lv) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = ((((((((((("http://" + mbc) + "/my/core.swf?mv=5&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("3a61aedc", this, 10301);
_root.debug = function (thing) {
if (thing != undefined) {
trace("debug: " + thing);
}
return(false);
};
play();
Frame 5
function setup() {
_global.tl = this;
this.objs = {};
var _local3 = ["bg", "fall", "putt", "bounce", "hit"];
if (_global.snd == undefined) {
_global.snd = new com.rubberductions.SoundManager(this, _local3, false);
}
if (_global.firstRun == false) {
setupGameObj();
} else {
_global.firstRun = false;
readInstructions_mc._x = 0;
readInstructions_mc._y = 0;
readInstructions_mc.bg_but.useHandCursor = false;
readInstructions_mc.okbut_mc.cb = this;
readInstructions_mc.okbut_mc.onRelease = function () {
this._parent._x = -1000;
this._parent._y = -1000;
this.cb.setupGameObj();
};
}
}
function setupGameObj() {
this.objs.game = new com.rubberductions.Game(this, ball_mc, rotator_mc, _global.gameLevel);
}
function preload(clip, goFrame, percentRequired) {
clip.preloadTo = percentRequired;
clip.goFrame = goFrame;
clip.tl = this;
clip.onEnterFrame = function () {
var _local2 = this.tl.getBytesLoaded();
var _local4 = this.tl.getBytesTotal();
var _local3 = (100 / _local4) * _local2;
if (_local2 > 16) {
this.gotoAndStop(Math.round(_local3));
if (Math.round(_local3) >= 100) {
this.tl.gotoAndStop(goFrame);
}
}
};
}
function setupPalmLink(clip) {
clip.onRelease = function () {
var _local2 = _global.scriptURL + "linkTracking?link=exit3";
getURL (_local2, "_blank");
};
}
function setupSplash(clip, goto, startLevel) {
if (_global.firstRun == true) {
doID();
}
setupPalmLink(clip._parent.palm_mc);
clip.frameIndex = startLevel;
clip.frames = [1, 15, 30];
clip.targetFrame = 1;
clip.dir = true;
clip.active = false;
clip.gotoAndStop(clip.frames[clip.frameIndex]);
clip.onEnterFrame = function () {
if (this.active) {
if (this.dir) {
if (this._currentframe == this.targetFrame) {
this.active = false;
this.play_mc._visible = true;
} else if (this._currentframe == this._totalframes) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(this._currentframe + 1);
}
} else if (this._currentframe == this.targetFrame) {
this.active = false;
this.play_mc._visible = true;
} else if (this._currentframe == 1) {
this.gotoAndStop(this._totalframes);
} else {
this.gotoAndStop(this._currentframe - 1);
}
}
};
clip.goNextForward = function () {
if (!this.active) {
this.frameIndex++;
if (this.frameIndex > (this.frames.length - 1)) {
this.frameIndex = 0;
}
this.targetFrame = this.frames[this.frameIndex];
this.dir = true;
this.active = true;
this.play_mc._visible = false;
}
};
clip.goNextBack = function () {
if (!this.active) {
this.frameIndex--;
if (this.frameIndex < 0) {
this.frameIndex = this.frames.length - 1;
}
this.targetFrame = this.frames[this.frameIndex];
this.dir = false;
this.active = true;
this.play_mc._visible = false;
}
};
clip.left_but.onRelease = function () {
this._parent.goNextBack();
};
clip.right_but.onRelease = function () {
this._parent.goNextForward();
};
clip.play_mc.goto = goto;
clip.play_mc.onRelease = function () {
_global.gameLevel = this._parent.frameIndex;
this._parent._parent.play();
};
}
function setupFeedback(tl, playAgainBut, submitClip, challengeBut, challengeClip, feedbackMessasge, scoreClip, findOutMoreClip) {
_global.snd.stopSound("bg");
setupFBPlayAgainButton(playAgainBut, tl);
setupWinATreo(submitClip, tl);
setupChallenge(challengeBut, challengeClip);
sendScoresGetRank(scoreClip);
normalFindOutMore(findOutMoreClip);
if (_global.holeInOne) {
fb_mc.gotoAndStop("holeInOne");
} else {
fb_mc.gotoAndStop("outOfTime");
}
if (_global.gotBonus) {
tl.gotBonus_mc.gotoAndStop("bonus");
} else {
tl.gotBonus_mc.gotoAndStop("no_bonus");
}
}
function normalFindOutMore(clip) {
clip.onRelease = function () {
var _local2 = _global.scriptURL + "linkTracking?link=exit1";
getURL (_local2, "_blank");
};
}
function hlFindOutMore() {
_root.debug();
var _local3 = findOutMore_mc.content_mc;
_local3.gotoAndStop("highlight");
_local3._parent.onRelease = function () {
var _local2 = _global.scriptURL + "linkTracking?link=exit2";
getURL (_local2, "_blank");
};
}
function sendScoresGetRank(clip) {
clip.yourScore_txt.text = _global.score;
clip.yourRank_txt.text = "";
clip.todayScore_txt.text = "";
clip.loader = new LoadVars();
clip.loader.cb = clip;
clip.loader.onLoad = function (success) {
if (success) {
this.cb.haveSomeData(this.rank, this.today);
}
};
clip.haveSomeData = function (rank, today) {
_root.debug();
if ((rank != "") && (rank != undefined)) {
this.yourRank_txt.text = rank;
}
if ((today != "") && (today != undefined)) {
this.todayScore_txt.text = today;
}
};
var _local5 = "" + _global.score;
clip.loader.track = _global.MD5.hex_md5(_local5);
clip.loader.score = _global.score;
clip.loader.hole = _global.levels[_global.gameLevel].bgFrame;
clip.loader.id = _global.playerID;
var _local6 = _global.scriptURL + "addHighScore";
clip.loader.sendAndLoad(_local6, clip.loader, _global.loadMethod);
}
function setupChallenge(but, window) {
window.bg_but.useHandCursor = false;
var _local8 = window._name;
but.clipRef = _local8;
but.onRelease = function () {
this._parent[this.clipRef].show();
};
window.show = function () {
this._x = (this._y = 0);
};
window.hide = function () {
this._x = (this._y = -1000);
};
window.send_mc.onRelease = function () {
_root.debug();
var _local7 = this._parent.yourEmail_txt.text;
var _local9 = this._parent.yourName_txt.text;
var _local6 = this._parent.friendsName_txt.text;
var _local5 = this._parent.friendsEmail_txt.text;
var _local10 = _global.score;
if (_local5 != "") {
var _local4 = new LoadVars();
_local4.friendEmail = _local5;
_local4.friendName = _local6;
_local4.myName = _local9;
_local4.myEmail = _local7;
_local4.score = _local10;
_local4.onLoad = function () {
};
var _local8 = _global.scriptURL + "sendToFriend";
_local4.sendAndLoad(_local8, _local4, _global.loadMethod);
this._parent.hide();
}
};
window.cancel_mc.onRelease = function () {
this._parent.emailInput_txt.text = "";
this._parent.hide();
};
}
function setupWinATreo(clip, tl) {
clip.emailInput_txt.onSetFocus = function () {
this._parent.cursor_mc._visible = false;
};
clip.send_mc.onRelease = function () {
this._parent.submitEmail();
};
clip.submitEmail = function () {
_root.debug();
if (this.emailInput_txt.text != "") {
var _local5 = this.emailInput_txt.text;
_root.hlFindOutMore();
var _local4 = new LoadVars();
_local4.email = _local5;
_local4.onLoad = function (success) {
};
var _local6 = _global.scriptURL + "winATreo";
_local4.sendAndLoad(_local6, _local4, _global.loadMethod);
this.gotoAndStop("sent");
}
};
}
function setupFBPlayAgainButton(clip, tl) {
clip.tl = tl;
clip.onRelease = function () {
this.tl.gotoAndPlay("splash");
};
}
function doID() {
var id = com.rubberductions.Utils.readLSO("holeInOne", "id");
if (id != "") {
_global.playerID = id;
var _local3 = new LoadVars();
var _local4 = _global.scriptURL + "hasPlayed";
_local3.id = _global.playerID;
_local3.onLoad = function () {
};
_local3.sendAndLoad(_local4, _local3, _global.loadMethod);
} else {
var _local3 = new LoadVars();
var _local4 = _global.scriptURL + "generateID";
_local3.onLoad = function (success) {
if (success) {
_global.playerID = this.id;
com.rubberductions.Utils.writeLSO("holeInOne", "id", _global.playerID);
} else {
_global.playerID = -1;
}
};
_local3.sendAndLoad(_local4, _local3, _global.loadMethod);
}
}
_global.MD5 = new Object();
MD5.hexcase = 0;
MD5.b64pad = "";
MD5.chrsz = 8;
MD5.hex_md5 = function (s) {
return(this.binl2hex(this.core_md5(this.str2binl(s), s.length * this.chrsz)));
};
MD5.b64_md5 = function (s) {
return(this.binl2b64(this.core_md5(this.str2binl(s), s.length * this.chrsz)));
};
MD5.str_md5 = function (s) {
return(this.binl2str(this.core_md5(this.str2binl(s), s.length * this.chrsz)));
};
MD5.hex_hmac_md5 = function (key, data) {
return(this.binl2hex(this.core_hmac_md5(key, data)));
};
MD5.b64_hmac_md5 = function (key, data) {
return(this.binl2b64(this.core_hmac_md5(key, data)));
};
MD5.str_hmac_md5 = function (key, data) {
return(this.binl2str(this.core_hmac_md5(key, data)));
};
MD5.md5_vm_test = function () {
return(this.hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72");
};
MD5.core_md5 = function (x, len) {
var _local11;
var _local10;
var _local9;
var _local8;
x[len >> 5] = x[len >> 5] | (128 << (len & 31));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local5 = 1732584193 /* 0x67452301 */;
var _local4 = -271733879;
var _local3 = -1732584194;
var _local2 = 271733878 /* 0x10325476 */;
var _local12 = x.length;
var _local6 = 0;
while (_local6 < _local12) {
_local11 = _local5;
_local10 = _local4;
_local9 = _local3;
_local8 = _local2;
_local5 = this.md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 0], 7, -680876936);
_local2 = this.md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 1], 12, -389564586);
_local3 = this.md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 2], 17, 606105819);
_local4 = this.md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 3], 22, -1044525330);
_local5 = this.md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 4], 7, -176418897);
_local2 = this.md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 5], 12, 1200080426);
_local3 = this.md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 6], 17, -1473231341);
_local4 = this.md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 7], 22, -45705983);
_local5 = this.md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 8], 7, 1770035416);
_local2 = this.md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 9], 12, -1958414417);
_local3 = this.md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 10], 17, -42063);
_local4 = this.md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 11], 22, -1990404162);
_local5 = this.md5_ff(_local5, _local4, _local3, _local2, x[_local6 + 12], 7, 1804603682);
_local2 = this.md5_ff(_local2, _local5, _local4, _local3, x[_local6 + 13], 12, -40341101);
_local3 = this.md5_ff(_local3, _local2, _local5, _local4, x[_local6 + 14], 17, -1502002290);
_local4 = this.md5_ff(_local4, _local3, _local2, _local5, x[_local6 + 15], 22, 1236535329);
_local5 = this.md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 1], 5, -165796510);
_local2 = this.md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 6], 9, -1069501632);
_local3 = this.md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 11], 14, 643717713);
_local4 = this.md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 0], 20, -373897302);
_local5 = this.md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 5], 5, -701558691);
_local2 = this.md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 10], 9, 38016083);
_local3 = this.md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 15], 14, -660478335);
_local4 = this.md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 4], 20, -405537848);
_local5 = this.md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 9], 5, 568446438);
_local2 = this.md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 14], 9, -1019803690);
_local3 = this.md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 3], 14, -187363961);
_local4 = this.md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 8], 20, 1163531501);
_local5 = this.md5_gg(_local5, _local4, _local3, _local2, x[_local6 + 13], 5, -1444681467);
_local2 = this.md5_gg(_local2, _local5, _local4, _local3, x[_local6 + 2], 9, -51403784);
_local3 = this.md5_gg(_local3, _local2, _local5, _local4, x[_local6 + 7], 14, 1735328473);
_local4 = this.md5_gg(_local4, _local3, _local2, _local5, x[_local6 + 12], 20, -1926607734);
_local5 = this.md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 5], 4, -378558);
_local2 = this.md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 8], 11, -2022574463);
_local3 = this.md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 11], 16, 1839030562);
_local4 = this.md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 14], 23, -35309556);
_local5 = this.md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 1], 4, -1530992060);
_local2 = this.md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 4], 11, 1272893353);
_local3 = this.md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 7], 16, -155497632);
_local4 = this.md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 10], 23, -1094730640);
_local5 = this.md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 13], 4, 681279174);
_local2 = this.md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 0], 11, -358537222);
_local3 = this.md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 3], 16, -722521979);
_local4 = this.md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 6], 23, 76029189);
_local5 = this.md5_hh(_local5, _local4, _local3, _local2, x[_local6 + 9], 4, -640364487);
_local2 = this.md5_hh(_local2, _local5, _local4, _local3, x[_local6 + 12], 11, -421815835);
_local3 = this.md5_hh(_local3, _local2, _local5, _local4, x[_local6 + 15], 16, 530742520);
_local4 = this.md5_hh(_local4, _local3, _local2, _local5, x[_local6 + 2], 23, -995338651);
_local5 = this.md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 0], 6, -198630844);
_local2 = this.md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 7], 10, 1126891415);
_local3 = this.md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 14], 15, -1416354905);
_local4 = this.md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 5], 21, -57434055);
_local5 = this.md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 12], 6, 1700485571);
_local2 = this.md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 3], 10, -1894986606);
_local3 = this.md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 10], 15, -1051523);
_local4 = this.md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 1], 21, -2054922799);
_local5 = this.md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 8], 6, 1873313359);
_local2 = this.md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 15], 10, -30611744);
_local3 = this.md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 6], 15, -1560198380);
_local4 = this.md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 13], 21, 1309151649);
_local5 = this.md5_ii(_local5, _local4, _local3, _local2, x[_local6 + 4], 6, -145523070);
_local2 = this.md5_ii(_local2, _local5, _local4, _local3, x[_local6 + 11], 10, -1120210379);
_local3 = this.md5_ii(_local3, _local2, _local5, _local4, x[_local6 + 2], 15, 718787259);
_local4 = this.md5_ii(_local4, _local3, _local2, _local5, x[_local6 + 9], 21, -343485551);
_local5 = this.safe_add(_local5, _local11);
_local4 = this.safe_add(_local4, _local10);
_local3 = this.safe_add(_local3, _local9);
_local2 = this.safe_add(_local2, _local8);
_local6 = _local6 + 16;
}
var _local14 = Array(_local5, _local4, _local3, _local2);
return(_local14);
};
MD5.md5_cmn = function (q, a, b, x, s, t) {
var _local2 = this.safe_add(this.bit_rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s), b);
return(_local2);
};
MD5.md5_ff = function (a, b, c, d, x, s, t) {
return(this.md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
};
MD5.test = function () {
};
MD5.md5_gg = function (a, b, c, d, x, s, t) {
return(this.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
};
MD5.md5_hh = function (a, b, c, d, x, s, t) {
return(this.md5_cmn((b ^ c) ^ d, a, b, x, s, t));
};
MD5.md5_ii = function (a, b, c, d, x, s, t) {
return(this.md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
};
MD5.core_hmac_md5 = function (key, data) {
var _local3 = this.str2binl(key);
if (_local3.length > 16) {
_local3 = this.core_md5(_local3, key.length * this.chrsz);
}
var _local4 = Array(16);
var _local5 = Array(16);
var _local2 = 0;
while (_local2 < 16) {
_local4[_local2] = _local3[_local2] ^ 909522486;
_local5[_local2] = _local3[_local2] ^ 1549556828;
_local2++;
}
var _local6 = this.core_md5(_local4.concat(this.str2binl(data)), 512 + (data.length * this.chrsz));
return(this.core_md5(_local5.concat(_local6), 640));
};
MD5.safe_add = function (x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
};
MD5.bit_rol = function (num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
};
MD5.str2binl = function (str) {
var _local3 = Array();
var _local4 = (1 << this.chrsz) - 1;
var _local5 = str.length * this.chrsz;
var _local2 = 0;
while (_local2 < _local5) {
_local3[_local2 >> 5] = _local3[_local2 >> 5] | ((str.charCodeAt(_local2 / this.chrsz) & _local4) << (_local2 & 31));
_local2 = _local2 + this.chrsz;
}
return(_local3);
};
MD5.binl2str = function (bin) {
var _local3 = "";
var _local4 = (1 << this.chrsz) - 1;
var _local5 = bin.length * 32;
var _local2 = 0;
while (_local2 < _local5) {
_local3 = _local3 + String.fromCharCode((bin[_local2 >> 5] >>> (_local2 & 31)) & _local4);
_local2 = _local2 + this.chrsz;
}
return(_local3);
};
MD5.binl2hex = function (binarray) {
var _local3 = (this.hexcase ? "0123456789ABCDEF" : "0123456789abcdef");
var _local5 = "";
var _local6 = binarray.length * 4;
var _local2 = 0;
while (_local2 < _local6) {
_local5 = _local5 + (_local3.charAt((binarray[_local2 >> 2] >> (((_local2 & 3) * 8) + 4)) & 15) + _local3.charAt((binarray[_local2 >> 2] >> ((_local2 & 3) * 8)) & 15));
_local2++;
}
return(_local5);
};
MD5.binl2b64 = function (binarray) {
var _local9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var _local6 = "";
var _local7 = binarray.length * 4;
var _local8 = 4 * _local7;
var _local2 = 0;
while (_local2 < _local7) {
var _local5 = ((((binarray[_local2 >> 2] >> (8 * (_local2 & 3))) & 255) << 16) | (((binarray[(_local2 + 1) >> 2] >> (8 * ((_local2 + 1) & 3))) & 255) << 8)) | ((binarray[(_local2 + 2) >> 2] >> (8 * ((_local2 + 2) & 3))) & 255);
_local2 = _local2 + 3;
}
var _local3 = 0;
while (_local3 < 4) {
if (((_local2 * 8) + (_local3 * 6)) > _local8) {
_local6 = _local6 + this.b64pad;
} else {
_local6 = _local6 + _local9.charAt((_local5 >> (6 * (3 - _local3))) & 63);
}
_local3++;
}
return(_local6);
};
_global.scriptURL = "http://liono.teamrubber.com/rubber_client_work/hole_in_one/";
_global.loadMethod = "POST";
_global.firstRun = true;
_global.holeInOne = false;
preload(preload_mc, "splash", 100);
stop();
Frame 15
setupSplash(levelSelect_mc, "game", 2);
stop();
Instance of Symbol 59 MovieClip in Frame 21
onClipEvent (load) {
this.frameIndex = 0;
this.frames = [1, 15, 30];
this.targetFrame = 1;
this.dir = true;
this.active = false;
this.onEnterFrame = function () {
if (this.active) {
if (this.dir) {
if (this._currentframe == this.targetFrame) {
this.active = false;
} else if (this._currentframe == this._totalframes) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(this._currentframe + 1);
}
} else if (this._currentframe == this.targetFrame) {
this.active = false;
} else if (this._currentframe == 1) {
this.gotoAndStop(this._totalframes);
} else {
this.gotoAndStop(this._currentframe - 1);
}
}
};
this.goNextForward = function () {
if (!this.active) {
this.frameIndex++;
if (this.frameIndex > (this.frames.length - 1)) {
this.frameIndex = 0;
}
this.targetFrame = this.frames[this.frameIndex];
this.dir = true;
this.active = true;
}
};
this.goNextBack = function () {
if (!this.active) {
this.frameIndex--;
if (this.frameIndex < 0) {
this.frameIndex = this.frames.length - 1;
}
this.targetFrame = this.frames[this.frameIndex];
this.dir = false;
this.active = true;
}
};
}
Frame 43
var frames = [3, 2, 1];
disc_mc.gotoAndPlay(frames[_global.gameLevel]);
bonus_mc._visible = false;
play();
Frame 44
this.objs.game.destroy();
delete this.objs.game;
play();
Frame 45
setup();
faster_mc.onRelease = function () {
_root.objs.game.objs.rotator.faster();
};
slower_mc.onRelease = function () {
_root.objs.game.objs.rotator.slower();
};
stop();
Frame 53
setupFeedback(this, playNewHole_mc, winATreo_mc, challengeBut_mc, challenge_mc, fb_mc, scoresAndRank_mc, findOutMore_mc);
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 258 MovieClip [__Packages.com.rubberductions.SoundManager] Frame 0
class com.rubberductions.SoundManager
{
var linkList, tl, soundHolder, fadeList, panList, volume, sounds, playFlag, playList, currentPlayListSound, EOFlistener;
function SoundManager (tl, linkList) {
this.linkList = linkList;
this.tl = tl;
soundHolder = null;
fadeList = [];
panList = [];
volume = 100;
sounds = {};
playFlag = true;
playList = [];
currentPlayListSound = null;
EOFlistener = null;
setupSounds();
setNewVolume(volume);
}
function setupSounds() {
soundHolder = tl.soundHolder_mc;
soundHolder.cb = this;
soundHolder.onEnterFrame = function () {
this.cb.doLoop();
};
var _local3 = 0;
while (_local3 < linkList.length) {
var _local2 = linkList[_local3];
soundHolder.createEmptyMovieClip(_local2, 999 + _local3);
sounds[_local2] = new Sound(soundHolder[_local2]);
sounds[_local2].attachSound(_local2);
trace(((">>> sound '" + _local2) + "' duration is ") + sounds[_local2].duration);
_local3++;
}
}
function endOfPlayListSubscribe(obj) {
EOFlistener = obj;
}
function addToPlayList(linkName) {
playList.push(linkName);
}
function addArrayToPlayList(links) {
var _local2 = 0;
while (_local2 < links.length) {
playList.push(links[_local2]);
_local2++;
}
}
function playListKickIfEmpty() {
if (playList.length == 0) {
playListKick();
}
}
function playListKick() {
if (playList.length > 0) {
var _local2 = playList.shift();
sounds[_local2].cb = this;
sounds[_local2].onSoundComplete = function () {
this.playing = false;
this.cb.endOfSound();
};
currentPlayListSound = sounds[_local2];
currentPlayListSound.link = _local2;
playSound(_local2, 0, false);
} else {
EOFlistener.endOfPlayList();
EOFlistener = null;
}
}
function stopAndEmptyPlayList() {
if (playList.length > 0) {
for (var _local2 in playList) {
playList[_local2].stop();
playList[_local2].playing = false;
}
playList = [];
}
currentPlayListSound.stop();
currentPlayListSound.playing = false;
currentPlayListSound = null;
}
function endOfSound() {
trace("end of sound " + currentPlayListSound.link);
currentPlayListSound.onSoundComplete = null;
currentPlayListSound.playing = false;
playListKick();
}
function doLoop() {
for (var _local2 in fadeList) {
if (fadeSound(fadeList[_local2])) {
delete fadeList[_local2];
}
}
for (var _local2 in panList) {
if (panSound(panList[_local2])) {
delete panList[_local2];
}
}
}
function playSound(linkname, loop, setOnComplete) {
if (playFlag && (!sounds[linkname].playing)) {
if (loop == undefined) {
loop = 0;
}
if (setOnComplete == undefined) {
setOnComplete = true;
}
if (setOnComplete) {
sounds[linkname].onSoundComplete = function () {
this.playing = false;
delete this.onSoundComplete;
};
}
sounds[linkname].start(0, loop);
sounds[linkname].playing = true;
}
}
function stopSound(linkname) {
sounds[linkname].stop(linkname);
sounds[linkname].playing = false;
sounds[linkname].onSoundComplete = null;
}
function setNewVolume(theVol_num, linkname) {
if (linkname == undefined) {
for (var _local3 in sounds) {
trace("set volume " + theVol_num);
sounds[_local3].setVolume(theVol_num);
}
} else {
sounds[linkname].setVolume(theVol_num);
}
}
function fadeSound(obj) {
obj.curVol = obj.curVol + obj.volInc;
if (obj.volInc < 0) {
if (obj.curVol <= obj.fadeTo) {
setNewVolume(obj.fadeTo, obj.linkName);
obj = null;
return(true);
}
setNewVolume(obj.curVol, obj.linkName);
return(false);
}
if (obj.volInc > 0) {
if (obj.curVol >= obj.fadeTo) {
setNewVolume(obj.fadeTo, obj.linkName);
obj = null;
return(true);
}
setNewVolume(obj.curVol, obj.linkName);
return(false);
}
obj = null;
return(true);
}
function setSoundState(flag) {
playFlag = flag;
if (playFlag) {
setNewVolume(100);
} else {
setNewVolume(0);
}
}
function setupAfade(linkName, fadeTo, inc) {
fadeList[linkName] = {linkName:linkName, curVol:sounds[linkName].getVolume(), volInc:inc, fadeTo:fadeTo};
}
function cancelFade(linkName) {
delete fadeList[linkName];
}
function fadeOutAllSounds() {
for (var _local2 in sounds) {
setupAfade(_local2, 0, -25);
}
}
function setNewPan(thePan_num, linkname) {
if (linkname == undefined) {
for (var _local3 in sounds) {
trace("set pan " + thePan_num);
sounds[_local3].setPan(thePan_num);
}
} else {
sounds[linkname].setPan(thePan_num);
}
}
function panSound(obj) {
obj.curPan = obj.curPan + obj.panInc;
if (obj.panInc < 0) {
if (obj.curPan <= obj.fadeTo) {
setNewPan(obj.fadeTo, obj.linkName);
obj = null;
return(true);
}
setNewPan(obj.curVol, obj.linkName);
return(false);
}
if (obj.panInc > 0) {
if (obj.curPan >= obj.fadeTo) {
setNewPan(obj.fadeTo, obj.linkName);
obj = null;
return(true);
}
setNewPan(obj.curPan, obj.linkName);
return(false);
}
obj = null;
return(true);
}
function setupAPan(linkName, fadeTo, inc) {
panList[linkName] = {linkName:linkName, curPan:sounds[linkName].getPan(), panInc:inc, fadeTo:fadeTo};
}
function cancelPan(linkName) {
delete panList[linkName];
}
}
Symbol 259 MovieClip [__Packages.com.rubberductions.Utils] Frame 0
class com.rubberductions.Utils
{
function Utils () {
}
static function calcAngle(x1, y1, x2, y2) {
var _local3 = x2 - x1;
var _local2 = y2 - y1;
var _local1 = 0;
if (_local3 == 0) {
if (_local2 == 0) {
_local1 = 0;
} else if (_local2 > 0) {
_local1 = (Math.PI/2);
} else {
_local1 = 4.71238898038469;
}
} else if (_local2 == 0) {
if (_local3 > 0) {
_local1 = 0;
} else {
_local1 = Math.PI;
}
} else {
if (_local3 < 0) {
_local1 = Math.atan(_local2 / _local3) + Math.PI;
} else if (_local2 < 0) {
_local1 = Math.atan(_local2 / _local3) + (Math.PI*2);
} else {
_local1 = Math.atan(_local2 / _local3);
}
_local1 = (_local1 * 180) / Math.PI;
return(_local1);
}
}
static function readLSO(lsoName, prop) {
if (lsoName != undefined) {
var _local1 = SharedObject.getLocal(lsoName);
if (_local1.data[prop] == undefined) {
return("");
}
return(_local1.data[prop]);
}
}
static function writeLSO(lsoName, prop, stuff) {
var _local1 = SharedObject.getLocal(lsoName);
_local1.data[prop] = stuff;
_local1.data.flush();
}
static function randomRange(from, to) {
return(Math.round(Math.random() * (to - from)) + from);
}
}
Symbol 260 MovieClip [__Packages.com.rubberductions.Game] Frame 0
class com.rubberductions.Game
{
var tl, objs, clips, loopers, enterFrameID, currentLevel, levels, bonusIdx, bonusClips, gotBonus;
function Game (tl, ball, rotator, gameLevel) {
this.tl = tl;
objs = {};
clips = {};
loopers = {};
enterFrameID = 0;
currentLevel = gameLevel;
levels = [];
bonusIdx = 0;
bonusClips = [];
gotBonus = false;
setup(ball, rotator, gameLevel);
}
function setupLevels() {
levels = (_global.levels = [{friction:0.982, bgFrame:3, holes:3, scores:[100, 200, 300]}, {friction:0.998, bgFrame:2, holes:3, scores:[100, 200, 300]}, {friction:0.985, bgFrame:1, holes:3, scores:[100, 200, 300]}]);
}
function buildBonusClips() {
var _local4 = tl.bonus_mc;
_local4.gotoAndStop(levels[currentLevel].bgFrame);
_local4._visible = true;
var _local2 = 0;
while (_local2 < levels[currentLevel].holes) {
var _local3 = _local4[("bonus_" + _local2) + "_mc"];
_local3._visible = false;
bonusClips.push(_local3);
_local2++;
}
}
function setupBonus() {
_root.debug();
buildBonusClips();
bonusIdx = com.rubberductions.Utils.randomRange(0, bonusClips.length - 1);
var _local3 = bonusClips[bonusIdx];
trace(_local3);
trace("mmoooooo");
_local3._visible = true;
}
function checkBonus(idx) {
if (idx == bonusIdx) {
bonusClips[bonusIdx].play();
gotBonus = true;
}
}
function setup(ball, rotator, gameLevel) {
_global.score = 0;
_global.snd.playSound("bg", 9999);
setupLevels();
setupBonus();
var _local4 = levels[currentLevel].bgFrame;
tl.disc_mc.gotoAndStop(_local4);
clips.looper = tl.createEmptyMovieClip("loop_mc", tl.getNextHighestDepth());
clips.looper.cb = this;
clips.looper.onEnterFrame = function () {
this.cb.doLoop();
};
var _local3 = buildHoles(levels[currentLevel].holes);
objs.ball = new com.rubberductions.Ball(tl, ball, this, levels[currentLevel].friction, _local3);
objs.rotator = new com.rubberductions.Rotator(tl, rotator, this, tl.multiplier_tf);
objs.timer = new com.rubberductions.Timer(tl.time_tf, 60, this);
objs.powerBar = new com.rubberductions.PowerBar(tl.power_mc, [2.5, 14], this);
objs.timer.start();
}
function buildHoles(num) {
var _local3 = [];
var _local2 = 1;
while (_local2 <= num) {
_local3.push(tl.platform_mc[("hole" + _local2) + "_mc"]);
_local2++;
}
return(_local3);
}
function destroy() {
cleanUp();
for (var _local2 in objs) {
delete objs[_local2];
}
for (var _local2 in loopers) {
delete loopers[_local2];
}
clips.looper.removeMovieClip();
}
function enterFrameSubscribe(obj) {
enterFrameID++;
loopers[enterFrameID] = obj;
return(enterFrameID);
}
function enterFrameUnsubscribe(id) {
delete loopers[id];
}
function calcPotentialPoints() {
var _local2 = calcBaseScore(false) * 2;
tl.potentialPoints_txt.text = _local2;
}
function doLoop() {
calcPotentialPoints();
for (var _local2 in loopers) {
loopers[_local2].doLoop();
}
}
function setBallPower(power) {
_global.snd.playSound("hit");
objs.rotator.enableSpeedChange(false);
objs.ball.setSpeed(power);
}
function outOfTime() {
cleanUp();
_global.holeInOne = false;
tl.gotoAndStop("feedback");
trace("game over out of time");
}
function calcBaseScore(real) {
var _local6 = objs.rotator.getMultiVal();
var _local4 = objs.ball.getSunkHole();
var _local3 = objs.timer.getMSremaining();
var _local5 = Math.round(_local3 / 1000);
var _local2;
if (real) {
_local2 = levels[currentLevel].scores[_local4];
} else {
_local2 = levels[currentLevel].scores[levels[currentLevel].holes - 1];
}
return(_local6 * (_local2 + _local5));
}
function endOfPlay(obj) {
trace("end of game");
trace("success was: " + obj.returnSuccess());
objs.rotator.putDiskLow();
if (obj.returnSuccess()) {
var _local4 = calcBaseScore(true);
_root.debug();
if (gotBonus) {
_global.gotBonus = true;
_local4 = _local4 * 2;
} else {
_global.gotBonus = false;
}
_global.score = _local4;
trace("SCORE IS: " + _local4);
cleanUp();
_global.holeInOne = true;
tl.gotoAndStop("feedback");
} else {
objs.ball.reset();
objs.powerBar.reset();
objs.rotator.enableSpeedChange(true);
}
}
function cleanUp() {
objs.ball.stop();
objs.rotator.stop();
objs.timer.stop();
objs.powerBar.stop();
for (var _local2 in objs) {
objs[_local2].cleanUp();
}
}
function initPanel(pType) {
_global.snd.stopSound("bg");
tl.eogPanel_mc._x = 0;
tl.eogPanel_mc._y = 0;
tl.eogPanel_mc.gotoAndStop(pType);
tl.eogPanel_mc.bg_but.useHandCursor = false;
if (pType == "holeInOne") {
setupHolePanel(tl.eogPanel_mc);
} else {
setupOutOfTimePanel(tl.eogPanel_mc);
}
}
function setupHolePanel(clip) {
clip.okbut_mc.cb = this;
clip.okbut_mc.onRelease = function () {
this.cb.tl.gotoAndStop("feedback");
};
}
function setupOutOfTimePanel(clip) {
clip.restartBut_mc.cb = this;
clip.restartBut_mc.onRelease = function () {
this.cb.tl.gotoAndPlay("game");
};
clip.changeLevelBut_mc.cb = this;
clip.changeLevelBut_mc.onRelease = function () {
this.cb.tl.gotoAndPlay("splash");
};
}
}
Symbol 261 MovieClip [__Packages.com.rubberductions.Ball] Frame 0
class com.rubberductions.Ball
{
var tl, clip, game, efID, levelFriction, platformMC, holes, sunkHole, sunkIndex, ballClipProps, friction, state, speed, vectors, angle, rads, sinkAngle, success;
function Ball (tl, clip, tGame, friction, holes) {
this.tl = tl;
this.clip = clip;
game = tGame;
efID = -1;
levelFriction = friction;
platformMC = this.tl.platform_mc;
this.holes = holes;
sunkHole = null;
sunkIndex = null;
ballClipProps = {};
setupBallProps();
reset();
setup();
}
function setupBallProps() {
var _local2 = ["_x", "_y", "_xscale", "_yscale", "_alpha"];
for (var _local3 in _local2) {
ballClipProps[_local2[_local3]] = clip[_local2[_local3]];
}
}
function restoreBallProps() {
var _local2 = ["_x", "_y", "_xscale", "_yscale", "_alpha"];
for (var _local3 in _local2) {
clip[_local2[_local3]] = ballClipProps[_local2[_local3]];
}
}
function reset() {
friction = levelFriction;
state = "";
speed = 0;
vectors = {x:0, y:0};
angle = 0;
rads = 0;
sinkAngle = 0;
success = false;
restoreBallProps();
}
function setup() {
efID = game.enterFrameSubscribe(this);
}
function getSunkHole() {
return(sunkIndex);
}
function setSpeed(num) {
speed = num;
state = "start";
setAngle(-90);
}
function stop() {
state = "";
}
function checkStandStill() {
var _local2 = 0.2;
if (((vectors.x <= _local2) && (vectors.x >= (-_local2))) && ((vectors.y <= _local2) && (vectors.y >= (-_local2)))) {
return(true);
}
return(false);
}
function checkPlatformCollision() {
var _local6 = angle - 180;
var _local3 = (_local6 * Math.PI) / 180;
var _local5 = clip._width / 4;
var _local4 = {x:(_local5 * Math.cos(_local3)) + clip._x, y:(_local5 * Math.sin(_local3)) + clip._y};
if (platformMC.hitTest(_local4.x, _local4.y, true)) {
return(true);
}
_global.snd.playSound("fall");
return(false);
}
function setAngle(angle) {
this.angle = angle;
rads = (this.angle * Math.PI) / 180;
vectors.x = speed * Math.cos(rads);
vectors.y = speed * Math.sin(rads);
}
function setVector(x, y) {
vectors.x = x;
vectors.y = y;
}
function returnSuccess() {
return(success);
}
function doRotMove() {
speed = speed * friction;
angle = game.objs.rotator.getClip()._rotation;
rads = (angle * Math.PI) / 180;
vectors.x = speed * Math.cos(rads);
vectors.y = speed * Math.sin(rads);
clip._x = clip._x + vectors.x;
clip._y = clip._y + vectors.y;
}
function doNormalMove() {
speed = speed * friction;
rads = (angle * Math.PI) / 180;
vectors.x = speed * Math.cos(rads);
vectors.y = speed * Math.sin(rads);
clip._x = clip._x + vectors.x;
clip._y = clip._y + vectors.y;
}
function doLoop() {
if (state != "") {
var _local3 = game.objs.rotator.getClip();
}
var _local6 = {x:clip._x, y:clip._y};
var _local4 = (angle * Math.PI) / 180;
var _local5 = clip._width / 2;
var _local2 = {x:(_local5 * Math.cos(_local4)) + clip._x, y:(_local5 * Math.sin(_local4)) + clip._y};
clip._parent.dot1_mc._x = _local2.x;
clip._parent.dot1_mc._y = _local2.y;
switch (state) {
case "start" :
doStartState(_local3, _local2);
break;
case "onRotator" :
doOnRotatorState(_local3);
break;
case "postRoll" :
doPostRollState();
break;
case "bounce" :
doBounceState();
break;
case "putted" :
doPuttedState();
break;
case "falling" :
doFallingState();
break;
case "end" :
doEndState();
break;
}
}
function doStartState(rotProxy, proj) {
if (checkStandStill()) {
state = "end";
}
if (rotProxy.topWall_mc.hitTest(proj.x, proj.y, true)) {
_global.snd.playSound("bounce");
angle = angle * -1;
state = "bounce";
} else if (rotProxy.bottomWall_mc.hitTest(proj.x, proj.y, true)) {
_global.snd.playSound("bounce");
trace("hit wall");
angle = angle * -1;
state = "bounce";
} else if (rotProxy.proxy_mc.hitTest(proj.x, proj.y, true)) {
if (checkStandStill()) {
state = "end";
}
state = "onRotator";
game.objs.rotator.flipRightdirection();
game.objs.rotator.setMarkerPos(clip._x, clip._y);
doLoop();
} else {
doNormalMove();
}
}
function doOnRotatorState(rotProxy) {
if (checkStandStill()) {
state = "end";
}
var _local2 = game.objs.rotator.getMarkerPos();
clip._x = _local2.x;
clip._y = _local2.y;
doRotMove();
game.objs.rotator.setMarkerPos(clip._x, clip._y);
if (!rotProxy.end_mc.hitTest(clip._x, clip._y, true)) {
} else {
state = "postRoll";
game.objs.rotator.putDiskHigh();
}
}
function doPostRollState() {
if (checkStandStill()) {
state = "end";
}
doNormalMove();
var _local7 = true;
for (var _local8 in holes) {
if (holes[_local8].hitTest(clip._x, clip._y, true)) {
_global.snd.playSound("putt");
_local7 = false;
sunkHole = holes[_local8];
sunkIndex = _local8;
state = "putted";
success = true;
var _local3 = {x:sunkHole._x, y:sunkHole._y};
platformMC.localToGlobal(_local3);
angle = com.rubberductions.Utils.calcAngle(clip._x, clip._y, _local3.x, _local3.y);
speed = 1;
var _local4 = clip._x - _local3.x;
rads = (angle * Math.PI) / 180;
vectors.x = speed * Math.cos(rads);
vectors.y = speed * Math.sin(rads);
friction = 1;
game.checkBonus(_local8);
break;
}
}
if (_local7) {
if (!checkPlatformCollision()) {
state = "falling";
}
}
}
function doBounceState() {
if (checkStandStill()) {
state = "end";
}
if (checkPlatformCollision()) {
doNormalMove();
if (checkStandStill()) {
state = "end";
}
} else {
state = "falling";
}
}
function doPuttedState() {
if (clip._alpha > 50) {
doNormalMove();
clip._alpha = clip._alpha - 10;
clip._xscale = (clip._yscale = clip._yscale - 10);
} else {
state = "end";
}
}
function doFallingState() {
friction = 0.7;
if (clip._xscale > 0) {
doNormalMove();
var _local2 = 10;
clip._xscale = (clip._yscale = clip._yscale - _local2);
clip._alpha = clip._alpha - 4;
} else {
state = "end";
}
}
function doEndState() {
state = "ended";
game.endOfPlay(this);
}
}
Symbol 262 MovieClip [__Packages.com.rubberductions.Rotator] Frame 0
class com.rubberductions.Rotator
{
var tl, clip, curDiskDepth, rotation, game, active, speedLock, field, multiInc, multiVal, efID;
function Rotator (tl, clip, tGame, multiField) {
this.tl = tl;
this.clip = clip;
curDiskDepth = this.clip._parent.disc_mc.getDepth();
rotation = 0.4;
game = tGame;
active = true;
speedLock = true;
field = multiField;
multiInc = 5;
multiVal = 1;
setup();
}
function setup() {
clip._parent.disc_mc._rotation = clip._rotation;
efID = game.enterFrameSubscribe(this);
setMultiVal();
}
function stop() {
putDiskLow();
active = false;
}
function getClip() {
return(clip);
}
function setMultiVal() {
field.text = multiVal;
}
function getMultiVal() {
return(multiVal);
}
function enableSpeedChange(val) {
if (val != undefined) {
speedLock = val;
}
}
function putDiskLow() {
clip._parent.disc_mc.swapDepths(curDiskDepth);
}
function putDiskHigh() {
clip._parent.disc_mc.swapDepths(9999);
}
function faster() {
if (speedLock) {
rotation = rotation + 0.2;
if (rotation > 4.6) {
rotation = 4.6;
} else {
trace("this.rotation: " + rotation);
if (multiVal == 1) {
multiVal = 0;
}
multiVal = multiVal + multiInc;
setMultiVal();
}
}
}
function slower() {
if (speedLock) {
rotation = rotation - 0.2;
if (rotation < 0.4) {
rotation = 0.4;
}
multiVal = multiVal - multiInc;
if (multiVal <= 0) {
multiVal = 1;
}
setMultiVal();
}
}
function flipRightdirection() {
if (clip._rotation > 50) {
clip._rotation = clip._rotation - 180;
}
}
function doLoop() {
if (active) {
clip._rotation = clip._rotation + rotation;
clip._parent.disc_mc._rotation = clip._parent.disc_mc._rotation + rotation;
}
}
function setRotation(rot) {
rotation = rot;
}
function getMarkerPos() {
var _local2 = new Object();
_local2.x = clip.marker_mc._x;
_local2.y = clip.marker_mc._y;
clip.localToGlobal(_local2);
return(_local2);
}
function setMarkerPos(tx, ty) {
var _local2 = {x:tx, y:ty};
clip.globalToLocal(_local2);
clip.marker_mc._x = _local2.x;
clip.marker_mc._y = _local2.y;
}
}
Symbol 263 MovieClip [__Packages.com.rubberductions.Timer] Frame 0
class com.rubberductions.Timer
{
var startTime, totalTime, timeField, gameRef, elapsedMS, currentTime, state, efID;
function Timer (tf, totalTime, gr) {
startTime = new Date().getTime();
this.totalTime = totalTime * 1000;
timeField = tf;
gameRef = gr;
elapsedMS = 0;
currentTime = startTime;
state = false;
setup();
}
function setup() {
var _local2 = Math.round(totalTime / 1000);
timeField.text = _local2;
}
function start() {
state = true;
efID = gameRef.enterFrameSubscribe(this);
startTime = new Date().getTime();
}
function stop() {
gameRef.enterFrameUnsubscribe(efID);
}
function getMSremaining() {
return(totalTime - elapsedMS);
}
function doLoop() {
currentTime = new Date().getTime();
elapsedMS = currentTime - startTime;
var _local2 = Math.round(totalTime / 1000) - Math.round(elapsedMS / 1000);
if (_local2 <= 0) {
gameRef.outOfTime();
_local2 = 0;
gameRef.enterFrameUnsubscribe(efID);
}
timeField.text = _local2;
}
}
Symbol 264 MovieClip [__Packages.com.rubberductions.PowerBar] Frame 0
class com.rubberductions.PowerBar
{
var clip, topRange, botRange, gameRef, power, state, efID, curFrame, frameInc, frameDir;
function PowerBar (clip, range, gameRef) {
this.clip = clip;
topRange = range[1];
botRange = range[0];
this.gameRef = gameRef;
reset();
}
function reset() {
power = 0;
state = "idle";
efID = -1;
curFrame = 1;
frameInc = 4;
frameDir = true;
clip.gotoAndStop(1);
setup();
}
function setup() {
efID = gameRef.enterFrameSubscribe(this);
Key.addListener(this);
}
function stop() {
gameRef.enterFrameUnsubscribe(efID);
cleanUp();
}
function cleanUp() {
Key.removeListener(this);
}
function onKeyDown() {
if (state == "idle") {
state = "holdPower";
var _local2 = curFrame;
var _local3 = topRange - botRange;
power = (_local3 / 100) * _local2;
trace(power);
}
}
function onKeyUp() {
if (state == "holdPower") {
gameRef.setBallPower(power);
state = "end";
stop();
}
}
function doLoop() {
if (state == "idle") {
if (frameDir) {
curFrame = curFrame + frameInc;
if (curFrame >= clip._totalframes) {
frameDir = !frameDir;
curFrame = clip._totalframes;
}
} else {
curFrame = curFrame - frameInc;
if (curFrame <= 1) {
frameDir = !frameDir;
curFrame = 1;
}
}
clip.gotoAndStop(curFrame);
}
}
}
Symbol 29 MovieClip Frame 1
this._visible = false;
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 15
stop();
Symbol 70 MovieClip Frame 11
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 5
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 5
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 5
stop();
Symbol 105 MovieClip Frame 15
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 1
stop();
Selection.setFocus("emailInput_txt");
Symbol 231 MovieClip Frame 8
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 15
stop();
Symbol 239 MovieClip Frame 1
stop();
Symbol 250 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 1
stop();