Frame 1
function ProcessPreload() {
nPercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
oRoot.iLoaderBar.iTF.text = Math.round(nGradualPercentage);
if (nGradualPercentage < nPercentLoaded) {
if (nPercentLoaded >= 100) {
nGradualPercentage = nGradualPercentage + 1;
} else {
nGradualPercentage = nGradualPercentage + 0.25;
}
}
if (nGradualPercentage >= 100) {
oRoot.iLoaderBar.iTF.text = "";
delete oRoot.onEnterFrame;
oRoot.onEnterFrame = null;
oRoot.isLoadComplete = true;
if (oRoot.isIntroComplete) {
oRoot.gotoAndStop("Init");
}
}
}
function Track(szEvent) {
_root.flashTrack.trackEvent(szEvent.toLowerCase());
}
var oRoot = this;
var nPercentLoaded;
oRoot.stop();
Stage.scaleMode = "noScale";
Stage.showMenu = false;
var nGradualPercentage = 0;
oRoot.onEnterFrame = ProcessPreload;
_root.gvTrackCode = "2852";
System.security.allowDomain("www.chunk.co.uk");
this.createEmptyMovieClip("flashTrack", 98765);
loadMovie ("http://www.chunk.co.uk/reporting/chunkTrack.swf", flashTrack);
_root.Track("open");
Frame 29
var oDocument = new Document(this);
Frame 98
function LoadSuccess() {
iHighScoresPanel.iLoadingText._visible = false;
var _local1 = 1;
while (_local1 <= nScoresDisplayed) {
var _local4 = iHighScoresPanel["iNameTF" + _local1];
var _local2 = iHighScoresPanel["iScoreTF" + _local1];
var _local3 = iHighScoresPanel["iRankTF" + _local1];
if (m_nScorePosition == (_local1 - 1)) {
_local4.text = oHighScores.GetNameAtIndex(_local1);
_local2.text = String(oHighScores.GetScoreAtIndex(_local1));
_local3.text = String(oHighScores.GetRankAtIndex(_local1));
_local4.setTextFormat(oTextFormat);
_local2.setTextFormat(oTextFormat);
_local3.setTextFormat(oTextFormat);
iHighScoresPanel.iScoreHighlighter._y = oTextField._y;
iHighScoresPanel.iScoreHighlighter._visible = true;
iHighScoresPanel.iScoreHighlighter._alpha = 0;
new com.shauncampbell.utils.SCTween(400, null, iHighScoresPanel.iScoreHighlighter, "_alpha", com.shauncampbell.utils.SCTween.None.easeOut, 0, 100, 0.5, true);
m_nScorePosition = -1;
g_oGame.m_nScore = 0;
} else {
_local4.text = oHighScores.GetNameAtIndex(_local1);
_local2.text = String(oHighScores.GetScoreAtIndex(_local1));
_local3.text = String(oHighScores.GetRankAtIndex(_local1));
_local4.setTextFormat(oTextFormat);
_local2.setTextFormat(oTextFormat);
_local3.setTextFormat(oTextFormat);
}
_local4._visible = true;
_local4._alpha = 0;
_local2._visible = true;
_local2._alpha = 0;
_local3._visible = true;
_local3._alpha = 0;
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local2, "_alpha", com.shauncampbell.utils.SCTween.None.easeOut, 0, 100, 0.2, true);
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local2, "_y", com.shauncampbell.utils.SCTween.Back.easeOut, _local2._y - 10, _local2._y, 0.2, true);
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local4, "_alpha", com.shauncampbell.utils.SCTween.None.easeOut, 0, 100, 0.2, true);
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local4, "_y", com.shauncampbell.utils.SCTween.Back.easeOut, _local4._y - 10, _local4._y, 0.2, true);
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local3, "_alpha", com.shauncampbell.utils.SCTween.None.easeOut, 0, 100, 0.2, true);
new com.shauncampbell.utils.SCTween(_local1 * 30, null, _local3, "_y", com.shauncampbell.utils.SCTween.Back.easeOut, _local3._y - 10, _local3._y, 0.2, true);
_local1++;
}
}
function LoadFailure() {
trace("Load failure");
}
function ZeroMask(nNumber, nDesiredLength) {
var _local2 = "" + nNumber;
var _local1 = _local2.length;
while (_local1 < nDesiredLength) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
var nScoresDisplayed = 10;
var oHighScores = g_oGame.GetHighScoresInstance();
iHighScoresPanel.iScoreHighlighter._visible = false;
var oTextFormat = new TextFormat();
oTextFormat.letterSpacing = -0.7;
var i = 1;
while (i <= nScoresDisplayed) {
iHighScoresPanel["iNameTF" + i]._visible = false;
iHighScoresPanel["iScoreTF" + i]._visible = false;
iHighScoresPanel["iRankTF" + i]._visible = false;
i++;
}
oHighScores.GetScores(LoadSuccess, LoadFailure);
var nScore = g_oGame.GetPlayerScore();
if ((nScore > 0) && (_root.m_nScorePosition <= 0)) {
iHighScoresPanel.iYourScoreTF.text = String(nScore);
iHighScoresPanel.iYourScoreTitle._visible = true;
} else {
iHighScoresPanel.iYourScoreTF._visible = false;
iHighScoresPanel.iYourScoreTitle._visible = false;
}
Symbol 15 MovieClip [GameOverPanel] Frame 1
stop();
Symbol 35 MovieClip Frame 685
if (!_root.isLoadComplete) {
gotoAndPlay ("loop");
}
Symbol 35 MovieClip Frame 702
_root.isIntroComplete = true;
if (_root.isLoadComplete) {
_root.gotoAndStop("Init");
}
Symbol 380 MovieClip [__Packages.Document] Frame 0
class Document
{
var m_oStageSize, m_oRoot, m_oSettings, m_oLoader, m_oGame, m_oDebug, m_oEventListener;
function Document (oRoot) {
_global.g_oDocument = this;
Stage.showMenu = false;
Stage.scaleMode = "noScale";
m_oStageSize = new flash.geom.Point(460, 340);
m_oRoot = oRoot;
m_oRoot.stop();
System.security.loadPolicyFile("http://www.chunk.co.uk/crossdomain.xml");
m_oSettings = new com.shauncampbell.xml.SCSettings("http://www.chunk.co.uk/slabovia/monsterpig/GetSettings.xml", mx.utils.Delegate.create(this, SettingsLoaded), mx.utils.Delegate.create(this, SettingsFailed));
}
function GetStageSize() {
return(m_oStageSize.clone());
}
function SettingsLoaded() {
SetupApplication();
}
function SettingsFailed() {
m_oRoot.gotoAndStop("LoadError");
}
function SetupApplication() {
ConfigureListeners();
_root.g_szPromotionURL = m_oSettings.GetSetting("promotionUrl");
_root.g_szVideoURL = m_oSettings.GetSetting("videoUrl");
switch (m_oSettings.GetSetting("debugLevel")) {
case 1 :
var _local3 = m_oRoot.createEmptyMovieClip("iDebug", DepthManager.DEBUGPANEL);
m_oLoader.loadClip("SCDebugger.swf", _local3);
break;
case 2 :
_local3 = m_oRoot.createEmptyMovieClip("iDebug", DepthManager.DEBUGPANEL);
m_oLoader.loadClip("SCDebugger.swf", _local3);
break;
default :
PostDebugConfiguration();
}
com.shauncampbell.utils.SCCommandWatcher.Initialise();
com.shauncampbell.utils.SCCommandWatcher.AddCommand(m_oSettings.GetSetting("debugOverrideCommand"), ForceDebug);
}
function ForceDebug() {
_root.iDebug._visible = true;
}
function PostDebugConfiguration() {
m_oGame = new Game(this, m_oRoot, m_oDebug, m_oSettings);
_global.g_oGame = m_oGame;
m_oRoot.gotoAndStop("MainMenu");
}
function ConfigureListeners() {
m_oEventListener = new Object();
m_oLoader = new MovieClipLoader();
m_oLoader.addListener(m_oEventListener);
m_oEventListener.onLoadInit = mx.utils.Delegate.create(this, ExternalContentLoaded);
}
function ConfigureDebug() {
m_oDebug = _global.Debugger;
m_oSettings.ApplyDebuggerCommands();
if (m_oSettings.GetSetting("debugLevel") == 2) {
m_oDebug.Append("Entering Debug Level 2", 16776960);
}
PostDebugConfiguration();
}
function GetSettingsXML() {
return(m_oSettings);
}
function ExternalContentLoaded(oSource) {
if (oSource == _root.iDebug) {
if (m_oSettings.GetSetting("debugLevel") == 1) {
oSource._visible = false;
}
ConfigureDebug();
}
}
function BeginGameplay() {
m_oGame.Begin();
}
function EndGameplay() {
m_oGame.End();
}
}
Symbol 381 MovieClip [__Packages.com.shauncampbell.xml.SCSettings] Frame 0
class com.shauncampbell.xml.SCSettings
{
var m_oXML, m_fnLoadSuccess, m_fnLoadFailure;
function SCSettings (szURL, fnSuccessCallback, fnFailureCallback) {
m_oXML = new XML();
m_oXML.ignoreWhite = true;
SetLoadSuccessCallback(fnSuccessCallback);
SetLoadFailureCallback(fnFailureCallback);
m_oXML.onLoad = mx.utils.Delegate.create(this, IOResponse);
if (szURL) {
Load(szURL);
}
}
function IOResponse(bSuccess) {
if (bSuccess) {
m_fnLoadSuccess();
} else {
m_fnLoadFailure();
}
}
function Load(szURL) {
m_oXML.load(szURL);
}
function SetLoadSuccessCallback(fnSuccessCallback) {
m_fnLoadSuccess = fnSuccessCallback;
}
function SetLoadFailureCallback(fnFailureCallback) {
m_fnLoadFailure = fnFailureCallback;
}
function SettingExists(szSettingName) {
var _local2 = m_oXML.firstChild.firstChild.firstChild;
var _local3 = null;
while (_local3 = _local2.attributes.name , _local3) {
if (_local2.attributes.name == szSettingName) {
return(true);
}
_local2 = _local2.nextSibling;
}
return(false);
}
function ApplyDebuggerCommands() {
if (!_global.Debugger) {
return(undefined);
}
var _local3 = m_oXML.firstChild.firstChild.nextSibling.firstChild;
var _local4 = null;
while (_local4 = _local3 , _local4) {
_global.Debugger.ExecuteCommand(String(_local3.firstChild));
_local3 = _local3.nextSibling;
}
}
function GetSetting(szSettingName) {
var _local2 = m_oXML.firstChild.firstChild.firstChild;
var _local10 = null;
while (_local10 = _local2.attributes.name , _local10) {
if (_local2.attributes.name == szSettingName) {
switch (_local2.attributes.dataType.toUpperCase()) {
case "BOOLEAN" :
case "BOOL" :
if (String(_local2.firstChild).toLowerCase() == "true") {
return(Boolean(true));
}
if (String(_local2.firstChild).toLowerCase() == "false") {
return(Boolean(false));
}
break;
case "INT" :
case "INTEGER" :
return(parseInt(String(_local2.firstChild)));
case "NUMBER" :
case "FLOAT" :
return(parseFloat(String(_local2.firstChild)));
case "STRING" :
return(String(_local2.firstChild));
case "OBJECT" :
var _local9 = new Object();
var _local4 = String(_local2.firstChild);
_local4 = com.shauncampbell.utils.SCStringUtils.Replace(_local4, ", ", ",");
_local4 = com.shauncampbell.utils.SCStringUtils.Replace(_local4, "{", "");
_local4 = com.shauncampbell.utils.SCStringUtils.Replace(_local4, "}", "");
var _local8 = _local4.split(",");
var _local3 = 0;
while (_local3 < _local8.length) {
var _local7 = _local8[_local3];
var _local5 = _local7.split("");
var _local6 = _local5.splice(_local7.indexOf(":"), 9999);
_local6.shift();
_local9[_local5.join("")] = _local6.join("");
_local3++;
}
return(_local9);
}
}
_local2 = _local2.nextSibling;
}
}
function toString() {
var _local2 = m_oXML.firstChild.firstChild.firstChild;
var _local4 = "";
var _local3 = null;
while (_local3 = _local2.attributes.name , _local3) {
_local4 = _local4 + (((_local2.attributes.name + ": ") + _local2.firstChild) + newline);
_local2 = _local2.nextSibling;
}
return(_local4);
}
}
Symbol 382 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 383 MovieClip [__Packages.com.shauncampbell.utils.SCStringUtils] Frame 0
class com.shauncampbell.utils.SCStringUtils
{
function SCStringUtils () {
}
static function Replace(szString, szTarget, szReplacement) {
var _local3 = szString.indexOf(szTarget);
while (_local3 > -1) {
var _local1 = szString.split("");
_local1.splice(_local3, szTarget.length, szReplacement.split(""));
szString = _local1.join("");
_local3 = szString.indexOf(szTarget);
}
return(szString);
}
}
Symbol 384 MovieClip [__Packages.Game] Frame 0
class Game
{
var m_oDocument, m_oRoot, m_oDebug, m_oSettings, m_oSounds, m_oHighScores, m_nGameState, m_oStageSize, m_bUseScreenFlashEffects, m_nFriction, m_nScorePerKeypress, m_nGravity, m_nSlowdownTimestep, m_nFloorHeight, m_nTimesPlayed, m_nMaxLevels, m_voFoodCategories, m_oEventListener, m_voFakeScores, m_nScore, m_nCurrentLevel, m_bRandomGruntPlaying, m_oGameArea, m_oHUDArea, m_oMainScene, m_nKeyRattlerState, m_nKeyTriggerTimeout, m_oGameOverPanel, m_oLevelEntryPanel, m_oThrowMeter, m_oFood, m_oPig, m_nUpdateTimerInterval, m_oTimer, m_nFramecounter, m_oPlayer, m_oScorePanel, m_nThrowPower, m_oPlatform, m_nTimeLeftMilliseconds, m_nLiftingDifficulty, m_nKeyRattlePower, m_nCollisionSize, m_szGameStateString;
function Game (oDocument, oRoot, oDebug, oSettings) {
m_oDocument = oDocument;
m_oRoot = oRoot;
m_oDebug = oDebug;
m_oSettings = oSettings;
m_oSounds = new GameSounds(oDocument, oRoot, oDebug, oSettings);
_root.m_oSounds = m_oSounds;
m_oHighScores = new HighScores(m_oSettings.GetSetting("highScoreUrl"), m_oDebug, this);
m_nGameState = GameState.INITIALISATION;
m_oStageSize = m_oDocument.GetStageSize();
m_bUseScreenFlashEffects = m_oSettings.GetSetting("useScreenFlashEffects");
m_nFriction = m_oSettings.GetSetting("friction");
m_nScorePerKeypress = m_oSettings.GetSetting("scorePerKeypress");
m_nGravity = m_oSettings.GetSetting("gravity");
m_nSlowdownTimestep = m_oSettings.GetSetting("slowdownTimestep");
m_nFloorHeight = m_oStageSize.y - 20;
m_oSounds.MUSIC1.start(0, 99999);
m_nTimesPlayed = 0;
var _local7 = m_oSettings.GetSetting("overrideDifficulty");
m_nMaxLevels = m_oSettings.GetSetting("endingLevel");
m_voFoodCategories = [];
var _local6 = 1;
while (_local6 <= 20) {
var _local5 = m_oSettings.GetSetting("food" + _local6);
_local5 = com.shauncampbell.utils.SCStringUtils.Replace(_local5, ", ", ",");
var _local4 = _local5.split(",");
var _local3 = new FoodItem();
_local3.SetName(_local4[0]);
_local3.SetStartingOffset(parseFloat(_local4[1]));
_local3.SetLaunchVelocity(parseFloat(_local4[2]), parseFloat(_local4[3]));
_local3.SetRotationalVelocityFactor(parseFloat(_local4[4]));
if (_local7) {
_local3.SetLiftingTime(500);
} else {
_local3.SetLiftingTime(parseFloat(_local4[5]));
}
if (_local7) {
_local3.SetLiftingDifficulty(0.01);
} else {
_local3.SetLiftingDifficulty(parseFloat(_local4[6]));
}
_local3.SetPointsAwarded(parseFloat(_local4[7]));
_local3.SetCollisionSize(parseFloat(_local4[8]));
m_voFoodCategories.push(_local3);
_local6++;
}
m_oEventListener = new Object();
m_oEventListener.onKeyDown = mx.utils.Delegate.create(this, KeyDown);
m_oEventListener.onKeyUp = mx.utils.Delegate.create(this, KeyUp);
Key.addListener(m_oEventListener);
_root.Track("custom1");
}
function ParseFakeScores() {
var _local4 = m_oHighScores.GetIncomingVars().fileoutput.split(" ");
m_voFakeScores = [];
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split(":");
m_voFakeScores[_local2] = new Object();
m_voFakeScores[_local2].Name = _local3[0];
m_voFakeScores[_local2].Score = parseInt(_local3[1]);
m_voFakeScores[_local2].Rank = "Pig Master";
_local2++;
}
m_voFakeScores.sortOn("Score", Array.NUMERIC);
m_voFakeScores.reverse();
}
function OpenDebug() {
}
function SubmitNameAndScore(szName) {
m_oHighScores.SubmitScore(szName, m_nScore, m_nCurrentLevel, mx.utils.Delegate.create(this, ScoreSubmissionSuccess), mx.utils.Delegate.create(this, ScoreSubmissionFailure));
}
function ScoreSubmissionSuccess() {
_root.Track("custom8");
m_oRoot.gotoAndStop("HighScores");
}
function ScoreSubmissionFailure() {
m_oRoot.gotoAndStop("HighScores");
}
function StartRandomGruntSound() {
m_oSounds.RANDOMGRUNT1.onSoundComplete = mx.utils.Delegate.create(this, RandomGruntSoundComplete);
m_oSounds.RANDOMGRUNT2.onSoundComplete = mx.utils.Delegate.create(this, RandomGruntSoundComplete);
m_oSounds.RANDOMGRUNT3.onSoundComplete = mx.utils.Delegate.create(this, RandomGruntSoundComplete);
m_oSounds["RANDOMGRUNT" + (random(3) + 1)].start();
m_bRandomGruntPlaying = true;
}
function StopSuccessiveRandomGruntSounds() {
m_oSounds.RANDOMGRUNT1.onSoundComplete = null;
m_oSounds.RANDOMGRUNT2.onSoundComplete = null;
m_oSounds.RANDOMGRUNT3.onSoundComplete = null;
}
function StopAllRandomGruntSounds() {
m_oSounds.RANDOMGRUNT1.stop();
m_oSounds.RANDOMGRUNT2.stop();
m_oSounds.RANDOMGRUNT3.stop();
m_oSounds.RANDOMGRUNT1.onSoundComplete = null;
m_oSounds.RANDOMGRUNT2.onSoundComplete = null;
m_oSounds.RANDOMGRUNT3.onSoundComplete = null;
}
function RandomGruntSoundComplete() {
m_bRandomGruntPlaying = false;
m_oSounds["RANDOMGRUNT" + (random(3) + 1)].start();
m_bRandomGruntPlaying = true;
}
function Begin() {
m_oRoot.gotoAndStop("Gameplay");
m_oGameArea = m_oRoot.iGameArea;
m_oGameArea.xVel = 0;
m_oGameArea.yVel = 0;
m_oHUDArea = m_oRoot.iHUDArea;
m_nTimesPlayed++;
if (m_nTimesPlayed == 2) {
_root.Track("playagain");
}
m_oMainScene = m_oGameArea.attachMovie("MainScene", "iMainScene", DepthManager.MAINSCENE);
m_oMainScene.m_nRatio = m_oMainScene._height / m_oMainScene._width;
m_oMainScene._xscale = (m_oMainScene._yscale = 150);
m_oMainScene._x = (m_oStageSize.x * 0.5) + 12;
m_oMainScene._y = m_oStageSize.y;
m_oSounds.StopAllMusic();
m_oDebug.Append("Initialising game.");
m_nKeyRattlerState = KeyRattlerState.NONE;
m_nKeyTriggerTimeout = 0;
m_nCurrentLevel = m_oSettings.GetSetting("startingLevel");
m_nScore = 0;
ConfigurePlatform();
ConfigurePig();
m_oGameArea.onEnterFrame = mx.utils.Delegate.create(this, Update);
StartLevel();
}
function End(szTargetFrame, nScorePositionAcheived) {
m_nKeyRattlerState = KeyRattlerState.NONE;
m_oGameOverPanel.removeMovieClip();
m_oLevelEntryPanel.removeMovieClip();
m_oThrowMeter.removeMovieClip();
m_oFood.removeMovieClip();
m_oPig.removeMovieClip();
m_oSounds.StopAllMusic();
m_oSounds.MUSIC1.start(0, 99999);
m_oSounds.STRUGGLE.stop();
clearInterval(m_nUpdateTimerInterval);
m_oTimer.removeMovieClip();
m_oGameArea.onEnterFrame = null;
m_oRoot.gotoAndStop(szTargetFrame);
m_nGameState = GameState.MAIN_MENU;
}
function StartLevel() {
if (m_nCurrentLevel > m_nMaxLevels) {
_root.Track("custom7");
GameOver();
return(undefined);
}
switch (m_nCurrentLevel) {
case 1 :
m_oSounds.StopAllMusic();
m_oSounds.MUSIC1.start(0, 99999);
break;
case 5 :
m_oSounds.StopAllMusic();
m_oSounds.MUSIC2.start(0, 99999);
break;
case 9 :
m_oSounds.StopAllMusic();
m_oSounds.MUSIC3.start(0, 99999);
break;
case 13 :
m_oSounds.StopAllMusic();
m_oSounds.MUSIC4.start(0, 99999);
break;
case 17 :
m_oSounds.StopAllMusic();
m_oSounds.MUSIC5.start(0, 99999);
}
m_nFramecounter = 0;
m_nKeyRattlerState = KeyRattlerState.NONE;
m_oFood.removeMovieClip();
m_oPlayer.removeMovieClip();
clearInterval(m_nUpdateTimerInterval);
m_oTimer.removeMovieClip();
m_oPig.gotoAndStop("Closed" + m_nCurrentLevel);
m_oScorePanel.removeMovieClip();
m_oLevelEntryPanel.removeMovieClip();
m_oScorePanel = m_oHUDArea.attachMovie("ScorePanel", "iScorePanel", DepthManager.SCOREPANEL);
m_oScorePanel._x = m_oStageSize.x - m_oScorePanel._width;
m_oScorePanel._y = 0;
m_oLevelEntryPanel = m_oHUDArea.attachMovie("LevelEntryPanel", "iLevelEntryPanel", DepthManager.LEVELENTRYPANEL);
m_oLevelEntryPanel._y = 0;
m_oLevelEntryPanel.iTF.text = "stage " + m_nCurrentLevel;
m_nThrowPower = 0;
ConfigureFoodItem();
m_oSounds.ENTERLEVEL.start();
new com.shauncampbell.utils.SCTween(0, mx.utils.Delegate.create(this, TweenLevelEntryPanelOut), m_oLevelEntryPanel, "_x", com.shauncampbell.utils.SCTween.Strong.easeOut, -m_oLevelEntryPanel._width, 0, 0.8, true);
}
function TweenLevelEntryPanelOut() {
new com.shauncampbell.utils.SCTween(1500, mx.utils.Delegate.create(this, LevelEntryTweenComplete), m_oLevelEntryPanel, "_x", com.shauncampbell.utils.SCTween.Strong.easeOut, 0, -m_oLevelEntryPanel._width, 0.8, true);
}
function LevelEntryTweenComplete() {
m_oLevelEntryPanel.removeMovieClip();
m_oLevelEntryPanel = null;
}
function ConfigurePig() {
m_oPig = m_oMainScene.attachMovie("Pig", "iPig", DepthManager.PIG);
m_oPig._x = -45;
m_oPig._xscale = (m_oPig._yscale = 80);
m_oPig.m_nStartingPositionX = m_oPig._x;
m_oPig.gotoAndStop("Closed" + m_nCurrentLevel);
m_oPig.swapDepths(m_oMainScene.iTree);
var _local2 = new flash.geom.Point(0, m_nFloorHeight);
m_oPig._parent.globalToLocal(_local2);
m_oPig.m_nFloorPositionY = _local2.y;
m_oPig._y = m_oPig.m_nFloorPositionY - (m_oPig._height * 0.5);
m_oPig.m_nWaitingTime = 0;
m_oPig.m_nRatio = m_oPig._height / m_oPig._width;
m_oMainScene.m_nPigOccupationRatio = m_oPig._width / m_oMainScene._width;
}
function ConfigurePlatform() {
m_oPlatform = m_oGameArea.attachMovie("Platform", "iPlatform", DepthManager.PLATFORM);
m_oPlatform._x = m_oStageSize.x - m_oPlatform._width;
m_oPlatform._y = m_oStageSize.y - m_oPlatform._height;
}
function ConfigurePlayer() {
m_oPlayer = m_oGameArea.attachMovie("Player", "iPlayer", DepthManager.PLAYER);
m_oPlayer._x = (m_oStageSize.x + m_oPlayer._x) + m_oPlayer._width;
m_oPlayer._y = m_oPlatform._y + 3;
m_oPlayer._xscale = (m_oPlayer._yscale = 80 - (m_nCurrentLevel * 2));
m_oPlayer.gotoAndStop("Running");
new com.shauncampbell.utils.SCTween(200, mx.utils.Delegate.create(this, BeginThrowAttempt), m_oPlayer, "_x", com.shauncampbell.utils.SCTween.None.easeOut, m_oPlayer._x, m_oPlatform._x + 50, 1.4, true);
ConfigureTimer();
m_nGameState = GameState.PLAYER_ENTERING;
}
function BeginThrowAttempt() {
m_oPlayer.gotoAndStop("Bending");
m_oFood._y = m_oFood._y - (23 - (m_nCurrentLevel * 0.5));
ConfigureThrowMeter();
m_oSounds.STRUGGLE.start(0, 9999);
m_nGameState = GameState.PLAYER_ATTEMPTING_THROW;
StartRandomGruntSound();
}
function ConfigureThrowMeter() {
m_oThrowMeter = m_oHUDArea.attachMovie("ThrowMeter", "iThrowMeter", DepthManager.THROWMETER);
m_oThrowMeter._x = (m_oStageSize.x * 0.5) - (m_oThrowMeter._width * 0.5);
m_oThrowMeter._y = (m_oTimer._y + m_oTimer._height) - 1;
m_oSounds.BLEEP.start();
new com.shauncampbell.utils.SCTween(0, null, m_oThrowMeter, "_y", com.shauncampbell.utils.SCTween.None.easeOut, m_oThrowMeter._y - m_oThrowMeter._height, m_oThrowMeter._y, 0.2, true);
m_oThrowMeter.Fill._xscale = 0;
}
function ConfigureTimer() {
m_oTimer = m_oHUDArea.attachMovie("Timer", "iTimer", DepthManager.TIMER);
m_oTimer._x = m_oStageSize.x * 0.5;
m_oTimer._y = 0;
m_oTimer.iTF.text = "";
clearInterval(m_nUpdateTimerInterval);
m_oSounds.BLEEP.start();
new com.shauncampbell.utils.SCTween(0, null, m_oTimer, "_y", com.shauncampbell.utils.SCTween.Back.easeOut, m_oTimer._y - 30, m_oTimer._y, 0.3, true);
m_nUpdateTimerInterval = setInterval(mx.utils.Delegate.create(this, UpdateTimer), 10);
}
function UpdateTimer() {
if ((m_nGameState == GameState.PLAYER_ATTEMPTING_THROW) && (m_nTimeLeftMilliseconds > 0)) {
m_nTimeLeftMilliseconds--;
if (m_nTimeLeftMilliseconds <= 0) {
GameOver();
}
}
}
function GetTimerString() {
var _local2 = Math.floor(m_nTimeLeftMilliseconds / 100);
if (_local2 > 0) {
var _local3 = m_nTimeLeftMilliseconds % (_local2 * 100);
} else {
var _local3 = m_nTimeLeftMilliseconds;
}
return((((((_local2 < 10) ? "0" : "") + _local2) + ":") + ((_local3 < 10) ? "0" : "")) + _local3);
}
function ConfigureFoodItem() {
var _local2 = m_voFoodCategories[m_nCurrentLevel - 1];
m_oFood = m_oGameArea.attachMovie(_local2.GetName(), "iFood", DepthManager.FOOD);
m_oFood._x = (m_oPlatform._x + 37) + _local2.GetStartingOffset();
m_oFood._y = (m_oPlatform._y - m_oFood._height) + 3;
m_oFood.m_nTimestep = 1;
var _local3 = _local2.GetLaunchVelocity();
m_nTimeLeftMilliseconds = _local2.GetLiftingTime();
m_nLiftingDifficulty = _local2.GetLiftingDifficulty();
m_oFood.m_nPointsAwarded = _local2.GetPointsAwarded();
m_oFood.m_nRotationalVelocityFactor = _local2.GetRotationalVelocityFactor();
m_nKeyRattlePower = 2 / m_nLiftingDifficulty;
m_oFood.launchVelocityX = _local3.x;
m_oFood.launchVelocityY = _local3.y;
m_oFood.m_nCollisionWidth = m_oFood._width;
m_oFood.m_nCollisionHeight = m_oFood._height;
m_oFood.xVel = (m_oFood.yVel = 0);
m_nCollisionSize = _local2.GetCollisionSize();
new com.shauncampbell.utils.SCTween(0, mx.utils.Delegate.create(this, ConfigurePlayer), m_oFood, "_y", com.shauncampbell.utils.SCTween.Bounce.easeOut, -m_oFood._height, m_oFood._y, 0.8, true);
m_nGameState = GameState.FOOD_DROPPING_IN;
}
function KeyDown() {
if (m_nGameState == GameState.PLAYER_ATTEMPTING_THROW) {
var _local2 = Key.getCode();
if ((_local2 == 37) && (m_nKeyRattlerState != KeyRattlerState.LEFT)) {
m_nKeyTriggerTimeout = 0;
m_nScore = m_nScore + m_nScorePerKeypress;
RockGameArea();
m_nKeyRattlerState = KeyRattlerState.LEFT;
SetThrowPowerDelta(m_nKeyRattlePower);
}
if ((_local2 == 39) && (m_nKeyRattlerState != KeyRattlerState.RIGHT)) {
m_nKeyTriggerTimeout = 0;
m_nScore = m_nScore + m_nScorePerKeypress;
RockGameArea();
m_nKeyRattlerState = KeyRattlerState.RIGHT;
SetThrowPowerDelta(m_nKeyRattlePower);
}
}
}
function RockGameArea() {
}
function KeyUp() {
}
function SetThrowPowerDelta(nDelta) {
m_nThrowPower = m_nThrowPower + nDelta;
if (m_nThrowPower < 0) {
m_nThrowPower = 0;
}
}
function ResizeScene(nScale, nTweenTime, fnCallback) {
var _local2 = com.shauncampbell.utils.SCTween.Regular.easeInOut;
var _local9 = m_oPig._width + (nScale * 6);
var _local4 = m_oPig._height + ((nScale * 6) * m_oPig.m_nRatio);
var _local7 = m_oPig.m_nFloorPositionY - (_local4 * 0.5);
var _local8 = m_oMainScene._x - 3;
var _local5 = m_oMainScene._width;
var _local6 = _local5 * m_oMainScene.m_nRatio;
_local5 = m_oMainScene._width * 0.95;
_local6 = _local5 * m_oMainScene.m_nRatio;
if (nTweenTime > 0) {
new com.shauncampbell.utils.SCTween(0, null, m_oPig, "_width", _local2, m_oPig._width, _local9, nTweenTime, true);
new com.shauncampbell.utils.SCTween(0, null, m_oPig, "_height", _local2, m_oPig._height, _local4, nTweenTime, true);
new com.shauncampbell.utils.SCTween(0, null, m_oPig, "_y", _local2, m_oPig._y, _local7, nTweenTime, true);
new com.shauncampbell.utils.SCTween(0, null, m_oMainScene, "_x", _local2, m_oMainScene._x, _local8, nTweenTime, true);
new com.shauncampbell.utils.SCTween(0, null, m_oMainScene, "_width", _local2, m_oMainScene._width, _local5, nTweenTime, true);
new com.shauncampbell.utils.SCTween(0, mx.utils.Delegate.create(this, fnCallback), m_oMainScene, "_height", _local2, m_oMainScene._height, _local6, nTweenTime, true);
m_oDebug.Append("Enlarging pig with tween.");
} else {
m_oPig._width = _local9;
m_oPig._height = _local4;
m_oPig._y = _local7;
m_oMainScene._x = _local8;
m_oMainScene._width = _local5;
m_oMainScene._height = _local6;
m_oDebug.Append("Enlarging pig without tween.");
fnCallback();
}
m_oSounds.ZOOM.start();
}
function DisplayScoreSummary() {
m_oTimer.gotoAndStop("PointsRoundup");
var _local2 = Math.round(m_nTimeLeftMilliseconds) * 2;
m_oTimer.iScoreDeltaTF.text = _local2;
new com.shauncampbell.utils.SCTween(0, null, m_oFood, "m_nTimestep", com.shauncampbell.utils.SCTween.None.easeOut, 1, m_nSlowdownTimestep, 0.1, true);
m_oSounds.COUNTUP.start(0, 9999);
m_nGameState = GameState.SCORE_SUMMARY;
}
function RemoveScoreSummary() {
m_nGameState = GameState.THROW_EXECUTED;
m_oSounds.COUNTUP.stop();
m_oTimer.removeMovieClip();
new com.shauncampbell.utils.SCTween(0, null, m_oFood, "m_nTimestep", com.shauncampbell.utils.SCTween.None.easeOut, m_nSlowdownTimestep, 1, 0.3, true);
}
function Update() {
var _local3;
m_nKeyTriggerTimeout++;
m_nFramecounter++;
m_oScorePanel.iTF.text = m_nScore;
m_oTimer.iTF.text = GetTimerString();
m_oGameArea._x = m_oGameArea._x + m_oGameArea.xVel;
m_oGameArea._y = m_oGameArea._y + m_oGameArea.yVel;
m_oGameArea._x = m_oGameArea._x * 0.7;
m_oGameArea._y = m_oGameArea._y * 0.7;
m_oGameArea.xVel = m_oGameArea.xVel * 0.98;
m_oGameArea.yVel = m_oGameArea.yVel * 0.98;
switch (m_nGameState) {
case GameState.PLAYER_ATTEMPTING_THROW :
SetThrowPowerDelta(-m_nLiftingDifficulty);
if (((m_nFramecounter % 3) == 0) && (m_oThrowMeter.Fill._xscale > 10)) {
if (m_oPlayer.Graphic._currentframe == 2) {
m_oPlayer.Graphic.gotoAndStop(1);
m_oPlayer._x = m_oPlayer._x + 1;
m_oFood._x = m_oFood._x + 1;
} else {
m_oPlayer.Graphic.nextFrame();
m_oPlayer._x = m_oPlayer._x - 1;
m_oFood._x = m_oFood._x - 1;
}
}
m_oThrowMeter.Fill._xscale = Math.round(m_nThrowPower);
if (m_nThrowPower >= 100) {
m_nThrowPower = 0;
m_oThrowMeter.removeMovieClip();
clearInterval(m_nUpdateTimerInterval);
m_oPlayer.gotoAndStop("Throwing");
m_oFood.xVel = -m_oFood.launchVelocityX;
m_oFood.yVel = -m_oFood.launchVelocityY;
m_oFood.m_bUpdate = true;
m_oSounds.STRUGGLE.stop();
m_oSounds.THROW.start();
if (m_bUseScreenFlashEffects) {
m_oGameArea.attachMovie("WhiteFlash", "iWhiteFlash", DepthManager.WHITEFLASH);
}
m_nGameState = GameState.THROW_EXECUTED;
m_oGameArea.xVel = 0;
m_oGameArea.yVel = 0;
StopSuccessiveRandomGruntSounds();
com.shauncampbell.utils.SCScheduler.Set(mx.utils.Delegate.create(this, DisplayScoreSummary), 120);
}
break;
case GameState.SCORE_SUMMARY :
var _local2 = parseInt(m_oTimer.iScoreDeltaTF.text);
_local2 = _local2 - 10;
m_nScore = m_nScore + 10;
if ((_local2 > 0) && (_local2 < 10)) {
m_nScore = m_nScore + _local2;
_local2 = 0;
}
m_oTimer.iScoreDeltaTF.text = _local2;
if (_local2 <= 0) {
RemoveScoreSummary();
}
break;
case GameState.GAME_OVER_MESSAGE :
}
UpdateFood();
m_szGameStateString = GameState.GetStateString(m_nGameState);
}
function TweenPlayerOut() {
m_oPlayer.gotoAndStop("Running");
new com.shauncampbell.utils.SCTween(0, mx.utils.Delegate.create(this, EnlargeSceneBeforeLevelCompletion), m_oPlayer, "_x", com.shauncampbell.utils.SCTween.None.easeOut, m_oPlayer._x, m_oStageSize.x + m_oPlayer._width, 1.4, true);
}
function EnlargeSceneBeforeLevelCompletion() {
m_oPig.gotoAndStop("Sitting");
m_oSounds.PIGGROW.start();
ResizeScene(2, 0.4, LevelComplete);
}
function LevelComplete() {
m_nCurrentLevel++;
switch (m_nCurrentLevel) {
case 9 :
_root.Track("custom2");
break;
case 12 :
_root.Track("custom3");
break;
case 15 :
_root.Track("custom4");
break;
case 18 :
_root.Track("custom5");
break;
case 20 :
_root.Track("custom6");
}
StartLevel();
}
function UpdateFood() {
if (m_oFood.m_bUpdate) {
m_oFood._x = m_oFood._x + (m_oFood.xVel * m_oFood.m_nTimestep);
m_oFood._y = m_oFood._y + (m_oFood.yVel * m_oFood.m_nTimestep);
m_oFood.Graphic._rotation = m_oFood.Graphic._rotation + ((m_oFood.xVel * m_oFood.m_nRotationalVelocityFactor) * m_oFood.m_nTimestep);
m_oFood.yVel = m_oFood.yVel + (m_nGravity * m_oFood.m_nTimestep);
if (m_oFood.xVel > 0) {
m_oFood.xVel = m_oFood.xVel - (m_nFriction * m_oFood.m_nTimestep);
}
if (m_oFood.xVel < 0) {
m_oFood.xVel = m_oFood.xVel + (m_nFriction * m_oFood.m_nTimestep);
}
if (m_oFood.yVel > 0) {
m_oFood.yVel = m_oFood.yVel - (m_nFriction * m_oFood.m_nTimestep);
}
if (m_oFood.yVel < 0) {
m_oFood.yVel = m_oFood.yVel + (m_nFriction * m_oFood.m_nTimestep);
}
if ((m_oFood.yVel > 2) && ((m_oPig._currentframe % 2) == 1)) {
m_oPig.gotoAndStop("Open" + m_nCurrentLevel);
}
if (RectRectCollision(m_oPig, m_oFood, m_nCollisionSize)) {
m_oSounds.CHOMP.start();
AddScorePopup(m_oFood.m_nPointsAwarded);
m_nScore = m_nScore + m_oFood.m_nPointsAwarded;
m_oFood.removeMovieClip();
m_oPig.gotoAndStop("Closed" + (m_nCurrentLevel + 1));
m_oPlayer._xscale = -m_oPlayer._xscale;
TweenPlayerOut();
m_nGameState = GameState.PLAYER_EXITING;
}
}
}
function AddScorePopup(nScore) {
var _local3 = m_oHUDArea.attachMovie("ScorePopup", "iScorePopup", DepthManager.SCOREPOPUP);
var _local2 = new flash.geom.Point();
m_oPig.localToGlobal(_local2);
_local3._x = _local2.x + 10;
_local3._y = _local2.y - 110;
_local3.Graphic.iTF.text = "+" + nScore;
}
function GetHighScoresInstance() {
return(m_oHighScores);
}
function GameOver() {
StopSuccessiveRandomGruntSounds();
m_oThrowMeter.removeMovieClip();
m_nKeyRattlerState = KeyRattlerState.NONE;
m_oSounds.STRUGGLE.stop();
m_oSounds.FAILED.start();
m_oGameOverPanel = m_oHUDArea.attachMovie("GameOverPanel", "iGameOverPanel", DepthManager.GAMEOVERPANEL);
m_oGameOverPanel._x = m_oStageSize.x * 0.5;
m_oGameOverPanel._y = m_oStageSize.y * 0.5;
m_nGameState = GameState.GAME_OVER_MESSAGE;
m_oHighScores.CheckScore(m_nScore, mx.utils.Delegate.create(this, ScoreCheckSuccess), mx.utils.Delegate.create(this, ScoreCheckFailure));
}
function ScoreCheckSuccess() {
var _local3 = m_oHighScores.GetIncomingVars();
_root.m_nScorePosition = parseInt(_local3.hiscore);
if ((_local3.hiscore > 0) && (_local3.hiscore <= 10)) {
m_oGameOverPanel.gotoAndStop("Success");
com.shauncampbell.utils.SCScheduler.Set(mx.utils.Delegate.create(this, End), 3000, ["NameEntry"]);
} else {
m_oGameOverPanel.gotoAndStop("Fail");
com.shauncampbell.utils.SCScheduler.Set(mx.utils.Delegate.create(this, End), 3000, ["HighScores"]);
}
}
function ScoreCheckFailure() {
End("HighScores");
}
function CircleCircleCollision(oA, oB, nRadiusA, nRadiusB) {
return((Math.abs(oA._x - oB._x) + Math.abs(oA._y - oB._y)) < (Math.abs(nRadiusA + nRadiusB) * 0.5));
}
function SendToFriend(szYourName, szFriendName, szFriendEmail, oMenu) {
var _local3 = new LoadVars();
var oReceiveVars = new LoadVars();
_local3.name = szYourName;
_local3.friendname = szFriendName;
_local3.friendemail = szFriendEmail;
_local3.sendAndLoad(m_oSettings.GetSetting("sendToFriendUrl"), oReceiveVars, "POST");
oReceiveVars.onLoad = function (bSuccess) {
if (bSuccess && (oReceiveVars.success == 1)) {
_root.Track("sendtofriend");
oMenu.gotoAndStop("Confirmation");
} else {
oMenu.gotoAndStop("Error");
}
};
}
function GetPlayerScore() {
return(m_nScore);
}
function RectRectCollision(oA, oB, fHitAreaScale) {
var _local2 = new flash.geom.Point();
var _local1 = new flash.geom.Point();
oA.localToGlobal(_local2);
oB.localToGlobal(_local1);
if ((((_local2.x > (_local1.x + (oB._width * fHitAreaScale))) || (_local2.x < (_local1.x - (oA._width * fHitAreaScale)))) || (_local2.y > (_local1.y + (oB._height * fHitAreaScale)))) || (_local2.y < (_local1.y - (oA._height * fHitAreaScale)))) {
return(false);
}
return(true);
}
}
Symbol 385 MovieClip [__Packages.GameSounds] Frame 0
class GameSounds
{
var m_oDocument, m_oRoot, m_oSettings, m_oDebug, m_oSoundContainer, SILENCE, MUSIC1, MUSIC2, MUSIC3, MUSIC4, MUSIC5, CLICK, STRUGGLE, THROW, CHOMP, BLEEP, ZOOM, ENTERLEVEL, FAILED, PIGGROW, COUNTUP, ROLLOVER, RANDOMGRUNT1, RANDOMGRUNT2, RANDOMGRUNT3;
function GameSounds (oDocument, oRoot, oDebug, oSettings) {
m_oDocument = oDocument;
m_oRoot = oRoot;
m_oSettings = oSettings;
m_oDebug = oDebug;
m_oSoundContainer = m_oRoot.createEmptyMovieClip("iSoundContainer", DepthManager.SOUNDCONTAINER);
m_oDebug.Append("GameSounds class initialised.");
CreateSounds();
}
function CreateSounds() {
SILENCE = CreateSound("music1");
MUSIC1 = CreateSound("music1");
MUSIC2 = CreateSound("music2");
MUSIC3 = CreateSound("music3");
MUSIC4 = CreateSound("music4");
MUSIC5 = CreateSound("music5");
CLICK = CreateSound("click");
STRUGGLE = CreateSound("struggle");
THROW = CreateSound("throw");
CHOMP = CreateSound("chomp");
BLEEP = CreateSound("bleep");
ZOOM = CreateSound("zoom");
ENTERLEVEL = CreateSound("enterlevel");
FAILED = CreateSound("failed");
PIGGROW = CreateSound("piggrow");
COUNTUP = CreateSound("countup");
ROLLOVER = CreateSound("rollover");
RANDOMGRUNT1 = CreateSound("randomgrunt1");
RANDOMGRUNT2 = CreateSound("randomgrunt2");
RANDOMGRUNT3 = CreateSound("randomgrunt3");
RANDOMGRUNT1.setVolume(35);
RANDOMGRUNT2.setVolume(35);
RANDOMGRUNT3.setVolume(35);
SILENCE.setVolume(0);
SILENCE.start(0, 999999);
FAILED.setVolume(80);
CHOMP.setVolume(15);
STRUGGLE.setVolume(100);
COUNTUP.setVolume(75);
}
function StopAllMusic() {
MUSIC1.stop();
MUSIC2.stop();
MUSIC3.stop();
MUSIC4.stop();
MUSIC5.stop();
}
function CreateSound(szLinkageID) {
var _local2 = new Sound(CreateContainer());
_local2.attachSound(szLinkageID);
return(_local2);
}
function CreateContainer() {
var _local2 = m_oSoundContainer.getNextHighestDepth();
return(m_oSoundContainer.createEmptyMovieClip("iSoundTimeline" + _local2, _local2));
}
}
Symbol 386 MovieClip [__Packages.DepthManager] Frame 0
class DepthManager
{
function DepthManager () {
}
static var SOUNDCONTAINER = 1002;
static var DEBUGPANEL = 1001;
static var GAMEOVERPANEL = 1010;
static var SCOREPANEL = 1009;
static var LEVELENTRYPANEL = 1008;
static var TIMER = 1007;
static var THROWMETER = 1006;
static var SCOREPOPUP = 1005;
static var WHITEFLASH = 1011;
static var FOOD = 1004;
static var PLAYER = 1003;
static var PLATFORM = 1002;
static var MAINSCENE = 1001;
static var PIG = 1001;
}
Symbol 387 MovieClip [__Packages.HighScores] Frame 0
class HighScores
{
var m_oDebug, m_oGame, m_vszRanks, m_szScriptURL, m_oLoadVars, m_oReceiveVars, m_fnSuccessCallback, m_fnFailureCallback;
function HighScores (szURL, oDebug, oGame) {
m_oDebug = oDebug;
m_oGame = oGame;
m_vszRanks = [];
m_vszRanks.push("Oink Boy", "Oink Merchant", "Pig Mercenary", "Pig Leader", "Red Pig Leader", "Oink Master");
m_vszRanks.push("Super Oink Master", "High Pig Commander", "Supreme Pig Commander", "Emperor Pig");
m_vszRanks.reverse();
m_szScriptURL = szURL;
m_oLoadVars = new LoadVars();
m_oReceiveVars = new LoadVars();
m_oReceiveVars.onLoad = mx.utils.Delegate.create(this, LoadCallback);
m_oDebug.Append("HighScores class initialised.");
}
function GetScores(fnSuccessCallback, fnFailureCallback) {
m_oDebug.Append("HighScores.GetScores");
m_fnSuccessCallback = fnSuccessCallback;
m_fnFailureCallback = fnFailureCallback;
m_oLoadVars.submitscore = 0;
m_oLoadVars.playerscore = 0;
m_oLoadVars.sendAndLoad(m_szScriptURL, m_oReceiveVars, "GET");
}
function CheckScore(nScore, fnSuccessCallback, fnFailureCallback) {
m_oDebug.Append("HighScores.CheckScore");
m_fnSuccessCallback = fnSuccessCallback;
m_fnFailureCallback = fnFailureCallback;
m_oLoadVars.submitscore = 0;
m_oLoadVars.playerscore = nScore;
m_oLoadVars.sendAndLoad(m_szScriptURL, m_oReceiveVars, "GET");
}
function SubmitScore(szName, nScore, nStageReached, fnSuccessCallback, fnFailureCallback) {
m_oDebug.Append("HighScores.SubmitScore");
m_fnSuccessCallback = fnSuccessCallback;
m_fnFailureCallback = fnFailureCallback;
m_oLoadVars.playername = szName;
m_oLoadVars.submitscore = 1;
m_oLoadVars.stagereached = nStageReached;
m_oLoadVars.playerscore = nScore;
m_oLoadVars.sendAndLoad(m_szScriptURL, m_oReceiveVars, "GET");
}
function GetScoreAtIndex(nIndex) {
return(m_oReceiveVars["score" + nIndex]);
}
function GetNameAtIndex(nIndex) {
return(m_oReceiveVars["name" + nIndex]);
}
function GetStageReachedAtIndex(nIndex) {
return(parseInt(m_oReceiveVars["stagereached" + nIndex]));
}
function GetRankAtIndex(nIndex) {
return(m_vszRanks[nIndex - 1]);
}
function GetRankFromStageReached(nStage) {
var _local2 = -1 + nStage;
return(m_vszRanks[Math.floor(_local2 * 0.5)]);
}
function GetIncomingVars() {
m_oDebug.Append("HighScores.GetIncomingVars");
return(m_oReceiveVars);
}
function GetOutgoingVars() {
m_oDebug.Append("HighScores.GetOutgoingVars");
return(m_oLoadVars);
}
function LoadCallback(bSuccess) {
if (bSuccess) {
m_oDebug.Append("HighScores callback received.");
m_oGame.ParseFakeScores();
m_fnSuccessCallback();
} else {
m_oDebug.Append("HighScores callback failed.");
m_fnFailureCallback();
}
}
function toString() {
return("[object HighScores]");
}
}
Symbol 388 MovieClip [__Packages.GameState] Frame 0
class GameState
{
function GameState () {
}
static function GetStateString(nState) {
switch (nState) {
case INITIALISATION :
return("INITIALISATION");
case MAIN_MENU :
return("MAIN_MENU");
case FOOD_DROPPING_IN :
return("FOOD_DROPPING_IN");
case PLAYER_ENTERING :
return("PLAYER_ENTERING");
case PLAYER_ATTEMPTING_THROW :
return("PLAYER_ATTEMPTING_THROW");
case THROW_EXECUTED :
return("THROW_EXECUTED");
case SCORE_SUMMARY :
return("SCORE_SUMMARY");
case GAME_OVER_MESSAGE :
return("GAME_OVER_MESSAGE");
case PLAYER_EXITING :
return("PLAYER_EXITING");
}
}
static var INITIALISATION = 1;
static var MAIN_MENU = 2;
static var FOOD_DROPPING_IN = 3;
static var PLAYER_ENTERING = 4;
static var PLAYER_ATTEMPTING_THROW = 5;
static var THROW_EXECUTED = 6;
static var SCORE_SUMMARY = 7;
static var GAME_OVER_MESSAGE = 8;
static var PLAYER_EXITING = 9;
}
Symbol 389 MovieClip [__Packages.FoodItem] Frame 0
class FoodItem
{
var m_szName, m_nStartingOffset, m_oLaunchVelocity, m_nRotationalVelocityFactor, m_nLiftingTime, m_nLiftingDifficulty, m_nPointsAwarded, m_nCollisionSize;
function FoodItem () {
}
function GetName() {
return(m_szName);
}
function GetStartingOffset() {
return(m_nStartingOffset);
}
function GetLaunchVelocity() {
return(m_oLaunchVelocity.clone());
}
function GetRotationalVelocityFactor() {
return(m_nRotationalVelocityFactor);
}
function GetLiftingTime() {
return(m_nLiftingTime);
}
function GetLiftingDifficulty() {
return(m_nLiftingDifficulty);
}
function GetPointsAwarded() {
return(m_nPointsAwarded);
}
function GetCollisionSize() {
return(m_nCollisionSize);
}
function SetName(szName) {
m_szName = szName;
}
function SetStartingOffset(nStartingOffset) {
m_nStartingOffset = nStartingOffset;
}
function SetLaunchVelocity(nX, nY) {
if (m_oLaunchVelocity) {
m_oLaunchVelocity.x = nX;
m_oLaunchVelocity.y = nY;
} else {
m_oLaunchVelocity = new flash.geom.Point(nX, nY);
}
}
function SetRotationalVelocityFactor(nFactor) {
m_nRotationalVelocityFactor = nFactor;
}
function SetLiftingTime(nTime) {
m_nLiftingTime = nTime;
}
function SetLiftingDifficulty(nDifficulty) {
m_nLiftingDifficulty = nDifficulty;
}
function SetPointsAwarded(nPoints) {
m_nPointsAwarded = nPoints;
}
function SetCollisionSize(nSize) {
m_nCollisionSize = nSize;
}
}
Symbol 390 MovieClip [__Packages.KeyRattlerState] Frame 0
class KeyRattlerState
{
function KeyRattlerState () {
}
static var LEFT = 1;
static var RIGHT = 2;
static var NONE = 4;
}
Symbol 391 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 392 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 393 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 394 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 395 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 396 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 397 MovieClip [__Packages.com.shauncampbell.utils.SCTween] Frame 0
class com.shauncampbell.utils.SCTween
{
function SCTween (nStartingDelay, fnCallback, oObject, szProperty, fnTweenType, nStartingValue, nEndingValue, nDuration, bUseSeconds) {
if (nStartingDelay > 0) {
com.shauncampbell.utils.SCScheduler.Set(function () {
var _local1 = new mx.transitions.Tween(oObject, szProperty, fnTweenType, nStartingValue, nEndingValue, nDuration, bUseSeconds);
_local1.onMotionFinished = function () {
fnCallback();
};
}, nStartingDelay);
} else {
var _local1 = new mx.transitions.Tween(oObject, szProperty, fnTweenType, nStartingValue, nEndingValue, nDuration, bUseSeconds);
_local1.onMotionFinished = function () {
fnCallback();
};
}
}
function toString() {
return("[object SCTween]");
}
static var None = {easeIn:mx.transitions.easing.None.easeIn, easeOut:mx.transitions.easing.None.easeOut, easeInOut:mx.transitions.easing.None.easeInOut};
static var Back = {easeIn:mx.transitions.easing.Back.easeIn, easeOut:mx.transitions.easing.Back.easeOut, easeInOut:mx.transitions.easing.Back.easeInOut};
static var Bounce = {easeIn:mx.transitions.easing.Bounce.easeIn, easeOut:mx.transitions.easing.Bounce.easeOut, easeInOut:mx.transitions.easing.Bounce.easeInOut};
static var Elastic = {easeIn:mx.transitions.easing.Elastic.easeIn, easeOut:mx.transitions.easing.Elastic.easeOut, easeInOut:mx.transitions.easing.Elastic.easeInOut};
static var Regular = {easeIn:mx.transitions.easing.Regular.easeIn, easeOut:mx.transitions.easing.Regular.easeOut, easeInOut:mx.transitions.easing.Regular.easeInOut};
static var Strong = {easeIn:mx.transitions.easing.Strong.easeIn, easeOut:mx.transitions.easing.Strong.easeOut, easeInOut:mx.transitions.easing.Strong.easeInOut};
}
Symbol 398 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 399 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 400 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 401 MovieClip [__Packages.com.shauncampbell.utils.SCScheduler] Frame 0
class com.shauncampbell.utils.SCScheduler
{
static var m_vnSchedules;
function SCScheduler () {
}
static function ClearAll() {
while (m_vnSchedules.length) {
clearInterval(m_vnSchedules[m_vnSchedules.length - 1]);
m_vnSchedules.pop();
}
}
static function Untrack() {
m_bTracking = false;
}
static function Track() {
m_bTracking = true;
}
static function Set(cArg1, cArg2, cArg3, cArg4) {
if (!m_vnSchedules) {
m_vnSchedules = new Array();
}
var nIntervalID;
var _local2;
if (typeof(cArg1) == "function") {
var vArguments = arguments.slice(2);
_local2 = function () {
(com.shauncampbell.utils.SCScheduler.m_bTracking ? (trace("Unscoped scheduled function called.")) : null);
cArg1.apply(null, vArguments);
clearInterval(nIntervalID);
};
nIntervalID = setInterval(_local2, cArg2, vArguments);
(m_bTracking ? (trace("Unscoped function scheduled.")) : null);
} else {
var vArguments = arguments.slice(3);
_local2 = function () {
(com.shauncampbell.utils.SCScheduler.m_bTracking ? (trace("Scoped scheduled function called.")) : null);
cArg1[cArg2].apply(cArg1, vArguments);
clearInterval(nIntervalID);
};
nIntervalID = setInterval(_local2, cArg3, vArguments);
(m_bTracking ? (trace("Scoped function scheduled.")) : null);
}
m_vnSchedules.push(nIntervalID);
return(nIntervalID);
}
static var m_bTracking = false;
}
Symbol 402 MovieClip [__Packages.com.shauncampbell.utils.SCCommandWatcher] Frame 0
class com.shauncampbell.utils.SCCommandWatcher
{
static var m_voCommands, m_vszInputHistory, m_nUpdateInterval, m_oListener, m_nRemoveCharacterInterval;
function SCCommandWatcher () {
}
static function Initialise() {
_global.CommandWatcher = com.shauncampbell.utils.SCCommandWatcher;
m_voCommands = [];
m_vszInputHistory = [];
clearInterval(m_nUpdateInterval);
m_oListener = new Object();
Key.addListener(m_oListener);
m_oListener.onKeyDown = OnKeyDown;
m_nUpdateInterval = setInterval(Update, 30);
ResetCharacterRemovalInterval();
}
static function ResetCharacterRemovalInterval() {
clearInterval(m_nRemoveCharacterInterval);
m_nRemoveCharacterInterval = setInterval(RemoveOneCharacter, 380);
}
static function RemoveOneCharacter() {
if (m_vszInputHistory.length) {
m_vszInputHistory.pop();
}
}
static function AddCommand(szCommandString, fnFunction) {
var _local1 = new Object();
_local1.m_szCommandString = szCommandString;
_local1.m_fnFunction = fnFunction;
m_voCommands.push(_local1);
}
static function OnKeyDown() {
var _local1 = chr(Key.getAscii());
m_vszInputHistory.unshift(_local1);
ResetCharacterRemovalInterval();
if (m_vszInputHistory.length > 20) {
m_vszInputHistory.pop();
}
}
static function Update() {
var _local6 = m_voCommands;
var _local7 = _local6.length;
var _local1 = 0;
while (_local1 < _local7) {
var _local3 = _local6[_local1];
var _local2 = _local3.m_szCommandString.split("").reverse().join("");
var _local5 = _local2.length;
var _local4 = m_vszInputHistory.join("");
if (_local4.indexOf(_local2) == 0) {
_local3.m_fnFunction.call();
while (m_vszInputHistory.length) {
m_vszInputHistory.pop();
}
m_vszInputHistory = [];
}
_local1++;
}
}
}
Symbol 403 MovieClip [__Packages.FLVController] Frame 0
class FLVController
{
var flvController_mc, my_video, slider_btn, play_btn, fwd_btn, rew_btn, myNetConnection_nc, myNetStream_ns, playState_str, loader_si, seek_si;
function FLVController (flvController_mc_arg) {
flvController_mc = flvController_mc_arg;
flvController_mc.buffering_mc.flvcontroller = this;
my_video = flvController_mc.my_video;
slider_btn = flvController_mc.panel_mc.slider_btn;
slider_btn.flvController = this;
play_btn = flvController_mc.panel_mc.play_btn;
play_btn.flvController = this;
fwd_btn = flvController_mc.panel_mc.fwd_btn;
fwd_btn.flvController = this;
rew_btn = flvController_mc.panel_mc.rew_btn;
rew_btn.flvController = this;
defineButtons();
myNetConnection_nc = new NetConnection();
myNetConnection_nc.connect(null);
myNetStream_ns = new NetStream(myNetConnection_nc);
myNetStream_ns.setBufferTime(5);
flvController_mc.my_video.attachVideo(myNetStream_ns);
myNetStream_ns.FLVCcontroller_class = this;
myNetStream_ns.onMetaData = function (obj) {
this.duration_num = obj.duration;
};
myNetStream_ns.onStatus = function (infoObject) {
if (infoObject.code == "NetStream.Buffer.Empty") {
this.FLVCcontroller_class.showBuffer();
} else if (infoObject.code == "NetStream.Buffer.Full") {
this.FLVCcontroller_class.hideBuffer();
}
if (infoObject.code == "NetStream.Seek.InvalidTime") {
this.FLVCcontroller_class.showBuffer();
}
var _local3 = this.duration_num - this.time;
if (_local3 < 0.5) {
}
};
}
function loadFLV(url_arg) {
showBuffer();
playState_str = "playing";
play_btn.gotoAndStop("playing");
myNetStream_ns.play(url_arg);
flvController_mc.buffering_mc.gotoAndStop("on");
loader_si = setInterval(this, "checkLoaded", 50);
}
function jumpSection() {
clearInterval(loader_si);
clearInterval(seek_si);
_root.play();
}
function reset() {
}
function showBuffer() {
flvController_mc.buffering_mc.gotoAndStop("on");
flvController_mc.buffering_mc.onEnterFrame = function () {
this.percent_num = Math.floor((this.flvcontroller.myNetStream_ns.bufferLength / this.flvcontroller.myNetStream_ns.bufferTime) * 99) + "%";
};
disable();
}
function hideBuffer() {
flvController_mc.buffering_mc.gotoAndStop("off");
flvController_mc.buffering_mc.onEnterFrame = function () {
};
enable();
}
function disable() {
clearInterval(seek_si);
slider_btn.enabled = false;
play_btn.enabled = false;
fwd_btn.enabled = false;
rew_btn.enabled = false;
}
function checkLoaded() {
var _local3 = (myNetStream_ns.time / myNetStream_ns.duration_num) * 100;
flvController_mc.panel_mc.loadbar_mc.progressbar_mc._xscale = _local3;
var _local2 = (myNetStream_ns.bytesLoaded / myNetStream_ns.bytesTotal) * 100;
flvController_mc.panel_mc.loadbar_mc.loadbar_mc._xscale = _local2;
}
function slidePanelOut() {
flvController_mc.panel_mc._y = flvController_mc.panel_mc._y + ((292 - flvController_mc.panel_mc._y) / 2);
if (flvController_mc.panel_mc._y < 293) {
flvController_mc.panel_mc._y = 292;
clearInterval(loader_si);
}
}
function slidePanelIn() {
flvController_mc.panel_mc._y = flvController_mc.panel_mc._y + ((320 - flvController_mc.panel_mc._y) / 2);
if (flvController_mc.panel_mc._y > 319) {
flvController_mc.panel_mc._y = 320;
clearInterval(loader_si);
}
}
function enable() {
slider_btn.enabled = true;
play_btn.enabled = true;
fwd_btn.enabled = true;
rew_btn.enabled = true;
}
function startPlaying() {
if (playState_str != "playing") {
playState_str = "playing";
play_btn.gotoAndStop("playing");
myNetStream_ns.pause();
}
}
function stopPlaying() {
if (playState_str != "stopped") {
playState_str = "stopped";
play_btn.gotoAndStop("paused");
myNetStream_ns.pause();
}
}
function closeVideo() {
myNetStream_ns.close();
}
function fwd() {
var _local2 = myNetStream_ns.time + 1;
myNetStream_ns.seek(_local2);
}
function rew() {
myNetStream_ns.seek(myNetStream_ns.time - 1);
}
function defineButtons() {
play_btn.onRelease = function () {
if (this.flvController.playState_str != "playing") {
this.flvController.startPlaying();
} else {
this.flvController.stopPlaying();
}
};
fwd_btn.onPress = function () {
this.flvController.seek_si = setInterval(this.flvController, "fwd", 50);
};
fwd_btn.onRelease = (fwd_btn.onReleaseOutside = function () {
clearInterval(this.flvController.seek_si);
});
rew_btn.onPress = function () {
this.flvController.myNetStream_ns.seek(0);
};
rew_btn.onRelease = (rew_btn.onReleaseOutside = function () {
});
disable();
}
}
Symbol 40 MovieClip [WhiteFlash] Frame 35
this.removeMovieClip();
Symbol 76 MovieClip Frame 1
stop();
Symbol 99 MovieClip [Timer] Frame 1
stop();
Symbol 102 MovieClip [ScorePopup] Frame 70
this.removeMovieClip();
Symbol 200 MovieClip Frame 1
loadMovie (_root.g_szPromotionURL, this);
Symbol 209 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
_root.gotoAndStop("Video");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
stop();
Symbol 214 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.gotoAndStop("Instructions");
_root.m_oSounds.CLICK.start();
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 217 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
_root.gotoAndStop("HighScores");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 220 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
_root.gotoAndStop("SendToAFriend");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 225 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
g_oDocument.BeginGameplay();
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 228 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
_root.Track("clickthru");
getURL ("http://www.slabovia.tv", "_blank");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 255 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
_root.gotoAndStop("MainMenu");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 260 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 272 MovieClip Frame 1
iNameTF.restrict = "a-z A-Z 0-9";
iScoreTF.text = "You scored " + g_oGame.m_nScore;
iPositionTF.text = ("reached position " + parseInt(_root.m_nScorePosition)) + "!";
var oTextFormat = new TextFormat();
oTextFormat.letterSpacing = -0.7;
iScoreTF.setTextFormat(oTextFormat);
iPositionTF.setTextFormat(oTextFormat);
iNameTF.onSetFocus = function () {
if (this.text == "Enter your name") {
this.text = "";
}
this.setTextFormat(oTextFormat);
};
iNameTF.onKillFocus = function () {
if (this.text == "") {
this.text = "Enter your name";
}
this.setTextFormat(oTextFormat);
};
var oSendListener = new Object();
Key.addListener(oSendListener);
oSendListener.onKeyDown = function () {
if (Key.getCode() == 13) {
Button_Send.HitArea.onPress();
}
};
Button_Send.HitArea.onPress = function () {
if (iNameTF.text != "Enter your name") {
Key.removeListener(oSendListener);
g_oGame.SubmitNameAndScore(iNameTF.text);
iNameTF.type = "dynamic";
iNameTF.selectable = false;
Button_Send.HitArea.enabled = (Button_Send.HitArea.buttonMode = false);
}
};
Symbol 312 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
g_oDocument.BeginGameplay();
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 317 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 333 MovieClip Frame 1
stop();
var oThis = this;
var oTextFormat = new TextFormat();
oTextFormat.letterSpacing = -0.7;
iYourNameTF.onSetFocus = function () {
if (this.text == "Your Name") {
this.text = "";
}
this.setTextFormat(oTextFormat);
};
iYourNameTF.onKillFocus = function () {
if (this.text == "") {
this.text = "Your Name";
}
this.setTextFormat(oTextFormat);
};
iFriendNameTF.onSetFocus = function () {
if (this.text == "Friend\u2019s Name") {
this.text = "";
}
this.setTextFormat(oTextFormat);
};
iFriendNameTF.onKillFocus = function () {
if (this.text == "") {
this.text = "Friend\u2019s Name";
}
this.setTextFormat(oTextFormat);
};
iFriendEmailTF.onSetFocus = function () {
if (this.text == "Friend\u2019s Email") {
this.text = "";
}
this.setTextFormat(oTextFormat);
};
iFriendEmailTF.onKillFocus = function () {
if (this.text == "") {
this.text = "Friend\u2019s Email";
}
this.setTextFormat(oTextFormat);
};
iYourNameTF.onChanged = (iFriendNameTF.onChanged = (iFriendEmailTF.onChanged = function () {
this.setTextFormat(oTextFormat);
}));
Button_Send.HitArea.onPress = function () {
if ((((iYourNameTF.text != "Your Name") && (iFriendNameTF.text != "Friend\u2019s Name")) && (iFriendEmailTF.text != "Friend\u2019s Email")) && (String(iFriendEmailTF.text).indexOf("@") > 1)) {
_root.m_oSounds.CLICK.start();
g_oGame.SendToFriend(iYourNameTF.text, iFriendNameTF.text, iFriendEmailTF.text, oThis);
Button_Send.HitArea.enabled = (Button_Send.HitArea.buttonMode = false);
iYourNameTF.type = (iFriendNameTF.type = (iFriendEmailTF.type = "dynamic"));
iYourNameTF.selectable = (iFriendNameTF.selectable = (iFriendEmailTF.selectable = false));
} else {
if (iYourNameTF.text == "Your Name") {
YourNameErrorBox.gotoAndPlay(2);
}
if (iFriendNameTF.text == "Friend\u2019s Name") {
FriendNameErrorBox.gotoAndPlay(2);
}
if ((iFriendEmailTF.text == "Friend\u2019s Email") || (String(iFriendEmailTF.text).indexOf("@") <= 1)) {
FriendEmailErrorBox.gotoAndPlay(2);
}
}
};
Symbol 333 MovieClip Frame 16
stop();
Symbol 333 MovieClip Frame 31
stop();
var oThis = this;
Button_Retry.HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
oThis.gotoAndStop("Input");
};
Symbol 335 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.flvPlayer.stopPlaying();
_root.flvPlayer.closeVideo();
_root.m_oSounds.MUSIC1.start(0, 99999);
_root.m_oSounds.CLICK.start();
_root.gotoAndStop("MainMenu");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
Symbol 348 MovieClip Frame 1
this.onRollOver = function () {
back_mc.gotoAndStop("on");
};
this.onRollOut = (this.onDragOut = function () {
back_mc.gotoAndStop("off");
});
stop();
Symbol 366 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 10
stop();
Symbol 378 MovieClip Frame 1
if (!bInitialised) {
var oThis = this;
HitArea.onPress = function () {
_root.m_oSounds.CLICK.start();
getURL ("http://www.slabovia.tv", "_blank");
};
HitArea.onRollOver = (HitArea.onDragOver = function () {
_root.m_oSounds.ROLLOVER.start();
oThis.gotoAndStop("Over");
});
HitArea.onRollOut = (HitArea.onDragOut = function () {
_root.m_oSounds.ROLLOVER.stop();
oThis.gotoAndStop("Out");
});
bInitialised = true;
stop();
}
stop();
Symbol 379 MovieClip Frame 1
myFLVController = new FLVController(controller_mc);
myFLVController.loadFLV(_root.g_szVideoURL);
_root.flvPlayer = myFLVController;
_root.m_oSounds.MUSIC1.stop();
stop();