Frame 2
function goSite(menu, obj) {
if (_level0.cs) {
_level0.cs.track.url.open("http://www.cityofember.com");
} else {
getURL ("http://www.cityofember.com", "_blank");
}
}
function goSoap(menu, obj) {
if (_level0.cs) {
_level0.cs.track.url.open("http://www.soap.com.au");
} else {
getURL ("http://www.soap.com.au", "_blank");
}
}
function qualityHigh() {
_quality = "high";
}
function qualityLow() {
_quality = "low";
}
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
var gameName = "flipit";
vNum = "1.02";
gameQuality = "AUTO";
_quality = "HIGH";
authorsSite = "http://www.terrypaton.com";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("Visit site", goSite));
menu_cm.customItems.push(new ContextMenuItem("Made by Soap", goSoap));
menu_cm.customItems.push(new ContextMenuItem("HIGH Quality", qualityHigh));
menu_cm.customItems.push(new ContextMenuItem("LOW Quality", qualityLow));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
this.scrollRect = new flash.geom.Rectangle(0, 0, 450, 360);
firstRun = true;
Frame 3
gameLoadingName = "flipit";
loadingClip.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
if (pL < 100) {
this.loaderText.textBox.text = ((pL / 100) * 100) + "%";
this.mask._xscale = (pL / 100) * 100;
this._parent.stop();
} else {
this._parent.play();
}
};
stringLength = gameLoadingName.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 160;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = gameLoadingName.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 5
function disableButtons() {
_global.allowButtonAction = false;
}
function enableButtons() {
_global.allowButtonAction = true;
}
function setupBtn(_clip) {
_clip.onRollOver = function () {
if (_global.allowButtonAction) {
playSound("mouseOver.wav");
gs.TweenMax.to(_clip, 0.5, {glowFilter:{color:16755714, blurX:5, blurY:5, alpha:1, inner:true}});
}
};
_clip.onRollOut = (_clip.onReleaseOutside = function () {
if (_global.allowButtonAction) {
gs.TweenMax.to(_clip, 0.25, {glowFilter:{color:16755714, blurX:0, blurY:0, alpha:0, inner:true}});
}
});
}
function goGame() {
gotoAndPlay (24);
}
function goHelp() {
_level0.cs.track.event("view_help");
gotoAndPlay (14);
}
function goChoose() {
gotoAndPlay (23);
}
function goHighscores() {
_level0.cs.track.event("view_highscores");
gotoAndPlay (25);
}
function goIntro() {
gotoAndPlay (7);
}
function evalMusicState() {
trace("soundState = " + soundState);
if (soundState) {
_soundControlsRef.sfxBtn.gotoAndStop(1);
flippingSequence.introPanel.soundControls2.sfxBtn.gotoAndStop(1);
mySound.setVolume(100);
} else {
mySound.setVolume(0);
_soundControlsRef.sfxBtn.gotoAndStop(2);
flippingSequence.introPanel.soundControls2.sfxBtn.gotoAndStop(2);
}
if (musicState) {
_soundControlsRef.musicBtn.gotoAndStop(1);
flippingSequence.introPanel.soundControls2.musicBtn.gotoAndStop(1);
} else {
_soundControlsRef.musicBtn.gotoAndStop(2);
flippingSequence.introPanel.soundControls2.musicBtn.gotoAndStop(2);
}
}
function evaluateNonGameHUD() {
_nonGameHUDRef.playBtn2.enabled = true;
_nonGameHUDRef.stfClip.enabled = true;
_nonGameHUDRef.howToPlay.enabled = true;
_nonGameHUDRef.highscoresBtnClip.enabled = true;
_nonGameHUDRef.mainMenuBtn.enabled = true;
_nonGameHUDRef.highscoresBtnClip._alpha = 100;
_nonGameHUDRef.stfClip._alpha = 100;
_nonGameHUDRef.playBtn2._alpha = 100;
_nonGameHUDRef.howToPlay._alpha = 100;
trace("currentGamePage:" + currentGamePage);
switch (currentGamePage) {
case "INTRO" :
hideNonGameHUD();
break;
case "HIGHSCORES" :
_nonGameHUDRef.highscoresBtnClip.enabled = false;
_nonGameHUDRef.highscoresBtnClip._alpha = 40;
break;
case "STF" :
_nonGameHUDRef.stfClip.enabled = false;
_nonGameHUDRef.stfClip._alpha = 40;
break;
case "HOWTOPLAY" :
_nonGameHUDRef.howToPlay.enabled = false;
_nonGameHUDRef.howToPlay._alpha = 40;
break;
case "CHOOSE" :
_nonGameHUDRef.playBtn2.enabled = false;
_nonGameHUDRef.playBtn2._alpha = 40;
}
trace(_nonGameHUDRef.playBtn2);
}
function hideNonGameHUD() {
gs.TweenMax.to(_nonGameHUDRef, 0.25, {_alpha:0, onComplete:nonGameHUDInvs});
if (currentGamePage != "GAME") {
gs.TweenMax.to(_soundControlsRef, 0.25, {_alpha:0});
}
}
function showNonGameHUD() {
_nonGameHUDRef._visible = true;
gs.TweenMax.to(_nonGameHUDRef, 0.5, {_alpha:100});
_soundControlsRef._visible = true;
gs.TweenMax.to(_soundControlsRef, 0.5, {_alpha:100});
evaluateNonGameHUD();
}
function nonGameHUDInvs() {
_nonGameHUDRef._visible = false;
}
function openDoors() {
gs.TweenMax.to(doorsClip.door1Clip, doorSpeed * 0.2, {_y:102});
gs.TweenMax.to(doorsClip.door1Clip, doorSpeed * 0.5, {_x:-190, delay:doorSpeed * 0.2, overwrite:false});
gs.TweenMax.to(doorsClip.door2Clip, doorSpeed * 0.2, {_y:82});
gs.TweenMax.to(doorsClip.door2Clip, doorSpeed * 0.5, {_x:431, delay:doorSpeed * 0.2, overwrite:false});
}
function closeDoors() {
playSound("closingDoors.wav");
gs.TweenMax.to(doorsClip.door1Clip, doorSpeed * 0.5, {_x:24});
gs.TweenMax.to(doorsClip.door1Clip, doorSpeed * 0.2, {_y:92, delay:doorSpeed * 0.5, overwrite:false});
gs.TweenMax.to(doorsClip.door2Clip, doorSpeed * 0.5, {_x:216});
gs.TweenMax.to(doorsClip.door2Clip, doorSpeed * 0.2, {_y:92, delay:doorSpeed * 0.5, overwrite:false});
gs.TweenMax.to(doorsClip, doorSpeed * 0.7, {onComplete:createDoorSmoke});
}
function manageParticles() {
manageEmmiters();
n = particleArray.length;
while (n--) {
_particleRef = particleArray[n];
_particleRef.manageParticle();
if (_particleRef.getRemove()) {
removeMovieClip(_particleRef.getClip());
particleArray.splice(n, 1);
}
}
}
function removeClip(_clip) {
removeMovieClip(_clip);
}
function manageEmmiters() {
var _local1 = emmiterArray.length;
while (_local1--) {
_tempEmmiterClip = emmiterArray[_local1];
_type = _tempEmmiterClip.num;
if (_type == undefined) {
_type = 1;
}
createparticleSpray(_tempEmmiterClip._x, _tempEmmiterClip._y, _type);
if (_tempEmmiterClip.kill) {
removeMovieClip(_tempEmmiterClip);
emmiterArray.splice(_local1, 1);
}
}
}
function createparticleSpray(_px, _py, type) {
rot = Math.random() * 360;
speed = 4;
switch (type) {
case 1 :
speed = (Math.random() * 1) + 1;
createparticle(_px, _py, type, speed, rot);
break;
case 2 :
var _local4 = 10;
while (_local4--) {
speed = (Math.random() * 1) + 3;
rot = Math.random() * 360;
createparticle((_px + (Math.random() * 10)) - 5, (_py + (Math.random() * 10)) - 5, type, speed, rot);
}
break;
case 3 :
speed = 2;
_local4 = 10;
while (_local4--) {
speed = (2 + (Math.random() * 1)) - 0.5;
rot = Math.random() * 360;
createparticle(_px, _py, type, speed, rot);
}
break;
case 4 :
speed = 0.25;
rot = Math.random() * 360;
createparticle(_px, _py, type, speed, rot);
break;
case 5 :
if (Math.random() < 0.5) {
rot = (Math.random() * 20) - 90;
speed = (Math.random() * 0.5) + 0.5;
createparticle(_px, _py, type, speed, rot);
}
break;
case 6 :
if (Math.random() < 0.5) {
speed = (Math.random() * 1) + 1;
createparticle(_px, _py, 1, speed, rot);
}
break;
case 7 :
if (Math.random() >= 0.5) {
break;
}
rot = (Math.random() * 20) - 180;
speed = (Math.random() * 0.5) + 0.5;
createparticle(_px, _py, type, speed, rot);
}
}
function createparticle(_ptx, _pty, _ptype, _speed, _direction) {
_clip = particleHolder.attachMovie("particle", "p" + particleNum, particleNum);
particleNum++;
_clip.gotoAndStop(_ptype);
_particleRef = new particleClass(_ptx, _pty, _ptype, _speed, _direction, _clip);
particleArray.push(_particleRef);
_clip.cacheAsBitmap = true;
}
function flipClip(_clip) {
_clip.play();
}
storage = SharedObject.getLocal("switchWorks_storage", "/");
soundClipRef = this.createEmptyMovieClip("soundClip", 9801);
soundManager.setClip(soundClipRef);
mySound = new Sound(soundClipRef);
musicClipRef = this.createEmptyMovieClip("musicClip", 9901);
musicSound = new Sound(musicClipRef);
musicSound.attachSound("music.wav");
_global.drawLightning = function (point1, point2) {
if (random(10) < 9) {
dx = point1.x - point2.x;
dy = point1.y - point2.y;
dist = Math.floor(Math.sqrt((dx * dx) + (dy * dy)));
radians = Math.atan2(dy, dx);
theAngle = (radians * 180) / Math.PI;
line.clear();
line.lineStyle(5, 16777215, 100);
line.moveTo(point1.x, point1.y);
clipLevel = 10;
traveled = 0;
lineThickness = 5;
while (traveled < (dist - 30)) {
speed = random(2) + 20;
tmpAngle = (theAngle * Math.PI) / 180;
bx = traveled * Math.cos(tmpAngle);
by = traveled * Math.sin(tmpAngle);
traveled = traveled + speed;
theX = ((point1.x - bx) + random(30)) - 15;
theY = ((point1.y - by) + random(30)) - 15;
lineThickness = ((traveled / dist) * 10) + 1;
line.lineStyle(lineThickness, 16777215, 70);
line.lineTo(theX, theY);
createparticleSpray(theX, theY, 6);
clipLevel++;
}
line.lineTo(point2.x, point2.y);
}
};
musicState = storage.data.musicState;
trace("musicState = " + musicState);
if (musicState == undefined) {
storage.data.musicState = true;
musicState = true;
}
soundState = storage.data.soundState;
if (soundState == undefined) {
storage.data.soundState = true;
soundState = true;
}
_soundControlsRef = attachMovie("soundControls", "soundControls", 9997);
_soundControlsRef._x = 412;
_soundControlsRef._y = 46;
_soundControlsRef._alpha = 0;
evalMusicState();
musicSound.stop();
musicSound.start(0, 9999);
if (musicState) {
musicSound.setVolume(100);
_soundControlsRef.musicBtn.gotoAndStop(1);
} else {
musicSound.setVolume(0);
_soundControlsRef.musicBtn.gotoAndStop(2);
}
_soundControlsRef.sfxBtn._alpha = 0;
gs.TweenMax.to(_soundControlsRef.sfxBtn, 0.5, {_alpha:100, delay:0.2});
setupBaseButton(_soundControlsRef.sfxBtn);
setupBaseButton(_soundControlsRef.musicBtn);
_soundControlsRef.sfxBtn.onPress = function () {
soundState = !soundState;
storage.data.soundState = soundState;
evalMusicState();
};
_soundControlsRef.musicBtn.onPress = function () {
musicState = !musicState;
storage.data.musicState = musicState;
if (musicState) {
musicSound.setVolume(100);
_soundControlsRef.musicBtn.gotoAndStop(1);
} else {
musicSound.setVolume(0);
_soundControlsRef.musicBtn.gotoAndStop(2);
}
};
currentGamePage = "INTRO";
_nonGameHUDRef = attachMovie("nonGameHUD", "nonGameHUD", 9998);
_nonGameHUDRef._visible = false;
_nonGameHUDRef.playBtn2.onRelease = function () {
playSound("mouseDown.wav");
if (levelsUnlocked > 1) {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goChoose});
} else {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goGame});
}
};
_nonGameHUDRef.highscoresBtnClip.onRelease = function () {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goHighscores});
};
_nonGameHUDRef.howToPlay.onRelease = function () {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goHelp});
};
_nonGameHUDRef.mainMenuBtn.onRelease = function () {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goIntro});
};
_nonGameHUDRef.stfClip.onRelease = function () {
closeDoors();
gs.TweenMax.to(doorsClip, 1.5, {onComplete:goSTF});
};
setupBtn(_nonGameHUDRef.playBtn2);
setupBtn(_nonGameHUDRef.stfClip);
setupBtn(_nonGameHUDRef.howToPlay);
setupBtn(_nonGameHUDRef.highscoresBtnClip);
setupBtn(_nonGameHUDRef.mainMenuBtn);
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
levelsUnlocked = storage.data.levelsUnlocked;
if (levelsUnlocked == undefined) {
storage.data.levelsUnlocked = 1;
levelsUnlocked = 1;
}
_global.playSound = function (_string) {
if (soundState) {
soundManager.playSound(_string);
}
};
particleArray = new Array();
currentParticleType = 1;
particleNum = 1;
particleHolder = this.createEmptyMovieClip("particleHolder", 10000);
emmiterHolder = this.createEmptyMovieClip("emmiterHolder", 9999);
emmiterArray = new Array();
emmiterNum = 1;
particleInt = setInterval(manageParticles, 20);
Frame 6
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
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);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
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__("8b48794f", this, 10301, true);
Frame 7
function showIntroClip() {
flippingSequence._visible = true;
flippingToIntroSequence._visible = false;
}
function closeIntro() {
flippingSequence.gotoAndPlay(2);
}
function createDoorSmoke() {
playSound("doorClunk.wav");
var _local1 = 0;
while (_local1 < 30) {
if (Math.random() < 0.3) {
createparticleSpray(216, ((100 + (_local1 * 8.3)) + (Math.random() * 20)) - 10, 1);
}
if (Math.random() < 0.3) {
createparticleSpray(231, ((100 + (_local1 * 8.3)) + (Math.random() * 20)) - 10, 2);
}
if (_local1 < 16) {
createparticleSpray(216, 100 + (_local1 * 8.3), 4);
} else {
createparticleSpray(231, 100 + (_local1 * 8.3), 4);
}
_local1++;
}
}
function setupIntroButtons() {
setupBtn(flippingSequence.introPanel.howToPlay);
setupBtn(flippingSequence.introPanel.playBtnClip);
setupBtn(flippingSequence.introPanel.highscoresBtnClip);
setupBtn(flippingSequence.introPanel.visitOfficialSiteBtn);
setupBtn(flippingSequence.introPanel.embedBtn);
}
trace("intro");
flippingSequence.gotoAndStop(1);
if (firstRun) {
firstRun = false;
flippingToIntroSequence.gotoAndStop(1);
flippingToIntroSequence._visible = false;
} else {
flippingSequence._visible = false;
flippingToIntroSequence._visible = true;
gs.TweenMax.to(flippingToIntroSequence, 0.5, {onComplete:showIntroClip});
}
currentGamePage = "INTRO";
hideNonGameHUD();
doorSpeed = 1;
doorsClip.door1Clip._x = 24;
doorsClip.door1Clip._y = 92;
doorsClip.door2Clip._x = 216;
doorsClip.door2Clip._y = 92;
flippingSequence.introPanel.playBtnClip.onRelease = function () {
flippingSequence.onEnterFrame = null;
playSound("mouseDown.wav");
if (levelsUnlocked > 1) {
closeIntro();
gs.TweenMax.to(flippingSequence, 1.5, {onComplete:goChoose});
} else {
closeIntro();
gs.TweenMax.to(flippingSequence, 1.5, {onComplete:goChoose});
}
};
yourHighTextBox.text = yourhigh;
flippingSequence.introPanel.highscoresBtnClip.onRelease = function () {
flippingSequence.onEnterFrame = null;
playSound("mouseDown.wav");
closeIntro();
gs.TweenMax.to(flippingSequence, 1.5, {onComplete:goHighscores});
};
flippingSequence.introPanel.howToPlay.onRelease = function () {
flippingSequence.onEnterFrame = null;
playSound("mouseDown.wav");
closeIntro();
gs.TweenMax.to(flippingSequence, 1.5, {onComplete:goHelp});
};
flippingSequence.introPanel.visitOfficialSiteBtn.onRelease = function () {
flippingSequence.onEnterFrame = null;
playSound("mouseDown.wav");
if (_level0.cs) {
_level0.cs.track.url.open("http://www.cityofember.com");
}
};
flippingSequence.introPanel.embedBtn.onRelease = function () {
playSound("mouseDown.wav");
trace("embed game");
if (_level0.cs) {
_level0.cs.menu.show();
} else {
getURL ("http://www.cityofember.com", "_blank");
}
};
setupIntroButtons();
enableButtons();
highscoresBtnClip._x = 589;
flippingSequence.introPanel.soundControls2.sfxBtn.onPress = function () {
soundState = !soundState;
storage.data.soundState = soundState;
evalMusicState();
};
flippingSequence.introPanel.soundControls2.musicBtn.onPress = function () {
musicState = !musicState;
storage.data.musicState = musicState;
if (musicState) {
musicSound.setVolume(100);
} else {
musicSound.setVolume(0);
}
evalMusicState();
};
evalMusicState();
Frame 13
stop();
Frame 14
stop();
currentGamePage = "HOWTOPLAY";
showNonGameHUD();
openDoors();
Frame 22
stop();
helpText._alpha = 0;
gs.TweenMax.to(helpText, 0.5, {_alpha:100});
Frame 23
function setupChooseBtn(_clip) {
_clip.btn.onRollOver = function () {
if (_global.allowButtonAction) {
playSound("mouseOver.wav");
gs.TweenMax.to(_clip.btn, 0.5, {glowFilter:{color:16755714, blurX:5, blurY:5, alpha:1, inner:true}});
}
};
_clip.btn.onRollOut = (_clip.btn.onReleaseOutside = function () {
if (_global.allowButtonAction) {
gs.TweenMax.to(_clip.btn, 0.25, {glowFilter:{color:16755714, blurX:0, blurY:0, alpha:0, inner:true}});
}
});
_clip.btn.onPress = function () {
if (_global.allowButtonAction) {
playSound("mouseDown.wav");
}
};
}
function removeClip(_clip) {
removeMovieClip(_clip);
}
function exitChoose(temp) {
level = temp;
i = 0;
while (i < 51) {
_t = eval ("tileHolder.l" + i);
ty = Math.floor(i / 6);
tx = i - (ty * 6);
var delayTime = ((1 - (ty / 10)) - (tx / 10));
_t.onRollOver = null;
_t.onRollOut = null;
_t.onRelease = null;
i++;
}
gs.TweenMax.to(trailerClip, 0.5, {_y:52});
trailerClip.gotoAndPlay(2);
}
function videoFinished() {
if (musicState) {
musicSound.setVolume(100);
}
trailerClip.skipVideoBtn.onPress = null;
if (!videoSkipped) {
videoSkipped = true;
gs.TweenMax.to(tileHolder, 0.1, {onComplete:closeDoors});
gs.TweenMax.to(tileHolder, 2, {onComplete:goPlay, overwrite:false});
}
}
function goPlay() {
gotoAndPlay (24);
}
currentGamePage = "CHOOSE";
showNonGameHUD();
openDoors();
trailerClip.gotoAndStop(1);
trailerClip._y = -255;
if (levelsUnlocked == 1) {
level = 1;
musicTrack.stop();
exitChoose(1);
} else {
gs.TweenMax.to(chooseLevelClip, 0.5, {_x:-130, delay:2.2});
i = 0;
while (i < 36) {
ty = Math.floor(i / 6);
tx = i - (ty * 6);
_t = tileHolder.attachMovie("lvlBtn", "l" + i, i);
_t._x = -40;
gs.TweenMax.to(_t, 0.5, {_x:(105 + (tx * 40)) + 19, delay:(3 - ((ty + tx) / 7)) + 1});
_t._y = 118 + (ty * 40);
_t.num = i + 1;
if (i >= levelsUnlocked) {
_t.gotoAndStop("black");
} else {
_t.gotoAndStop("white");
setupChooseBtn(_t);
_t.btn.onRelease = function () {
exitChoose(this._parent.num);
};
}
if (i != (level - 1)) {
_t.ind._visible = false;
}
i++;
}
disableButtons();
gs.TweenMax.to(tileHolder, 3, {onComplete:enableButtons});
}
setupChooseBtn(trailerClip.skipVideoBtn);
trailerClip.skipVideoBtn.onPress = function () {
videoFinished();
};
videoSkipped = false;
stop();
Frame 24
function btnFunctions(_clip) {
_clip.onRollOver = function () {
gs.TweenMax.to(_clip, 0.5, {glowFilter:{color:16755714, blurX:5, blurY:5, alpha:1, inner:true}});
};
_clip.onRollOut = function () {
gs.TweenMax.to(_clip, 0.25, {glowFilter:{color:16755714, blurX:0, blurY:0, alpha:0, inner:true}});
};
}
function setupConfirmQuit() {
_confirmQuit = tileHolder.attachMovie("confirmQuit", "confirmQuit", 9900);
_confirmQuit.mouseCatcher.useHandCursor = false;
_confirmQuit._x = 558;
gs.TweenMax.to(_confirmQuit, 0.5, {_x:225});
_confirmQuit._y = 218;
btnFunctions(_confirmQuit.yesBtn);
btnFunctions(_confirmQuit.noBtn);
_confirmQuit.yesBtn.onRelease = function () {
gameState = "quit game";
};
_confirmQuit.noBtn.onRelease = function () {
gs.TweenMax.to(_confirmQuit, 0.5, {_x:-126, onComplete:removeClip, onCompleteParams:[_confirmQuit]});
};
}
function setup() {
lightningArm._rotation = -90;
textBoxHolder.scoreTXT.setNum(0);
textBoxHolder.bonusTXT.bigDate_6._visible = false;
textBoxHolder.bonusTXT.bigDate_5._visible = false;
textBoxHolder.bonusTXT.bigDate_4._visible = false;
btnFunctions(mainMenuBtn);
mainMenuBtn.onRelease = function () {
setupConfirmQuit();
};
drawPixelDelay = 6;
drawPixelCount = 0;
yPixelPos = 0;
energyBitmapData = new flash.display.BitmapData(32, 130, true, 13056);
graphBitmapData = new flash.display.BitmapData(31, 20, true, 3342336);
graphOfMoves.attachBitmap(graphBitmapData, this.getNextHighestDepth());
powerMeterClip.energyBeamClip.attachBitmap(energyBitmapData, this.getNextHighestDepth());
currentYPixel = 20;
textBoxHolder._alpha = 0;
gs.TweenMax.to(textBoxHolder, 0.5, {_alpha:100});
gs.TweenMax.to(resetLevelBtn, 0.5, {_alpha:100});
endGameBtn.onRelease = function () {
gameState = "game over";
};
btnFunctions(endGameBtn);
endGameBtn.onRollOver = function () {
gs.TweenMax.to(endGameBtn.clip, 0.5, {glowFilter:{color:16711680, blurX:30, blurY:30, alpha:0.8, inner:true}});
};
endGameBtn.onRollOut = (endGameBtn.onReleaseOutside = function () {
gs.TweenMax.to(endGameBtn.clip, 0.25, {glowFilter:{color:16711680, blurX:0, blurY:0, alpha:0, inner:true}});
});
btnFunctions(resetLevelBtn);
resetLevelBtn.onRelease = function () {
if (gameState == "playing") {
gameState = "reset level";
}
};
gridArray = new Array();
bl = "bl";
wh = "wh";
gridArray[1] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 1, 0, bl, 1, 1, bl, 1, 2, bl, 2, 0, wh, 2, 1, bl, 2, 2, wh);
gridArray[1].moves = 2;
gridArray[2] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 1, 0, wh, 1, 1, bl, 1, 2, wh, 2, 0, bl, 2, 1, wh, 2, 2, wh);
gridArray[2].moves = 3;
gridArray[3] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, bl, 1, 1, wh, 1, 2, wh, 1, 3, bl, 2, 0, wh, 2, 1, bl, 2, 2, bl, 2, 3, bl);
gridArray[3].moves = 4;
gridArray[4] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, bl, 2, 3, bl);
gridArray[4].moves = 4;
gridArray[5] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, bl, 1, 0, bl, 1, 1, wh, 1, 2, bl, 1, 3, wh, 2, 0, bl, 2, 1, bl, 2, 2, wh, 2, 3, bl, 3, 0, wh, 3, 1, bl, 3, 2, bl, 3, 3, wh);
gridArray[5].moves = 4;
gridArray[6] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, bl, 1, 1, wh, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, wh, 2, 3, bl, 3, 0, wh, 3, 1, bl, 3, 2, bl, 3, 3, bl);
gridArray[6].moves = 4;
gridArray[7] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, bl, 1, 0, wh, 1, 1, bl, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, bl, 2, 3, wh, 3, 0, bl, 3, 1, bl, 3, 2, wh, 3, 3, wh);
gridArray[7].moves = 6;
gridArray[8] = new Array(0, 0, wh, 0, 1, wh, 0, 2, wh, 0, 3, bl, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, bl, 2, 0, bl, 2, 1, wh, 2, 2, bl, 2, 3, bl, 3, 0, bl, 3, 1, wh, 3, 2, wh, 3, 3, wh);
gridArray[8].moves = 6;
gridArray[9] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, wh, 1, 0, bl, 1, 1, wh, 1, 2, bl, 1, 3, wh, 2, 0, wh, 2, 1, bl, 2, 2, wh, 2, 3, bl, 3, 0, wh, 3, 1, wh, 3, 2, bl, 3, 3, wh);
gridArray[9].moves = 6;
gridArray[10] = new Array(0, 0, bl, 0, 1, wh, 0, 2, wh, 0, 3, bl, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, bl, 2, 3, bl, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, bl, 4, 0, bl, 4, 1, wh, 4, 2, wh, 4, 3, bl);
gridArray[10].moves = 6;
gridArray[11] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, bl, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, bl, 2, 3, bl, 3, 0, bl, 3, 1, wh, 3, 2, bl, 3, 3, bl, 4, 0, bl, 4, 1, wh, 4, 2, bl, 4, 3, wh);
gridArray[11].moves = 4;
gridArray[12] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, wh, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, wh, 2, 0, wh, 2, 1, wh, 2, 2, wh, 2, 3, wh, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, wh, 4, 0, wh, 4, 1, bl, 4, 2, wh, 4, 3, wh);
gridArray[12].moves = 4;
gridArray[13] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, bl, 1, 1, wh, 1, 2, wh, 1, 3, bl, 2, 0, wh, 2, 1, wh, 2, 2, wh, 2, 3, wh, 3, 0, bl, 3, 1, wh, 3, 2, wh, 3, 3, bl, 4, 0, wh, 4, 1, bl, 4, 2, bl, 4, 3, wh);
gridArray[13].moves = 4;
gridArray[14] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, bl, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, wh, 2, 2, wh, 2, 3, bl, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, bl, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, bl);
gridArray[14].moves = 6;
gridArray[15] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, bl, 0, 4, wh, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, bl, 2, 0, wh, 2, 1, bl, 2, 2, bl, 2, 3, bl, 2, 4, wh, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, bl, 3, 4, bl, 4, 0, wh, 4, 1, bl, 4, 2, wh, 4, 3, bl, 4, 4, wh);
gridArray[15].moves = 5;
gridArray[16] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, bl, 0, 4, wh, 1, 0, wh, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, wh, 2, 0, bl, 2, 1, bl, 2, 2, wh, 2, 3, bl, 2, 4, bl, 3, 0, wh, 3, 1, bl, 3, 2, bl, 3, 3, bl, 3, 4, wh, 4, 0, wh, 4, 1, bl, 4, 2, bl, 4, 3, bl, 4, 4, wh);
gridArray[16].moves = 4;
gridArray[17] = new Array(0, 0, bl, 0, 1, wh, 0, 2, wh, 0, 3, wh, 0, 4, bl, 1, 0, wh, 1, 1, bl, 1, 2, wh, 1, 3, bl, 1, 4, wh, 2, 0, wh, 2, 1, wh, 2, 2, wh, 2, 3, wh, 2, 4, wh, 3, 0, wh, 3, 1, bl, 3, 2, wh, 3, 3, bl, 3, 4, wh, 4, 0, bl, 4, 1, wh, 4, 2, wh, 4, 3, wh, 4, 4, bl);
gridArray[17].moves = 8;
gridArray[18] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, bl, 0, 4, bl, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, bl, 2, 0, wh, 2, 1, wh, 2, 2, wh, 2, 3, wh, 2, 4, wh, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, bl, 3, 4, bl, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, bl, 4, 4, bl);
gridArray[18].moves = 6;
gridArray[19] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, wh, 0, 4, wh, 1, 0, wh, 1, 1, wh, 1, 2, wh, 1, 3, wh, 1, 4, wh, 2, 0, bl, 2, 1, wh, 2, 2, bl, 2, 3, wh, 2, 4, bl, 3, 0, wh, 3, 1, wh, 3, 2, wh, 3, 3, wh, 3, 4, wh, 4, 0, wh, 4, 1, wh, 4, 2, bl, 4, 3, wh, 4, 4, wh);
gridArray[19].moves = 5;
gridArray[20] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, bl, 0, 4, wh, 1, 0, wh, 1, 1, wh, 1, 2, wh, 1, 3, wh, 1, 4, wh, 2, 0, wh, 2, 1, bl, 2, 2, wh, 2, 3, bl, 2, 4, wh, 3, 0, wh, 3, 1, bl, 3, 2, wh, 3, 3, bl, 3, 4, wh, 4, 0, wh, 4, 1, wh, 4, 2, wh, 4, 3, wh, 4, 4, wh, 5, 0, wh, 5, 1, bl, 5, 2, bl, 5, 3, bl, 5, 4, wh);
gridArray[20].moves = 4;
gridArray[21] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, wh, 0, 4, wh, 1, 0, wh, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, bl, 2, 0, bl, 2, 1, wh, 2, 2, wh, 2, 3, bl, 2, 4, bl, 3, 0, bl, 3, 1, bl, 3, 2, wh, 3, 3, wh, 3, 4, bl, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, bl, 4, 4, wh, 5, 0, wh, 5, 1, wh, 5, 2, bl, 5, 3, wh, 5, 4, wh);
gridArray[21].moves = 8;
gridArray[22] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, bl, 0, 4, wh, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, bl, 1, 4, bl, 2, 0, wh, 2, 1, bl, 2, 2, wh, 2, 3, bl, 2, 4, wh, 3, 0, wh, 3, 1, bl, 3, 2, wh, 3, 3, bl, 3, 4, wh, 4, 0, bl, 4, 1, bl, 4, 2, wh, 4, 3, bl, 4, 4, bl, 5, 0, wh, 5, 1, bl, 5, 2, wh, 5, 3, bl, 5, 4, wh);
gridArray[22].moves = 4;
gridArray[23] = new Array(0, 0, wh, 0, 1, wh, 0, 2, wh, 0, 3, wh, 0, 4, wh, 1, 0, wh, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, wh, 2, 0, bl, 2, 1, bl, 2, 2, wh, 2, 3, bl, 2, 4, bl, 3, 0, bl, 3, 1, bl, 3, 2, wh, 3, 3, bl, 3, 4, bl, 4, 0, wh, 4, 1, bl, 4, 2, bl, 4, 3, bl, 4, 4, wh, 5, 0, wh, 5, 1, wh, 5, 2, wh, 5, 3, wh, 5, 4, wh);
gridArray[23].moves = 6;
gridArray[24] = new Array(0, 0, wh, 0, 1, wh, 0, 2, wh, 0, 3, wh, 0, 4, wh, 1, 0, bl, 1, 1, wh, 1, 2, bl, 1, 3, wh, 1, 4, bl, 2, 0, bl, 2, 1, bl, 2, 2, bl, 2, 3, bl, 2, 4, bl, 3, 0, wh, 3, 1, bl, 3, 2, bl, 3, 3, bl, 3, 4, wh, 4, 0, wh, 4, 1, bl, 4, 2, wh, 4, 3, bl, 4, 4, wh, 5, 0, wh, 5, 1, wh, 5, 2, wh, 5, 3, wh, 5, 4, wh);
gridArray[24].moves = 5;
gridArray[25] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, wh, 0, 4, bl, 0, 5, wh, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, wh, 1, 4, bl, 1, 5, bl, 2, 0, wh, 2, 1, wh, 2, 2, bl, 2, 3, bl, 2, 4, wh, 2, 5, wh, 3, 0, wh, 3, 1, wh, 3, 2, bl, 3, 3, bl, 3, 4, wh, 3, 5, wh, 4, 0, bl, 4, 1, bl, 4, 2, wh, 4, 3, wh, 4, 4, bl, 4, 5, bl, 5, 0, wh, 5, 1, bl, 5, 2, wh, 5, 3, wh, 5, 4, bl, 5, 5, wh);
gridArray[25].moves = 8;
gridArray[26] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, wh, 0, 4, bl, 0, 5, wh, 1, 0, wh, 1, 1, bl, 1, 2, bl, 1, 3, bl, 1, 4, bl, 1, 5, bl, 2, 0, wh, 2, 1, wh, 2, 2, bl, 2, 3, bl, 2, 4, wh, 2, 5, wh, 3, 0, wh, 3, 1, wh, 3, 2, bl, 3, 3, bl, 3, 4, wh, 3, 5, wh, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, bl, 4, 4, bl, 4, 5, wh, 5, 0, wh, 5, 1, bl, 5, 2, wh, 5, 3, bl, 5, 4, wh, 5, 5, wh);
gridArray[26].moves = 6;
gridArray[27] = new Array(0, 0, bl, 0, 1, wh, 0, 2, wh, 0, 3, wh, 0, 4, wh, 0, 5, bl, 1, 0, bl, 1, 1, wh, 1, 2, wh, 1, 3, wh, 1, 4, wh, 1, 5, bl, 2, 0, wh, 2, 1, wh, 2, 2, bl, 2, 3, bl, 2, 4, wh, 2, 5, wh, 3, 0, wh, 3, 1, wh, 3, 2, bl, 3, 3, bl, 3, 4, wh, 3, 5, wh, 4, 0, bl, 4, 1, wh, 4, 2, wh, 4, 3, wh, 4, 4, wh, 4, 5, bl, 5, 0, bl, 5, 1, wh, 5, 2, wh, 5, 3, wh, 5, 4, wh, 5, 5, bl);
gridArray[27].moves = 8;
gridArray[28] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, bl, 0, 4, wh, 0, 5, wh, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, wh, 1, 4, bl, 1, 5, bl, 2, 0, wh, 2, 1, bl, 2, 2, bl, 2, 3, bl, 2, 4, bl, 2, 5, wh, 3, 0, wh, 3, 1, bl, 3, 2, bl, 3, 3, bl, 3, 4, bl, 3, 5, wh, 4, 0, bl, 4, 1, bl, 4, 2, wh, 4, 3, wh, 4, 4, bl, 4, 5, bl, 5, 0, wh, 5, 1, wh, 5, 2, bl, 5, 3, bl, 5, 4, wh, 5, 5, wh);
gridArray[28].moves = 8;
gridArray[29] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, wh, 0, 4, wh, 0, 5, wh, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, wh, 1, 4, wh, 1, 5, wh, 2, 0, wh, 2, 1, wh, 2, 2, bl, 2, 3, wh, 2, 4, wh, 2, 5, wh, 3, 0, wh, 3, 1, wh, 3, 2, wh, 3, 3, bl, 3, 4, wh, 3, 5, wh, 4, 0, wh, 4, 1, wh, 4, 2, wh, 4, 3, wh, 4, 4, bl, 4, 5, bl, 5, 0, wh, 5, 1, wh, 5, 2, wh, 5, 3, wh, 5, 4, bl, 5, 5, wh);
gridArray[29].moves = 8;
gridArray[30] = new Array(0, 0, wh, 0, 1, wh, 0, 2, wh, 0, 3, bl, 0, 4, wh, 0, 5, wh, 1, 0, wh, 1, 1, wh, 1, 2, wh, 1, 3, bl, 1, 4, bl, 1, 5, wh, 2, 0, wh, 2, 1, wh, 2, 2, bl, 2, 3, wh, 2, 4, wh, 2, 5, wh, 3, 0, bl, 3, 1, bl, 3, 2, bl, 3, 3, wh, 3, 4, wh, 3, 5, wh, 4, 0, bl, 4, 1, wh, 4, 2, bl, 4, 3, wh, 4, 4, wh, 4, 5, wh, 5, 0, bl, 5, 1, bl, 5, 2, wh, 5, 3, bl, 5, 4, bl, 5, 5, wh);
gridArray[30].moves = 6;
gridArray[31] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, bl, 1, 0, bl, 1, 1, bl, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, wh, 2, 2, bl, 2, 3, wh, 3, 0, bl, 3, 1, wh, 3, 2, bl, 3, 3, wh, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, bl, 5, 0, bl, 5, 1, bl, 5, 2, bl, 5, 3, bl);
gridArray[31].moves = 6;
gridArray[32] = new Array(0, 0, wh, 0, 1, bl, 0, 2, wh, 0, 3, wh, 1, 0, wh, 1, 1, bl, 1, 2, wh, 1, 3, wh, 2, 0, bl, 2, 1, wh, 2, 2, bl, 2, 3, wh, 3, 0, wh, 3, 1, bl, 3, 2, wh, 3, 3, bl, 4, 0, wh, 4, 1, wh, 4, 2, bl, 4, 3, wh, 5, 0, wh, 5, 1, wh, 5, 2, bl, 5, 3, wh);
gridArray[32].moves = 6;
gridArray[33] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, bl, 1, 1, bl, 1, 2, wh, 1, 3, bl, 2, 0, bl, 2, 1, wh, 2, 2, bl, 2, 3, wh, 3, 0, wh, 3, 1, bl, 3, 2, wh, 3, 3, bl, 4, 0, bl, 4, 1, wh, 4, 2, bl, 4, 3, bl, 5, 0, wh, 5, 1, bl, 5, 2, bl, 5, 3, wh);
gridArray[33].moves = 6;
gridArray[34] = new Array(0, 0, wh, 0, 1, wh, 0, 2, bl, 0, 3, wh, 1, 0, wh, 1, 1, wh, 1, 2, bl, 1, 3, bl, 2, 0, bl, 2, 1, bl, 2, 2, wh, 2, 3, wh, 3, 0, wh, 3, 1, wh, 3, 2, wh, 3, 3, wh, 4, 0, bl, 4, 1, bl, 4, 2, bl, 4, 3, wh, 5, 0, wh, 5, 1, bl, 5, 2, wh, 5, 3, wh);
gridArray[34].moves = 7;
gridArray[35] = new Array(0, 0, wh, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, wh, 1, 1, wh, 1, 2, bl, 1, 3, wh, 2, 0, wh, 2, 1, wh, 2, 2, wh, 2, 3, bl, 3, 0, bl, 3, 1, wh, 3, 2, wh, 3, 3, bl, 4, 0, wh, 4, 1, wh, 4, 2, wh, 4, 3, bl, 5, 0, wh, 5, 1, bl, 5, 2, wh, 5, 3, wh);
gridArray[35].moves = 10;
gridArray[36] = new Array(0, 0, bl, 0, 1, bl, 0, 2, bl, 0, 3, wh, 1, 0, wh, 1, 1, wh, 1, 2, wh, 1, 3, bl, 2, 0, bl, 2, 1, wh, 2, 2, wh, 2, 3, bl, 3, 0, wh, 3, 1, wh, 3, 2, bl, 3, 3, wh, 4, 0, bl, 4, 1, wh, 4, 2, wh, 4, 3, bl, 5, 0, bl, 5, 1, bl, 5, 2, bl, 5, 3, wh);
gridArray[36].moves = 7;
trace("gridArray[1].moves = " + gridArray[1].moves);
if (levelEdit) {
createEmptyArray();
} else if (level == undefined) {
level = 1;
}
trace("level = " + level);
firstPlayMessage._alpha = 0;
if (level == 1) {
gs.TweenMax.to(firstPlayMessage, 1, {_alpha:100, delay:2});
}
clipSize = 40;
score = 0;
trace("gridArray[1].moves = " + gridArray[1].moves);
}
function getLevelDimensions() {
if (level < 3) {
levelXSize = 3;
levelYSize = 3;
}
if ((level > 2) && (level < 5)) {
levelXSize = 3;
levelYSize = 4;
}
if ((level > 4) && (level < 10)) {
levelXSize = 4;
levelYSize = 4;
}
if ((level > 9) && (level < 15)) {
levelXSize = 5;
levelYSize = 4;
}
if ((level > 14) && (level < 20)) {
levelXSize = 5;
levelYSize = 5;
}
if ((level > 19) && (level < 25)) {
levelXSize = 6;
levelYSize = 5;
}
if ((level > 24) && (level < 31)) {
levelXSize = 6;
levelYSize = 6;
}
if (level > 30) {
levelXSize = 6;
levelYSize = 4;
}
}
function setupGrid() {
if (level > levelsUnlocked) {
storage.data.levelsUnlocked = level;
levelsUnlocked = level;
storage.flush();
}
outOfBonusSndPlayed = false;
if (level > 1) {
gs.TweenMax.to(firstPlayMessage, 3, {_alpha:0});
}
getLevelDimensions();
n = gridArray[level].length;
minimumMoves = gridArray[level].moves;
clipNum = 1;
clipArray = new Array();
tilesWidth = levelXSize * clipSize;
tilesHigh = levelYSize * clipSize;
xOffset = (((gameXSize - tilesWidth) / 2) - (clipSize / 2)) + 25;
if (levelYSize < 5) {
yOffset = 118;
} else {
yOffset = 78;
}
trace("yOffset = " + yOffset);
enableButtons();
disableButtons();
gs.TweenMax.to(tileHolder, 2, {onComplete:enableButtons});
i = 0;
while (i < n) {
tx = gridArray[level][i];
ty = gridArray[level][i + 1];
tileType = gridArray[level][i + 2];
t = tileHolder.attachMovie("tile", ("t" + tx) + ty, clipNum);
t.x = tx;
t.y = ty;
t._x = 500;
t._y = (yOffset + (ty * clipSize)) + clipSize;
gs.TweenMax.to(t, 0.5, {_x:(xOffset + (tx * clipSize)) + clipSize, _xscale:100, _yscale:100, _rotation:0, _alpha:100, delay:(i / 3) / 10});
clipArray.push(t);
t.flipHotspot.onPress = function () {
testFlip(this._parent);
};
if (tileType.toLowerCase() == bl) {
tileType = "black";
}
if (tileType.toLowerCase() == wh) {
tileType = "white";
}
t.setFace(tileType);
clipNum++;
i = i + 3;
}
thisLevelsTiles = n / 3;
flipBonus = (minimumMoves * 2) * 50;
}
function createEmptyArray() {
trace("setting up");
getLevelDimensions();
gridArray[level] = new Array();
var k = 0;
while (k < levelXSize) {
var l = 0;
while (l < levelYSize) {
var tc = eval (("tileHolder.t" + k) + l);
colourRef = "wh";
gridArray[level].push(k, l, colourRef);
l++;
}
k++;
}
trace(((("gridArray[" + level) + "] = new Array(") + outputArray) + ")");
}
function compileArray() {
outputArray = new Array();
var k = 0;
while (k < 20) {
var l = 0;
while (l < 20) {
var tc = eval (("tileHolder.t" + k) + l);
if (tc != undefined) {
colourRef = tc.getFace();
if (colourRef == "white") {
colourRef = "wh";
} else {
colourRef = "bl";
}
outputArray.push(tc.x, tc.y, colourRef);
}
l++;
}
k++;
}
trace(((("gridArray[" + level) + "] = new Array(") + outputArray) + ")");
trace((("gridArray[" + level) + "].moves = ") + levelFlipCount);
}
function testFlip(_clip) {
if (gameState == "playing") {
createparticleSpray(_xmouse, _ymouse, 2);
a = random(3) + 1;
playSound(("flipTileSnd" + a) + ".wav");
_clip.swapDepths(1000);
_clip.flipTile();
thisTX = _clip.x;
thisTY = _clip.y;
flipArray(thisTX, thisTY);
tf = eval (("tileHolder.t" + (thisTX - 1)) + (thisTY - 0));
tf.flipTile();
tf = eval (("tileHolder.t" + (thisTX + 1)) + (thisTY - 0));
tf.flipTile();
tf = eval (("tileHolder.t" + (thisTX + 0)) + (thisTY - 1));
tf.flipTile();
tf = eval (("tileHolder.t" + (thisTX + 0)) + (thisTY + 1));
tf.flipTile();
levelFlipCount++;
flipBonus = flipBonus - 10;
if (flipBonus <= 0) {
flipBonus = 0;
if (outOfBonusSndPlayed == false) {
playSound("outOfBonus.wav");
outOfBonusSndPlayed = true;
}
}
testIfLevelComplete();
updateDisplay();
}
}
function updateDisplay() {
if (levelFlipCount < 1000) {
textBoxHolder.flipsTXT.setNum(levelFlipCount);
} else {
textBoxHolder.flipsTXT.setNum(999);
}
textBoxHolder.levelTXT.setNum(level);
textBoxHolder.scoreTXT.setNum(score);
textBoxHolder.bonusTXT.setNum(flipBonus);
testHowManyWhite();
var _local1 = amountTilesWhite / targetAmountofTiles;
gs.TweenMax.to(powerMeterClip.energyBarMask, 0.5, {_yscale:_local1 * 100});
gs.TweenMax.to(powerMeterClip.energyCap, 0.5, {_y:120 - (_local1 * 120)});
}
function testHowManyWhite() {
var _local2 = clipArray.length;
amountTilesWhite = 0;
targetAmountofTiles = thisLevelsTiles;
while (_local2--) {
var _local1 = clipArray[_local2];
if (_local1.getFace() == "white") {
amountTilesWhite++;
}
}
var _local3 = amountTilesWhite / targetAmountofTiles;
yPixelPos = 20 - Math.floor(20 * _local3);
}
function testIfLevelComplete() {
var _local2 = clipArray.length;
amountTilesWhite = 0;
targetAmountofTiles = thisLevelsTiles;
while (_local2--) {
var _local1 = clipArray[_local2];
if (_local1.getFace() == "white") {
amountTilesWhite++;
}
}
if (amountTilesWhite >= targetAmountofTiles) {
gameState = "level complete";
}
var _local3 = amountTilesWhite / targetAmountofTiles;
yPixelPos = 25 - Math.floor(25 * _local3);
}
function removeAllTiles(_num) {
var _local2 = clipArray.length;
amountTilesWhite = 0;
targetAmountofTiles = thisLevelsTiles;
while (_local2--) {
var _local1 = clipArray[_local2];
gs.TweenMax.to(_local1, 0.5, {_x:-40, delay:_local2 / 20, onComplete:removeClip, onCompleteParams:[_local1], onStart:flipClip, onStartParams:[_local1]});
}
timeNeededForTransition = Math.ceil(((clipArray.length / 20) + 0.5) * frameRate);
trace("max time = " + timeNeededForTransition);
}
function drawPixelFunctions() {
energyBitmapData.scroll(0, -1);
drawBubbleCount--;
if (drawBubbleCount < 1) {
drawBubbleCount = (Math.random() * 5) + 5;
var _local1 = Math.floor(Math.random() * 32);
var _local2 = Math.floor(Math.random() * 3);
switch (_local2) {
case 0 :
energyBitmapData.setPixel32(_local1, bubbleYStart, drawBubbleColour);
energyBitmapData.setPixel32(_local1 + 1, bubbleYStart + 1, drawBubbleColour);
energyBitmapData.setPixel32(_local1 - 1, bubbleYStart + 1, drawBubbleColour);
energyBitmapData.setPixel32(_local1, bubbleYStart + 2, drawBubbleColour);
break;
case 1 :
energyBitmapData.setPixel32(_local1, bubbleYStart, drawBubbleColour);
energyBitmapData.setPixel32(_local1 + 1, bubbleYStart, drawBubbleColour);
energyBitmapData.setPixel32(_local1 + 2, bubbleYStart + 1, drawBubbleColour);
energyBitmapData.setPixel32(_local1 + 2, bubbleYStart + 2, drawBubbleColour);
energyBitmapData.setPixel32(_local1 - 1, bubbleYStart + 1, drawBubbleColour);
energyBitmapData.setPixel32(_local1 - 1, bubbleYStart + 2, drawBubbleColour);
energyBitmapData.setPixel32(_local1, bubbleYStart + 3, drawBubbleColour);
energyBitmapData.setPixel32(_local1 + 1, bubbleYStart + 3, drawBubbleColour);
break;
case 2 :
energyBitmapData.setPixel32(_local1, bubbleYStart, drawBubbleColour);
}
}
drawPixelCount--;
if (drawPixelCount < 1) {
drawPixelCount = drawPixelDelay;
graphBitmapData.scroll(-1, 0);
diff = (yPixelPos - currentYPixel) / 5;
currentYPixel = currentYPixel + diff;
graphBitmapData.setPixel32(29, Math.floor(currentYPixel), 1728053247);
graphBitmapData.setPixel32(28, Math.floor(currentYPixel), 1728053247);
}
}
function manageSteamVents() {
if (steamVent1Active) {
steamVent1Time--;
createparticleSpray(23, 25, 5);
if (steamVent1Time < 1) {
steamVent1Active = false;
steamVent1Counter = (Math.random() * 100) + 100;
}
} else {
steamVent1Counter--;
if (steamVent1Counter < 1) {
steamVent1Active = true;
steamVent1Time = 25 + Math.floor(Math.random() * 50);
}
}
if (steamVent2Active) {
steamVent2Time--;
createparticleSpray(430, 101, 7);
if (steamVent2Time < 1) {
steamVent2Active = false;
steamVent2Counter = (Math.random() * 100) + 100;
}
} else {
steamVent2Counter--;
if (steamVent2Counter < 1) {
steamVent2Active = true;
steamVent2Time = 25 + Math.floor(Math.random() * 50);
}
}
}
function loop() {
manageSteamVents();
drawPixelFunctions();
switch (gameState) {
case "playing" :
break;
case "quit game" :
closeDoors();
gs.TweenMax.to(textBoxHolder, 0.5, {_alpha:0});
gs.TweenMax.to(resetLevelBtn, 0.5, {_alpha:0});
gs.TweenMax.to(firstPlayMessage, 0.5, {_alpha:0});
gs.TweenMax.to(mainMenuBtn, 0.5, {_alpha:0});
gs.TweenMax.to(_soundControlsRef, 0.5, {_alpha:0});
removeAllTiles(1);
count = timeNeededForTransition;
gameState = "quit game wait";
break;
case "quit game wait" :
count--;
if (count < 1) {
gotoAndPlay (7);
delete onEnterFrame;
gameState = "game over screen";
}
break;
case "game over" :
closeDoors();
gs.TweenMax.to(textBoxHolder, 0.5, {_alpha:0});
gs.TweenMax.to(resetLevelBtn, 0.5, {_alpha:0});
gs.TweenMax.to(firstPlayMessage, 0.5, {_alpha:0});
removeAllTiles(1);
count = timeNeededForTransition;
gameState = "game over wait";
break;
case "game over wait" :
count--;
if (count < 1) {
gotoAndPlay (26);
delete onEnterFrame;
gameState = "game over screen";
}
break;
case "reset level" :
removeAllTiles(1);
count = timeNeededForTransition;
gameState = "reset level wait";
break;
case "reset level wait" :
count--;
if (count < 1) {
setupGrid();
gameState = "setup level";
}
break;
case "level complete" :
trace("level complete");
gs.TweenMax.to(lightningArm, 0.25, {_rotation:25});
playSound(("Lightning" + (Math.floor(Math.random() * 3) + 1)) + ".wav");
gs.TweenMax.to(powerMeterClip.energyBarMask, 1.2, {_yscale:1, delay:0.75});
gs.TweenMax.to(powerMeterClip.energyCap, 1.2, {_y:120, delay:0.75});
levelCompleteClipRef = tileHolder.attachMovie("levelCompleteClip", "levelCompleteClip", 100);
levelCompleteClipRef._x = 580;
levelCompleteClipRef._y = 199;
gs.TweenMax.to(levelCompleteClipRef, 0.5, {_x:225, ease:mx.transitions.easing.Back.easeOut, delay:2});
if (flipBonus > 0) {
fbt = tileHolder.attachMovie("flipBonusTellText", "flipBonusTellText", 101);
fbt.textBox.text = "FLIP BONUS: " + flipBonus;
score = score + flipBonus;
fbt._y = 275;
fbt._x = 580;
gs.TweenMax.to(fbt, 0.5, {_x:225, ease:mx.transitions.easing.Back.easeOut, delay:2.2});
}
levelBonus = level * 750;
lbt = tileHolder.attachMovie("levelBonusTellText", "levelBonusTellText", 102);
lbt._y = 120;
lbt._x = 580;
lbt.textBox.text = "LEVEL BONUS: " + levelBonus;
gs.TweenMax.to(lbt, 0.5, {_x:225, ease:mx.transitions.easing.Back.easeOut, delay:2.4});
score = score + levelBonus;
count = 60;
updateDisplay();
gameState = "level complete wait";
break;
case "level complete wait" :
count--;
if (count < 50) {
point1Ref = new flash.geom.Point(225, 215);
point2Ref = new flash.geom.Point(133, 132);
drawLightning(point1Ref, point2Ref);
}
if (count < 1) {
line.clear();
trace("level cleanup wait");
removeAllTiles();
count = 130;
gs.TweenMax.to(lightningArm, 0.5, {_rotation:-90});
gameState = "level cleanup wait";
}
break;
case "level cleanup wait" :
count--;
if (count < 1) {
gs.TweenMax.to(levelCompleteClipRef, 0.5, {_x:550, ease:mx.transitions.easing.Back.easeIn, onComplete:removeClip, onCompleteParams:[levelCompleteClipRef]});
gs.TweenMax.to(lbt, 0.5, {delay:0.25, _x:550, ease:mx.transitions.easing.Back.easeIn, onComplete:removeClip, onCompleteParams:[lbt]});
gs.TweenMax.to(fbt, 0.5, {_x:550, ease:mx.transitions.easing.Back.easeIn, onComplete:removeClip, onCompleteParams:[fbt]});
count = 60;
gameState = "level cleanup wait 2";
}
break;
case "level cleanup wait 2" :
count--;
if (count < 1) {
level++;
gs.TweenMax.to(textBoxHolder.levelText, 0.5, {colorMatrixFilter:{colorize:16755714, amount:1}});
gs.TweenMax.to(textBoxHolder.levelText, 0.5, {delay:0.51, colorMatrixFilter:{colorize:16755714, amount:0}, overwrite:false});
gameState = "setup level";
}
if (level > 30) {
gameState = "game complete";
}
break;
case "game complete" :
closeDoors();
gs.TweenMax.to(textBoxHolder, 0.5, {_alpha:0});
gs.TweenMax.to(resetLevelBtn, 0.5, {_alpha:0});
gs.TweenMax.to(firstPlayMessage, 0.5, {_alpha:0});
gs.TweenMax.to(mainMenuBtn, 0.5, {_alpha:0});
gs.TweenMax.to(_soundControlsRef, 0.5, {_alpha:0});
removeAllTiles(1);
count = timeNeededForTransition;
gameState = "game complete wait";
break;
case "game complete wait" :
count--;
if (count < 1) {
gotoAndPlay (35);
delete onEnterFrame;
gameState = "game completed";
}
break;
case "setup" :
gameState = "setup level";
break;
case "setup level" :
gameState = "playing";
setupGrid();
levelFlipCount = 0;
updateDisplay();
}
}
currentGamePage = "GAME";
_level0.cs.track.event("game_started");
hideNonGameHUD();
stop();
if (_url.slice(0, 4) != "file") {
levelEdit = false;
}
gameState = "setup";
onEnterFrame = loop;
frameRate = 41;
openDoors();
_soundControlsRef._visible = true;
gs.TweenMax.to(_soundControlsRef, 0.5, {_alpha:100});
disableButtons();
steamVent1Counter = (Math.random() * 50) + 100;
steamVent2Counter = (Math.random() * 50) + 100;
steamVent1Active = false;
steamVent2Active = false;
setup();
var tileType;
var gridArray;
var clipArray;
var tx;
var ty;
var i;
var n;
var clipNum;
var clipSize;
var thisLevelsTiles;
var amountTilesWhite;
var levelBonus;
var flipBonus;
var t;
var gameState;
var lastClipTurned;
var frameRate;
var outOfBonusSndPlayed;
var drawBubbleCount;
var keyListener = new Object();
keyListener.onKeyUp = function () {
if (levelEdit) {
compileArray();
}
};
Key.addListener(keyListener);
var tileSize = 38;
var gameXSize = 400;
var gameYSize = 245;
var stageXSize = 450;
var stageYSize = 360;
var graphBitmapData;
var yPixelPos;
var currentYPixel;
var drawPixelCount;
var bubbleYStart = 120;
var drawPixelDelay;
var drawBubbleColour = 1728053247;
drawBubbleCount = 0;
Frame 25
function loadScores() {
xmlobj.ignoreWhite = true;
xmlobj.onLoad = function (success) {
trace("I am working!");
onFormLoad();
};
xmlobj.load("http://stats.soap.com.au/highscore/highscoreXML.php?gameid=27&count=100");
}
function onFormLoad(string) {
scoreXML = xmlobj.firstChild;
while ((scoreXML != null) && ((scoreXML.nodeType != 1) || (scoreXML.nodeName.toLowerCase() != "game"))) {
scoreXML = scoreXML.nextSibling;
}
_clip.gotoAndPlay("showScores");
showList(scoreXML);
}
function showList(scoreXML) {
var _local3;
var _local1;
var _local2;
if (topRow > 10) {
hideLeft = false;
} else {
hideLeft = true;
}
if (topRow < 91) {
hideRight = false;
} else {
hideRight = true;
}
if (topRow >= scoreXML.childNodes.length) {
_local2 = null;
} else {
_local2 = scoreXML.childNodes[topRow - 1];
}
_local3 = 0;
while (_local3 < scoreRows.length) {
_local1 = scoreRows[_local3];
if (_local2 == null) {
_local1._alpha = 0;
} else {
_local1._alpha = 100;
scoresLoaded = true;
_local1._placeField.text = _local3 + topRow;
_local1._nameField.text = _local2.attributes.pname.toUpperCase();
var _local4 = parseInt(_local2.attributes.score);
_local1._scoreField.text = terrysTextFunctionClass.processNumber(_local4);
_local1._distanceField.text = _local2.attributes.miscellaneous6;
_local2 = _local2.nextSibling;
}
_local3++;
}
}
openDoors();
currentGamePage = "HIGHSCORES";
showNonGameHUD();
stop();
var scoreRows = [_s1, _s2, _s3, _s4, _s5, _s6, _s7, _s8, _s9, _s10];
var topRow = 1;
var xmlobj = new XML();
var scoreXML;
var scoresLoaded = false;
var scoreItemFadeIndex = 0;
_leftBtn.onRelease = function () {
if (topRow > 10) {
topRow = topRow - 10;
}
showList(scoreXML);
};
_leftBtn.gotoAndStop(1);
_rightBtn.gotoAndStop(1);
_leftBtn.onRollOver = function () {
_leftBtn.Speed = 1;
this.gotoAndStop(2);
};
_leftBtn.onRollOut = function () {
_leftBtn.Speed = -1;
this.gotoAndStop(1);
};
_rightBtn.onRelease = function () {
if (topRow < 100) {
topRow = topRow + 10;
}
showList(scoreXML);
};
_rightBtn.onRollOver = function () {
_rightBtn.Speed = 1;
this.gotoAndStop(2);
};
_rightBtn.onRollOut = function () {
_rightBtn.Speed = -1;
this.gotoAndStop(1);
};
loadScores();
delete this.onEnterFrame;
this.onEnterFrame = function () {
_hsTitle._alpha = _hsTitle._alpha + ((100 - _hsTitle._alpha) * 0.25);
_hsHeaderBar._alpha = _hsHeaderBar._alpha + ((100 - _hsHeaderBar._alpha) * 0.25);
if (scoresLoaded) {
_hsLoading._alpha = _hsLoading._alpha + ((-_hsLoading._alpha) * 0.25);
_rowDividers._alpha = _rowDividers._alpha + ((100 - _rowDividers._alpha) * 0.25);
scoreItemFadeIndex = scoreItemFadeIndex + 0.25;
var _local1 = 0;
while (_local1 < scoreRows.length) {
if (scoreItemFadeIndex > _local1) {
scoreRows[_local1]._alpha = scoreRows[_local1]._alpha + ((100 - scoreRows[_local1]._alpha) * 0.25);
}
_local1++;
}
} else {
_hsLoading._alpha = _hsLoading._alpha + ((100 - _hsLoading._alpha) * 0.25);
hideLeft = true;
hideRight = true;
}
if (hideLeft) {
_leftBtn._alpha = _leftBtn._alpha + ((-_leftBtn._alpha) * 0.25);
} else {
_leftBtn._alpha = _leftBtn._alpha + ((100 - _leftBtn._alpha) * 0.25);
}
if (hideRight) {
_rightBtn._alpha = _rightBtn._alpha + ((-_rightBtn._alpha) * 0.25);
} else {
_rightBtn._alpha = _rightBtn._alpha + ((100 - _rightBtn._alpha) * 0.25);
}
};
Frame 26
function testValidName() {
testName = _submitScoreClip.nameInput.text;
error = false;
if (testName == "") {
error = true;
}
if (!error) {
_submitScoreClip.gotoAndStop("submittingScore");
sendUsersScore();
} else {
gs.TweenLite.to(_submitScoreClip.initialsError, 0.5, {_alpha:100});
}
}
function setupSubmitScore() {
_submitScoreClip = scoreSubmitHolder.attachMovie("submitScoreClip", "submitScoreClip", 1006);
_submitScoreClip.initialsError._alpha = 0;
_submitScoreClip.highlightInitText._alpha = 0;
_submitScoreClip.nameInput.onSetFocus = function () {
gs.TweenLite.to(_submitScoreClip.highlightInitText, 0.5, {_alpha:100});
_submitScoreClip.initialsError._alpha = 0;
};
_submitScoreClip.nameInput.onChanged = function () {
_submitScoreClip.nameInput.text = _submitScoreClip.nameInput.text.toUpperCase();
};
_submitScoreClip.nameInput.onKillFocus = function () {
gs.TweenLite.to(_submitScoreClip.highlightInitText, 0.5, {_alpha:0});
};
setupBtn(_submitScoreClip.submitBtn);
_submitScoreClip.submitBtn.onRelease = function () {
testValidName();
};
_submitScoreClip._x = 580;
gs.TweenMax.to(_submitScoreClip, 0.5, {_x:225, delay:0.5});
var _local1 = setTimeout(initScoreBox, 30);
_submitScoreClip._y = 218;
lastNum = -1;
setupBaseButton(_submitScoreClip.submitBtn);
}
function initScoreBox() {
trace("initScoreBox");
_submitScoreClip.scoreTXT.setNum(score);
_submitScoreClip.scoreTXT.tellMe();
}
function sendUsersScore() {
var _local3 = new LoadVars();
_local3.onLoad = function (success) {
highScoreSendResult(success);
};
var _local2 = new LoadVars();
var _local6 = Math.random() * 100000;
var _local5 = Math.random() * 100000;
var _local4 = ((_local6 + "noemail@www") + _local5) + ".com";
_local2.intGameId = 27;
_local2.strName = testName;
_local2.intScore = score;
_local2.strEmail = _local4;
_local2.strMisc1 = level;
_local2.sendAndLoad("http://stats.soap.com.au/highscore/engine_mofo_rank.php", _local3, "POST");
}
function highScoreSendResult(_result) {
trace(_result);
if (_result) {
_submitScoreClip.gotoAndStop("success");
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:closeDoors, delay:1.5});
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:goIntro, delay:3, overwrite:false});
} else {
_submitScoreClip.gotoAndStop("error");
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:closeDoors, delay:1.5});
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:goIntro, delay:3, overwrite:false});
}
}
openDoors();
_level0.cs.track.event("submit_score");
currentGamePage = "GAMEOVER";
showNonGameHUD();
stop();
gameOverText._alpha = 0;
gameOverText._xscale = (gameOverText._yscale = 200);
gs.TweenLite.to(gameOverText, 0.5, {_alpha:100, _yscale:100, _xscale:100, ease:mx.transitions.easing.Back.easeOut});
scoreboxes._alpha = 0;
gs.TweenLite.to(scoreboxes, 0.5, {delay:0.75, _alpha:100});
yourHighestTextBox._alpha = 0;
gs.TweenLite.to(yourHighestTextBox, 0.5, {delay:1, _alpha:100});
playBtn._alpha = 0;
playBtn._xscale = (playBtn._yscale = 200);
gs.TweenLite.to(playBtn, 0.5, {delay:1, _alpha:100, _yscale:100, _xscale:100, ease:mx.transitions.easing.Back.easeOut});
_quality = "best";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
playSound("mouseDown.wav");
removeMovieClip(highHolder);
if (levelsUnlocked > 1) {
gotoAndPlay (23);
} else {
gotoAndPlay (24);
}
};
storage.flush();
setupSubmitScore();
Frame 34
stop();
Frame 35
function testValidName() {
testName = _submitScoreClip.nameInput.text;
error = false;
if (testName == "") {
error = true;
}
if (!error) {
_submitScoreClip.gotoAndStop("submittingScore");
sendUsersScore();
} else {
gs.TweenLite.to(_submitScoreClip.initialsError, 0.5, {_alpha:100});
}
}
function setupSubmitScore() {
_submitScoreClip = scoreSubmitHolder.attachMovie("gameCompleteSubmitScoreClip", "submitScoreClip", 1006);
_submitScoreClip.initialsError._alpha = 0;
_submitScoreClip.nameInput.onSetFocus = function () {
_submitScoreClip.initialsError._alpha = 0;
};
_submitScoreClip.nameInput.onChanged = function () {
_submitScoreClip.nameInput.text = _submitScoreClip.nameInput.text.toUpperCase();
};
setupBtn(_submitScoreClip.submitBtn);
_submitScoreClip.submitBtn.onRelease = function () {
testValidName();
};
_submitScoreClip._x = 580;
gs.TweenMax.to(_submitScoreClip, 0.5, {_x:225, delay:0.5});
_submitScoreClip._y = 218;
lastNum = -1;
var _local1 = setTimeout(initScoreBox, 30);
setupBaseButton(_submitScoreClip.submitBtn);
}
function sendUsersScore() {
var _local3 = new LoadVars();
_local3.onLoad = function (success) {
highScoreSendResult(success);
};
var _local2 = new LoadVars();
var _local6 = Math.random() * 100000;
var _local5 = Math.random() * 100000;
var _local4 = ((_local6 + "noemail@www") + _local5) + ".com";
_local2.intGameId = 27;
_local2.strName = testName;
_local2.intScore = score;
_local2.strEmail = _local4;
_local2.strMisc1 = level;
_local2.sendAndLoad("http://stats.soap.com.au/highscore/engine_mofo_rank.php", _local3, "POST");
}
function initScoreBox() {
trace("initScoreBox");
_submitScoreClip.scoreTXT.setNum(score);
_submitScoreClip.scoreTXT.tellMe();
}
function highScoreSendResult(_result) {
trace(_result);
if (_result) {
_submitScoreClip.gotoAndStop("success");
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:closeDoors, delay:1.5});
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:goIntro, delay:3, overwrite:false});
} else {
_submitScoreClip.gotoAndStop("error");
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:closeDoors, delay:1.5});
gs.TweenMax.to(_submitScoreClip, 1, {onComplete:goIntro, delay:3, overwrite:false});
}
}
openDoors();
_level0.cs.track.event("game_complete");
currentGamePage = "GAMEOVER";
showNonGameHUD();
scoreSubmitHolder.onEnterFrame = function () {
if ((Math.random() * 10) < 1) {
createparticleSpray(Math.random() * 450, Math.random() * 360, 3);
}
};
stop();
gameOverText._alpha = 0;
gameOverText._xscale = (gameOverText._yscale = 200);
gs.TweenLite.to(gameOverText, 0.5, {_alpha:100, _yscale:100, _xscale:100, ease:mx.transitions.easing.Back.easeOut});
scoreboxes._alpha = 0;
gs.TweenLite.to(scoreboxes, 0.5, {delay:0.75, _alpha:100});
yourHighestTextBox._alpha = 0;
gs.TweenLite.to(yourHighestTextBox, 0.5, {delay:1, _alpha:100});
playBtn._alpha = 0;
playBtn._xscale = (playBtn._yscale = 200);
gs.TweenLite.to(playBtn, 0.5, {delay:1, _alpha:100, _yscale:100, _xscale:100, ease:mx.transitions.easing.Back.easeOut});
_quality = "best";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
playSound("mouseDown.wav");
removeMovieClip(highHolder);
gotoAndPlay (23);
};
storage.flush();
setupSubmitScore();
Frame 43
stop();
Symbol 345 MovieClip [__Packages.tileClass] Frame 0
class tileClass extends MovieClip
{
var faceDisplayed, gotoAndStop, gotoAndPlay;
function tileClass () {
super();
}
function getFace() {
return(faceDisplayed);
}
function setFace(_val) {
faceDisplayed = _val;
if (faceDisplayed == "white") {
gotoAndStop("white");
} else if (faceDisplayed == "black") {
gotoAndStop("black");
}
}
function flipTile() {
if (faceDisplayed == "white") {
faceDisplayed = "black";
gotoAndPlay("turnBlack");
} else if (faceDisplayed == "black") {
faceDisplayed = "white";
gotoAndPlay("turnWhite");
}
}
}
Symbol 346 MovieClip [__Packages.soundManager] Frame 0
class soundManager
{
static var clipRef, mysoundobj;
function soundManager () {
}
static function setClip(_clip) {
clipRef = _clip;
}
static function playSound(_soundLinkageRef) {
mysoundobj = new Sound(clipRef);
mysoundobj.attachSound(_soundLinkageRef);
mysoundobj.start();
}
}
Symbol 347 MovieClip [__Packages.particleClass] Frame 0
class particleClass extends MovieClip
{
var speed, typeOfParticle, rot, clip, locX, locY, remove, life, alphaFade, vx, vy;
function particleClass (_locX, _locY, _type, _speed, _rot, _clip) {
super();
speed = _speed;
typeOfParticle = _type;
rot = _rot;
clip = _clip;
locX = _locX;
locY = _locY;
calculateValues();
remove = false;
life = 50;
alphaFade = 100 / life;
switch (typeOfParticle) {
case P_NORMAL :
life = 25;
alphaFade = 100 / life;
break;
case P_SLOW :
clip.clip.gotoAndStop(Math.floor(Math.random() * 3) + 1);
break;
case P_WANDER :
life = 30;
alphaFade = 100 / life;
break;
case P_SMOKE :
clip._xscale = (clip._yscale = (Math.random() * 60) + 20);
clip._alpha = (Math.random() * 50) + 50;
rot = Math.random() * 360;
break;
case P_STEAM :
life = 25;
alphaFade = 40 / life;
clip._rotation = Math.random() * 360;
clip._alpha = 60;
clip._xscale = (clip._yscale = (Math.random() * 20) + 20);
break;
case P_STEAM2 :
life = 50;
alphaFade = 60 / life;
clip._rotation = Math.random() * 360;
clip._alpha = 60;
clip._xscale = (clip._yscale = (Math.random() * 20) + 20);
}
manageParticle();
}
function getClip() {
return(clip);
}
function getRemove() {
return(remove);
}
function calculateValues() {
var _local2 = (rot / 180) * Math.PI;
vx = Math.cos(_local2) * speed;
vy = Math.sin(_local2) * speed;
if (typeOfParticle != P_STEAM) {
clip._rotation = rot;
}
}
function manageParticle() {
life--;
if (life < 1) {
remove = true;
} else {
switch (typeOfParticle) {
case P_NORMAL :
clip._alpha = clip._alpha - alphaFade;
break;
case P_WANDER :
vy = vy + 0.02;
vy = vy + 0.2;
clip._alpha = clip._alpha - alphaFade;
break;
case P_SLOW :
vx = vx * 0.95;
vy = vy + 0.25;
rot = rot + ((Math.random() * 10) - 5);
clip._alpha = clip._alpha - alphaFade;
break;
case P_SMOKE :
vy = vy + 0.02;
clip._alpha = clip._alpha - alphaFade;
clip._xscale = (clip._yscale = clip._yscale + 1);
break;
case P_STEAM :
vy = vy - 0.02;
clip._alpha = clip._alpha - alphaFade;
clip._xscale = (clip._yscale = clip._yscale + 1);
break;
case P_STEAM2 :
vy = vy - 0.02;
clip._alpha = clip._alpha - alphaFade;
clip._xscale = (clip._yscale = clip._yscale + 1);
}
clip._x = locX;
clip._y = locY;
locX = locX + vx;
locY = locY + vy;
if (locX > 450) {
remove = true;
}
}
}
var P_NORMAL = 1;
var P_WANDER = 2;
var P_SLOW = 3;
var P_SMOKE = 4;
var P_STEAM = 5;
var P_STEAM2 = 7;
}
Symbol 348 MovieClip [__Packages.gs.TweenLite] Frame 0
class gs.TweenLite
{
static var _e, _classInitted, _curTime, _gc, overwriteManager, _listening;
var tweenID, endTargetID, vars, duration, delay, _active, target, tweens, _subTweens, _hst, _initted, initTime, startTime, _hasUpdate;
function TweenLite ($target, $duration, $vars) {
if ((_e._visible != false) || (!_classInitted)) {
_curTime = getTimer();
var _local3 = 999;
while (_root.getInstanceAtDepth(_local3) != undefined) {
_local3++;
}
_e = _root.createEmptyMovieClip("__tweenLite_mc", _local3);
_e._visible = false;
clearInterval(_gc);
_gc = setInterval(killGarbage, 2000);
_e.onEnterFrame = executeAll;
if (overwriteManager == undefined) {
overwriteManager = {mode:1, enabled:false};
}
_classInitted = true;
}
_cnt++;
tweenID = "tw" + _cnt;
endTargetID = getID($target, true);
var _local6 = (($vars.overwrite == undefined) ? (overwriteManager.mode) : (Number($vars.overwrite)));
if ((_local6 == 1) && ($target != undefined)) {
delete _all[endTargetID];
_all[endTargetID] = {info:[$target, endTargetID]};
}
_all[endTargetID][tweenID] = this;
vars = $vars;
duration = $duration || 0.001;
delay = $vars.delay || 0;
_active = ($duration == 0) && (delay == 0);
target = $target;
if (typeof(vars.ease) != "function") {
vars.ease = defaultEase;
}
if (vars.easeParams != undefined) {
vars.proxiedEase = vars.ease;
vars.ease = easeProxy;
}
if (typeof(vars.autoAlpha) == "number") {
vars._alpha = vars.autoAlpha;
vars._visible = vars._alpha > 0;
}
tweens = [];
_subTweens = [];
_hst = (_initted = false);
initTime = _curTime;
if (_active || ((vars.runBackwards == true) && (vars.renderOnStart != true))) {
initTweenVals();
startTime = _curTime;
if (_active) {
render(startTime + 1);
} else {
render(startTime);
}
if ((vars._visible != undefined) && (vars.runBackwards == true)) {
target._visible = vars._visible;
}
}
if ((!_active) && (!_listening)) {
_listening = true;
}
}
function initTweenVals($hrp, $reservedProps) {
var _local9 = typeof(target) == "movieclip";
var _local3;
var _local2;
if (($hrp != true) && (overwriteManager.enabled)) {
overwriteManager.manageOverwrites(vars, _all[endTargetID]);
}
if (target instanceof Array) {
var _local5 = vars.endArray || ([]);
_local2 = 0;
while (_local2 < _local5.length) {
if ((target[_local2] != _local5[_local2]) && (target[_local2] != undefined)) {
tweens[tweens.length] = {o:target, p:_local2.toString(), s:target[_local2], c:_local5[_local2] - target[_local2], name:_local2.toString()};
}
_local2++;
}
} else {
if (((vars.tint != undefined) || (vars.removeTint == true)) && (_local9 || (target instanceof TextField))) {
var _local14 = new Color(target);
var _local11 = vars._alpha;
if (_local11 != undefined) {
delete vars._alpha;
} else {
_local11 = target._alpha;
}
if (((vars.removeTint == true) || (vars.tint == null)) || (vars.tint == "")) {
addSubTween("tint", tintProxy, _local14.getTransform(), {rb:0, gb:0, bb:0, ab:0, ra:_local11, ga:_local11, ba:_local11, aa:_local11}, {color:_local14});
} else {
addSubTween("tint", tintProxy, _local14.getTransform(), {rb:vars.tint >> 16, gb:(vars.tint >> 8) & 255, bb:vars.tint & 255, ra:0, ga:0, ba:0, aa:_local11}, {color:_local14});
}
}
if ((vars.frame != undefined) && (_local9)) {
addSubTween("frame", frameProxy, {frame:target._currentframe}, {frame:vars.frame}, {mc:target});
}
if ((vars.volume != undefined) && (_local9 || (target instanceof Sound))) {
var _local15;
if (_local9) {
_local15 = new Sound(target);
} else {
_local15 = Sound(target);
}
addSubTween("volume", volumeProxy, {volume:_local15.getVolume()}, {volume:vars.volume}, {sound:_local15});
}
for (_local3 in vars) {
if (((((((((((((((((((_local3 == "ease") || (_local3 == "delay")) || (_local3 == "overwrite")) || (_local3 == "onComplete")) || (_local3 == "onCompleteParams")) || (_local3 == "onCompleteScope")) || (_local3 == "runBackwards")) || (_local3 == "onUpdate")) || (_local3 == "onUpdateParams")) || (_local3 == "onUpdateScope")) || (_local3 == "persist")) || (_local3 == "volume")) || (_local3 == "onStart")) || (_local3 == "onStartParams")) || (_local3 == "onStartScope")) || (_local3 == "renderOnStart")) || (_local3 == "proxiedEase")) || (_local3 == "easeParams")) || ($hrp && ($reservedProps.indexOf((" " + _local3) + " ") != -1))) {
} else if ((!(_local9 && (((((_local3 == "_visible") || (_local3 == "autoAlpha")) || (_local3 == "tint")) || (_local3 == "removeTint")) || (_local3 == "frame")))) && (target[_local3] != undefined)) {
if (typeof(vars[_local3]) == "number") {
tweens[tweens.length] = {o:target, p:_local3, s:target[_local3], c:vars[_local3] - target[_local3], name:_local3};
} else {
tweens[tweens.length] = {o:target, p:_local3, s:target[_local3], c:Number(vars[_local3]), name:_local3};
}
}
}
}
if (vars.runBackwards == true) {
var _local4;
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local4 = tweens[_local2];
_local4.s = _local4.s + _local4.c;
_local4.c = _local4.c * -1;
_local2--;
}
}
if (vars._visible == true) {
target._visible = true;
}
if (vars.onUpdate != null) {
_hasUpdate = true;
}
_initted = true;
}
function addSubTween($name, $proxy, $target, $props, $info) {
var _local7 = {name:$name, proxy:$proxy, target:$target, info:$info};
_subTweens[_subTweens.length] = _local7;
for (var _local10 in $props) {
if (typeof($props[_local10]) == "number") {
tweens[tweens.length] = {o:$target, p:_local10, s:$target[_local10], c:$props[_local10] - $target[_local10], sub:_local7, name:$name};
} else {
tweens[tweens.length] = {o:$target, p:_local10, s:$target[_local10], c:Number($props[_local10]), sub:_local7, name:$name};
}
}
_hst = true;
}
static function to($target, $duration, $vars) {
return(new gs.TweenLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenLite($target, $duration, $vars));
}
static function delayedCall($delay, $onComplete, $onCompleteParams, $onCompleteScope) {
return(new gs.TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:0}));
}
function render($t) {
var _local5 = ($t - startTime) / 1000;
var _local4;
var _local3;
var _local2;
if (_local5 >= duration) {
_local5 = duration;
_local4 = 1;
} else {
_local4 = vars.ease(_local5, 0, 1, duration);
}
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local3 = tweens[_local2];
_local3.o[_local3.p] = _local3.s + (_local4 * _local3.c);
_local2--;
}
if (_hst) {
_local2 = _subTweens.length - 1;
while (_local2 > -1) {
_subTweens[_local2].proxy(_subTweens[_local2]);
_local2--;
}
}
if (_hasUpdate) {
vars.onUpdate.apply(vars.onUpdateScope, vars.onUpdateParams);
}
if (_local5 == duration) {
complete(true);
}
}
static function executeAll() {
var _local5 = (_curTime = getTimer());
if (_listening) {
var _local2 = _all;
var _local1;
var _local4;
var _local3;
for (_local3 in _local2) {
for (_local4 in _local2[_local3]) {
_local1 = _local2[_local3][_local4];
if (_local1.active) {
_local1.render(_local5);
}
}
}
}
}
static function removeTween($t) {
_all[$t.endTargetID][$t.tweenID] = {active:false};
delete _all[$t.endTargetID][$t.tweenID];
}
static function killTweensOf($tg, $complete) {
var _local3 = getID($tg, true);
if ($complete) {
var _local1 = _all[_local3];
for (var _local2 in _local1) {
_local1[_local2].complete(false);
}
}
delete _all[_local3];
}
function complete($skipRender) {
if ($skipRender != true) {
if (!_initted) {
initTweenVals();
}
startTime = _curTime - (duration * 1000);
render(_curTime);
return(undefined);
}
if (vars._visible != undefined) {
if ((vars.autoAlpha != undefined) && (target._alpha == 0)) {
target._visible = false;
} else if (vars.runBackwards != true) {
target._visible = vars._visible;
}
}
if (vars.onComplete) {
vars.onComplete.apply(vars.onCompleteScope, vars.onCompleteParams);
}
if (vars.persist != true) {
removeTween(this);
}
}
function killVars($vars) {
if (overwriteManager.enabled) {
overwriteManager.killVars($vars, vars, tweens, _subTweens, []);
}
}
static function getID($tg, $lookup) {
var _local3;
if ($lookup) {
var _local1 = _all;
if (typeof($tg) == "movieclip") {
if (_local1[String($tg)] != undefined) {
return(String($tg));
}
_local3 = String($tg);
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
for (var _local4 in _local1) {
if (_local1[_local4].info[0] == $tg) {
return(_local4);
}
}
}
_cnt++;
_local3 = "t" + _cnt;
_all[_local3] = {info:[$tg, _local3]};
return(_local3);
}
static function killGarbage() {
if (_listening) {
var _local1 = _all;
var _local2;
var _local3;
var _local5;
var _local6 = 0;
var _local4 = 0;
for (_local3 in _local1) {
_local4 = 0;
for (_local5 in _local1[_local3]) {
_local2 = _local1[_local3][_local5];
if (_local2.tweens == undefined) {
} else {
_local4++;
}
}
if (_local4 == 0) {
delete _local1[_local3];
} else {
_local6++;
}
}
if (_local6 == 0) {
_listening = false;
}
}
}
static function defaultEase($t, $b, $c, $d) {
$t = $t / $d;
return((((-$c) * $t) * ($t - 2)) + $b);
}
function easeProxy($t, $b, $c, $d) {
var _local3 = this;
return(_local3.proxiedEase.apply(null, arguments.concat(_local3.easeParams)));
}
static function tintProxy($o) {
$o.info.color.setTransform($o.target);
}
static function frameProxy($o) {
$o.info.mc.gotoAndStop(Math.round($o.target.frame));
}
static function volumeProxy($o) {
$o.info.sound.setVolume($o.target.volume);
}
function get active() {
if (_active) {
return(true);
}
if (((_curTime - initTime) / 1000) > delay) {
_active = true;
startTime = initTime + (delay * 1000);
if (!_initted) {
initTweenVals();
} else if (vars._visible != undefined) {
target._visible = true;
}
if (duration == 0.001) {
startTime = startTime - 1;
}
if (vars.onStart != undefined) {
vars.onStart.apply(vars.onStartScope, vars.onStartParams);
}
return(true);
}
return(false);
}
static var version = 8.02;
static var killDelayedCallsTo = killTweensOf;
static var _all = new Object();
static var _cnt = -16000;
static var _hrp = false;
}
Symbol 349 MovieClip [__Packages.gs.TweenFilterLite] Frame 0
class gs.TweenFilterLite extends gs.TweenLite
{
var vars, endTargetID, _clrsa, _filters, _matrix, target, _cmf, _endMatrix, tweens, startTime, duration, _hst, _subTweens, _hasUpdate, complete;
function TweenFilterLite ($target, $duration, $vars) {
super($target, $duration, $vars);
if (gs.TweenLite.version < 8.02) {
trace("TweenFilterLite error: Please update your TweenLite class or try clearing your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
}
if ($vars.type != undefined) {
trace(("TweenFilterLite warning: " + $target) + " appears to be using deprecated syntax. Please update to the new syntax. See http://www.TweenFilterLite.com for details.");
}
}
static function to($target, $duration, $vars) {
return(new gs.TweenFilterLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenFilterLite($target, $duration, $vars));
}
function initTweenVals($hrp, $reservedProps) {
if (($hrp != true) && (gs.TweenLite.overwriteManager.enabled)) {
gs.TweenLite.overwriteManager.manageOverwrites(vars, gs.TweenLite._all[endTargetID]);
}
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
$reservedProps = $reservedProps || "";
$reservedProps = $reservedProps + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ";
if ((typeof(target) == "movieclip") || (target instanceof TextField)) {
var _local4;
var _local5;
if (vars.blurFilter != undefined) {
_local5 = vars.blurFilter;
addFilter("blurFilter", _local5, flash.filters.BlurFilter, ["blurX", "blurY", "quality"], new flash.filters.BlurFilter(0, 0, _local5.quality || 2));
}
if (vars.glowFilter != undefined) {
_local5 = vars.glowFilter;
addFilter("glowFilter", _local5, flash.filters.GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new flash.filters.GlowFilter(16777215, 0, 0, 0, _local5.strength || 1, _local5.quality || 2, _local5.inner, _local5.knockout));
}
if (vars.colorMatrixFilter != undefined) {
_local5 = vars.colorMatrixFilter;
var _local12 = addFilter("colorMatrixFilter", _local5, flash.filters.ColorMatrixFilter, [], new flash.filters.ColorMatrixFilter(_matrix));
_cmf = _local12.filter;
_matrix = _cmf.matrix;
if ((_local5.matrix != undefined) && (_local5.matrix instanceof Array)) {
_endMatrix = _local5.matrix;
} else {
if (_local5.relative == true) {
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
}
_endMatrix = setBrightness(_endMatrix, _local5.brightness);
_endMatrix = setContrast(_endMatrix, _local5.contrast);
_endMatrix = setHue(_endMatrix, _local5.hue);
_endMatrix = setSaturation(_endMatrix, _local5.saturation);
_endMatrix = setThreshold(_endMatrix, _local5.threshold);
if (!isNaN(_local5.colorize)) {
_endMatrix = colorize(_endMatrix, _local5.colorize, _local5.amount);
} else if (!isNaN(_local5.color)) {
_endMatrix = colorize(_endMatrix, _local5.color, _local5.amount);
}
}
_local4 = 0;
while (_local4 < _endMatrix.length) {
if ((_matrix[_local4] != _endMatrix[_local4]) && (_matrix[_local4] != undefined)) {
tweens[tweens.length] = {o:_matrix, p:_local4.toString(), s:_matrix[_local4], c:_endMatrix[_local4] - _matrix[_local4], name:"colorMatrixFilter"};
}
_local4++;
}
}
if (vars.dropShadowFilter != undefined) {
_local5 = vars.dropShadowFilter;
addFilter("dropShadowFilter", _local5, flash.filters.DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new flash.filters.DropShadowFilter(0, 45, 0, 0, 0, 0, 1, _local5.quality || 2, _local5.inner, _local5.knockout, _local5.hideObject));
}
if (vars.bevelFilter != undefined) {
_local5 = vars.bevelFilter;
addFilter("bevelFilter", _local5, flash.filters.BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new flash.filters.BevelFilter(0, 0, 16777215, 0.5, 0, 0.5, 2, 2, 0, _local5.quality || 2));
}
if (vars.runBackwards == true) {
var _local3;
_local4 = 0;
while (_local4 < _clrsa.length) {
_local3 = _clrsa[_local4];
_local3.sr = _local3.sr + _local3.cr;
_local3.cr = _local3.cr * -1;
_local3.sg = _local3.sg + _local3.cg;
_local3.cg = _local3.cg * -1;
_local3.sb = _local3.sb + _local3.cb;
_local3.cb = _local3.cb * -1;
_local3.f[_local3.p] = ((_local3.sr << 16) | (_local3.sg << 8)) | _local3.sb;
_local4++;
}
}
super.initTweenVals(true, $reservedProps);
} else {
super.initTweenVals($hrp, $reservedProps);
}
}
function addFilter($name, $fv, $filterType, $props, $defaultFilter) {
var _local5 = {type:$filterType, name:$name};
var _local8 = target.filters;
var _local3;
var _local2;
var _local9;
var _local4;
var _local7;
_local3 = 0;
while (_local3 < _local8.length) {
if (_local8[_local3] instanceof $filterType) {
_local5.filter = _local8[_local3];
break;
}
_local3++;
}
if (_local5.filter == undefined) {
_local5.filter = $defaultFilter;
_local8[_local8.length] = _local5.filter;
target.filters = _local8;
}
_local3 = 0;
while (_local3 < $props.length) {
_local2 = $props[_local3];
if ($fv[_local2] != undefined) {
if (((_local2 == "color") || (_local2 == "highlightColor")) || (_local2 == "shadowColor")) {
_local4 = HEXtoRGB(_local5.filter[_local2]);
_local7 = HEXtoRGB($fv[_local2]);
_clrsa[_clrsa.length] = {f:_local5.filter, p:_local2, sr:_local4.rb, cr:_local7.rb - _local4.rb, sg:_local4.gb, cg:_local7.gb - _local4.gb, sb:_local4.bb, cb:_local7.bb - _local4.bb};
} else if ((((_local2 == "quality") || (_local2 == "inner")) || (_local2 == "knockout")) || (_local2 == "hideObject")) {
_local5.filter[_local2] = $fv[_local2];
} else {
if (typeof($fv[_local2]) == "number") {
_local9 = $fv[_local2] - _local5.filter[_local2];
} else {
_local9 = Number($fv[_local2]);
}
tweens[tweens.length] = {o:_local5.filter, p:_local2, s:_local5.filter[_local2], c:_local9, name:$name};
}
}
_local3++;
}
_filters[_filters.length] = _local5;
_hf = true;
return(_local5);
}
function render($t) {
var _local10 = ($t - startTime) / 1000;
var _local6;
var _local3;
var _local2;
if (_local10 >= duration) {
_local10 = duration;
}
_local6 = vars.ease(_local10, 0, 1, duration);
_local2 = tweens.length - 1;
while (_local2 > -1) {
_local3 = tweens[_local2];
_local3.o[_local3.p] = _local3.s + (_local6 * _local3.c);
_local2--;
}
if (_hf) {
var _local4;
var _local8;
var _local9;
var _local7;
_local2 = _clrsa.length - 1;
while (_local2 > -1) {
_local3 = _clrsa[_local2];
_local8 = _local3.sr + (_local6 * _local3.cr);
_local9 = _local3.sg + (_local6 * _local3.cg);
_local7 = _local3.sb + (_local6 * _local3.cb);
_local3.f[_local3.p] = ((_local8 << 16) | (_local9 << 8)) | _local7;
_local2--;
}
if (_cmf) {
_cmf.matrix = _matrix;
}
var _local5 = target.filters;
_local2 = 0;
while (_local2 < _filters.length) {
_local4 = _local5.length - 1;
while (_local4 > -1) {
if (_local5[_local4] instanceof _filters[_local2].type) {
_local5.splice(_local4, 1, _filters[_local2].filter);
break;
}
_local4--;
}
_local2++;
}
target.filters = _local5;
}
if (_hst) {
_local2 = _subTweens.length - 1;
while (_local2 > -1) {
_subTweens[_local2].proxy(_subTweens[_local2]);
_local2--;
}
}
if (_hasUpdate) {
vars.onUpdate.apply(vars.onUpdateScope, vars.onUpdateParams);
}
if (_local10 == duration) {
complete(true);
}
}
function killVars($vars) {
if (gs.TweenLite.overwriteManager.enabled) {
gs.TweenLite.overwriteManager.killVars($vars, vars, tweens, _subTweens, _filters);
}
}
function HEXtoRGB($n) {
return({rb:$n >> 16, gb:($n >> 8) & 255, bb:$n & 255});
}
static function colorize($m, $color, $amount) {
if (($color == undefined) || (isNaN($color))) {
return($m);
}
if ($amount == undefined) {
$amount = 1;
}
var _local3 = (($color >> 16) & 255) / 255;
var _local5 = (($color >> 8) & 255) / 255;
var _local2 = ($color & 255) / 255;
var _local4 = 1 - $amount;
var _local7 = [_local4 + (($amount * _local3) * _lumR), ($amount * _local3) * _lumG, ($amount * _local3) * _lumB, 0, 0, ($amount * _local5) * _lumR, _local4 + (($amount * _local5) * _lumG), ($amount * _local5) * _lumB, 0, 0, ($amount * _local2) * _lumR, ($amount * _local2) * _lumG, _local4 + (($amount * _local2) * _lumB), 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local7, $m));
}
static function setThreshold($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local2 = [_lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, _lumR * 256, _lumG * 256, _lumB * 256, 0, -256 * $n, 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function setHue($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n * (Math.PI/180);
var _local1 = Math.cos($n);
var _local2 = Math.sin($n);
var _local4 = [(_lumR + (_local1 * (1 - _lumR))) + (_local2 * (-_lumR)), (_lumG + (_local1 * (-_lumG))) + (_local2 * (-_lumG)), (_lumB + (_local1 * (-_lumB))) + (_local2 * (1 - _lumB)), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * 0.143), (_lumG + (_local1 * (1 - _lumG))) + (_local2 * 0.14), (_lumB + (_local1 * (-_lumB))) + (_local2 * -0.283), 0, 0, (_lumR + (_local1 * (-_lumR))) + (_local2 * (-(1 - _lumR))), (_lumG + (_local1 * (-_lumG))) + (_local2 * _lumG), (_lumB + (_local1 * (1 - _lumB))) + (_local2 * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return(applyMatrix(_local4, $m));
}
static function setBrightness($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = ($n * 100) - 100;
return(applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
static function setSaturation($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
var _local4 = 1 - $n;
var _local3 = _local4 * _lumR;
var _local5 = _local4 * _lumG;
var _local2 = _local4 * _lumB;
var _local6 = [_local3 + $n, _local5, _local2, 0, 0, _local3, _local5 + $n, _local2, 0, 0, _local3, _local5, _local2 + $n, 0, 0, 0, 0, 0, 1, 0];
return(applyMatrix(_local6, $m));
}
static function setContrast($m, $n) {
if (($n == undefined) || (isNaN($n))) {
return($m);
}
$n = $n + 0.01;
var _local2 = [$n, 0, 0, 0, 128 * (1 - $n), 0, $n, 0, 0, 128 * (1 - $n), 0, 0, $n, 0, 128 * (1 - $n), 0, 0, 0, 1, 0];
return(applyMatrix(_local2, $m));
}
static function applyMatrix($m, $m2) {
if (((($m == undefined) || (!($m instanceof Array))) || ($m2 == undefined)) || (!($m2 instanceof Array))) {
return($m2);
}
var _local7 = [];
var _local2 = 0;
var _local5 = 0;
var _local6;
var _local1;
_local6 = 0;
while (_local6 < 4) {
_local1 = 0;
while (_local1 < 5) {
if (_local1 == 4) {
_local5 = $m[_local2 + 4];
} else {
_local5 = 0;
}
_local7[_local2 + _local1] = (((($m[_local2] * $m2[_local1]) + ($m[_local2 + 1] * $m2[_local1 + 5])) + ($m[_local2 + 2] * $m2[_local1 + 10])) + ($m[_local2 + 3] * $m2[_local1 + 15])) + _local5;
_local1++;
}
_local2 = _local2 + 5;
_local6++;
}
return(_local7);
}
static var version = 8.02;
static var delayedCall = gs.TweenLite.delayedCall;
static var killTweensOf = gs.TweenLite.killTweensOf;
static var killDelayedCallsTo = gs.TweenLite.killDelayedCallsTo;
static var _idMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
static var _lumR = 0.212671;
static var _lumG = 0.71516;
static var _lumB = 0.072169;
var _hf = false;
}
Symbol 350 MovieClip [__Packages.gs.OverwriteManager] Frame 0
class gs.OverwriteManager
{
static var mode, enabled;
function OverwriteManager () {
}
static function init($mode) {
if (gs.TweenLite.version < 8.01) {
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
}
gs.TweenLite.overwriteManager = gs.OverwriteManager;
mode = (($mode == undefined) ? 2 : ($mode));
enabled = true;
return(mode);
}
static function manageOverwrites($vars, $objTweens) {
var _local5 = (($vars.overwrite == undefined) ? (mode) : (Number($vars.overwrite)));
if (_local5 < 2) {
return(undefined);
}
var _local1;
if (_local5 == AUTO) {
var _local3 = {};
for (_local1 in $vars) {
if ((((((((((((((((((_local1 == "ease") || (_local1 == "delay")) || (_local1 == "overwrite")) || (_local1 == "onComplete")) || (_local1 == "onCompleteParams")) || (_local1 == "runBackwards")) || (_local1 == "persist")) || (_local1 == "onUpdate")) || (_local1 == "onUpdateParams")) || (_local1 == "onStart")) || (_local1 == "onStartParams")) || (_local1 == "renderOnStart")) || (_local1 == "proxiedEase")) || (_local1 == "easeParams")) || (_local1 == "onCompleteAll")) || (_local1 == "onCompleteAllParams")) || (_local1 == "yoyo")) || (_local1 == "loop")) {
} else {
_local3[_local1] = 1;
}
}
for (_local1 in $objTweens) {
if ((_local1 != "info") && ($objTweens[_local1].tweens.length != 0)) {
$objTweens[_local1].killVars(_local3);
}
}
} else {
for (_local1 in $objTweens) {
if ((_local1 != "info") && ($objTweens[_local1].tweens.length != 0)) {
delete $objTweens[_local1];
}
}
}
}
static function killVars($killVars, $vars, $tweens, $subTweens, $filters) {
var _local1 = $subTweens.length - 1;
while (_local1 > -1) {
if ($killVars[$subTweens[_local1].name] != undefined) {
$subTweens.splice(_local1, 1);
}
_local1--;
}
_local1 = $tweens.length - 1;
while (_local1 > -1) {
if ($killVars[$tweens[_local1].name] != undefined) {
$tweens.splice(_local1, 1);
}
_local1--;
}
_local1 = $filters.length - 1;
while (_local1 > -1) {
if ($killVars[$filters[_local1].name] != undefined) {
$filters.splice(_local1, 1);
}
_local1--;
}
for (var _local6 in $killVars) {
delete $vars[_local6];
}
}
static var version = 0.91;
static var NONE = 0;
static var ALL = 1;
static var AUTO = 2;
static var CONCURRENT = 3;
}
Symbol 351 MovieClip [__Packages.gs.TweenMax] Frame 0
class gs.TweenMax extends gs.TweenFilterLite
{
var _pauseTime, _originalEase, vars, _thisReverseEase, endTargetID, target, addSubTween, _active, initTime, startTime, delay, duration, render, _initted, tweens, _subTweens, killVars;
function TweenMax ($target, $duration, $vars) {
super($target, $duration, $vars);
_pauseTime = null;
_originalEase = vars.ease;
_thisReverseEase = mx.utils.Delegate.create(this, reverseEase);
if ((vars.yoyo == true) || (vars.loop == true)) {
vars.persist = true;
}
if (gs.TweenFilterLite.version < 8.02) {
trace("TweenMax error! Please update your TweenFilterLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
}
}
function initTweenVals($hrp, $reservedProps) {
$reservedProps = $reservedProps || "";
$reservedProps = $reservedProps + " hexColors bezier bezierThrough orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop ";
var _local3;
var _local4;
var _local15;
var _local13;
var _local5;
var _local9 = bezierProxy;
if (($hrp != true) && (gs.TweenLite.overwriteManager.enabled)) {
gs.TweenLite.overwriteManager.manageOverwrites(vars, gs.TweenLite._all[endTargetID]);
}
if (vars.orientToBezier == true) {
vars.orientToBezier = [["_x", "_y", "_rotation", 0]];
_local9 = bezierProxy2;
} else if (vars.orientToBezier instanceof Array) {
_local9 = bezierProxy2;
}
if (vars.bezier != undefined) {
_local13 = {};
_local5 = vars.bezier;
_local4 = 0;
while (_local4 < _local5.length) {
for (_local3 in _local5[_local4]) {
if (_local13[_local3] == undefined) {
_local13[_local3] = [target[_local3]];
}
if (typeof(_local5[_local4][_local3]) == "number") {
_local13[_local3].push(_local5[_local4][_local3]);
} else {
_local13[_local3].push(target[_local3] + Number(_local5[_local4][_local3]));
}
}
_local4++;
}
for (_local3 in _local13) {
if (typeof(vars[_local3]) == "number") {
_local13[_local3].push(vars[_local3]);
} else {
_local13[_local3].push(target[_local3] + Number(vars[_local3]));
}
delete vars[_local3];
}
addSubTween("bezier", _local9, {t:0}, {t:1}, {props:parseBeziers(_local13, false), target:target, orientToBezier:vars.orientToBezier});
}
if (vars.bezierThrough != undefined) {
_local13 = {};
_local5 = vars.bezierThrough;
_local4 = 0;
while (_local4 < _local5.length) {
for (_local3 in _local5[_local4]) {
if (_local13[_local3] == undefined) {
_local13[_local3] = [target[_local3]];
}
if (typeof(_local5[_local4][_local3]) == "number") {
_local13[_local3].push(_local5[_local4][_local3]);
} else {
_local13[_local3].push(target[_local3] + Number(_local5[_local4][_local3]));
}
}
_local4++;
}
for (_local3 in _local13) {
if (typeof(vars[_local3]) == "number") {
_local13[_local3].push(vars[_local3]);
} else {
_local13[_local3].push(target[_local3] + Number(vars[_local3]));
}
delete vars[_local3];
}
addSubTween("bezierThrough", _local9, {t:0}, {t:1}, {props:parseBeziers(_local13, true), target:target, orientToBezier:vars.orientToBezier});
}
if ((vars.hexColors != undefined) && (typeof(vars.hexColors) == "object")) {
for (_local3 in vars.hexColors) {
addSubTween("hexColors", hexColorsProxy, {r:target[_local3] >> 16, g:(target[_local3] >> 8) & 255, b:target[_local3] & 255}, {r:vars.hexColors[_local3] >> 16, g:(vars.hexColors[_local3] >> 8) & 255, b:vars.hexColors[_local3] & 255}, {prop:_local3, target:target});
}
}
super.initTweenVals(true, $reservedProps);
}
function pause() {
if (_pauseTime == null) {
_pauseTime = gs.TweenLite._curTime;
_active = false;
}
}
function resume() {
if (_pauseTime != null) {
var _local2 = gs.TweenLite._curTime - _pauseTime;
initTime = initTime + _local2;
if (startTime != undefined) {
startTime = startTime + _local2;
}
_pauseTime = null;
if (((gs.TweenLite._curTime - initTime) / 1000) > delay) {
_active = true;
}
}
}
function restart() {
progress = (0);
resume();
}
function reverse($adjustDuration) {
vars.ease = ((vars.ease == _originalEase) ? (_thisReverseEase) : (_originalEase));
if (($adjustDuration != false) && (gs.TweenLite._curTime > startTime)) {
startTime = gs.TweenLite._curTime - (((1 - progress) * duration) * 1000);
initTime = startTime - (delay * 1000);
}
}
function reverseEase($t, $b, $c, $d) {
return(_originalEase($d - $t, $b, $c, $d));
}
function complete($skipRender) {
super.complete($skipRender);
if ((vars.yoyo == true) || (vars.loop == true)) {
if (vars.yoyo == true) {
reverse(false);
}
startTime = gs.TweenLite._curTime;
initTime = startTime - (delay * 1000);
render(gs.TweenLite._curTime);
} else if (vars.persist == true) {
_pauseTime = gs.TweenLite._curTime;
_active = false;
}
}
function invalidate() {
if (_initted) {
var _local2 = progress;
progress = (0);
tweens = [];
_subTweens = [];
initTweenVals();
if (_local2 != 0) {
progress = (_local2);
}
}
}
function killProperties($names) {
var _local4 = {};
var _local2;
_local2 = $names.length - 1;
while (_local2 > -1) {
if (vars[$names[_local2]] != undefined) {
_local4[$names[_local2]] = 1;
}
_local2--;
}
killVars(_local4);
}
static function to($target, $duration, $vars) {
return(new gs.TweenMax($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new gs.TweenMax($target, $duration, $vars));
}
static function allTo($targets, $duration, $vars) {
if ($targets.length == 0) {
return([]);
}
var _local4;
var _local3;
var _local1;
var _local10;
var _local7;
var _local5 = [];
var _local9 = $vars.delayIncrement || 0;
delete $vars.delayIncrement;
if ($vars.onCompleteAll == undefined) {
_local7 = $vars;
} else {
_local7 = {};
for (_local1 in $vars) {
_local7[_local1] = $vars[_local1];
}
_local7.onCompleteParams = [[$vars.onComplete, $vars.onCompleteAll], [$vars.onCompleteParams, $vars.onCompleteAllParams], [$vars.onCompleteScope, $vars.onCompleteAllScope]];
_local7.onComplete = callbackProxy;
delete $vars.onCompleteAll;
}
delete $vars.onCompleteAllParams;
delete $vars.onCompleteAllScope;
if (_local9 == 0) {
_local5[_local5.length] = new gs.TweenMax($targets[0], $duration, _local7);
_local4 = 1;
while (_local4 < $targets.length) {
_local3 = {};
for (_local1 in $vars) {
_local3[_local1] = $vars[_local1];
}
_local5[_local5.length] = new gs.TweenMax($targets[_local4], $duration, _local3);
_local4++;
}
} else {
_local10 = $vars.delay || 0;
_local4 = 0;
while (_local4 < ($targets.length - 1)) {
_local3 = {};
for (_local1 in $vars) {
_local3[_local1] = $vars[_local1];
}
_local3.delay = _local10 + (_local4 * _local9);
_local5[_local5.length] = new gs.TweenMax($targets[_local4], $duration, _local3);
_local4++;
}
_local7.delay = _local10 + (($targets.length - 1) * _local9);
_local5[_local5.length] = new gs.TweenMax($targets[$targets.length - 1], $duration, _local7);
}
return(_local5);
}
static function allFrom($targets, $duration, $vars) {
$vars.runBackwards = true;
return(allTo($targets, $duration, $vars));
}
static function callbackProxy($functions, $params, $scopes) {
var _local1 = 0;
while (_local1 < $functions.length) {
if ($functions[_local1] != undefined) {
$functions[_local1].apply($scopes[_local1], $params[_local1]);
}
_local1++;
}
}
static function sequence($target, $tweens) {
var _local1 = 0;
while (_local1 < $tweens.length) {
$tweens[_local1].target = $target;
_local1++;
}
return(multiSequence($tweens));
}
static function multiSequence($tweens) {
var _local3 = [];
var _local11 = [];
var _local14 = gs.TweenLite.overwriteManager.mode;
var _local12 = 0;
var _local4;
var _local6;
var _local9;
var _local10;
var _local7;
var _local1;
var _local5;
var _local8;
var _local2;
_local7 = 0;
while (_local7 < $tweens.length) {
_local4 = $tweens[_local7];
_local10 = _local4.time || 0;
_local1 = {};
for (_local5 in _local4) {
_local1[_local5] = _local4[_local5];
}
delete _local1.time;
_local9 = _local1.delay || 0;
_local1.delay = _local12 + _local9;
_local6 = _local1.target;
delete _local1.target;
if (_local14 == 1) {
_local8 = false;
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2] == _local6) {
_local8 = true;
break;
}
_local2++;
}
if ((!_local8) && (_local1.overwrite == undefined)) {
_local3[_local3.length] = _local6;
} else {
_local1.overwrite = 2;
}
}
_local11[_local11.length] = new gs.TweenMax(_local6, _local10, _local1);
_local12 = _local12 + (_local10 + _local9);
_local7++;
}
return(_local11);
}
static function delayedCall($delay, $onComplete, $onCompleteParams, $onCompleteScope) {
return(new gs.TweenMax($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:0}));
}
static function parseBeziers($props, $through) {
var _local2;
var _local1;
var _local3;
var _local4;
var _local6 = {};
if ($through) {
for (_local4 in $props) {
_local1 = $props[_local4];
_local3 = [];
_local6[_local4] = _local3;
if (_local1.length > 2) {
_local3[_local3.length] = {s:_local1[0], cp:_local1[1] - ((_local1[2] - _local1[0]) / 4), e:_local1[1]};
_local2 = 1;
while (_local2 < (_local1.length - 1)) {
_local3[_local3.length] = {s:_local1[_local2], cp:_local1[_local2] + (_local1[_local2] - _local3[_local2 - 1].cp), e:_local1[_local2 + 1]};
_local2++;
}
} else {
_local3[_local3.length] = {s:_local1[0], cp:(_local1[0] + _local1[1]) / 2, e:_local1[1]};
}
}
} else {
for (_local4 in $props) {
_local1 = $props[_local4];
_local3 = [];
_local6[_local4] = _local3;
if (_local1.length > 3) {
_local3[_local3.length] = {s:_local1[0], cp:_local1[1], e:(_local1[1] + _local1[2]) / 2};
_local2 = 2;
while (_local2 < (_local1.length - 2)) {
_local3[_local3.length] = {s:_local3[_local2 - 2].e, cp:_local1[_local2], e:(_local1[_local2] + _local1[_local2 + 1]) / 2};
_local2++;
}
_local3[_local3.length] = {s:_local3[_local3.length - 1].e, cp:_local1[_local1.length - 2], e:_local1[_local1.length - 1]};
} else if (_local1.length == 3) {
_local3[_local3.length] = {s:_local1[0], cp:_local1[1], e:_local1[2]};
} else if (_local1.length == 2) {
_local3[_local3.length] = {s:_local1[0], cp:(_local1[0] + _local1[1]) / 2, e:_local1[1]};
}
}
}
return(_local6);
}
static function getTweensOf($target) {
var _local1 = gs.TweenLite._all[gs.TweenLite.getID($target, true)];
var _local2 = [];
if (_local1 != null) {
for (var _local3 in _local1) {
if (_local1[_local3].tweens != undefined) {
_local2[_local2.length] = _local1[_local3];
}
}
}
return(_local2);
}
static function isTweening($target) {
var _local2 = getTweensOf($target);
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].active) {
return(true);
}
_local1++;
}
return(false);
}
static function getAllTweens() {
var _local1 = gs.TweenLite._all;
var _local4 = [];
var _local5;
var _local3;
var _local2;
for (_local2 in _local1) {
for (_local3 in _local1[_local2]) {
_local5 = _local1[_local2][_local3];
if (_local5.tweens != undefined) {
_local4[_local4.length] = _local1[_local2][_local3];
}
}
}
return(_local4);
}
static function killAllTweens($complete) {
killAll($complete, true, false);
}
static function killAllDelayedCalls($complete) {
killAll($complete, false, true);
}
static function killAll($complete, $tweens, $delayedCalls) {
if ($tweens == undefined) {
$tweens = true;
}
if ($delayedCalls == undefined) {
$delayedCalls = false;
}
var _local2 = getAllTweens();
var _local1 = _local2.length - 1;
while (_local1 > -1) {
if (((typeof(_local2[_local1].target) == "function") == $delayedCalls) || ((typeof(_local2[_local1].target) == "function") != $tweens)) {
if ($complete) {
_local2[_local1].complete();
} else {
gs.TweenLite.removeTween(_local2[_local1]);
}
}
_local1--;
}
}
static function pauseAll($tweens, $delayedCalls) {
changePause(true, $tweens, $delayedCalls);
}
static function resumeAll($tweens, $delayedCalls) {
changePause(false, $tweens, $delayedCalls);
}
static function changePause($pause, $tweens, $delayedCalls) {
if ($pause == undefined) {
$pause = true;
}
if ($tweens == undefined) {
$tweens = true;
}
if ($delayedCalls == undefined) {
$delayedCalls = false;
}
var _local2 = getAllTweens();
var _local1 = _local2.length - 1;
while (_local1 > -1) {
if ((_local2[_local1] instanceof gs.TweenMax) && (((typeof(_local2[_local1].target) == "function") == $delayedCalls) || ((typeof(_local2[_local1].target) == "function") != $tweens))) {
_local2[_local1].paused = $pause;
}
_local1--;
}
}
static function hexColorsProxy($o) {
$o.info.target[$o.info.prop] = (($o.target.r << 16) | ($o.target.g << 8)) | $o.target.b;
}
static function bezierProxy($o) {
var _local4 = $o.target.t;
var _local7 = $o.info.props;
var _local8 = $o.info.target;
var _local3;
var _local6;
var _local1;
var _local5;
var _local2;
for (_local6 in _local7) {
_local2 = _local7[_local6].length;
if (_local4 < 0) {
_local3 = 0;
} else if (_local4 >= 1) {
_local3 = _local2 - 1;
} else {
_local3 = (_local2 * _local4) >> 0;
}
_local5 = (_local4 - (_local3 * (1 / _local2))) * _local2;
_local1 = _local7[_local6][_local3];
_local8[_local6] = _local1.s + (_local5 * (((2 * (1 - _local5)) * (_local1.cp - _local1.s)) + (_local5 * (_local1.e - _local1.s))));
}
}
static function bezierProxy2($o) {
bezierProxy($o);
var _local4 = {};
var _local3 = $o.info.target;
$o.info.target = _local4;
$o.target.t = $o.target.t + 0.01;
bezierProxy($o);
var _local5 = $o.info.orientToBezier;
var _local10;
var _local7;
var _local6;
var _local1;
var _local8;
var _local2;
_local2 = 0;
while (_local2 < _local5.length) {
_local1 = _local5[_local2];
_local8 = _local1[3] || 0;
_local7 = _local4[_local1[0]] - _local3[_local1[0]];
_local6 = _local4[_local1[1]] - _local3[_local1[1]];
_local3[_local1[2]] = (Math.atan2(_local6, _local7) * RAD2DEG) + _local8;
_local2++;
}
$o.info.target = _local3;
$o.target.t = $o.target.t - 0.01;
}
function get active() {
if (_active) {
return(true);
}
if (_pauseTime != null) {
return(false);
}
if (((gs.TweenLite._curTime - initTime) / 1000) > delay) {
_active = true;
startTime = initTime + (delay * 1000);
if (!_initted) {
initTweenVals();
} else if (vars._visible != undefined) {
target._visible = true;
}
if (duration == 0.001) {
startTime = startTime - 1;
}
if (vars.onStart != undefined) {
vars.onStart.apply(null, vars.onStartParams);
}
return(true);
}
return(false);
}
function get paused() {
if (_pauseTime != null) {
return(true);
}
return(false);
}
function set paused($b) {
if ($b) {
pause();
} else {
resume();
}
//return(paused);
}
function get progress() {
var _local2 = (((gs.TweenLite._curTime - startTime) / 1000) / duration) || 0;
if (_local2 > 1) {
return(1);
}
return(_local2);
}
function set progress($n) {
var _local2 = gs.TweenLite._curTime - ((duration * $n) * 1000);
initTime = _local2 - (delay * 1000);
var _local3 = active;
startTime = _local2;
render(gs.TweenLite._curTime);
//return(progress);
}
static var version = 2.02;
static var RAD2DEG = 57.2957795130823;
static var _overwriteMode = (gs.OverwriteManager.enabled ? (gs.OverwriteManager.mode) : (gs.OverwriteManager.init()));
static var killTweensOf = gs.TweenLite.killTweensOf;
static var killDelayedCallsTo = gs.TweenLite.killDelayedCallsTo;
static var removeTween = gs.TweenLite.removeTween;
static var defaultEase = gs.TweenLite.defaultEase;
}
Symbol 352 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 353 MovieClip [__Packages.mx.transitions.easing.Back] Frame 0
class mx.transitions.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 354 MovieClip [__Packages.cockroachClass] Frame 0
class cockroachClass extends MovieClip
{
var targetLoc, currentLoc, onEnterFrame, velocityPoint, speed, angle, _rotation, _x, _y, dist, dx, dy, radians;
function cockroachClass () {
super();
targetLoc = new flash.geom.Point((Math.random() * 1000) - 500, (Math.random() * 1000) - 500);
currentLoc = new flash.geom.Point((Math.random() * 1000) - 500, (Math.random() * 1000) - 500);
onEnterFrame = loop;
velocityPoint = new flash.geom.Point();
speed = 2;
}
function loop() {
angle = findAngle(targetLoc, currentLoc);
velocityPoint = findXYSpeed();
currentLoc.x = currentLoc.x + velocityPoint.x;
currentLoc.y = currentLoc.y + velocityPoint.y;
_rotation = angle;
_x = currentLoc.x;
_y = currentLoc.y;
if (dist < 10) {
targetLoc = new flash.geom.Point((Math.random() * 1000) - 500, (Math.random() * 1000) - 500);
}
}
function findAngle(_point1, _point2) {
dx = _point1.x - _point2.x;
dy = _point1.y - _point2.y;
dist = Math.floor(Math.sqrt((dx * dx) + (dy * dy)));
radians = Math.atan2(dy, dx);
angle = (radians * 180) / Math.PI;
return(angle);
}
function findXYSpeed() {
var _local2 = new flash.geom.Point();
_local2.x = Math.cos(radians) * speed;
_local2.y = Math.sin(radians) * speed;
return(_local2);
}
}
Symbol 355 MovieClip [__Packages.terrysTextFunctionClass] Frame 0
class terrysTextFunctionClass
{
function terrysTextFunctionClass () {
trace("terrysTextFunctionClass inited");
}
static function processNumber(_num) {
if (_num < 100) {
var _local4 = _num.toString();
} else {
var _local4 = "";
var _local5 = _num.toString();
var _local7 = _local5.length;
var _local11 = _local7 / 3;
var _local6 = Math.floor(_local7 / 3);
var _local8 = _local7 - (_local6 * 3);
var _local10 = 0;
if (_local8 > 0) {
_local4 = _local4 + (_local5.slice(_local10, _local8) + ",");
_local5 = _local5.slice(_local8, _local7);
}
var _local1 = 0;
while (_local1 < _local6) {
var _local2 = _local1 * 3;
var _local3 = _local2 + 3;
if (_local1 > 0) {
_local4 = _local4 + ",";
}
_local4 = _local4 + _local5.slice(_local2, _local3);
_local1++;
}
}
return(_local4);
}
}
Symbol 15 MovieClip Frame 10
stop();
Symbol 85 MovieClip [tile] Frame 1
#initclip 12
Object.registerClass("tile", tileClass);
#endinitclip
stop();
flickerClip.gotoAndPlay(Math.floor(Math.random() * 70));
Symbol 85 MovieClip [tile] Frame 18
stop();
Symbol 104 MovieClip [lvlBtn] Frame 10
stop();
Symbol 104 MovieClip [lvlBtn] Frame 21
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 1
stop();
digit = Number(_name.substr(8, 2));
txt_bot.txt = num;
txt_top_under.txt = num;
topTXT.txt.txt = num;
Symbol 161 MovieClip Frame 2
topTXT.gotoAndStop(1);
topTXT.txt.txt = num;
num = num + diff;
if (num == -1) {
num = topLimit;
_parent.chgNxtDigit(this);
}
txt_top_under.txt = num;
Symbol 161 MovieClip Frame 5
topTXT.gotoAndStop(2);
topTXT.txt.txt = num;
Symbol 161 MovieClip Frame 8
txt_bot.txt = num;
if (loops > 0) {
loopi++;
if (loopi == loops) {
stop();
} else {
gotoAndPlay (2);
}
} else {
stop();
}
Symbol 162 MovieClip Frame 1
function showBigDate(n, mc) {
newNum = n;
var _local2 = newNum - mc.num;
mc.loops = 0;
mc.loops = Math.abs(_local2);
if (_local2 > 0) {
mc.diff = 1;
} else if (_local2 < 0) {
mc.diff = -1;
} else {
mc.diff = 0;
}
mc.loopi = 0;
mc.gotoAndPlay(2);
}
function chgNxtDigit(mc) {
nxtMC = eval ("bigDate_" + (mc.digit + 1));
showBigDate(nxtMC.num - 1, nxtMC);
}
function setNum(n) {
if (n != lastNum) {
var num = n;
n = n + "";
var l = n.length;
var i = 0;
while (i < l) {
var mc = eval ("bigDate_" + i);
var theN = n.substr((l - 1) - i, 1);
showBigDate(Number(theN), mc);
i++;
}
lastNum = n;
}
}
bigDate_0.num = 0;
bigDate_1.num = 0;
bigDate_2.num = 0;
bigDate_3.num = 0;
bigDate_4.num = 0;
bigDate_5.num = 0;
bigDate_6.num = 0;
bigDate_7.num = 0;
bigDate_8.num = 0;
bigDate_0.topLimit = 9;
bigDate_1.topLimit = 9;
bigDate_2.topLimit = 9;
bigDate_3.topLimit = 9;
bigDate_4.topLimit = 9;
bigDate_5.topLimit = 9;
bigDate_6.topLimit = 9;
bigDate_7.topLimit = 9;
bigDate_8.topLimit = 9;
Symbol 173 MovieClip [submitScoreClip] Frame 1
stop();
Symbol 195 MovieClip [gameCompleteSubmitScoreClip] Frame 1
stop();
Symbol 208 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 22
stop();
Symbol 254 MovieClip Frame 25
stop();
Symbol 269 MovieClip Frame 1
i = 1;
while (i < 10) {
eval (("h" + i) + ".flipHotspot")._visible = false;
i++;
}
h1.gotoAndStop("white");
h2.gotoAndStop("black");
h3.gotoAndStop("black");
h4.gotoAndStop("white");
h5.gotoAndStop("white");
h6.gotoAndStop("white");
h7.gotoAndStop("black");
h8.gotoAndStop("white");
h9.gotoAndStop("black");
Symbol 269 MovieClip Frame 49
h4.play();
h7.play();
h8.play();
Symbol 269 MovieClip Frame 116
h2.play();
h4.play();
h5.play();
h6.play();
h8.play();
Symbol 269 MovieClip Frame 200
h5.play();
h6.play();
h3.play();
h9.play();
lightningGen.onEnterFrame = function () {
point1Ref = new flash.geom.Point(225, 225);
point2Ref = new flash.geom.Point(15, 130);
drawLightning(point1Ref, point2Ref);
};
Symbol 269 MovieClip Frame 289
_parent.play();
Symbol 287 MovieClip Frame 2
_parent.musicSound.setVolume(0);
Symbol 287 MovieClip Frame 2173
_parent.videoFinished();
stop();
Symbol 298 MovieClip [cockroach] Frame 1
#initclip 13
Object.registerClass("cockroach", cockroachClass);
#endinitclip
Symbol 317 MovieClip Frame 1
function showBigDate(n, mc) {
newNum = n;
var _local2 = newNum - mc.num;
mc.loops = 0;
mc.loops = Math.abs(_local2);
if (_local2 > 0) {
mc.diff = 1;
} else if (_local2 < 0) {
mc.diff = -1;
} else {
mc.diff = 0;
}
mc.loopi = 0;
mc.gotoAndPlay(2);
}
function chgNxtDigit(mc) {
nxtMC = eval ("bigDate_" + (mc.digit + 1));
showBigDate(nxtMC.num - 1, nxtMC);
}
function setNum(n) {
if (n != lastNum) {
var num = n;
n = n + "";
var l = n.length;
var i = 0;
while (i < l) {
var mc = eval ("bigDate_" + i);
var theN = n.substr((l - 1) - i, 1);
showBigDate(Number(theN), mc);
i++;
}
lastNum = n;
}
}
bigDate_0.num = 0;
bigDate_1.num = 0;
bigDate_2.num = 0;
bigDate_3.num = 0;
bigDate_4.num = 0;
bigDate_5.num = 0;
bigDate_6.num = 0;
bigDate_7.num = 0;
bigDate_8.num = 0;
bigDate_0.topLimit = 9;
bigDate_1.topLimit = 9;
bigDate_2.topLimit = 9;
bigDate_3.topLimit = 9;
bigDate_4.topLimit = 9;
bigDate_5.topLimit = 9;
bigDate_6.topLimit = 9;
bigDate_7.topLimit = 9;
bigDate_8.topLimit = 9;