Frame 1
function load(url) {
var _local3 = createEmptyMovieClip("loader_mc", getNextHighestDepth());
var _local2 = new MovieClipLoader();
_local2.addListener(this);
_local2.loadClip(url, _local3);
}
function onLoadInit(mc) {
_root.gs_loaded = true;
gs_gameServices = new GameServices(gameServicesCallback);
gs_scoreSubmit = new GSScoreSubmit(gameServicesCallback);
gs_sendToFriend = new GSSendToFriend(stfCallback);
GameServices.initGameTracking(null, false);
trace((("Game Services module " + mtvnGSPath) + " loaded, GS ver=") + GameServices.getVersionString());
trace("BaseDir=" + GameServices.getBaseDir());
trace(showGSStartupInfo());
}
function stfCallback(action) {
trace("STF callback hit with " + action);
if (action == "nodata") {
stop();
} else if (action == "load") {
gotoAndStop ("ReceivedData");
} else {
gotoAndStop ("Result");
}
}
function gameServicesCallback(gsResponseInfo, whichCommand) {
if (gsResponseInfo.isError()) {
trace((("Error=" + gsResponseInfo.message) + "; ") + gsResponseInfo.extended_info);
startupVars.text = (gsResponseInfo.message + "; ") + gsResponseInfo.extended_info;
} else {
trace("gameServicesCallback");
var _local6 = gsResponseInfo.success;
if (_local6) {
switch (whichCommand) {
case "SetUserScoreGetScores" :
case "SetUserScoreGetScoresUnauth" :
case "GetScoreRanks" :
case "GetScoreRanksUnauth" :
case "GetUserScoreRanks" :
case "GetUserRatingRanks" :
case "GetRatingRanks" :
HiscoreList.singleton.showHiscoreList(gsResponseInfo.results);
break;
case "SetUserScoreGetRank" :
case "SetUserScoreGetRankUnauth" :
case "GetSiteUserRank" :
var _local5 = gsResponseInfo.outparams.user_rank;
showData.text = "Your rank is " + _local5;
break;
case "GetRegistrationStatus" :
case "UserLogin" :
var _local3 = gsResponseInfo.results[0];
showData.text = (((((((("User " + _local3.user_name) + " (id=") + _local3.user_id) + ") created on ") + _local3.date_created) + "\nLogged in ") + _local3.login_count) + " times, last login on ") + _local3.last_login;
GameServices.loadAvatar(1, _root, "myAvatar", _root.getNextHighestDepth());
break;
case "GetUserGameGroupExperiencePoints" :
case "GetUserGameExperiencePoints" :
case "GetUserSiteExperiencePoints" :
var _local7 = gsResponseInfo.results[0].experience_points;
showData.text = ("You currently have " + _local7) + " experience points.";
}
if (whichCommand.indexOf("SetUserScore") != -1) {
resultCode = gsResponseInfo.message;
if (resultCode == "UNCHANGED") {
startupVars.text = "You already have a better score.";
} else {
startupVars.text = "Score submitted!";
}
}
} else {
showData.text = (("Command " + whichCommand) + " failed: ") + gsResponseInfo.message;
}
}
}
function showGSStartupInfo() {
gs_siteId = GameServices.getSiteId();
gs_sessionId = GameServices.getSessionId();
gs_playbackId = gs_sendToFriend.getPlaybackId();
return((((((((("Loaded from " + mtvnGSPath) + "; version ") + GameServices.getVersionString()) + "\nSiteId=") + gs_siteId) + "; SessionId=") + gs_sessionId) + "; PlaybackId=") + gs_playbackId);
}
stop();
var g_isDev = (_root.GSPath == null);
var mtvnGSPath = "gs1.swf";
var g_startFrame = "title";
if (g_isDev) {
_root.game_id = "6";
_root.site_id = "10";
_root.SubmitURL = "http://gs.mtv-q.mtvi.com/community.php";
} else {
mtvnGSPath = _root.GSPath + mtvnGSPath;
}
var gs_gameServices = null;
var gs_scoreSubmit = null;
var gs_sendToFriend = null;
var gs_loaded = false;
if (!_root.gs_loaded) {
trace("Loading GS from " + mtvnGSPath);
load(mtvnGSPath);
}
TestMain.main();
Instance of Symbol 18 MovieClip in Frame 1
onClipEvent (load) {
stop();
}
onClipEvent (enterFrame) {
if (_root.getBytesTotal() > 0) {
var percent = (_root.getBytesLoaded() / _root.getBytesTotal());
var frame = (Math.round(percent * 10) + 1);
gotoAndStop(frame);
if ((percent == 1) && (_root.gs_loaded)) {
_root.gotoAndStop("title");
}
}
}
Frame 2
Mouse.show();
Frame 17
stop();
mBlueTag.enabled = false;
Symbol 4 MovieClip Frame 6
stop();
Symbol 6 MovieClip Frame 6
stop();
Symbol 9 MovieClip Frame 6
stop();
Symbol 12 MovieClip Frame 6
stop();
Symbol 14 MovieClip Frame 7
stop();
Symbol 15 MovieClip Frame 17
stop();
Symbol 380 MovieClip [__Packages.TestMain] Frame 0
class TestMain
{
function TestMain () {
}
static function main() {
Object.registerClass("GameArea", GameArea);
Object.registerClass("Cheney", Cheney);
Object.registerClass("lib_enemy0", Enemy);
Object.registerClass("lib_enemy1", Enemy);
Object.registerClass("lib_enemy2", Enemy);
Object.registerClass("EnemyLoc", EnemyLoc);
}
static function showResult() {
GameArea.singleton.terminate();
Cheney.singleton.mActive = false;
_root.mResult.gotoAndStop("lose");
}
}
Symbol 381 MovieClip [__Packages.GameArea] Frame 0
class GameArea extends MovieClip
{
static var singleton;
var iHitArea, _mCrossHair, attachMovie, onEnterFrame, _xmouse, _ymouse;
function GameArea () {
super();
}
function onLoad() {
singleton = this;
iHitArea._alpha = 0;
_mCrossHair = attachMovie("crosshair", "crosshair", 100);
onEnterFrame = update;
}
function terminate() {
if (_mCrossHair) {
_mCrossHair.removeMovieClip();
_mCrossHair = null;
}
onEnterFrame = null;
Cheney.singleton.mActive = false;
Mouse.show();
}
function update() {
if (_mCrossHair) {
if (iHitArea.hitTest(_root._xmouse, _root._ymouse, true)) {
Cheney.singleton.mActive = true;
Mouse.hide();
} else {
Cheney.singleton.mActive = false;
Mouse.show();
}
_mCrossHair._x = _xmouse;
_mCrossHair._y = _ymouse;
}
}
}
Symbol 382 MovieClip [__Packages.Cheney] Frame 0
class Cheney extends MovieClip
{
static var singleton;
var mLineMC, _parent, mSplash, mActive, mShots, mHits, gun_axis, gun, head;
function Cheney () {
super();
}
function onLoad() {
singleton = this;
mLineMC = _parent.createEmptyMovieClip("lineMC", 100);
mSplash = _parent.attachMovie("splash_1", "splash", 99);
mSplash._visible = false;
mActive = true;
trace(mLineMC);
mShots = 0;
mHits = 0;
}
function onMouseMove() {
if (mActive) {
var _local2 = tinymantis.Utils.radians2degrees(Math.atan2(gun_axis._ymouse, gun_axis._xmouse));
if ((_local2 > -179) && (_local2 < -80)) {
gun._rotation = _local2;
head._rotation = _local2 + 180;
}
}
}
function onMouseDown() {
if (mActive) {
gun.gotoAndPlay("shoot");
tinymantis.SoundManager.__get__sSingleton().playSound("snd_gun", false);
mLineMC.clear();
mLineMC.lineStyle(1, 6750207);
var _local2 = {x:gun.tip._x, y:gun.tip._y};
gun.localToGlobal(_local2);
_parent.globalToLocal(_local2);
mSplash._visible = true;
mSplash._rotation = gun._rotation + 180;
mSplash._x = _parent._xmouse;
mSplash._y = _parent._ymouse;
mSplash.gotoAndPlay(1);
mShots++;
}
}
}
Symbol 383 MovieClip [__Packages.tinymantis.Utils] Frame 0
class tinymantis.Utils
{
function Utils () {
}
static function GET_NEW_FINGERPRINT() {
return(++_sFingerPrint);
}
static function DELETE(inObj) {
inObj.destroy();
if (inObj instanceof MovieClip) {
traceD("DELETE instance of movie", 4);
inObj._visible = false;
inObj.removeMovieClip();
} else {
}
return(undefined);
}
static function DEPRECTATED(oldName, newName, theArgs) {
traceD("____________________________________________________", 2);
traceD((("the function " + oldName) + "has been changed to ") + newName, 2);
traceD("called from " + theArgs, 2);
traceD("____________________________________________________", 2);
}
static function getSymbol(parent, srcUrl, id, name, depth, param, callback) {
var _local2 = parent.createEmptyMovieClip(name, depth);
var _local3 = new MovieClipLoader();
var _local1 = new Object();
_local1.onLoadInit = function (target_mc) {
tinymantis.Utils.traceD("loaded", 4);
var _local1 = target_mc.attachMovie(id, "clip", 1, param);
callback();
};
_local3.addListener(_local1);
_local3.loadClip(srcUrl, _local2);
return(_local2);
}
static function changeSymbol(clip, id) {
clip.attachMovie(id, "clip", 1);
}
static function traceD(msg, debugLevel) {
if (debugLevel <= _sDebugLevel) {
trace(msg);
}
}
static function radians2degrees(inRadians) {
var _local1 = inRadians * _180_DIVIDED_BY_PI;
return(_local1);
}
static function degrees2radians(inDegrees) {
var _local1 = inDegrees * _PI_DIVIDED_BY_180;
return(_local1);
}
static function printBounds(inMC) {
var _local1 = inMC.getBounds(inMC);
trace("-----bound for object" + inMC);
for (var _local2 in _local1) {
trace((("\t" + _local2) + "=") + _local1[_local2]);
}
}
static function drawMCBounds(inMC) {
var _local1 = inMC.getBounds(inMC);
var _local2 = 3;
inMC.lineStyle(2, 16711680, 1);
inMC.moveTo(_local1.xMin + _local2, _local1.yMin + _local2);
inMC.lineTo(_local1.xMax - _local2, _local1.yMin);
inMC.lineTo(_local1.xMax - _local2, _local1.yMax - _local2);
inMC.lineTo(_local1.xMin + _local2, _local1.yMax - _local2);
inMC.lineTo(_local1.xMin + _local2, _local1.yMin + _local2);
}
static var _sFingerPrint = 0;
static var _sDebugLevel = 0;
static var _180_DIVIDED_BY_PI = 57.2957795130823;
static var _PI_DIVIDED_BY_180 = (Math.PI/180);
}
Symbol 384 MovieClip [__Packages.tinymantis.SoundManager] Frame 0
class tinymantis.SoundManager
{
static var _sSingleton;
function SoundManager (inNumChannels) {
var _local2 = 0;
while (_local2 < inNumChannels) {
addSound();
_local2++;
}
}
static function get sSingleton() {
if (_sSingleton == undefined) {
_sSingleton = new tinymantis.SoundManager(20);
}
return(_sSingleton);
}
function isChannelPlaying(index) {
if ((index >= 0) && (index < mSoundIsPlaying.length)) {
return(mSoundIsPlaying[index]);
}
return(false);
}
function playSound(inSoundName, loop) {
var _local3 = -1;
var _local2 = 0;
while (_local2 < mSoundIsPlaying.length) {
if (!mSoundIsPlaying[_local2]) {
mSoundIsPlaying[_local2] = true;
_local3 = _local2;
break;
}
_local2++;
}
if (_local3 != -1) {
var _local4 = mSoundPool[_local3];
_local4.attachSound(inSoundName);
if (_local4 == undefined) {
throw new Error("there is no sound at index" + _local3);
}
if (loop) {
_local4.start(0, 100000);
} else {
_local4.start();
}
_local4.setVolume(100);
} else {
throw new Error("Not enough sound channels!!! Increase the number of channels");
}
return(_local3);
}
function stopSound(inIndex) {
var _local2 = mSoundPool[inIndex];
if (_local2 == undefined) {
throw new Error("there is no sound at index" + inIndex);
}
_local2.stop();
freeSound(inIndex);
return(-1);
}
function freeSound(inIndex) {
mSoundIsPlaying[inIndex] = false;
}
function setVolume(inIndex, inVolume) {
var _local2 = mSoundPool[inIndex];
if (_local2 == undefined) {
throw new Error("there is no sound at index" + inIndex);
}
_local2.setVolume(inVolume);
}
function addSound() {
var _local4 = _root.createEmptyMovieClip("sm" + mCounter, _root.getNextHighestDepth());
var _local3 = new Sound(_local4);
_local3.index = mSoundPool.length;
_local3.onSoundComplete = function () {
tinymantis.SoundManager.__get__sSingleton().freeSound(this.index);
};
mSoundPool.push(_local3);
mSoundParentPool.push(_local4);
mSoundIsPlaying.push(false);
mCounter++;
}
var mSoundPool = new Array();
var mSoundParentPool = new Array();
var mSoundIsPlaying = new Array();
var mCounter = 100000;
}
Symbol 385 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends MovieClip
{
var mState, mLocIndex, pTimer, body, _x, _y, swapDepths, onPress, mGendor, mNameID, mScore;
function Enemy () {
super();
}
function onLoad() {
mState = new tinymantis.StateMachine(this);
mState.setState("HIDE");
trace("Enemy CTOR");
mLocIndex = -1;
pTimer = 1;
}
function HIDE_enter() {
body.gotoAndStop("hide");
if (mLocIndex != -1) {
EnemyLoc.sLocationsOccupied[mLocIndex] = false;
}
var _local2;
do {
_local2 = random(EnemyLoc.sLocations.length);
} while (EnemyLoc.sLocationsOccupied[_local2] == true);
mLocIndex = _local2;
EnemyLoc.sLocationsOccupied[mLocIndex] = true;
var _local3 = EnemyLoc.sLocations[mLocIndex];
_x = _local3.x;
_y = _local3.y;
swapDepths(_local3.depth);
trace(_local3);
mState.mModalCounter = Math.round((10 + (pTimer * 5)) + (Math.random() * (20 + (pTimer * 80))));
}
function HIDE_update() {
if (Cheney.singleton.mActive) {
mState.mModalCounter--;
if (mState.mModalCounter == 0) {
mState.setState("UP");
}
}
}
function UP_enter() {
body.gotoAndPlay("up");
trace("up");
}
function READY_enter() {
mState.mModalCounter = Math.round((10 + (pTimer * 5)) + (Math.random() * (20 + (pTimer * 20))));
if (Cheney.singleton.mActive) {
onPress = READY_press;
}
}
function READY_update() {
mState.mModalCounter--;
if (mState.mModalCounter == 0) {
mState.setState("DOWN");
}
}
function READY_exit() {
onPress = null;
}
function READY_press() {
trace("I am hit-------------------------------");
mState.setState("HIT");
}
function HIT_enter() {
body.gotoAndPlay("hit");
var _local2 = "snd_hit_";
if (mGendor == "female") {
tinymantis.SoundManager.__get__sSingleton().playSound(("snd_hit_" + mGendor) + Math.floor(Math.random() * 2), false);
} else {
tinymantis.SoundManager.__get__sSingleton().playSound((("snd_hit_" + mGendor) + "") + mNameID, false);
}
if (mScore > 0) {
Cheney.singleton.mHits++;
}
ScoreClip.singleton.setScore(ScoreClip.singleton.getScore() + mScore);
}
function DOWN_enter() {
body.gotoAndPlay("down");
}
function onEnterFrame() {
pTimer = Math.max(0, pTimer - 0.0006);
mState.update();
}
}
Symbol 386 MovieClip [__Packages.tinymantis.StateMachine] Frame 0
class tinymantis.StateMachine
{
var _mFuncPrefix;
function StateMachine (inParent, inFuncPrefix) {
if (inParent == null) {
throw new Error("StateMachine : cannot initialize: inParent is null");
}
if (inFuncPrefix == undefined) {
inFuncPrefix = "";
}
_mFuncPrefix = inFuncPrefix;
mParent = inParent;
mNextState = new Array();
tinymantis.Utils.traceD("state machine created:" + mParent, 4);
}
function get mFramesSinceEnteredState() {
return(_mFramesSinceEnteredState);
}
function get mFingerPrint() {
return(_mFingerPrint);
}
function resetState() {
mParent[(_mFuncPrefix + mCurrState) + "_exit"]();
mCurrState = null;
mNextState = new Array();
}
function setState(inState) {
if (inState == null) {
throw new Error("StateMachine : cannot setState: inState is null; Use resetState instead.");
}
mNextState.unshift(inState);
}
function getState() {
return(mCurrState);
}
function getNextState() {
return(mNextState[mNextState.length - 1]);
}
function update() {
do {
if (mNextState.length > 0) {
_mFingerPrint = tinymantis.Utils.GET_NEW_FINGERPRINT();
mParent[(_mFuncPrefix + mCurrState) + "_exit"]();
mParent[(_mFuncPrefix + mNextState[mNextState.length - 1]) + "_enter"]();
mCurrState = String(mNextState.pop());
_mFramesSinceEnteredState = 0;
tinymantis.Utils.traceD((((("* " + this) + "(") + mParent.mClassName) + ") switch to ") + mCurrState, 4);
}
if (mCurrState != null) {
_mFramesSinceEnteredState++;
mParent[(_mFuncPrefix + mCurrState) + "_update"]();
}
} while (mNextState.length > 0);
}
function run(yes) {
mParent[(_mFuncPrefix + mCurrState) + "_run"](yes);
}
function destroy() {
mParent = null;
mNextState = null;
mCurrState = null;
}
var mParent = null;
var mNextState = null;
var mCurrState = null;
var _mFingerPrint = 0;
var _mFramesSinceEnteredState = 0;
var mModalCounter = 0;
}
Symbol 387 MovieClip [__Packages.EnemyLoc] Frame 0
class EnemyLoc extends MovieClip
{
static var sLocations, sLocationsOccupied;
var getDepth, _y, _x;
function EnemyLoc () {
super();
if (sLocations == null) {
sLocations = new Array();
sLocationsOccupied = new Array();
}
sLocations.push({x:_x, y:_y, depth:getDepth()});
sLocationsOccupied.push(false);
}
}
Symbol 388 MovieClip [__Packages.ScoreClip] Frame 0
class ScoreClip extends MovieClip
{
static var singleton;
function ScoreClip () {
super();
}
function onLoad() {
setScore(0);
singleton = this;
}
function getScore() {
return(pScore);
}
function setScore(score) {
pScore = Math.max(0, score);
_root.gScore = pScore;
digitNumberPanel(this, pNumDigits, pScore);
}
static function digitNumberPanel(root, inNumDigits, number) {
var _local6 = 1;
var _local1 = number;
while (_local1 > 9) {
_local1 = Math.floor(_local1 / 10);
_local6++;
}
var _local5 = inNumDigits - _local6;
var _local3 = 0;
while (_local3 < inNumDigits) {
var _local4 = root["num" + _local3];
if (_local3 < _local5) {
_local4.gotoAndStop(11);
} else {
_local1 = number;
var _local2 = 0;
while (_local2 < (_local3 - _local5)) {
_local1 = _local1 / 10;
_local2++;
}
_local1 = Math.floor(_local1) % 10;
if (_local1 == 0) {
_local4.gotoAndStop(10);
} else {
_local4.gotoAndStop(_local1);
}
}
_local3++;
}
}
var pNumDigits = 8;
var pScore = 0;
}
Symbol 389 MovieClip [__Packages.HiscoreList] Frame 0
class HiscoreList extends MovieClip
{
static var singleton;
var pScore, pInitials, iScrollBar, pResults;
function HiscoreList () {
super();
}
function onLoad() {
singleton = this;
pScore = _root.gScore;
pInitials = _root.gInitials;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = this["list" + _local3];
_local4.clear();
_local3++;
}
trace((("unauthSubmitScoreGetScores:" + pScore) + ", ") + pInitials);
GSScoreSubmit.unauthSubmitScoreGetScores(pScore, pScore, "", pInitials, 1, 100);
iScrollBar.setRange(96);
iScrollBar.setCallback(tinymantis.Delegate.create(this, scroll));
}
function scroll() {
showList(iScrollBar.getIndex());
trace("scroll: " + iScrollBar.getIndex());
}
function showHiscoreList(results) {
pResults = results.slice(0);
showList(0);
}
function showList(startIndex) {
trace("get results");
var _local3 = 0;
while (_local3 < 5) {
var _local2 = this["list" + _local3];
var _local4 = startIndex + _local3;
if (_local4 < pResults.length) {
var _local5 = pResults[_local4];
_local2.setIndex(_local4 + 1);
_local2.setInitials(_local5.user_name);
_local2.setScore(_local5.score);
} else {
_local2.clear();
}
_local3++;
}
}
}
Symbol 390 MovieClip [__Packages.tinymantis.ScrollBar] Frame 0
class tinymantis.ScrollBar extends MovieClip
{
var iThumb, iUp, iDown, _mPreDragY, _mDragOffset, _ymouse, _mIndex, iBack, _mRange, _mPosition, _mCallback, _mRangeUnit;
function ScrollBar () {
super();
trace("ScrollBar");
iThumb.onPress = tinymantis.Delegate.create(this, thumbDown);
iThumb.onMouseMove = tinymantis.Delegate.create(this, thumbDrag);
iThumb.onRelease = tinymantis.Delegate.create(this, thumbRelease);
iThumb.onReleaseOutside = tinymantis.Delegate.create(this, thumbRelease);
iUp.onRelease = tinymantis.Delegate.create(this, up);
iDown.onRelease = tinymantis.Delegate.create(this, down);
}
function thumbDown() {
trace("mouseDown");
_mInDrag = true;
_mPreDragY = iThumb._y;
_mDragOffset = iThumb._y - _ymouse;
}
function thumbDrag() {
var _local5 = _mIndex;
var _local3 = iBack._height - iThumb._height;
if (_mInDrag) {
var _local2 = _ymouse + _mDragOffset;
if (_local2 < iBack._y) {
_local2 = iBack._y;
} else if (_local2 > (iBack._y + _local3)) {
_local2 = iBack._y + _local3;
}
if (_mRange != null) {
var _local4 = (_local2 - iBack._y) / _local3;
_mPosition = int(_local4 * _mRange) / _mRange;
_local2 = iBack._y + (_mPosition * _local3);
_mIndex = int(_mPosition * _mRange);
} else {
_mPosition = (_local2 - iBack._y) / _local3;
}
iThumb._y = _local2;
if ((_mIndex == null) || (_mIndex != _local5)) {
trace((getIndex() + " ") + getPosition());
_mCallback();
}
}
}
function up() {
setPosition(_mPosition - _mRangeUnit, _mCallback);
}
function down() {
setPosition(_mPosition + _mRangeUnit, _mCallback);
}
function thumbRelease() {
_mInDrag = false;
}
function setCallback(callback) {
_mCallback = callback;
}
function onLoad() {
setPosition(0);
}
function setRange(inRange) {
_mRange = inRange - 1;
_mRangeUnit = 1 / _mRange;
}
function setPosition(inPos, callback) {
inPos = Math.max(0, Math.min(1, inPos));
var _local3 = iBack._height - iThumb._height;
_mPosition = inPos;
if (_mRange != null) {
_mPosition = Math.round(inPos * _mRange) / _mRange;
_mIndex = Math.round(_mPosition * _mRange);
}
var _local4 = _mPosition * _local3;
iThumb._y = iBack._y + _local4;
callback();
}
function getPosition() {
return(_mPosition);
}
function getIndex() {
return(_mIndex);
}
var _mInDrag = false;
}
Symbol 391 MovieClip [__Packages.tinymantis.Delegate] Frame 0
class tinymantis.Delegate
{
function Delegate () {
}
static function create(target, handler) {
var extraArgs = arguments.slice(2);
var delegate;
delegate = function () {
var _local2 = arguments.concat(extraArgs, [delegate]);
return(handler.apply(target, _local2));
};
return(delegate);
}
}
Symbol 392 MovieClip [__Packages.HiscoreItem] Frame 0
class HiscoreItem extends MovieClip
{
var index0, index1, index2, mDot;
function HiscoreItem () {
super();
}
function clear() {
setInitials("");
var _local2 = 0;
while (_local2 < pNumDigits) {
var _local3 = this["num" + _local2];
_local3.gotoAndStop(11);
_local2++;
}
index0.clear();
index1.clear();
index2.clear();
mDot._visible = false;
}
function setIndex(index) {
if (index < 100) {
index2.clear();
} else {
index2.setNumber(Math.floor(index / 100));
}
if (index < 10) {
index1.clear();
} else {
index1.setNumber(Math.floor(index / 10) % 10);
}
index0.setNumber(index % 10);
mDot._visible = true;
}
function setInitials(initials) {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = "1";
if (_local2 < initials.length) {
_local3 = initials.charAt(_local2);
}
this["initial" + _local2].setLetter(_local3);
_local2++;
}
}
function setScore(score) {
var _local7 = 1;
var _local2 = score;
while (_local2 > 9) {
_local2 = Math.floor(_local2 / 10);
_local7++;
}
var _local6 = pNumDigits - _local7;
var _local4 = 0;
while (_local4 < pNumDigits) {
var _local5 = this["num" + _local4];
if (_local4 < _local6) {
_local5.gotoAndStop(11);
} else {
_local2 = score;
var _local3 = 0;
while (_local3 < (_local4 - _local6)) {
_local2 = _local2 / 10;
_local3++;
}
_local2 = Math.floor(_local2) % 10;
if (_local2 == 0) {
_local5.gotoAndStop(10);
} else {
_local5.gotoAndStop(_local2);
}
}
_local4++;
}
}
var pNumDigits = 8;
}
Symbol 393 MovieClip [__Packages.NewsFeedClip] Frame 0
class NewsFeedClip extends MovieClip
{
var mDisplayText, mRunning, pNews, pCurrentIndex, onEnterFrame, mMask;
function NewsFeedClip () {
super();
}
function onLoad() {
var _local4 = GameServices.getBaseDir(_root);
var _local3 = new LoadVars();
_local3.onData = tinymantis.Delegate.create(this, onReceiveFeed);
_local3.load(_local4 + "news_feed.txt");
mDisplayText.autoSize = "left";
mRunning = true;
}
function onReceiveFeed(data) {
var _local2;
_local2 = "\n\r";
if (data.indexOf(_local2) < 0) {
_local2 = "\r\n";
if (data.indexOf(_local2) < 0) {
_local2 = newline;
if (data.indexOf(_local2) < 0) {
_local2 = "\r";
if (data.indexOf(_local2) < 0) {
_local2 = "";
}
}
}
}
if (_local2.length) {
pNews = data.split(_local2);
} else {
pNews = new Array();
pNews.push(data);
}
start();
}
function start() {
if (pNews.length) {
pCurrentIndex = -1;
showNextNews();
onEnterFrame = update;
}
}
function showNextNews() {
pCurrentIndex++;
if (pCurrentIndex >= pNews.length) {
pCurrentIndex = 0;
}
mDisplayText.text = pNews[pCurrentIndex];
mDisplayText._x = mMask._x + mMask._width;
}
function update() {
if (mRunning) {
mDisplayText._x = mDisplayText._x - 2;
if ((mDisplayText._x + mDisplayText._width) < mMask._x) {
showNextNews();
}
}
}
}
Symbol 394 MovieClip [__Packages.Digit] Frame 0
class Digit extends MovieClip
{
var gotoAndStop, _totalframes;
function Digit () {
super();
}
function clear() {
(gotoAndStop(11));// not popped
}
function setNumber(num) {
if (num == 0) {
(gotoAndStop(10));// not popped
} else {
(gotoAndStop(num));// not popped
}
}
function setLetter(letter) {
trace("setLetter:" + letter);
letter = letter.toUpperCase();
var _local4 = letter.charCodeAt(0) - String("A").charCodeAt(0);
var _local2 = 12 + _local4;
if ((_local2 < 12) || (_local2 > _totalframes)) {
_local2 = 11;
}
(gotoAndStop(_local2));// not popped
}
}
Symbol 395 MovieClip [__Packages.SubmitScreen] Frame 0
class SubmitScreen extends MovieClip
{
static var singleton;
var pCurrentInitialPosition;
function SubmitScreen () {
super();
}
function onLoad() {
singleton = this;
pCurrentInitialPosition = 0;
setInitial(0, 11);
setInitial(1, 11);
setInitial(2, 11);
Key.addListener(this);
setupScores(_root.gScore);
}
function submit() {
_root.gInitials = getInitials();
_root.gotoAndStop("scorelist");
}
function getNumLetters() {
return(pCurrentInitialPosition);
}
function getInitials() {
var _local4 = "";
var _local3 = 0;
while (_local3 < 3) {
var _local5 = this["initial" + _local3];
var _local2 = _local5._currentframe;
if (_local2 < 10) {
_local4 = _local4 + ("" + _local2);
} else if (_local2 == 10) {
_local4 = _local4 + "0";
} else if (_local2 > 11) {
var _local7 = _local2 - 12;
var _local6 = String("A").charCodeAt(0) + _local7;
_local4 = _local4 + String.fromCharCode(_local6);
}
_local3++;
}
return(_local4);
}
function onKeyDown() {
switch (Key.getCode()) {
case 8 :
case 46 :
if (pCurrentInitialPosition > 0) {
pCurrentInitialPosition--;
}
setInitial(pCurrentInitialPosition, 11);
break;
default :
var _local3 = Key.getAscii();
var _local2 = _local3 - String("a").charCodeAt(0);
if ((_local2 >= 0) && (_local2 < 26)) {
setInitial(pCurrentInitialPosition++, _local2 + 12);
} else {
_local2 = _local3 - String("A").charCodeAt(0);
if ((_local2 >= 0) && (_local2 < 26)) {
setInitial(pCurrentInitialPosition++, _local2 + 12);
} else if (_local3 == String("0").charCodeAt(0)) {
setInitial(pCurrentInitialPosition++, 10);
} else {
_local2 = _local3 - String("1").charCodeAt(0);
if (!((_local2 >= 0) && (_local2 < 9))) {
break;
}
setInitial(pCurrentInitialPosition++, _local2 + 1);
}
}
}
if (pCurrentInitialPosition > 3) {
pCurrentInitialPosition = 3;
}
trace(_local3);
}
function setInitial(digit, frame) {
trace((("setInitial: " + digit) + " = ") + frame);
this["initial" + digit].gotoAndStop(frame);
}
function setupScores(score) {
var _local3 = 0;
while (_local3 < 8) {
var _local5 = this["num" + _local3];
var _local4 = score;
var _local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 / 10;
_local2++;
}
var _local6 = Math.floor(_local4) % 10;
if (_local6 == 0) {
_local5.gotoAndStop((((_local3 == 0) || (_local4 > 9)) ? 10 : 11));
} else {
_local5.gotoAndStop(_local6);
}
_local3++;
}
}
}
Symbol 20 MovieClip Frame 5
stop();
Symbol 21 Button
on (press) {
_root.gotoAndStop("instructions");
}
Symbol 28 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 6
stop();
Symbol 38 MovieClip Frame 18
stop();
Symbol 39 Button
on (press) {
_root.gotoAndStop("game");
}
Symbol 42 MovieClip Frame 4
stop();
Symbol 52 MovieClip [EnemyLoc] Frame 1
_visible = false;
Symbol 63 MovieClip Frame 5
stop();
Symbol 66 MovieClip Frame 20
stop();
Symbol 73 MovieClip Frame 2
stop();
Symbol 73 MovieClip Frame 10
stop();
_parent.mState.setState("READY");
Symbol 73 MovieClip Frame 30
_parent.mState.setState("HIDE");
Symbol 73 MovieClip Frame 105
stop();
_parent.mState.setState("DOWN");
Symbol 74 MovieClip [lib_enemy0] Frame 1
mGendor = "male";
mNameID = 0;
mScore = -5000;
Symbol 78 MovieClip Frame 20
stop();
Symbol 92 MovieClip Frame 2
stop();
Symbol 92 MovieClip Frame 11
stop();
_parent.mState.setState("READY");
Symbol 92 MovieClip Frame 24
_parent.mState.setState("HIDE");
Symbol 92 MovieClip Frame 108
stop();
_parent.mState.setState("DOWN");
Symbol 93 MovieClip [lib_enemy1] Frame 1
mGendor = "male";
mNameID = 1;
mScore = 5000;
Symbol 97 MovieClip Frame 20
stop();
Symbol 108 MovieClip Frame 2
stop();
Symbol 108 MovieClip Frame 11
stop();
_parent.mState.setState("READY");
Symbol 108 MovieClip Frame 23
_parent.mState.setState("HIDE");
Symbol 108 MovieClip Frame 95
stop();
_parent.mState.setState("DOWN");
Symbol 109 MovieClip [lib_enemy2] Frame 1
mGendor = "female";
mScore = 10000;
Symbol 124 MovieClip [placeholder] Frame 1
_visible = false;
Symbol 129 MovieClip Frame 6
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 19
water.gotoAndPlay(1);
Symbol 156 MovieClip [lib_score] Frame 1
#initclip 19
Object.registerClass("lib_score", ScoreClip);
#endinitclip
Symbol 160 MovieClip Frame 31
stop();
Symbol 163 MovieClip Frame 31
stop();
Symbol 166 MovieClip Frame 31
stop();
Symbol 169 MovieClip Frame 31
stop();
Symbol 172 MovieClip Frame 31
stop();
Symbol 176 MovieClip Frame 31
stop();
Symbol 179 MovieClip Frame 31
stop();
Symbol 182 MovieClip Frame 31
stop();
Symbol 185 MovieClip Frame 31
stop();
Symbol 188 MovieClip Frame 31
stop();
Symbol 191 MovieClip Frame 31
stop();
Symbol 195 MovieClip Frame 31
stop();
Symbol 199 MovieClip Frame 31
stop();
Symbol 204 MovieClip Frame 31
stop();
Symbol 209 MovieClip Frame 31
stop();
Symbol 212 MovieClip Frame 31
stop();
Symbol 215 MovieClip Frame 31
stop();
Symbol 218 MovieClip Frame 31
stop();
Symbol 221 MovieClip Frame 31
stop();
Symbol 224 MovieClip Frame 31
stop();
Symbol 227 MovieClip Frame 31
stop();
Symbol 228 MovieClip Frame 31
stop();
Symbol 229 MovieClip Frame 31
stop();
Symbol 232 MovieClip Frame 31
stop();
Symbol 237 MovieClip Frame 31
stop();
Symbol 240 MovieClip Frame 31
stop();
Symbol 243 MovieClip Frame 31
stop();
Symbol 246 MovieClip Frame 31
stop();
Symbol 249 MovieClip Frame 31
stop();
Symbol 252 MovieClip Frame 31
stop();
Symbol 255 MovieClip Frame 31
stop();
Symbol 258 MovieClip Frame 31
stop();
Symbol 261 MovieClip Frame 31
stop();
Symbol 262 MovieClip Frame 31
stop();
Symbol 264 MovieClip Frame 1
gotoAndPlay (900);
Symbol 264 MovieClip Frame 901
mDigit.gotoAndStop(mDigit._totalframes);
Symbol 264 MovieClip Frame 2817
stop();
TestMain.showResult();
Symbol 276 MovieClip Frame 6
stop();
Symbol 277 Button
on (release) {
_parent.mRunning = false;
gotoAndStop (2);
}
Symbol 279 MovieClip Frame 6
stop();
Symbol 280 Button
on (release) {
_parent.mRunning = true;
gotoAndStop (1);
}
Symbol 281 MovieClip Frame 1
stop();
Symbol 282 MovieClip [tickerbar] Frame 1
#initclip 17
Object.registerClass("tickerbar", NewsFeedClip);
#endinitclip
Symbol 323 MovieClip [lib_letter_digits] Frame 1
#initclip 18
Object.registerClass("lib_letter_digits", Digit);
#endinitclip
Symbol 329 MovieClip Frame 1
ScoreClip.digitNumberPanel(mScore, 8, _root.gScore);
ScoreClip.digitNumberPanel(mHits, 3, Cheney.singleton.mHits);
var accuracy = 0;
if (Cheney.singleton.mShots > 0) {
accuracy = Cheney.singleton.mHits / Cheney.singleton.mShots;
}
var percent = Math.round(accuracy * 100);
ScoreClip.digitNumberPanel(mAccuracy, 3, percent);
mPercentSign._x = 126;
if (percent < 100) {
mPercentSign._x = mPercentSign._x - 18;
}
if (percent < 10) {
mPercentSign._x = mPercentSign._x - 18;
}
Symbol 331 MovieClip Frame 5
stop();
Symbol 333 Button
on (release) {
play();
}
Symbol 334 MovieClip Frame 18
stop();
Symbol 334 MovieClip Frame 24
_root.gotoAndStop("submit");
Symbol 336 MovieClip Frame 5
stop();
Symbol 337 Button
on (release) {
_root.gotoAndStop(1);
}
Symbol 339 MovieClip Frame 5
stop();
Symbol 342 MovieClip Frame 8
stop();
Symbol 344 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 6
stop();
Symbol 348 Button
on (release) {
setMute(true);
}
Symbol 351 MovieClip Frame 6
stop();
Symbol 352 Button
on (release) {
setMute(false);
}
Symbol 353 MovieClip Frame 1
function setMute(off) {
var _local2 = _root.mSoundControl;
if ((_local2 == null) || (_local2 == undefined)) {
_local2 = new Sound(_root);
_root.mSoundControl = _local2;
}
_local2.setVolume((off ? 0 : 100));
gotoAndStop((off ? "off" : "on"));
}
stop();
Symbol 358 Button
on (release) {
if (getNumLetters() == 3) {
this.submit();
}
}
Symbol 361 MovieClip [lib_submit_score] Frame 1
#initclip 20
Object.registerClass("lib_submit_score", SubmitScreen);
#endinitclip
Instance of Symbol 360 MovieClip in Symbol 361 MovieClip [lib_submit_score] Frame 1
onClipEvent (enterFrame) {
var num_digits = SubmitScreen.singleton.getNumLetters();
if (num_digits > 2) {
this._visible = false;
} else {
this._visible = true;
this._x = _parent["initial" + num_digits]._x;
}
}
Symbol 364 Button
on (release) {
_root.gotoAndStop("title");
}
Symbol 367 MovieClip [lib_hiscore_item] Frame 1
#initclip 23
Object.registerClass("lib_hiscore_item", HiscoreItem);
#endinitclip
Symbol 375 MovieClip Frame 6
stop();
Symbol 378 MovieClip [lib_scrollbar] Frame 1
#initclip 21
Object.registerClass("lib_scrollbar", tinymantis.ScrollBar);
#endinitclip
Symbol 379 MovieClip [lib_hiscorelist] Frame 1
#initclip 22
Object.registerClass("lib_hiscorelist", HiscoreList);
#endinitclip