STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228086
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/47517221?noj=FRM47517221-2DC" width="1" height="1"></div>

GAY.swf

This is the info page for
Flash #102779

(Click the ID number above for more basic data on this flash file.)


Text
Kiss Twilight Boys!

made with my eternal love

Play!

Play!

instructions

instructions

Medals

Medals

<p align="left"></p>

100

<p align="left"></p>

pts

Instructions
Those TwilighT BOYS ARE SO CUTE!
SADLY, THEY ARE NOT GETTING ENOUGH
KISSES! tHIS IS WHERE YOU COME IN.
YOU MUST USE YOUR MOUSE TO KISS
EITHER EDWARD CULLEN OR JACOB BLACK!
CHOOSE ONE AND KISS HIM! DO NOT KISS
BOTH. YOU WILL LOSE POINTS!
kiss justin bieber to catch the
bieber fever and 3x score!

Back!

Back!

medals

team jacob!

team edward!

bieber fever!

Hater

BIEBER FEVER!

3x score!!!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

BIEBER FEVER!

40

Timer

time's up!

high scores:

team edward

team edward

team jacob

team jacob

team edward:

Option

High Scores

Page 1

1

Some-Dude-or-Chick

9,999,999,999

team Jacob:

ActionScript [AS3]

Section 1
//DefaultMedalIcon (com.newgrounds.assets.DefaultMedalIcon) package com.newgrounds.assets { import flash.display.*; public dynamic class DefaultMedalIcon extends BitmapData { public function DefaultMedalIcon(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package com.newgrounds.assets
Section 2
//DefaultSaveIcon (com.newgrounds.assets.DefaultSaveIcon) package com.newgrounds.assets { import flash.display.*; public dynamic class DefaultSaveIcon extends BitmapData { public function DefaultSaveIcon(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package com.newgrounds.assets
Section 3
//APIConnector (com.newgrounds.components.APIConnector) package com.newgrounds.components { import flash.utils.*; import flash.display.*; import com.newgrounds.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class APIConnector extends MovieClip { public var encryptionKey:String; public var loader:Preloader; public var ad:FlashAd; public var connectorType:String; public var className:String; public var _redirect:Boolean; public var redirectOnHostBlocked:Boolean; public var redirectOnNewVersion:Boolean; public var movieVersion:String; public var debugMode:String; public var apiId:String; public function APIConnector(){ addFrameScript(0, frame1); } public function _apiConnect():void{ var _local1:*; _local1 = API; if (((_local1) && (!(_local1.connected)))){ if (!apiId){ Logger.logError("No API ID entered in the API Connector component.", "You can create an API ID for this submission at http://newgrounds.com/account/flashapi", "Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector)."); return; }; switch (debugMode){ case "Off": default: _local1.debugMode = _local1.RELEASE_MODE; break; case "Simulate Logged-in User": _local1.debugMode = _local1.DEBUG_MODE_LOGGED_IN; break; case "Simulate Logged-out User": _local1.debugMode = _local1.DEBUG_MODE_LOGGED_OUT; break; case "Simulate New Version": _local1.debugMode = _local1.DEBUG_MODE_NEW_VERSION; break; case "Simulate Host Blocked": _local1.debugMode = _local1.DEBUG_MODE_HOST_BLOCKED; break; }; _local1.addEventListener(APIEvent.API_CONNECTED, _onConnected); _local1.connect(root, apiId, encryptionKey, movieVersion); }; } public function _onConnected(_arg1:APIEvent):void{ if (((((redirectOnNewVersion) && (_arg1.success))) && (_arg1.data.newVersion))){ _redirect = true; }; if (((((redirectOnHostBlocked) && (!(_arg1.success)))) && ((_arg1.error == APIEvent.ERROR_HOST_BLOCKED)))){ _redirect = true; }; if (_redirect){ gotoAndStop("adPreloader"); forceAlwaysOnTop(); }; } public function forceAlwaysOnTop():void{ var _local1:uint; if (parent){ _local1 = (parent.numChildren - 1); if (parent.getChildIndex(this) != _local1){ parent.setChildIndex(this, _local1); }; }; if (stage){ x = ((stage.stageWidth - width) / 2); y = ((stage.stageHeight - height) / 2); visible = true; }; if (((root) && ((root is MovieClip)))){ MovieClip(root).stop(); }; } public function _onLoaded():void{ var mainClass:Class; var main:*; gotoAndStop("invisible"); if (_redirect){ API.loadOfficialVersion(); return; }; if (className){ try { mainClass = (getDefinitionByName(className) as Class); if (((mainClass) && (parent))){ main = new (mainClass); parent.addChild(main); parent.removeChild(this); }; } catch(error) { Logger.logError(("Unable to create main class: " + className)); }; }; } function frame1(){ stop(); if (((root) && ((root is MovieClip)))){ MovieClip(root).stop(); }; x = int(x); y = int(y); if (!debugMode){ debugMode = "Simulate Logged-in User"; }; if (!connectorType){ connectorType = "Flash Ad + Preloader"; }; switch (connectorType){ case "Flash Ad + Preloader": gotoAndStop("adPreloader"); break; case "Flash Ad Only": gotoAndStop("ad"); break; case "Invisible": gotoAndStop("invisible"); break; }; _apiConnect(); } } }//package com.newgrounds.components
Section 4
//FlashAd (com.newgrounds.components.FlashAd) package com.newgrounds.components { import flash.utils.*; import flash.display.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class FlashAd extends FlashAdBase { public function FlashAd(){ addFrameScript(0, frame1, 29, frame30); } function frame1(){ stop(); } function frame30(){ if (this["playButton"]){ this["playButton"].addEventListener(MouseEvent.CLICK, onPlayClick); }; } public function onPlayClick(_arg1:MouseEvent):void{ removeAd(); if (parent){ parent.removeChild(this); }; } } }//package com.newgrounds.components
Section 5
//FlashAdBase (com.newgrounds.components.FlashAdBase) package com.newgrounds.components { import flash.display.*; import com.newgrounds.*; import flash.events.*; import flash.net.*; import flash.system.*; public class FlashAdBase extends MovieClip { private var _showBorder:Boolean;// = true public var showPlayButton:Boolean; private var _fullScreen:Boolean; private var _adFeedLoader:URLLoader; private var _ad:Loader; public function FlashAdBase(){ try { Security.allowDomain("server.cpmstar.com"); Security.allowInsecureDomain("server.cpmstar.com"); } catch(error) { }; x = int(x); y = int(y); stop(); if (this["newgroundsButton"]){ this["newgroundsButton"].addEventListener(MouseEvent.CLICK, this.onNGClick); }; addEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage); if (API.adFeedURL){ this.loadAdFeed(); } else { API.addEventListener(APIEvent.API_CONNECTED, this.loadAdFeed); }; } public function get _adContainer():Sprite{ return (this["adContainer"]); } public function get _newgroundsButton():DisplayObject{ return (this["newgroundsButton"]); } public function get fullScreen():Boolean{ return (this._fullScreen); } public function set fullScreen(_arg1:Boolean):void{ this._fullScreen = _arg1; if (_arg1){ if (stage){ this.drawFullScreenRect(); } else { addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage); }; } else { graphics.clear(); }; } public function get showBorder():Boolean{ return (this._showBorder); } public function set showBorder(_arg1:Boolean):void{ this._showBorder = _arg1; if (this._showBorder){ if (this._ad){ if (this._ad.content){ if (this.showPlayButton){ gotoAndStop("loadedPlay"); } else { gotoAndStop("loaded"); }; } else { gotoAndStop("loading"); }; } else { gotoAndStop("idle"); }; } else { gotoAndStop("noBorder"); }; } private function loadAdFeed(_arg1:APIEvent=null):void{ var event = _arg1; if (!API.adFeedURL){ return; }; if (this._showBorder){ gotoAndStop("loading"); }; this._adFeedLoader = new URLLoader(); this._adFeedLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded); this._adFeedLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError); this._adFeedLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError); var adFeedRequest:URLRequest = new URLRequest(API.adFeedURL); try { this._adFeedLoader.load(adFeedRequest); } catch(e:Error) { onAdError(); }; } private function onAdFeedLoaded(_arg1:Event):void{ if (((((this._adFeedLoader) && (this._adFeedLoader.data))) && (!((this._adFeedLoader.data == ""))))){ this.loadAd(this._adFeedLoader.data); } else { this.onAdError(); }; } private function loadAd(_arg1:String):void{ var adURL = _arg1; if (this._ad){ this.removeAd(); }; Logger.logMessage("Loading flash ad..."); this._ad = new Loader(); this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError); try { Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (_arg1:Event):void{ _arg1.preventDefault(); }); } catch(error:Error) { }; try { this._ad.load(new URLRequest(adURL), new LoaderContext(false, new ApplicationDomain(null))); if (this._adContainer){ this._adContainer.addChild(this._ad); }; if (this._showBorder){ if (this.showPlayButton){ gotoAndStop("loadedPlay"); } else { gotoAndStop("loaded"); }; }; } catch(error:Error) { onAdError(); }; } private function drawFullScreenRect():void{ if (stage){ x = ((stage.stageWidth - width) / 2); y = ((stage.stageHeight - height) / 2); graphics.beginFill(0); graphics.drawRect(-(stage.stageWidth), -(stage.stageHeight), (stage.stageWidth * 2), (stage.stageHeight * 2)); graphics.endFill(); }; } public function removeAd():void{ removeEventListener(Event.REMOVED_FROM_STAGE, this.onRemovedFromStage); if (this._adFeedLoader){ try { this._adFeedLoader.close(); } catch(e:Error) { }; }; if (this._ad){ try { this._ad.close(); } catch(e:Error) { }; try { Object(this._ad).unloadAndStop(true); } catch(e:Error) { _ad.unload(); }; if (this._ad.parent){ this._ad.parent.removeChild(this._ad); }; this._ad = null; }; Logger.logError("Ad destroyed."); } private function onAdError(_arg1:Event=null):void{ Logger.logError("Unable to load ad."); this.removeAd(); } private function onRemovedFromStage(_arg1:Event):void{ this.removeAd(); } private function onAddedToStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage); if (this.fullScreen){ this.drawFullScreenRect(); }; } private function onNGClick(_arg1:MouseEvent):void{ API.loadNewgrounds(); } } }//package com.newgrounds.components
Section 6
//MedalPopup (com.newgrounds.components.MedalPopup) package com.newgrounds.components { import flash.utils.*; import flash.display.*; import com.newgrounds.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class MedalPopup extends MovieClip { public var medalPointsText:TextField; public var medalIcon:MovieClip; public var alwaysOnTop:String; public var _medalScrollRect:Rectangle; public var _alwaysOnTop:Boolean; public var medalNameClip:MovieClip; public var _unlockedMedal:Medal; public var _medalQueue:Array; public function MedalPopup(){ addFrameScript(0, frame1, 14, frame15, 22, frame23, 83, frame84, 104, frame105); } function frame84(){ if (_medalScrollRect){ stop(); }; } public function showNextUnlock():void{ if (_unlockedMedal){ return; }; if (!_medalQueue.length){ gotoAndStop("hidden"); removeEventListener(Event.ENTER_FRAME, medalPopupEnterFrame); return; }; _unlockedMedal = Medal(_medalQueue.shift()); gotoAndPlay("medalUnlocked"); } public function onMedalUnlocked(_arg1:APIEvent):void{ if (_arg1.success){ _medalQueue.push(_arg1.data); showNextUnlock(); }; } function frame1(){ gotoAndStop("hidden"); API.addEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked); x = int(x); y = int(y); _medalQueue = []; _alwaysOnTop = true; if (alwaysOnTop){ _alwaysOnTop = (alwaysOnTop == "true"); }; } function frame105(){ stop(); _unlockedMedal = null; showNextUnlock(); } function frame23(){ if (((_unlockedMedal) && (medalIcon))){ _unlockedMedal.attachIcon(medalIcon); }; } public function medalPopupEnterFrame(_arg1:Event):void{ var topIndex:uint; var event = _arg1; if (_alwaysOnTop){ try { if (parent){ topIndex = (parent.numChildren - 1); if (parent.getChildIndex(this) != topIndex){ parent.setChildIndex(this, topIndex); }; }; } catch(error) { removeEventListener(Event.ENTER_FRAME, medalPopupEnterFrame); }; }; if (_medalScrollRect){ _medalScrollRect.offset(2, 0); medalNameClip.scrollRect = _medalScrollRect; if (_medalScrollRect.left >= (medalNameClip.textField.textWidth + 10)){ _medalScrollRect = null; play(); }; }; } function frame15(){ if (_unlockedMedal){ if (((medalNameClip) && (medalNameClip.textField))){ medalNameClip.textField.text = _unlockedMedal.name; API.setFont(medalNameClip.textField, "Pakenham"); }; if (medalPointsText){ medalPointsText.text = _unlockedMedal.value.toString(); }; if (medalNameClip.textField.textWidth > medalNameClip.width){ _medalScrollRect = new Rectangle(-(medalNameClip.width), 0, medalNameClip.width, medalNameClip.height); medalNameClip.textField.width = 1000; medalNameClip.scrollRect = _medalScrollRect; }; addEventListener(Event.ENTER_FRAME, medalPopupEnterFrame); }; } } }//package com.newgrounds.components
Section 7
//Preloader (com.newgrounds.components.Preloader) package com.newgrounds.components { import flash.utils.*; import flash.display.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class Preloader extends MovieClip { public var className:String; public var loadingBar:MovieClip; public var autoPlay:Boolean; public var playButton:MovieClip; public function Preloader(){ addFrameScript(0, frame1, 9, frame10); } public function enterFrameHandler(_arg1:Event):void{ var _local2:Number; _local2 = 0; if (loaderInfo){ _local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal); }; if (loadingBar){ loadingBar.gotoAndStop((int((_local2 * (loadingBar.totalFrames - 1))) + 1)); }; if (_local2 >= 1){ removeEventListener(Event.ENTER_FRAME, enterFrameHandler); gotoAndStop("loaded"); }; } function frame10(){ if (playButton){ playButton.addEventListener(MouseEvent.CLICK, _onPlayClick); playButton.stop(); playButton.buttonMode = true; }; if (autoPlay){ _onPlayClick(null); }; } function frame1(){ stop(); addEventListener(Event.ENTER_FRAME, enterFrameHandler); } public function _onPlayClick(_arg1:MouseEvent):void{ var _local2:MovieClip; var _local3:MovieClip; _local2 = (root as MovieClip); _local3 = (parent as MovieClip); if (_local2){ _local2.nextFrame(); _local2.play(); }; if (((_local3) && (_local3._onLoaded))){ _local3._onLoaded(); }; } } }//package com.newgrounds.components
Section 8
//ScoreBrowser (com.newgrounds.components.ScoreBrowser) package com.newgrounds.components { import flash.utils.*; import flash.display.*; import com.newgrounds.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class ScoreBrowser extends MovieClip { public var nextButton:SimpleButton; public var scoreClip:MovieClip; public var _scoreBoard:ScoreBoard; public var scoreContainer:MovieClip; public var reloadButton:SimpleButton; public var scoreBoardName:String; public var _listItems:Array; public var prevButton:SimpleButton; public var title:String; public var pageText:TextField; public var i:uint; public var score:Score; public var listBox:MovieClip; public var titleText:TextField; public var period:String; public var _numScores:uint; public var _loading:Boolean; public function ScoreBrowser(){ addFrameScript(0, frame1, 1, frame2, 10, frame11, 20, frame21, 29, frame30); } public function onReloadClick(_arg1:MouseEvent):void{ loadScores(); } public function _onListChange(_arg1:Object):void{ period = _arg1.data; loadScores(); } public function _onScoresLoaded(_arg1:APIEvent):void{ _loading = false; if (listBox){ listBox.mouseChildren = true; }; if (_arg1.success){ gotoAndStop("scores"); } else { gotoAndPlay("error"); }; } public function _onPageClick(_arg1:MouseEvent):void{ var _local2:*; _local2 = _arg1.currentTarget; if (((_scoreBoard) && (!(_loading)))){ if (_local2 == prevButton){ _scoreBoard.prevPage(); } else { _scoreBoard.nextPage(); }; loadScores(); }; } function frame1(){ if (!title){ title = "High Scores"; }; if (!period){ period = ScoreBoard.ALL_TIME; }; _numScores = 10; _listItems = [ScoreBoard.TODAY, ScoreBoard.THIS_WEEK, ScoreBoard.THIS_MONTH, ScoreBoard.THIS_YEAR, ScoreBoard.ALL_TIME]; x = int(x); y = int(y); if (titleText){ titleText.text = title; API.setFont(titleText, "Pakenham"); }; if (prevButton){ prevButton.addEventListener(MouseEvent.CLICK, _onPageClick); }; if (nextButton){ nextButton.addEventListener(MouseEvent.CLICK, _onPageClick); }; gotoAndPlay("error"); loadScores(); } public function onScoreClick(_arg1:MouseEvent):void{ var _local2:MovieClip; _local2 = (_arg1.currentTarget as MovieClip); if (_local2.usernameText){ navigateToURL(new URLRequest((("http://" + _local2.usernameText.text) + ".newgrounds.com")), "_blank"); }; } function frame21(){ if (reloadButton){ reloadButton.addEventListener(MouseEvent.CLICK, onReloadClick); }; } function frame2(){ if (listBox){ listBox.setListItems(_listItems); listBox.setSelectedItem(period); }; } public function loadScores():void{ if (_scoreBoard){ _scoreBoard.removeEventListener(APIEvent.SCORES_LOADED, _onScoresLoaded); }; _scoreBoard = API.getScoreBoard(scoreBoardName); if (!_scoreBoard){ if (!API.scoreBoards[0]){ Logger.logError("No scoreboards created for this movie. You can create scoreboards on your API Settings page at http://www.newgrounds.com/account/flashapi"); gotoAndPlay("error"); return; }; _scoreBoard = API.scoreBoards[0]; scoreBoardName = _scoreBoard.name; Logger.logWarning((("No scoreboard name set in the Score Browser component. Defaulting to scoreboard \"" + _scoreBoard.name) + "\".")); }; _scoreBoard.addEventListener(APIEvent.SCORES_LOADED, _onScoresLoaded); _scoreBoard.numResults = _numScores; _scoreBoard.period = period; if (pageText){ pageText.text = ("Page " + _scoreBoard.page); }; _loading = true; if (listBox){ listBox.mouseChildren = false; listBox.hideList(); }; gotoAndStop("loading"); _scoreBoard.loadScores(); } function frame30(){ stop(); } function frame11(){ i = 0; scoreClip = scoreContainer.score0; while (scoreClip) { score = (_scoreBoard.scores[i] as Score); if (score){ if (scoreClip.rankText){ scoreClip.rankText.text = score.rank.toString(); }; if (scoreClip.usernameText){ scoreClip.usernameText.text = score.username; }; if (scoreClip.scoreText){ scoreClip.scoreText.text = score.score; }; scoreClip.addEventListener(MouseEvent.CLICK, onScoreClick); } else { if (scoreClip.rankText){ scoreClip.rankText.text = ""; }; if (scoreClip.usernameText){ scoreClip.usernameText.text = ""; }; if (scoreClip.scoreText){ scoreClip.scoreText.text = ""; }; scoreClip.mouseEnabled = false; }; i++; scoreClip = scoreContainer[("score" + i)]; }; } } }//package com.newgrounds.components
Section 9
//MD5 (com.newgrounds.crypto.MD5) package com.newgrounds.crypto { import flash.utils.*; public class MD5 { public static var digest:ByteArray; private static var hexChars:String = "0123456789abcdef"; public static function hash(_arg1:String):String{ var _local2:ByteArray = new ByteArray(); _local2.writeUTFBytes(_arg1); return (hashBinary(_local2)); } public static function hashBytes(_arg1:ByteArray):String{ return (hashBinary(_arg1)); } public static function hashBinary(_arg1:ByteArray):String{ var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local2 = 1732584193; var _local3 = -271733879; var _local4 = -1732584194; var _local5 = 271733878; var _local10:Array = createBlocks(_arg1); var _local11:int = _local10.length; var _local12:int; while (_local12 < _local11) { _local6 = _local2; _local7 = _local3; _local8 = _local4; _local9 = _local5; _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551); _local2 = (_local2 + _local6); _local3 = (_local3 + _local7); _local4 = (_local4 + _local8); _local5 = (_local5 + _local9); _local12 = (_local12 + 16); }; digest = new ByteArray(); digest.writeInt(_local2); digest.writeInt(_local3); digest.writeInt(_local4); digest.writeInt(_local5); digest.position = 0; return ((((toHex(_local2) + toHex(_local3)) + toHex(_local4)) + toHex(_local5))); } private static function f(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg2) | (~(_arg1) & _arg3))); } private static function g(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg3) | (_arg2 & ~(_arg3)))); } private static function h(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 ^ _arg2) ^ _arg3)); } private static function i(_arg1:int, _arg2:int, _arg3:int):int{ return ((_arg2 ^ (_arg1 | ~(_arg3)))); } private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{ var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8); return ((rol(_local9, _arg7) + _arg3)); } private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function createBlocks(_arg1:ByteArray):Array{ var _local2:Array = new Array(); var _local3:int = (_arg1.length * 8); var _local4 = 0xFF; var _local5:int; while (_local5 < _local3) { _local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32))); _local5 = (_local5 + 8); }; _local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32))); _local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3; return (_local2); } public static function rol(_arg1:int, _arg2:int):int{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } public static function ror(_arg1:int, _arg2:int):uint{ var _local3:int = (32 - _arg2); return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3)))); } public static function toHex(_arg1:int, _arg2:Boolean=false):String{ var _local4:int; var _local5:int; var _local3 = ""; if (_arg2){ _local4 = 0; while (_local4 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15)))); _local4++; }; } else { _local5 = 0; while (_local5 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15)))); _local5++; }; }; return (_local3); } } }//package com.newgrounds.crypto
Section 10
//RC4 (com.newgrounds.crypto.RC4) package com.newgrounds.crypto { public class RC4 { private static var sbox:Array = new Array(0xFF); private static var mykey:Array = new Array(0xFF); public static function encrypt(_arg1:String, _arg2:String):String{ var _local3:Array = strToChars(_arg1); var _local4:Array = strToChars(_arg2); var _local5:Array = calculate(_local3, _local4); return (charsToHex(_local5)); } public static function encryptbin(_arg1:String, _arg2:String):Array{ var _local3:Array = strToChars(_arg1); var _local4:Array = strToChars(_arg2); var _local5:Array = calculate(_local3, _local4); return (_local5); } public static function decrypt(_arg1:String, _arg2:String):String{ var _local3:Array = hexToChars(_arg1); var _local4:Array = strToChars(_arg2); var _local5:Array = calculate(_local3, _local4); return (charsToStr(_local5)); } private static function initialize(_arg1:Array):void{ var _local3:uint; var _local2:uint; var _local4:uint = _arg1.length; var _local5:uint; while (_local5 <= 0xFF) { mykey[_local5] = _arg1[(_local5 % _local4)]; sbox[_local5] = _local5; _local5++; }; _local5 = 0; while (_local5 <= 0xFF) { _local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100); _local3 = sbox[_local5]; sbox[_local5] = sbox[_local2]; sbox[_local2] = _local3; _local5++; }; } private static function calculate(_arg1:Array, _arg2:Array):Array{ var _local6:uint; var _local7:uint; var _local8:uint; var _local10:uint; initialize(_arg2); var _local3:uint; var _local4:uint; var _local5:Array = new Array(); var _local9:uint; while (_local9 < _arg1.length) { _local3 = ((_local3 + 1) % 0x0100); _local4 = ((_local4 + sbox[_local3]) % 0x0100); _local7 = sbox[_local3]; sbox[_local3] = sbox[_local4]; sbox[_local4] = _local7; _local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100); _local6 = sbox[_local10]; _local8 = (_arg1[_local9] ^ _local6); _local5.push(_local8); _local9++; }; return (_local5); } private static function charsToHex(_arg1:Array):String{ var _local2:String = new String(""); var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"); var _local4:uint; while (_local4 < _arg1.length) { _local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)])); _local4++; }; return (_local2); } private static function hexToChars(_arg1:String):Array{ var _local2:Array = new Array(); var _local3:uint = ((_arg1.substr(0, 2))=="0x") ? 2 : 0; while (_local3 < _arg1.length) { _local2.push(parseInt(_arg1.substr(_local3, 2), 16)); _local3 = (_local3 + 2); }; return (_local2); } private static function charsToStr(_arg1:Array):String{ var _local2:String = new String(""); var _local3:uint; while (_local3 < _arg1.length) { _local2 = (_local2 + String.fromCharCode(_arg1[_local3])); _local3++; }; return (_local2); } private static function strToChars(_arg1:String):Array{ var _local2:Array = new Array(); var _local3:uint; while (_local3 < _arg1.length) { _local2.push(_arg1.charCodeAt(_local3)); _local3++; }; return (_local2); } } }//package com.newgrounds.crypto
Section 11
//decodeJson (com.newgrounds.encoders.json.decodeJson) package com.newgrounds.encoders.json { public const decodeJson:Function = initDecodeJson(); }//package com.newgrounds.encoders.json import flash.utils.*; private const initDecodeJson:Function = function ():Function{ var position:uint; var byteInput:ByteArray; var char:uint; var charConvert:ByteArray; var isNumberChar:ByteArray; var stringHelper:ByteArray; var isWhitespace:ByteArray; var parseNumber:Function; var parseWhitespace:Function; var parse:Object; charConvert = new ByteArray(); (charConvert.length = 0x0100); (charConvert[34] = 34); (charConvert[92] = 92); (charConvert[47] = 47); (charConvert[98] = 8); (charConvert[102] = 12); (charConvert[110] = 10); (charConvert[114] = 13); (charConvert[116] = 9); isNumberChar = new ByteArray(); (isNumberChar.length = 0x0100); (isNumberChar[43] = 1); (isNumberChar[45] = 1); (isNumberChar[46] = 1); (isNumberChar[48] = 1); (isNumberChar[49] = 1); (isNumberChar[50] = 1); (isNumberChar[51] = 1); (isNumberChar[52] = 1); (isNumberChar[53] = 1); (isNumberChar[54] = 1); (isNumberChar[55] = 1); (isNumberChar[56] = 1); (isNumberChar[57] = 1); (isNumberChar[69] = 1); (isNumberChar[101] = 1); stringHelper = new ByteArray(); (stringHelper.length = 0x0100); var i:int; while (i < 0x0100) { i = (i + 1); var _local2 = i; (stringHelper[_local2] = 1); }; (stringHelper[34] = 0); (stringHelper[92] = 0); isWhitespace = new ByteArray(); (isWhitespace.length = 0x0100); (isWhitespace[9] = 1); (isWhitespace[10] = 1); (isWhitespace[13] = 1); (isWhitespace[32] = 1); parseNumber = function ():Number{ if (position === 1){ (byteInput.position = 0); return (parseFloat(byteInput.readUTFBytes(byteInput.length))); }; (byteInput.position = (position - 1)); do { } while (isNumberChar[byteInput[position++]]); return (Number(byteInput.readUTFBytes(((position-- - byteInput.position) - 1)))); }; parseWhitespace = function ():Object{ while (isWhitespace[byteInput[position]]) { position++; }; return (parse[byteInput[position++]]()); }; var parseStringEscaped:Function = function (_arg1:String):String{ do { if ((char = byteInput[position++]) === 117){ (byteInput.position = position); (char = parseInt(byteInput.readUTFBytes(4), 16)); (position = (position + 4)); } else { if (!(char = charConvert[char])){ throw (new Error(("Unknown escaped character encountered at position " + (position - 1)))); }; (byteInput.position = position); }; _arg1 = (_arg1 + String.fromCharCode(char)); _arg1; do { } while (stringHelper[byteInput[position++]]); if ((position - 1) > byteInput.position){ _arg1 = (_arg1 + byteInput.readUTFBytes(((position - 1) - byteInput.position))); _arg1; }; } while (byteInput[(position - 1)] === 92); return (_arg1); }; parse = {34:function ():String{ if (stringHelper[byteInput[position++]]){ (byteInput.position = (position - 1)); do { } while (stringHelper[byteInput[position++]]); if (byteInput[(position - 1)] === 92){ return (parseStringEscaped(byteInput.readUTFBytes(((position - 1) - byteInput.position)))); }; return (byteInput.readUTFBytes(((position - 1) - byteInput.position))); //unresolved jump }; if (byteInput[(position - 1)] === 92){ return (parseStringEscaped("")); }; return (""); }, 123:function ():Object{ var _local2:*; while (isWhitespace[byteInput[position]]) { position++; }; if (byteInput[position] === 125){ position++; return ({}); }; var _local1:* = {}; do { do { _local2 = parse[byteInput[position++]](); _local2; if (byteInput[position] !== 58){ while (isWhitespace[byteInput[position]]) { position++; }; if (byteInput[position++] !== 58){ throw (new Error(("Expected : at " + (position - 1)))); }; } else { position++; }; var _temp1 = _local2; (_local1[_temp1] = parse[byteInput[position++]]()); } while (byteInput[position++] === 44); if (byteInput[(position - 1)] === 125){ return (_local1); }; while (isWhitespace[byteInput[position]]) { position++; }; } while (byteInput[position++] === 44); if (byteInput[(position - 1)] !== 125){ throw (new Error(("Expected , or } at " + (position - 1)))); }; return (_local1); }, 91:function ():Object{ while (isWhitespace[byteInput[position]]) { position++; }; if (byteInput[position] === 93){ position++; return ([]); }; var _local1:* = []; do { do { (_local1[_local1.length] = parse[byteInput[position++]]()); } while (byteInput[position++] === 44); if (byteInput[(position - 1)] === 93){ return (_local1); }; position--; while (isWhitespace[byteInput[position]]) { position++; }; } while (byteInput[position++] === 44); if (byteInput[(position - 1)] !== 93){ throw (new Error(("Expected , or ] at " + (position - 1)))); }; return (_local1); }, 116:function ():Boolean{ if ((((((byteInput[position] === 114)) && ((byteInput[(position + 1)] === 117)))) && ((byteInput[(position + 2)] === 101)))){ (position = (position + 3)); return (true); }; throw (new Error(("Expected \"true\" at position " + position))); }, 102:function ():Boolean{ if ((((((((byteInput[position] === 97)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 115)))) && ((byteInput[(position + 3)] === 101)))){ (position = (position + 4)); return (false); }; throw (new Error(("Expected \"false\" at position " + (position - 1)))); }, 110:function ():Object{ if ((((((byteInput[position] === 117)) && ((byteInput[(position + 1)] === 108)))) && ((byteInput[(position + 2)] === 108)))){ (position = (position + 3)); return (null); }; throw (new Error(("Expected \"null\" at position " + position))); }, 110:function ():void{ throw (new Error(("Unexpected end of array at " + position))); }, 125:function ():void{ throw (new Error(("Unexpected end of object at " + position))); }, 44:function ():void{ throw (new Error(("Unexpected comma at " + position))); }, 45:parseNumber, 48:parseNumber, 49:parseNumber, 50:parseNumber, 51:parseNumber, 52:parseNumber, 53:parseNumber, 54:parseNumber, 55:parseNumber, 56:parseNumber, 57:parseNumber, 13:parseWhitespace, 10:parseWhitespace, 9:parseWhitespace, 32:parseWhitespace}; return (function (_arg1):Object{ var input = _arg1; if ((input is String)){ (byteInput = new ByteArray()); byteInput.writeUTFBytes((input as String)); } else { if ((input is ByteArray)){ (byteInput = (input as ByteArray)); } else { throw (new Error((("Unexpected input <" + input) + ">"))); }; }; (position = 0); try { return (parse[byteInput[position++]]()); } catch(e:TypeError) { if ((position - 1) < byteInput.length){ (e.message = ((((((((("Unexpected character " + String.fromCharCode(byteInput[(position - 1)])) + " (0x") + byteInput[(position - 1)].toString(16)) + ")") + " at position ") + (position - 1)) + " (") + e.message) + ")")); }; throw (e); }; return (null); }); };
Section 12
//encodeJson (com.newgrounds.encoders.json.encodeJson) package com.newgrounds.encoders.json { public const encodeJson:Function = initDecodeJson(); }//package com.newgrounds.encoders.json import flash.utils.*; private const initDecodeJson:Function = function ():Function{ var result:IDataOutput; var i:int; var j:int; var strLen:int; var str:String; var char:int; var tempBytes:ByteArray; var blockNonFiniteNumbers:Boolean; var charConvert:Array; var parseString:Function; var parse:Object; tempBytes = new ByteArray(); charConvert = new Array(0x0100); j = 0; while (j < 10) { (charConvert[j] = ((j + 48) | 808464384)); j = (j + 1); }; while (j < 16) { (charConvert[j] = ((j + 55) | 808464384)); j = (j + 1); }; while (j < 26) { (charConvert[j] = ((j + 32) | 808464640)); j = (j + 1); }; while (j < 32) { (charConvert[j] = ((j + 39) | 808464640)); j = (j + 1); }; while (j < 0x0100) { (charConvert[j] = j); j = (j + 1); }; (charConvert[10] = 23662); (charConvert[13] = 23666); (charConvert[9] = 23668); (charConvert[8] = 23650); (charConvert[12] = 23654); (charConvert[8] = 23650); (charConvert[34] = 23586); (charConvert[92] = 0x5C5C); (charConvert[127] = 808466246); var parseArray:Function = function (_arg1:Array):void{ result.writeByte(91); var _local2:int; var _local3:int = (_arg1.length - 1); if (_local3 >= 0){ while (_local2 < _local3) { parse[typeof(_arg1[_local2])](_arg1[_local2]); result.writeByte(44); var _temp1 = _local2; _local2 = (_local2 + 1); _temp1; }; parse[typeof(_arg1[_local2])](_arg1[_local2]); }; result.writeByte(93); }; parseString = function (_arg1:String):void{ result.writeByte(34); (tempBytes.position = 0); (tempBytes.length = 0); tempBytes.writeUTFBytes(_arg1); (i = 0); (j = 0); (strLen = tempBytes.length); while (j < strLen) { (char = charConvert[tempBytes[j++]]); if (char > 0x0100){ if ((j - 1) > i){ result.writeBytes(tempBytes, i, ((j - 1) - i)); }; if (char > 65536){ result.writeShort(23669); result.writeUnsignedInt(char); } else { result.writeShort(char); }; (i = j); }; }; if (strLen > i){ result.writeBytes(tempBytes, i, (strLen - i)); }; result.writeByte(34); }; parse = {object:function (_arg1:Object):void{ var _local2:*; if (_arg1){ if ((_arg1 is Array)){ parseArray(_arg1); } else { result.writeByte(123); _local2 = true; for (str in _arg1) { if (_local2){ _local2 = false; _local2; } else { result.writeByte(44); }; parseString(str); result.writeByte(58); parse[typeof(_arg1[str])](_arg1[str]); }; result.writeByte(125); }; } else { result.writeUnsignedInt(1853189228); }; }, string:parseString, number:function (_arg1:Number):void{ if (((blockNonFiniteNumbers) && (!(isFinite(_arg1))))){ throw (new Error((("Number " + _arg1) + " is not encodable"))); }; result.writeUTFBytes(String(_arg1)); }, boolean:function (_arg1:Boolean):void{ if (_arg1){ result.writeUnsignedInt(1953658213); } else { result.writeByte(102); result.writeUnsignedInt(1634497381); }; }, xml:function (_arg1:Object):void{ if ((((!(_arg1.toXMLString) is Function)) || ((_temp2 == null)))){ throw (new Error("unserializable XML object encountered")); }; parseString(_arg1); }, undefined:function (_arg1:Boolean):void{ result.writeUnsignedInt(1853189228); }}; return (function (_arg1:Object, _arg2:IDataOutput=null, _arg3:Boolean=false):String{ var byteOutput:*; var input = _arg1; var writeTo = _arg2; var strictNumberSupport = _arg3; (blockNonFiniteNumbers = strictNumberSupport); try { if (writeTo){ (result = writeTo); (result.endian = "bigEndian"); parse[typeof(input)](input); (byteOutput.position = 0); return (byteOutput.readUTFBytes(byteOutput.length)); } else { switch (typeof(input)){ case "xml": if ((((!(input.toXMLString) is Function)) || ((_local5 == null)))){ throw (new Error("unserializable XML object encountered")); }; case "object": case "string": var _local5 = new ByteArray(); byteOutput = _local5; (result = _local5); (result.endian = "bigEndian"); parse[typeof(input)](input); (byteOutput.position = 0); return (byteOutput.readUTFBytes(byteOutput.length)); case "number": if (((blockNonFiniteNumbers) && (!(isFinite((input as Number)))))){ throw (new Error((("Number " + input) + " is not encodable"))); }; return (String(input)); case "boolean": return ((input) ? "true" : "false"); case "undefined": return ("null"); default: throw (new Error((("Unexpected type \"" + typeof(input)) + "\" encountered"))); }; }; } catch(e:TypeError) { throw (new Error("Unexpected type encountered")); }; return (null); }); };
Section 13
//JSON (com.newgrounds.encoders.json.JSON) package com.newgrounds.encoders.json { public class JSON { public static function encode(_arg1:Object):String{ return (encodeJson(_arg1)); } public static function decode(_arg1:String):Object{ return (decodeJson(_arg1)); } } }//package com.newgrounds.encoders.json
Section 14
//BaseN (com.newgrounds.encoders.BaseN) package com.newgrounds.encoders { import flash.utils.*; public class BaseN { private var _hash:String; private var _base:uint; private var _reverseHash:Dictionary; private static const DEFAULT_HASH:String = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/"; public function BaseN(_arg1:String){ if (_arg1){ this._hash = _arg1; } else { this._hash = DEFAULT_HASH; }; this._base = this._hash.length; this._reverseHash = new Dictionary(); var _local2:uint; while (_local2 < this._hash.length) { this._reverseHash[this._hash.charAt(_local2)] = _local2; _local2++; }; } public function encodeUint(_arg1:uint, _arg2:uint=1):String{ var _local3 = ""; var _local4:uint = _arg1; while (_local4 != 0) { _local3 = (this._hash.charAt((_local4 % this._base)) + _local3); _local4 = (_local4 / this._base); }; while (_local3.length < _arg2) { _local3 = (this._hash.charAt(0) + _local3); }; return (_local3); } public function decodeUint(_arg1:String):uint{ var _local2:uint; var _local3:uint; while (_local3 < _arg1.length) { _local2 = (_local2 * this._base); _local2 = (_local2 + this._reverseHash[_arg1.charAt(_local3)]); _local3++; }; return (_local2); } } }//package com.newgrounds.encoders
Section 15
//PNGEncoder (com.newgrounds.encoders.PNGEncoder) package com.newgrounds.encoders { import flash.utils.*; import flash.display.*; import flash.geom.*; public class PNGEncoder { private static var crcTable:Array; private static var crcTableComputed:Boolean = false; public static function encode(_arg1:BitmapData):ByteArray{ var _local6:uint; var _local7:int; var _local2:ByteArray = new ByteArray(); _local2.writeUnsignedInt(2303741511); _local2.writeUnsignedInt(218765834); var _local3:ByteArray = new ByteArray(); _local3.writeInt(_arg1.width); _local3.writeInt(_arg1.height); _local3.writeUnsignedInt(134610944); _local3.writeByte(0); writeChunk(_local2, 1229472850, _local3); var _local4:ByteArray = new ByteArray(); var _local5:int; while (_local5 < _arg1.height) { _local4.writeByte(0); if (!_arg1.transparent){ _local7 = 0; while (_local7 < _arg1.width) { _local6 = _arg1.getPixel(_local7, _local5); _local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF))); _local7++; }; } else { _local7 = 0; while (_local7 < _arg1.width) { _local6 = _arg1.getPixel32(_local7, _local5); _local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24)))); _local7++; }; }; _local5++; }; _local4.compress(); writeChunk(_local2, 1229209940, _local4); writeChunk(_local2, 1229278788, null); return (_local2); } private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{ var _local8:uint; var _local9:uint; var _local10:uint; if (!crcTableComputed){ crcTableComputed = true; crcTable = []; _local9 = 0; while (_local9 < 0x0100) { _local8 = _local9; _local10 = 0; while (_local10 < 8) { if ((_local8 & 1)){ _local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1)))); } else { _local8 = uint((_local8 >>> 1)); }; _local10++; }; crcTable[_local9] = _local8; _local9++; }; }; var _local4:uint; if (_arg3 != null){ _local4 = _arg3.length; }; _arg1.writeUnsignedInt(_local4); var _local5:uint = _arg1.position; _arg1.writeUnsignedInt(_arg2); if (_arg3 != null){ _arg1.writeBytes(_arg3); }; var _local6:uint = _arg1.position; _arg1.position = _local5; _local8 = 4294967295; var _local7:int; while (_local7 < (_local6 - _local5)) { _local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8)))); _local7++; }; _local8 = uint((_local8 ^ uint(4294967295))); _arg1.position = _local6; _arg1.writeUnsignedInt(_local8); } } }//package com.newgrounds.encoders
Section 16
//FontShim (com.newgrounds.shims.FontShim) package com.newgrounds.shims { import flash.display.*; public dynamic class FontShim extends MovieClip { } }//package com.newgrounds.shims
Section 17
//API (com.newgrounds.API) package com.newgrounds { import flash.display.*; import flash.text.*; import flash.events.*; import flash.net.*; import com.newgrounds.encoders.json.*; import com.newgrounds.crypto.*; import flash.system.*; public class API { public static const RELEASE_MODE:String = "releaseMode"; public static const DEBUG_MODE_LOGGED_IN:String = "debugModeLoggedIn"; public static const DEBUG_MODE_LOGGED_OUT:String = "debugModeLoggedOut"; public static const DEBUG_MODE_NEW_VERSION:String = "debugModeNewVersion"; public static const DEBUG_MODE_HOST_BLOCKED:String = "debugModeHostBlocked"; private static const TEST_AD_FEED_URL:String = "http://www.ngads.com/adtest.php"; public static const VERSION:String = "3.0.5.6 beta AS3"; private static var _bridge:Bridge; private static var _dispatcher:APIEventDispatcher = new APIEventDispatcher(); private static var _movieName:String; private static var _movieVersion:String; private static var _root:DisplayObject; private static var _connection:APIConnection = new APIConnection(); private static var _debugMode:String = "debugModeLoggedIn"; private static var _newVersion:Boolean; private static var _adsApproved:Boolean = false; private static var _adFeedURL:String; private static var _medals:Object = new Object(); private static var _medalsArray:Array = []; private static var _scoreBoards:Object = new Object(); private static var _scoreBoardsArray:Array = []; private static var _saveGroups:Object = new Object(); private static var _saveGroupsArray:Array = []; private static var _imageFilePath:String; private static var _saveFilePath:String; private static var _sharedObjects:Object = new Object(); private static var _requestedSaveFileId:uint; private static var _requestedSaveGroupId:uint; public static function get connected():Boolean{ return (_connection.connected); } public static function get isNetworkHost():Boolean{ return (_connection.isNetworkHost); } public static function get apiId():String{ _connection.assertInitialized(); return (_connection.apiId); } public static function get debugMode():String{ return (_debugMode); } public static function set debugMode(_arg1:String):void{ _debugMode = _arg1; } public static function get publisherId():uint{ _connection.assertInitialized(); return (_connection.publisherId); } public static function get sessionId():String{ _connection.assertInitialized(); return (_connection.sessionId); } public static function get hostDomain():String{ _connection.assertInitialized(); return (_connection.hostDomain); } public static function get hostURL():String{ _connection.assertInitialized(); return (_connection.hostURL); } public static function get isNewgrounds():Boolean{ return ((_connection.publisherId == 1)); } public static function get hasUserSession():Boolean{ _connection.assertInitialized(); return (_connection.hasUserSession); } public static function get username():String{ _connection.assertInitialized(); return (_connection.username); } public static function get userId():uint{ _connection.assertInitialized(); return (_connection.userId); } private static function assertConnected(_arg1:String=null):Boolean{ if (_connection.assertConnected()){ return (true); }; if (_arg1){ dispatchEvent(_arg1, null, APIEvent.ERROR_NOT_CONNECTED); }; return (false); } public static function get adsApproved():Boolean{ return (_adsApproved); } public static function get adFeedURL():String{ return (_adFeedURL); } public static function get medals():Array{ return (_medalsArray); } public static function get scoreBoards():Array{ return (_scoreBoardsArray); } public static function get saveGroups():Array{ return (_saveGroupsArray); } public static function connect(_arg1:DisplayObject, _arg2:String, _arg3:String=null, _arg4:String=""):void{ var _local5:uint; APIEventDispatcher.globalDispatcher = _dispatcher; Security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml"); if (_connection.initialized){ Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection."); dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_NOT_CONNECTED); return; }; _arg2 = trimWhitespace(_arg2); if (_arg3){ _arg3 = trimWhitespace(_arg3); }; if (((!(_arg2)) || ((_arg2 == "")))){ Logger.logError("No apiId given. Please use the API ID from your API settings page."); dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT); return; }; Logger.logMessage((("====== Newgrounds API v" + VERSION) + " ======")); _connection.connectionState = APIConnection.CONNECTING; _root = _arg1; _movieVersion = _arg4; _connection.apiId = _arg2; _local5 = _arg2.indexOf(":"); if (_local5 != -1){ _connection.trackerId = uint(_arg2.substring(0, _local5)); } else { _connection.trackerId = uint(_arg2); }; if (!_connection.trackerId){ Logger.logError(("Invalid API ID: " + _arg2)); dispatchEvent(APIEvent.API_CONNECTED, false, APIEvent.ERROR_INVALID_ARGUMENT); return; }; _connection.encryptionKey = _arg3; _connection.initialized = true; if (!_root.loaderInfo){ Logger.logWarning("The root DisplayObject is currently not on the stage. Connection will be completed once it is added to stage."); }; _root.addEventListener(Event.ENTER_FRAME, checkRootLoaderInfo); checkRootLoaderInfo(null); } private static function doConnect(_arg1:Object):void{ if (((isNetworkHost) && (!((_debugMode == RELEASE_MODE))))){ Logger.logMessage("Live file detected, turning off debug mode."); _debugMode = RELEASE_MODE; }; if (((_arg1) && (_arg1.NewgroundsAPI_SandboxID))){ _bridge = new Bridge(_arg1.NewgroundsAPI_SandboxID); APICommand.bridge = _bridge; }; if (_debugMode == RELEASE_MODE){ if (_arg1){ if (_arg1.NewgroundsAPI_UserName){ _connection.username = _arg1.NewgroundsAPI_UserName; }; if (_arg1.NewgroundsAPI_UserID){ _connection.userId = _arg1.NewgroundsAPI_UserID; }; if (_arg1.NewgroundsAPI_PublisherID){ _connection.publisherId = _arg1.NewgroundsAPI_PublisherID; }; if (_arg1.NewgroundsAPI_UserpageFormat){ _connection.userpageFormat = _arg1.NewgroundsAPI_UserpageFormat; }; if (_arg1.NewgroundsAPI_SessionID){ _connection.sessionId = _arg1.NewgroundsAPI_SessionID; }; if (_arg1.NewgroundsAPI_SaveGroupID){ _requestedSaveGroupId = _arg1.NewgroundsAPI_SaveGroupID; }; if (_arg1.NewgroundsAPI_SaveFileID){ _requestedSaveFileId = _arg1.NewgroundsAPI_SaveFileID; }; }; } else { _connection.debug = true; if ((((_debugMode == DEBUG_MODE_LOGGED_IN)) || ((_debugMode == DEBUG_MODE_LOGGED_OUT)))){ _connection.publisherId = 1; }; if (_debugMode == DEBUG_MODE_LOGGED_IN){ _connection.sessionId = "D3bu64p1U53R"; _connection.userId = 10; _connection.username = "API-Debugger"; }; }; _connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId}); } private static function onConnect(_arg1:APIEvent):void{ var _local2:Object = _arg1.data; if (!_arg1.success){ Logger.logError("Unable to connect to the API."); _connection.reset(); dispatchEvent(APIEvent.API_CONNECTED, _arg1.data, _arg1.error); return; }; if (debugMode != RELEASE_MODE){ _adFeedURL = TEST_AD_FEED_URL; } else { if (_local2.ad_url){ _adFeedURL = unescape(_local2.ad_url); }; }; switch (_local2.ad_status){ case -1: Logger.logWarning("Your movie is not approved to run Flash Ads."); break; case 0: Logger.logWarning("Your movie is still awaiting approval to run Flash Ads."); break; case 1: Logger.logMessage("Your movie is approved to run Flash Ads!"); break; }; _adsApproved = (_local2.ad_status == 1); if ((((_debugMode == DEBUG_MODE_HOST_BLOCKED)) || (_local2.deny_host))){ Logger.logWarning((_connection.hostDomain + " does not have permission to host this movie!"), "Update your API configuration to allow this host."); dispatchEvent(APIEvent.API_CONNECTED, {officialURL:unescape(_local2.movie_url)}, APIEvent.ERROR_HOST_BLOCKED); _connection.reset(); return; }; _movieName = (_local2.movieName) ? _local2.movieName : ""; Logger.logMessage("Connecting to the Newgrounds API Gateway...", (("----- " + _local2.movie_name) + " -----")); if (_debugMode == DEBUG_MODE_NEW_VERSION){ _local2.movie_version = "Debug Mode"; }; if (_local2.movie_version){ Logger.logMessage("A new version of this movie is available.", ("Current version:\t" + _movieVersion), ("Newest version:\t" + _local2.movie_version), "Use API.loadOfficialVersion() to link to the latest version."); _newVersion = true; } else { _newVersion = false; }; if (_local2.request_portal_url){ _connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.hostURL}); }; _connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId}); } private static function onMetadataLoaded(_arg1:APIEvent):void{ var _local3:uint; var _local4:uint; var _local6:Object; var _local7:Object; var _local8:Boolean; var _local9:Boolean; var _local10:Boolean; var _local11:Medal; var _local12:Object; var _local13:ScoreBoard; var _local14:Object; var _local15:Array; var _local16:Array; var _local17:SaveGroup; var _local18:Object; var _local19:Object; var _local2:Object = _arg1.data; if (!_arg1.success){ Logger.logWarning("Unable to load movie metadata."); disconnect(); dispatchEvent(APIEvent.API_CONNECTED, null, _arg1.error); return; }; var _local5:uint; if (_local2.medals){ _local5 = _local2.medals.length; if (hasUserSession){ _local6 = loadLocal(("medals_unlocked_" + username)); } else { _local6 = loadLocal("medals_unlocked"); }; _local3 = 0; while (_local3 < _local5) { _local7 = _local2.medals[_local3]; _local8 = _local7.medal_unlocked; _local9 = ((_local6) && (_local6[_local7.medal_id])); _local10 = (hasUserSession) ? _local8 : _local9; if (debugMode != RELEASE_MODE){ _local10 = false; }; _local11 = new Medal(_connection, _local7.medal_id, _local7.medal_name, _local10, _local7.medal_value, _local7.medal_difficulty, _local7.medal_icon); _local11.addEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true); _local11.addEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true); _medals[_local11.name] = _local11; _medalsArray.push(_local11); Logger.logMessage(_local11); if (((((hasUserSession) && (_local9))) && (!(_local8)))){ Logger.logMessage((("Server missed the \"" + _local11.name) + "\" unlock. Resending...")); _local11.unlock(); }; _local3++; }; }; Logger.logMessage((((_local5 + " medal") + ((_local5)!=1) ? "s" : "") + " initialized.")); _local5 = 0; if (_local2.score_boards){ _local5 = _local2.score_boards.length; _local3 = 0; while (_local3 < _local5) { _local12 = _local2.score_boards[_local3]; _local13 = new ScoreBoard(_connection, _local12.name, _local12.id); _scoreBoards[_local13.name] = _local13; _scoreBoardsArray.push(_local13); Logger.logMessage(_local13); _local3++; }; }; Logger.logMessage((((_local5 + " scoreboard") + ((_local5)!=1) ? "s" : "") + " initialized.")); _local5 = 0; if (_local2.save_groups){ _local5 = _local2.save_groups.length; _local3 = 0; while (_local3 < _local5) { _local14 = _local2.save_groups[_local3]; _local15 = []; if (_local14.keys){ _local4 = 0; while (_local4 < _local14.keys.length) { _local18 = _local14.keys[_local4]; _local15.push(new SaveKey(_local18.name, _local18.id, _local18.type)); _local4++; }; }; _local16 = []; if (_local14.ratings){ _local3 = 0; while (_local3 < _local14.ratings.length) { _local19 = _local14.ratings[_local3]; _local16.push(new SaveRating(_local19.name, _local19.id, _local19.float, _local19.min, _local19.max)); _local3++; }; }; _local17 = new SaveGroup(_connection, _local14.group_name, _local14.group_id, _local14.group_type, _local15, _local16); _saveGroups[_local17.name] = _local17; _saveGroupsArray.push(_local17); Logger.logMessage(_local17); _local3++; }; }; Logger.logMessage((((_local5 + " save group") + ((_local5)!=1) ? "s" : "") + " initialized.")); if (_local2.save_file_path){ _saveFilePath = (_local2.save_file_path + "/"); SaveFile._saveFilePath = _saveFilePath; Logger.logInternal(("Save file path: " + _saveFilePath)); }; if (_local2.image_file_path){ _imageFilePath = (_local2.image_file_path + "/"); SaveFile._imageFilePath = _imageFilePath; Logger.logInternal(("Image file path: " + _imageFilePath)); }; Logger.logMessage("Connection complete!"); _connection.connectionState = APIConnection.CONNECTED; dispatchEvent(APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion}); if (((_requestedSaveFileId) && (_requestedSaveGroupId))){ API.addEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded); API.loadSaveFile(_requestedSaveFileId, false); }; } public static function disconnect():void{ var _local1:Medal; if (!_connection.connected){ Logger.logWarning("The Newgrounds API is already disconnected."); return; }; _connection.reset(); for each (_local1 in _medals) { _local1.removeEventListener(APIEvent.MEDAL_UNLOCKED, onMedalUnlocked); _local1.removeEventListener(APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed); }; _newVersion = false; _medals = new Object(); _medalsArray = []; _scoreBoards = new Object(); _scoreBoardsArray = []; _saveGroups = new Object(); _saveGroupsArray = []; _sharedObjects = new Object(); _imageFilePath = null; _saveFilePath = null; Logger.logMessage("Disconnected from the Newgrounds API."); } public static function loadNewgrounds():void{ _connection.loadInBrowser("loadNewgrounds"); } public static function loadOfficialVersion():void{ if (_connection.assertInitialized()){ _connection.loadInBrowser("loadOfficialVersion", false); }; } public static function loadMySite():void{ if (_connection.assertInitialized()){ _connection.loadInBrowser("loadMySite"); }; } public static function loadCustomLink(_arg1:String):void{ if (_connection.assertInitialized()){ _connection.loadInBrowser("loadCustomLink", true, {link:_arg1}); }; } public static function getMedal(_arg1:String):Medal{ return (_medals[_arg1]); } public static function unlockMedal(_arg1:String):void{ if (!assertConnected()){ return; }; var _local2:Medal = _medals[_arg1]; if (!_local2){ Logger.logError((("No medal named \"" + _arg1) + "\" was found.")); return; }; _local2.unlock(); } private static function onMedalUnlocked(_arg1:APIEvent):void{ var _local2:Medal; var _local3:Object; if (_arg1.success){ _local2 = Medal(_arg1.data); if (hasUserSession){ _local3 = loadLocal(("medals_unlocked_" + username)); if (!_local3){ _local3 = new Object(); }; _local3[_local2.id] = true; saveLocal(("medals_unlocked_" + username), _local3); } else { _local3 = loadLocal("medals_unlocked"); if (!_local3){ _local3 = new Object(); }; _local3[Medal(_arg1.data).id] = true; saveLocal("medals_unlocked", _local3); Logger.logMessage((("User is not logged in. Medal \"" + _local2.name) + "\" unlocked locally.")); }; }; } private static function onMedalUnlockConfirmed(_arg1:APIEvent):void{ var _local2:Object; if (hasUserSession){ _local2 = loadLocal(("medals_unlocked_" + username)); if (!_local2){ _local2 = new Object(); } else { delete _local2[Medal(_arg1.data).id]; }; saveLocal(("medals_unlocked_" + username), _local2); }; } public static function getScoreBoard(_arg1:String):ScoreBoard{ if (!assertConnected()){ return (null); }; return (_scoreBoards[_arg1]); } public static function loadScores(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10, _arg5:String=null):ScoreBoard{ if (!assertConnected()){ return (null); }; var _local6:ScoreBoard = _scoreBoards[_arg1]; if (!_local6){ Logger.logError((("No scoreboard named \"" + _arg1) + "\" was found.")); dispatchEvent(APIEvent.SCORES_LOADED, null, APIEvent.ERROR_INVALID_ARGUMENT); return (null); }; _local6.period = _arg2; _local6.firstResult = _arg3; _local6.numResults = _arg4; _local6.tag = _arg5; _local6.loadScores(); return (_local6); } public static function postScore(_arg1:String, _arg2:Number, _arg3:String=null):void{ if (!assertConnected()){ return; }; if (!hasUserSession){ Logger.logError("The user must be logged-in to post a score."); dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_NOT_LOGGED_IN); return; }; var _local4:ScoreBoard = _scoreBoards[_arg1]; if (!_local4){ Logger.logError((("No scoreboard named \"" + _arg1) + "\" was found.")); dispatchEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT); return; }; _local4.postScore(_arg2, _arg3); } public static function getSaveGroup(_arg1:String):SaveGroup{ if (!assertConnected()){ return (null); }; return (_saveGroups[_arg1]); } private static function getSaveGroupById(_arg1:uint):SaveGroup{ var _local2:SaveGroup; for each (_local2 in _saveGroups) { if (_local2.id == _arg1){ return (_local2); }; }; return (null); } public static function createSaveFile(_arg1:String):SaveFile{ if (!assertConnected()){ return (null); }; var _local2:SaveGroup = getSaveGroup(_arg1); if (!_local2){ Logger.logError((("The save group \"" + _arg1) + "\" was not found.")); return (null); }; return (new SaveFile(_local2)); } public static function loadSaveFile(_arg1:uint, _arg2:Boolean=true):void{ _connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:_arg1, get_contents:_arg2}); } private static function onFileLoaded(_arg1:APIEvent):void{ var _local2:SaveFile; if (_arg1.success){ _local2 = SaveFile.fromObject(getSaveGroupById(_arg1.data.group_id), _arg1.data.file); if (_arg1.data.get_contents){ _local2.load(); } else { dispatchEvent(APIEvent.FILE_LOADED, _local2); }; } else { Logger.logError("Unable to load file:", _arg1.error); dispatchEvent(APIEvent.FILE_LOADED, null, _arg1.error); }; } public static function createSaveQuery(_arg1:String):SaveQuery{ if (!assertConnected()){ return (null); }; var _local2:SaveGroup = getSaveGroup(_arg1); if (!_local2){ Logger.logError((("The save group \"" + _arg1) + "\" was not found.")); return (null); }; var _local3:SaveQuery = new SaveQuery(_local2); return (_local3); } public static function createSaveQueryByDate(_arg1:String, _arg2:Boolean=true):SaveQuery{ var _local3:SaveQuery = createSaveQuery(_arg1); if (!_local3){ return (null); }; _local3.sortOn(SaveQuery.CREATED_ON, _arg2); return (_local3); } public static function createSaveQueryByName(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false):SaveQuery{ var _local5:SaveQuery = createSaveQuery(_arg1); _local5.addCondition(SaveQuery.FILE_NAME, (_arg3) ? SaveQuery.OPERATOR_EQUAL : SaveQuery.OPERATOR_CONTAINS, _arg2); return (_local5); } public static function createSaveQueryByRating(_arg1:String, _arg2:String, _arg3:Boolean=true):SaveQuery{ var _local4:SaveQuery = createSaveQuery(_arg1); _local4.sortOn(_arg2, _arg3); return (_local4); } private static function onRequestedFileLoaded(_arg1:APIEvent):void{ var _local2:SaveFile; API.removeEventListener(APIEvent.FILE_LOADED, onRequestedFileLoaded); if (_arg1.success){ _local2 = (_arg1.data as SaveFile); if (_local2){ dispatchEvent(APIEvent.FILE_REQUESTED, _local2); }; }; } public static function addEventListener(_arg1:String, _arg2:Function, _arg3:int=0, _arg4:Boolean=true):void{ _dispatcher.addEventListener(_arg1, _arg2, false, _arg3, _arg4); } public static function removeEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.removeEventListener(_arg1, _arg2); } private static function dispatchEvent(_arg1:String, _arg2=null, _arg3:String=null):void{ _dispatcher.dispatchEvent(new APIEvent(_arg1, _arg2, _arg3)); } public static function saveLocal(_arg1:String, _arg2:Object):Boolean{ var sharedObject:SharedObject; var sharedObjectName:String; var saveId = _arg1; var saveData = _arg2; try { sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey)); if (!_sharedObjects[saveId]){ _sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName); }; sharedObject = _sharedObjects[saveId]; sharedObject.data.data = encodeData(saveData); } catch(error:Error) { Logger.logError("Unable to save local data.", error); return (false); }; return (true); } public static function loadLocal(_arg1:String):Object{ var sharedObject:SharedObject; var sharedObjectName:String; var saveId = _arg1; try { sharedObjectName = ((("ng_ap_secure_" + _connection.trackerId) + "_") + RC4.encrypt(saveId, _connection.encryptionKey)); if (!_sharedObjects[saveId]){ _sharedObjects[saveId] = SharedObject.getLocal(sharedObjectName); }; sharedObject = _sharedObjects[saveId]; if (((((sharedObject) && (sharedObject.data))) && (sharedObject.data.data))){ return (decodeData(sharedObject.data.data)); }; return (null); } catch(error:Error) { Logger.logError("Unable to load local data.", error); }; return (null); } public static function logCustomEvent(_arg1:String):void{ if (assertConnected()){ Logger.logMessage(("Logged event: " + _arg1)); _connection.sendSimpleCommand("logCustomEvent", null, {event:_arg1}); }; } private static function encodeData(_arg1:Object):String{ if (!_connection.assertInitialized()){ return (null); }; return (RC4.encrypt(JSON.encode(_arg1), _connection.encryptionKey)); } private static function decodeData(_arg1:String):Object{ if (!_connection.assertInitialized()){ return (null); }; try { return ((JSON.decode(RC4.decrypt(_arg1, _connection.encryptionKey)) as Object)); } catch(error:Error) { }; return (null); } public static function stopPendingCommands():void{ APICommand.stopPendingCommands(); Logger.logMessage("Pending commands stopped."); } public static function setFont(_arg1:TextField, _arg2:String):void{ var _local3:TextFormat; var _local4:Boolean; var _local5:TextFormat; if (((_arg1) && (_arg2))){ _local3 = _arg1.getTextFormat(); _local4 = _arg1.embedFonts; _local5 = new TextFormat(_arg2); _arg1.defaultTextFormat = _local5; _arg1.setTextFormat(_local5); _arg1.embedFonts = true; if (_arg1.textWidth == 0){ _arg1.embedFonts = _local4; _arg1.setTextFormat(_local3); _arg1.defaultTextFormat = _local3; } else { _arg1.antiAliasType = "advanced"; _arg1.sharpness = 120; }; }; } private static function trimWhitespace(_arg1:String):String{ if (!_arg1){ return (null); }; var _local2:int; while (_arg1.charAt(_local2) == " ") { _local2++; }; var _local3:int = (_arg1.length - 1); while ((((_arg1.charAt(_local2) == " ")) && ((_local3 >= 0)))) { _local3--; }; return (_arg1.slice(_local2, (_local3 + 1))); } private static function checkRootLoaderInfo(_arg1:Event):void{ var event = _arg1; var loaderInfo:LoaderInfo = _root.loaderInfo; if (loaderInfo){ try { while (loaderInfo.loader) { loaderInfo = loaderInfo.loader.loaderInfo; }; } catch(error:Error) { return; }; _root.removeEventListener(Event.ENTER_FRAME, checkRootLoaderInfo); _connection.hostURL = loaderInfo.url; doConnect(loaderInfo.parameters); }; } } }//package com.newgrounds
Section 18
//APICommand (com.newgrounds.APICommand) package com.newgrounds { import flash.utils.*; import flash.events.*; import flash.net.*; import com.newgrounds.encoders.json.*; import com.newgrounds.crypto.*; import com.newgrounds.encoders.*; public class APICommand extends APIEventDispatcher { private var _command:String; private var _parameters:Object; private var _secureParameters:Object; private var _files:Object; private var _preventCache:Boolean; private var _hasTimeout:Boolean; private var _timeoutTimer:Timer; private var _loader:URLLoader; private static const TIMEOUT_INTERVAL:uint = 10000; private static const THROTTLE_INTERVAL:uint = 10050; private static const THROTTLE_TICK_INTERVAL:uint = 1000; private static const THROTTLE_THRESHOLD:uint = 24; private static const ENCRYPTOR_RADIX:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X"; private static const CRLF:String = " "; public static var bridge:Bridge; private static var _throttleTimestamp:uint; private static var _throttleCount:int = 0; private static var _commandQueue:Array = []; private static var _encryptor:BaseN = new BaseN(ENCRYPTOR_RADIX); private static var _pendingCommands:Array = []; private static var _throttleTimer:Timer = function ():Timer{ var _local1:* = new Timer(THROTTLE_TICK_INTERVAL, 0); _local1.addEventListener(TimerEvent.TIMER, onThrottleTimer); _local1.start(); return (_local1); }(); public function APICommand(_arg1:String){ this._command = _arg1; this._parameters = new Object(); this._secureParameters = new Object(); this._timeoutTimer = new Timer(TIMEOUT_INTERVAL, 1); this._timeoutTimer.addEventListener(TimerEvent.TIMER, this.onTimeout); this._hasTimeout = true; } public function get command():String{ return (this._command); } public function set command(_arg1:String):void{ this._command = _arg1; } public function get hasTimeout():Boolean{ return (this._hasTimeout); } public function set hasTimeout(_arg1:Boolean):void{ this._hasTimeout = _arg1; } public function get parameters():Object{ return (this._parameters); } public function set parameters(_arg1:Object):void{ var _local2:String; this._parameters = new Object(); if (_arg1){ for (_local2 in _arg1) { this._parameters[_local2] = _arg1[_local2]; }; }; } public function get preventCache():Boolean{ return (this._preventCache); } public function set preventCache(_arg1:Boolean):void{ this._preventCache = _arg1; } public function get secureParameters():Object{ return (this._secureParameters); } public function set secureParameters(_arg1:Object):void{ var _local2:String; this._secureParameters = new Object(); if (_arg1){ for (_local2 in _arg1) { this._secureParameters[_local2] = _arg1[_local2]; }; }; } public function get hasSecureParameters():Boolean{ var _local1:String; for (_local1 in this._secureParameters) { return (true); }; return (false); } public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octet-stream"):void{ if (!this._files){ this._files = new Object(); }; var _local5:Object = {filename:_arg1, data:_arg2, dataField:_arg3, contentType:_arg4}; this._files[_arg1] = _local5; } public function removeFile(_arg1:String):void{ if (this._files){ delete this._files[_arg1]; }; } public function clearFiles():void{ this._files = null; } public function close():void{ var _local1:uint; if (this._loader){ try { this._loader.close(); } catch(error:Error) { }; this._timeoutTimer.stop(); _local1 = 0; while (_local1 < _pendingCommands.length) { if (_pendingCommands[_local1] == this){ _pendingCommands.splice(_local1, 1); break; }; _local1++; }; this._loader = null; }; } public function loadInBrowser(_arg1:APIConnection, _arg2:Boolean):void{ var _local4:String; var _local5:String; this._parameters.command_id = this._command; this._parameters.tracker_id = (_arg1.apiId) ? _arg1.apiId : 1; if (_arg1.debug){ this._parameters.debug = 1; }; var _local3:String = ((_arg1.apiURL + "?host=") + escape(_arg1.hostDomain)); for (_local4 in this._parameters) { _local3 = (_local3 + ((("&" + escape(_local4)) + "=") + escape(this._parameters[_local4]))); }; if (_arg2){ _local5 = "_blank"; } else { _local5 = "_top"; }; navigateToURL(new URLRequest(_local3), _local5); } public function send(_arg1:APIConnection):void{ if (_throttleCount >= THROTTLE_THRESHOLD){ _commandQueue.push({connection:_arg1, command:this}); } else { this.sendInternal(_arg1); }; } private function sendInternal(_arg1:APIConnection):void{ var _local2:Object; var _local3:String; var _local4:*; var _local5:uint; var _local6:String; var _local7:Object; var _local8:String; var _local9:String; var _local10:String; var _local11:String; _local2 = new URLVariables(); _local2.command_id = this._command; _local2.tracker_id = _arg1.apiId; if (_arg1.debug){ _local2.debug = 1; }; if (this._preventCache){ _local2.seed = Math.random(); }; for (_local3 in this._parameters) { _local4 = this._parameters[_local3]; if (_local4 != null){ if ((_local4 is Boolean)){ _local2[_local3] = int(_local4); } else { _local2[_local3] = _local4; }; }; }; if (this.hasSecureParameters){ _local7 = new Object(); for (_local3 in this._secureParameters) { _local4 = this._secureParameters[_local3]; if (_local4 != null){ if ((_local4 is Boolean)){ _local7[_local3] = int(_local4); } else { _local7[_local3] = _local4; }; }; }; _local8 = ""; _local5 = 0; while (_local5 < 16) { _local8 = (_local8 + ENCRYPTOR_RADIX.charAt(uint((Math.random() * ENCRYPTOR_RADIX.length)))); _local5++; }; _local2.command_id = "securePacket"; _local7.command_id = this._command; _local7.as_version = 3; _local7.session_id = _arg1.sessionId; _local7.user_email = _arg1.userEmail; _local7.publisher_id = _arg1.publisherId; _local7.seed = _local8; _local9 = MD5.hash(_local8); _local10 = RC4.encrypt(JSON.encode(_local7), _arg1.encryptionKey); _local2.secure = encryptHex((_local9 + _local10)); }; Logger.logInternal("Sending packet:", _local2); if (this._files){ _local11 = ""; _local5 = 0; while (_local5 < 32) { _local11 = (_local11 + String.fromCharCode(uint((97 + (Math.random() * 25))))); _local5++; }; _local6 = (("multipart/form-data; boundary=\"" + _local11) + "\""); _local2 = this.buildMultipartData(_local11, _local2, this._files); } else { for (_local3 in _local2) { if (typeof(_local2[_local3]) == "object"){ _local2[_local3] = JSON.encode(_local2[_local3]); }; }; _local6 = "application/x-www-form-urlencoded"; }; _pendingCommands.push(this); _throttleCount++; _throttleTimestamp = getTimer(); this.startLoader(_arg1.apiURL, _local2, _local6); } private function onTimeout(_arg1):void{ this.close(); Logger.logError("Command timed out."); dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_TIMED_OUT)); } private function onError(_arg1:String):void{ Logger.logError("Error when sending command:", _arg1); dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_UNKNOWN)); this.close(); } private function onComplete(_arg1:String):void{ var response:Object; var data = _arg1; try { if (((!(data)) || ((data == "")))){ throw (new Error()); }; Logger.logInternal("Received packet:", data); response = JSON.decode(data); if (!response){ throw (new Error()); }; if (bridge){ bridge.sendEvent(response.command_id, response); }; dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, response, (((response) && (response.success))) ? APIEvent.ERROR_NONE : APIEvent.ERROR_COMMAND_FAILED)); } catch(e) { Logger.logError(("Invalid response returned from server: " + data)); dispatchEvent(new APIEvent(APIEvent.COMMAND_COMPLETE, null, APIEvent.ERROR_BAD_RESPONSE)); }; this.close(); } private function startLoader(_arg1:String, _arg2:Object, _arg3:String):void{ var url = _arg1; var data = _arg2; var contentType = _arg3; var urlRequest:URLRequest = new URLRequest(url); urlRequest.data = data; urlRequest.method = URLRequestMethod.POST; urlRequest.contentType = contentType; this._loader = new URLLoader(); this._loader.addEventListener(Event.COMPLETE, this.as3CompleteHandler); this._loader.addEventListener(Event.OPEN, this.as3UpdateHandler); this._loader.addEventListener(ProgressEvent.PROGRESS, this.as3UpdateHandler); this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.as3ErrorHandler); this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3ErrorHandler); try { this._loader.load(urlRequest); if (this._hasTimeout){ this._timeoutTimer.start(); }; } catch(error) { onError("Security error"); }; } private function as3CompleteHandler(_arg1:Event):void{ this.onComplete(this._loader.data); } private function as3UpdateHandler(_arg1:Event):void{ if (this._timeoutTimer.running){ this._timeoutTimer.reset(); this._timeoutTimer.start(); }; } private function as3ErrorHandler(_arg1:Event):void{ this.onError(_arg1.toString()); } private function buildMultipartData(_arg1:String, _arg2:Object, _arg3:Object):ByteArray{ var _local5:String; var _local6:Object; var _local4:ByteArray = new ByteArray(); _local4.endian = Endian.BIG_ENDIAN; _arg1 = ("--" + _arg1); for (_local5 in _arg2) { _local4.writeUTFBytes((_arg1 + CRLF)); _local4.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local5) + "\"") + CRLF)); _local4.writeUTFBytes(CRLF); _local4.writeUTFBytes((_arg2[_local5].toString() + CRLF)); }; if (this._files){ for each (_local6 in _arg3) { _local4.writeUTFBytes((_arg1 + CRLF)); _local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF)); _local4.writeUTFBytes(CRLF); _local4.writeUTFBytes((_local6.filename + CRLF)); _local4.writeUTFBytes((_arg1 + CRLF)); _local4.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local6.dataField) + "\"; filename=\"") + _local6.filename) + "\"") + CRLF)); _local4.writeUTFBytes((("Content-Type: " + _local6.contentType) + CRLF)); _local4.writeUTFBytes(CRLF); _local4.writeBytes(_local6.data); _local4.writeUTFBytes(CRLF); }; _local4.writeUTFBytes((_arg1 + CRLF)); _local4.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF)); _local4.writeUTFBytes(CRLF); _local4.writeUTFBytes(("Submit Query" + CRLF)); }; _local4.writeUTFBytes((_arg1 + "--")); _local4.position = 0; return (_local4); } public static function stopPendingCommands():void{ var _local1:APICommand; for each (_local1 in _pendingCommands) { _local1.close(); }; _pendingCommands = []; } private static function onThrottleTimer(_arg1):void{ var _local2:Object; if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL){ _throttleCount = 0; _throttleCount = 0; while (((_commandQueue.length) && ((_throttleCount < THROTTLE_THRESHOLD)))) { _local2 = _commandQueue.shift(); _local2.command.send(_local2.connection); _throttleCount++; }; }; } private static function encryptHex(_arg1:String):String{ var _local2:uint = (_arg1.length % 6); var _local3 = ""; var _local4:uint; while (_local4 < _arg1.length) { _local3 = (_local3 + _encryptor.encodeUint(uint(("0x" + _arg1.substr(_local4, 6))), 4)); _local4 = (_local4 + 6); }; return ((_local2.toString() + _local3)); } } }//package com.newgrounds
Section 19
//APIConnection (com.newgrounds.APIConnection) package com.newgrounds { import flash.system.*; public class APIConnection { public var initialized:Boolean; public var connectionState:String;// = "notConnected" public var apiURL:String;// = "http://www.ngads.com/gateway_v2.php" public var apiId:String; public var debug:Boolean; public var trackerId:uint; public var publisherId:uint; public var encryptionKey:String; public var sessionId:String; public var userEmail:String; public var username:String; public var userId:uint; public var userpageFormat:uint; private var _hostURL:String; public var hostDomain:String; public static const NOT_CONNECTED:String = "notConnected"; public static const CONNECTING:String = "connecting"; public static const CONNECTED:String = "connected"; public function APIConnection(){ this.reset(); } public function get hostURL():String{ return (this._hostURL); } public function set hostURL(_arg1:String):void{ var _local2:Array; this._hostURL = _arg1; this.hostDomain = null; if (this._hostURL){ _local2 = this._hostURL.split("/"); if (((!((_local2[0] == "file:"))) && (!((this._hostURL == "localhost"))))){ this.hostDomain = _local2[2]; }; }; if (!this.hostDomain){ this.hostDomain = "localhost"; }; } public function get sandboxType():String{ return (Security.sandboxType); } public function get isNetworkHost():Boolean{ switch (this.sandboxType){ case "localWithFile": case "localWithNetwork": case "localTrusted": case "application": return (false); case "remote": default: return (true); }; } public function get hasUserSession():Boolean{ return (((((!((this.sessionId == null))) && (!((this.sessionId == ""))))) && (!((this.publisherId == 0))))); } public function get connected():Boolean{ return ((this.connectionState == CONNECTED)); } public function reset():void{ this.connectionState = NOT_CONNECTED; this.encryptionKey = null; this.sessionId = null; this.userEmail = null; this.username = null; this.userId = 0; this.userpageFormat = 0; } public function assertInitialized():Boolean{ if (!this.initialized){ Logger.logError("You must initialized the API using API.connect() before using this command."); return (false); }; return (true); } public function assertConnected():Boolean{ if (!(this.connectionState) == CONNECTED){ Logger.logError("You must establish a connection using API.connect() before using this command."); return (false); }; return (true); } public function sendSimpleCommand(_arg1:String, _arg2:Function, _arg3:Object=null, _arg4:Object=null):void{ var _local5:APICommand = new APICommand(_arg1); _local5.parameters = _arg3; _local5.secureParameters = _arg4; if (_arg2 != null){ _local5.addEventListener(APIEvent.COMMAND_COMPLETE, _arg2); }; _local5.send(this); } public function sendCommand(_arg1:APICommand):void{ _arg1.send(this); } public function loadInBrowser(_arg1:String, _arg2:Boolean=true, _arg3:Object=null):void{ var _local4:APICommand = new APICommand(_arg1); _local4.parameters = _arg3; _local4.loadInBrowser(this, _arg2); } } }//package com.newgrounds
Section 20
//APIEvent (com.newgrounds.APIEvent) package com.newgrounds { import flash.events.*; public class APIEvent extends Event { private var _data; private var _success:Boolean; private var _error:String; static const COMMAND_COMPLETE:String = "commandComplete"; static const MEDAL_UNLOCK_CONFIRMED:String = "medalUnlockConfirmed"; static const ICON_LOADED:String = "iconLoaded"; public static const API_CONNECTED:String = "movieConnected"; public static const LOG:String = "log"; public static const MEDAL_UNLOCKED:String = "medalUnlocked"; public static const SCORES_LOADED:String = "scoresLoaded"; public static const SCORE_POSTED:String = "scorePosted"; public static const QUERY_COMPLETE:String = "queryComplete"; public static const FILE_LOADED:String = "fileLoaded"; public static const FILE_SAVED:String = "fileSaved"; public static const FILE_REQUESTED:String = "fileRequested"; public static const VOTE_COMPLETE:String = "voteComplete"; public static const ERROR_NONE:String = "noError"; public static const ERROR_UNKNOWN:String = "unknownError"; public static const ERROR_COMMAND_FAILED:String = "commandFailed"; public static const ERROR_NOT_CONNECTED:String = "notConnected"; public static const ERROR_INVALID_ARGUMENT:String = "invalidArgument"; public static const ERROR_TIMED_OUT:String = "timedOut"; public static const ERROR_BAD_FILE:String = "badFile"; public static const ERROR_BAD_RESPONSE:String = "badResponse"; public static const ERROR_SENDING_COMMAND:String = "errorSendingCommand"; public static const ERROR_HOST_BLOCKED:String = "hostBlocked"; public static const ERROR_ALREADY_VOTED:String = "alreadyVoted"; public static const ERROR_NOT_LOGGED_IN:String = "notLoggedIn"; public static const ERROR_WRONG_ENCRYPTION_KEY:String = "wrongEncryptionKey"; public function APIEvent(_arg1:String, _arg2=null, _arg3:String=null){ super(_arg1); if (((((!(_arg3)) || ((_arg3 == "")))) || ((_arg3 == ERROR_NONE)))){ this._error = ERROR_NONE; this._success = true; } else { this._error = _arg3; this._success = false; }; if (_arg2){ this._data = _arg2; } else { this._data = {}; }; } override public function clone():Event{ return (new APIEvent(type, this._data, this._error)); } public function get success():Boolean{ return (this._success); } public function get data(){ return (this._data); } public function get error():String{ return (this._error); } } }//package com.newgrounds
Section 21
//APIEventDispatcher (com.newgrounds.APIEventDispatcher) package com.newgrounds { import flash.display.*; import com.newgrounds.*; import flash.events.*; class APIEventDispatcher extends EventDispatcher { private static var _globalDispatcher:EventDispatcher; private static var _eventQueue:Array = initEventQueue(); private static var _ticker:Sprite; override public function dispatchEvent(_arg1:Event):Boolean{ _eventQueue.push({dispatcher:this, event:_arg1}); return (true); } private function actualDispatchEvent(_arg1:Event):void{ var _local2:Boolean = super.dispatchEvent(_arg1); if (((_globalDispatcher) && (!((this == _globalDispatcher))))){ _globalDispatcher.dispatchEvent(_arg1); }; } public static function get globalDispatcher():EventDispatcher{ return (_globalDispatcher); } public static function set globalDispatcher(_arg1:EventDispatcher):void{ _globalDispatcher = _arg1; } private static function initEventQueue():Array{ _ticker = new Sprite(); _ticker.addEventListener(Event.ENTER_FRAME, runEventQueue); return ([]); } private static function runEventQueue(_arg1):void{ var _local3:Array; var _local4:uint; var _local5:Object; var _local2:uint = _eventQueue.length; if (_local2){ _local3 = _eventQueue; _eventQueue = []; _local4 = 0; while (_local4 < _local2) { _local5 = _local3[_local4]; _local5.dispatcher.actualDispatchEvent(_local5.event); _local4++; }; }; } } }//package com.newgrounds
Section 22
//BitmapLoader (com.newgrounds.BitmapLoader) package com.newgrounds { import flash.display.*; import flash.events.*; import flash.net.*; import flash.system.*; public class BitmapLoader extends APIEventDispatcher { private var _url:String; private var _bitmapData:BitmapData; private var _loaded:Boolean;// = true private var _loader:Loader; private static const LOADER_CONTEXT:LoaderContext = new LoaderContext(true); static var _cacheSeed:uint = 0; public function BitmapLoader(_arg1:BitmapData, _arg2:String){ this._bitmapData = _arg1; this._url = _arg2; } public function get url():String{ return (this._url); } public function set url(_arg1:String):void{ this._loaded = false; this._url = _arg1; } public function get bitmapData():BitmapData{ return (this._bitmapData); } public function set bitmapData(_arg1:BitmapData):void{ this._bitmapData = _arg1; this._loaded = true; } public function get loaded():Boolean{ return (this._loaded); } private function createLoader():Loader{ var _local1:Loader = new Loader(); var _local2:URLRequest = new URLRequest(this._url); _local2.method = URLRequestMethod.GET; _local2.data = _cacheSeed.toString(); _local1.load(_local2, LOADER_CONTEXT); return (_local1); } private function disposeLoader():void{ if (this._loader){ try { this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.onLoadComplete); this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete); this._loader.unload(); } catch(error) { }; this._loader = null; }; } public function load():void{ if (((!(this._url)) || ((this._url == "")))){ this.onLoadComplete(null); return; }; this.disposeLoader(); this._loader = this.createLoader(); this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onLoadComplete); this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onLoadComplete); } public function attachBitmap(_arg1:DisplayObjectContainer):Sprite{ var _local2:Sprite = new Sprite(); if (((((!(this._loaded)) && (this._url))) && (!((this._url == ""))))){ if (!this._loader){ this.load(); }; _local2.addChild(this.createLoader()); } else { _local2.addChild(new Bitmap(this._bitmapData)); }; if (_arg1){ _arg1.addChild(_local2); }; return (_local2); } private function onLoadComplete(_arg1:Event):void{ var bitmapData:BitmapData; var event = _arg1; try { if (((((((event) && ((event.type == Event.COMPLETE)))) && (this._loader))) && ((this._loader.content is Bitmap)))){ bitmapData = Bitmap(this._loader.content).bitmapData; this._bitmapData = bitmapData; this._loaded = true; }; } catch(error:SecurityError) { if (bitmapData){ bitmapData.dispose(); }; }; this.disposeLoader(); dispatchEvent(new APIEvent(APIEvent.ICON_LOADED, this, (this._loaded) ? null : APIEvent.ERROR_BAD_FILE)); } } }//package com.newgrounds
Section 23
//Bridge (com.newgrounds.Bridge) package com.newgrounds { import flash.events.*; import flash.net.*; public class Bridge { private var _inConnection:LocalConnection; private var _outConnection:LocalConnection; private var _widgetId:String; public function Bridge(_arg1:String){ this._widgetId = _arg1; this._inConnection = new LocalConnection(); this._outConnection = new LocalConnection(); this._inConnection.client = this; try { this._inConnection.connect(("rec_" + this._widgetId)); } catch(error) { }; this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus); Logger.addEventListener(APIEvent.LOG, this.onLogMessage); } private function onLogMessage(_arg1:APIEvent):void{ try { this._outConnection.send(this._widgetId, "sendEvent", "trace", String(_arg1.data)); } catch(error) { }; } public function sendEvent(_arg1:String, _arg2:Object):void{ if (this._outConnection){ _arg2 = {data:_arg2}; this._outConnection.send(this._widgetId, "sendEvent", _arg1, _arg2); }; } public function receiveEvent(_arg1:String, _arg2:Object):void{ } private function onStatus(_arg1:Event):void{ } } }//package com.newgrounds
Section 24
//Logger (com.newgrounds.Logger) package com.newgrounds { import flash.events.*; public class Logger { static const PRIORITY_INTERNAL:uint = 0; public static const PRIORITY_MESSAGE:uint = 1; public static const PRIORITY_WARNING:uint = 2; public static const PRIORITY_ERROR:uint = 3; public static const PRIORITY_MAX:uint = 4; private static const HEADER:String = "[Newgrounds API] :: "; private static var _eventDispatcher:EventDispatcher = new EventDispatcher(); private static var _messageLevel:uint = 1; private static var _throwLevel:uint = 4; static function logInternal(... _args):void{ log(PRIORITY_INTERNAL, _args); } public static function logMessage(... _args):void{ log(PRIORITY_MESSAGE, _args); } public static function logWarning(... _args):void{ log(PRIORITY_WARNING, _args); } public static function logError(... _args):void{ log(PRIORITY_ERROR, _args); } private static function log(_arg1:uint=1, _arg2:Array=null):void{ var _local3:uint; if (_arg1 >= _messageLevel){ _local3 = 0; while (_local3 < _arg2.length) { trace((HEADER + _arg2[_local3])); _eventDispatcher.dispatchEvent(new APIEvent(APIEvent.LOG, _arg2[_local3])); _local3++; }; }; if (_arg1 >= _throwLevel){ throw (new Error(_arg2.join("\n"))); }; } public static function addEventListener(_arg1:String, _arg2:Function):void{ _eventDispatcher.addEventListener(_arg1, _arg2, false, 0, false); } } }//package com.newgrounds
Section 25
//Medal (com.newgrounds.Medal) package com.newgrounds { import flash.display.*; import com.newgrounds.assets.*; public class Medal extends APIEventDispatcher { private var _connection:APIConnection; private var _name:String; private var _id:uint; private var _value:uint; private var _unlocked:Boolean; private var _difficulty:String; private var _iconLoader:BitmapLoader; public static const ICON_WIDTH:uint = 50; public static const ICON_HEIGHT:uint = 50; public static const DIFFICULTY_EASY:String = "Easy"; public static const DIFFICULTY_MODERATE:String = "Moderate"; public static const DIFFICULTY_CHALLENGING:String = "Challenging"; public static const DIFFICULTY_DIFFICULT:String = "Difficult"; public static const DIFFICULTY_BRUTAL:String = "Brutal"; private static const DIFFICULTIES:Array = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL]; public static const DEFAULT_ICON:BitmapData = new DefaultMedalIcon(ICON_WIDTH, ICON_HEIGHT); public function Medal(_arg1:APIConnection, _arg2:uint, _arg3:String, _arg4:Boolean, _arg5:uint, _arg6:uint, _arg7:String){ this._connection = _arg1; this._id = _arg2; this._name = _arg3; this._unlocked = _arg4; this._value = _arg5; this._difficulty = DIFFICULTIES[_arg6]; this._iconLoader = new BitmapLoader(DEFAULT_ICON, _arg7); this._iconLoader.load(); } public function get difficulty():String{ return (this._difficulty); } public function get icon():BitmapData{ return (this._iconLoader.bitmapData); } public function get id():uint{ return (this._id); } public function get name():String{ return (this._name); } public function get unlocked():Boolean{ return (this._unlocked); } public function get value():uint{ return (this._value); } override public function toString():String{ return (((((((("Medal: " + this._name) + "\t\t(") + (this._unlocked) ? "unlocked, " : "locked, ") + this._value) + "pts, ") + this._difficulty) + ")")); } public function attachIcon(_arg1:DisplayObjectContainer):Sprite{ return (this._iconLoader.attachBitmap(_arg1)); } public function unlock():void{ if (this._unlocked){ Logger.logWarning((("Medal \"" + this._name) + "\" is already unlocked.")); return; }; Logger.logMessage((("Unlocking medal \"" + this.name) + "\"...")); this._unlocked = true; this._connection.sendSimpleCommand("unlockMedal", this.onUnlockConfirmed, null, {medal_id:this.id}); dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCKED, this)); } private function onUnlockConfirmed(_arg1:APIEvent):void{ if (_arg1.success){ Logger.logMessage((("Medal \"" + this.name) + "\" unlocked.")); } else { Logger.logError((("Failed to unlock \"" + this.name) + "\"!")); }; dispatchEvent(new APIEvent(APIEvent.MEDAL_UNLOCK_CONFIRMED, this, _arg1.error)); } } }//package com.newgrounds
Section 26
//SaveFile (com.newgrounds.SaveFile) package com.newgrounds { import flash.utils.*; import flash.display.*; import flash.events.*; import flash.net.*; import com.newgrounds.encoders.*; import com.newgrounds.assets.*; import flash.geom.*; public class SaveFile extends APIEventDispatcher { private var _group:SaveGroup; private var _name:String; private var _id:uint; private var _description:String; private var _authorId:uint; private var _authorName:String; private var _createdDate:String; private var _modifiedDate:String; private var _views:uint; private var _readOnly:Boolean; private var _public:Boolean; private var _approved:Boolean; private var _draft:Boolean; private var _iconLoader:BitmapLoader; private var _keys:Object; private var _ratings:Object; private var _dataURL:String; private var _data; private var _dataLoaded:Boolean; private var _encodedData; private var _encoderQueue:Array; private var _encoding:Boolean; private var _encodingParent:Object; private var _encodingProperty:String; private var _fileSize:uint; private var _dataLoader:URLLoader; public static const ICON_WIDTH:uint = 90; public static const ICON_HEIGHT:uint = 90; private static const STATUS_PRIVATE:uint = 0; private static const STATUS_SHARED:uint = 1; private static const STATUS_UNAPPROVED:uint = 2; private static const STATUS_APPROVED:uint = 3; public static const DEFAULT_ICON:BitmapData = new DefaultSaveIcon(ICON_WIDTH, ICON_HEIGHT); private static var _currentFile:SaveFile; static var _imageFilePath:String = ""; static var _saveFilePath:String = ""; public function SaveFile(_arg1:SaveGroup){ this._keys = new Object(); this._ratings = new Object(); super(); this._iconLoader = new BitmapLoader(DEFAULT_ICON, null); this._group = _arg1; } public function get group():SaveGroup{ return (this._group); } public function get name():String{ return (this._name); } public function set name(_arg1:String):void{ this._name = _arg1; } public function get description():String{ return (this._description); } public function set description(_arg1:String):void{ this._description = _arg1; } public function get id():uint{ return (this._id); } public function get data():Object{ return (this._data); } public function set data(_arg1:Object):void{ this._data = _arg1; } public function get bytesLoaded():uint{ if (this._data){ return (this.bytesTotal); }; if (!this._dataLoader){ return (0); }; return (this._dataLoader.bytesLoaded); } public function get bytesTotal():uint{ return (this._fileSize); } public function get readOnly():Boolean{ return (this._readOnly); } public function get draft():Boolean{ return (this._draft); } public function set draft(_arg1:Boolean):void{ this._draft = _arg1; } public function get authorId():uint{ return (this._authorId); } public function get authorName():String{ return (this._authorName); } public function get keys():Object{ return (this._keys); } public function get ratings():Object{ return (this._ratings); } public function get views():uint{ return (this._views); } public function get createdDate():String{ return (this._createdDate); } public function get updatedDate():String{ return (this._modifiedDate); } override public function toString():String{ return (("Save File: " + this._name)); } public function get icon():BitmapData{ return (this._iconLoader.bitmapData); } public function set icon(_arg1:BitmapData):void{ this.createIcon(_arg1); } public function get iconLoaded():Boolean{ return (this._iconLoader.loaded); } public function createIcon(_arg1:IBitmapDrawable):void{ var _local3:Number; var _local4:Number; var _local8:Number; var _local9:Rectangle; var _local2:BitmapData = new BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0); var _local5:Number = 0; var _local6:Number = 0; _local3 = Object(_arg1).width; _local4 = Object(_arg1).height; if ((_arg1 is DisplayObject)){ _local9 = DisplayObject(_arg1).getBounds(null); _local5 = _local9.left; _local6 = _local9.top; }; var _local7:Matrix = new Matrix(); _local8 = Math.min((ICON_WIDTH / _local3), (ICON_HEIGHT / _local4)); _local7.translate(-(_local5), -(_local6)); _local7.scale(_local8, _local8); _local7.translate(((ICON_WIDTH - (_local3 * _local8)) / 2), ((ICON_HEIGHT - (_local4 * _local8)) / 2)); _local2.draw(_arg1, _local7); this._iconLoader.bitmapData = _local2; } public function attachIcon(_arg1:DisplayObjectContainer):Sprite{ if (this._iconLoader){ return (this._iconLoader.attachBitmap(_arg1)); }; Logger.logError("No icon available for this sumbission."); return (null); } public function save():void{ if (!this._group.connection.hasUserSession){ Logger.logError("The user must be logged-in to save a file."); dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, null, APIEvent.ERROR_NOT_LOGGED_IN)); return; }; BitmapLoader._cacheSeed++; _currentFile = this; this.encodeData(true); } private function doSave():void{ var _local3:String; var _local4:Array; var _local5:String; var _local6:SaveKey; var _local7:SaveRating; var _local8:ByteArray; var _local1:APICommand = new APICommand("saveFile"); _local1.secureParameters.group = this._group.id; _local1.secureParameters.user_name = this._group.connection.username; _local1.secureParameters.filename = this._name; _local1.secureParameters.description = this._description; if (this._draft){ _local1.secureParameters.draft = true; }; if (((this._id) && (!(this._readOnly)))){ _local1.secureParameters.overwrite = 1; _local1.secureParameters.save_id = this._id; }; var _local2:Array = []; for (_local3 in this._keys) { _local6 = this._group.getKey(_local3); if (_local6){ _local2.push({id:_local6.id, value:_local6.validateValue(this._keys[_local3])}); } else { Logger.logError((((("No key named \"" + _local3) + "\" in save group \"") + this._group.name) + "\".")); }; }; _local1.secureParameters.keys = _local2; _local4 = []; for (_local5 in this._ratings) { _local7 = this._group.getRating(_local5); if (_local7){ _local4.push({id:_local7.id, value:_local7.validateValue(this._ratings[_local5])}); } else { Logger.logError((((("No rating named \"" + _local5) + "\" in save group \"") + this._group.name) + "\".")); }; }; _local1.secureParameters.ratings = _local4; _local8 = new ByteArray(); _local8.writeObject(this._encodedData); _local8.compress(); _local1.addFile("file", _local8, "file"); if (this.iconLoaded){ _local1.addFile("thumbnail", PNGEncoder.encode(this.icon), "thumbnail"); }; _local1.addEventListener(APIEvent.COMMAND_COMPLETE, this.onSaveComplete); this._group.connection.sendCommand(_local1); } private function encodeData(_arg1:Boolean):void{ this._encoderQueue = []; this._encoding = _arg1; if (_arg1){ this._encodedData = this._data; this.preEncodeObject(this, "_encodedData"); } else { this.preEncodeObject(this, "_data"); }; this.encodeObject(); } private function preEncodeObject(_arg1:Object, _arg2:String):void{ var _local4:Boolean; var _local6:Boolean; var _local7:String; var _local3:Object = _arg1[_arg2]; try { if (this._encoding){ _local4 = (_local3 is BitmapData); } else { _local4 = (_local3.type == "__bitmap"); }; } catch(error) { }; var _local5:Object = _local3; _local6 = (_local3 is ByteArray); if (_local4){ this._encoderQueue.push({parent:_arg1, property:_arg2}); } else { if ((((typeof(_local3) == "object")) && (!(_local6)))){ if (this._encoding){ if ((_local3 is Array)){ _local5 = []; } else { _local5 = {}; }; for (_local7 in _local3) { _local5[_local7] = _local3[_local7]; }; _arg1[_arg2] = _local5; }; for (_local7 in _local5) { this.preEncodeObject(_local5, _local7); }; }; }; } private function encodeObject():void{ var _local5:Object; if (!this._encoderQueue.length){ if (this._encoding){ this.doSave(); } else { this._dataLoaded = true; this.checkLoadComplete(); }; return; }; var _local1:Object = this._encoderQueue.pop(); var _local2:Object = _local1.parent; var _local3:String = _local1.property; var _local4:Object = _local2[_local3]; if (this._encoding){ _local5 = {type:"__bitmap", width:_local4.width, height:_local4.height, transparent:_local4.transparent}; _local2[_local3] = _local5; _local5.data = new ByteArray(); _local5.data.writeBytes(_local4.getPixels(_local4.rect)); _local5.data.position = 0; } else { _local5 = new BitmapData(_local4.width, _local4.height, _local4.transparent); new BitmapData(_local4.width, _local4.height, _local4.transparent).setPixels(_local5.rect, _local4.data); _local2[_local3] = _local5; }; this.encodeObject(); } private function onIconLoaded(_arg1:APIEvent):void{ if (((!(_arg1.success)) && (this._iconLoader.url))){ Logger.logWarning("Unable to load the icon for this save file."); }; this._iconLoader.removeEventListener(APIEvent.ICON_LOADED, this.onIconLoaded); this.checkLoadComplete(); } private function checkLoadComplete():void{ if (((this._dataLoaded) && (this.iconLoaded))){ Logger.logMessage("Data loaded."); dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this)); }; } private function onDataLoaded(_arg1):void{ var byteArray:ByteArray; var data = _arg1; try { if (data){ byteArray = data; byteArray.uncompress(); this._data = byteArray.readObject(); this.encodeData(false); }; } catch(error:Error) { Logger.logError("Error while loading data:", error); dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE)); }; } private function onDataError(_arg1:String):void{ Logger.logError("Unable to load data:", _arg1); dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, this, APIEvent.ERROR_BAD_FILE)); } private function onSaveComplete(_arg1:APIEvent):void{ if (_arg1.success){ Logger.logMessage((("File \"" + this._name) + "\" saved!")); if (_arg1.data){ this._id = _arg1.data.save_id; this._dataURL = unescape(_arg1.data.file_url); }; dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this)); } else { Logger.logError((("Error saving file \"" + this._name) + "\":"), _arg1.error); dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, this, _arg1.error)); }; } public function sendVote(_arg1:String, _arg2:Number):void{ var _local3:SaveRating = this._group.getRating(_arg1); if (!_local3){ Logger.logError((("No save rating named \"" + _arg1) + "\" exists for this save group.")); dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT)); return; }; _arg2 = _local3.validateValue(_arg2); if (isNaN(_arg2)){ Logger.logError((((((((("Invalid vote (" + _arg2) + "). ") + _arg1) + " allows a range of ") + _local3.minimum) + "-") + _local3.maximum) + ".")); dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, {}, APIEvent.ERROR_INVALID_ARGUMENT)); return; }; Logger.logMessage((((((("Voting " + _arg2) + " for ") + _arg1) + " on ") + this._name) + "...")); this._group.connection.sendSimpleCommand("rateSaveFile", this.onVoteComplete, null, {group:this._group.id, save_id:this._id, rating_id:_local3.id, vote:_arg2}); } private function onVoteComplete(_arg1:APIEvent):void{ var _local3:SaveRating; var _local2:String = _arg1.error; if (_arg1.data.already_voted){ Logger.logError("Vote failed. You've already voted on this rating today."); _local2 = APIEvent.ERROR_ALREADY_VOTED; }; if (_local2 == APIEvent.ERROR_NONE){ _local3 = this._group.getRatingById(_arg1.data.rating_id); if (_local3){ this._ratings[_local3.name] = _local3.validateValue(_arg1.data.score); }; }; dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, this, _local2)); } public function clone():SaveFile{ var _local2:String; var _local1:SaveFile = new SaveFile(this._group); _local1._data = this._data; _local1._description = this._description; _local1._draft = this._draft; _local1._fileSize = this._fileSize; _local1._iconLoader.bitmapData = this._iconLoader.bitmapData; for (_local2 in this._keys) { _local1._keys[_local2] = this._keys[_local2]; }; for (_local2 in this._ratings) { _local1._ratings[_local2] = this._ratings[_local2]; }; _local1._name = this._name; return (_local1); } public function load():void{ _currentFile = this; this._dataLoaded = false; this._data = null; if (!this.iconLoaded){ this._iconLoader.addEventListener(APIEvent.ICON_LOADED, this.onIconLoaded); this._iconLoader.load(); }; this._dataLoader = new URLLoader(); this._dataLoader.dataFormat = URLLoaderDataFormat.BINARY; this._dataLoader.addEventListener(Event.COMPLETE, this.as3DataLoaded); this._dataLoader.addEventListener(IOErrorEvent.IO_ERROR, this.as3DataError); this._dataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.as3DataError); this._dataLoader.load(new URLRequest(this._dataURL)); } private function as3DataLoaded(_arg1:Event):void{ this.onDataLoaded(this._dataLoader.data); } private function as3DataError(_arg1:Event):void{ this.onDataError(_arg1.toString()); } private function decodeObject(_arg1:Object):Object{ var _local2:BitmapData; var _local3:String; if (getQualifiedClassName(_arg1) == "Object"){ if (_arg1.type == "__bitmap"){ _local2 = new BitmapData(_arg1.width, _arg1.height, _arg1.transparent); _local2.setPixels(_local2.rect, _arg1.data); _arg1 = _local2; } else { for (_local3 in _arg1) { _arg1[_local3] = this.decodeObject(_arg1[_local3]); }; }; }; return (_arg1); } public static function get currentFile():SaveFile{ return (_currentFile); } static function fromObject(_arg1:SaveGroup, _arg2:Object):SaveFile{ var _local4:Object; var _local5:Object; var _local6:SaveKey; var _local7:SaveRating; var _local3:SaveFile = new SaveFile(_arg1); _local3._name = _arg2.filename; _local3._description = _arg2.description; _local3._id = _arg2.save_id; _local3._authorId = _arg2.user_id; _local3._authorName = _arg2.user_name; _local3._createdDate = _arg2.created; _local3._modifiedDate = _arg2.last_update; _local3._views = _arg2.views; if (((_arg2.thumb) && (!((_arg2.thumb == ""))))){ _local3._iconLoader.url = (_imageFilePath + _arg2.thumb); }; _local3._dataURL = (_saveFilePath + _arg2.file); _local3._fileSize = _arg2.file_size; _local3._approved = !((_arg2.status == STATUS_UNAPPROVED)); _local3._readOnly = false; _local3._public = ((!((_arg2.status == STATUS_PRIVATE))) && (!((_arg2.status == STATUS_UNAPPROVED)))); for each (_local4 in _arg2.keys) { _local6 = _arg1.getKeyById(_local4.id); if (_local6){ _local3._keys[_local6.name] = _local6.validateValue(_local4.value); }; }; for each (_local5 in _arg2.ratings) { _local7 = _arg1.getRatingById(_local5.id); if (_local7){ _local3._ratings[_local7.name] = _local7.validateValue(_local5.score); }; }; return (_local3); } } }//package com.newgrounds
Section 27
//SaveGroup (com.newgrounds.SaveGroup) package com.newgrounds { public class SaveGroup { private var _connection:APIConnection; private var _name:String; private var _id:uint; private var _type:uint; private var _keysArray:Array; private var _ratingsArray:Array; private var _keys:Object; private var _ratings:Object; public static const TYPE_SYSTEM:uint = 0; public static const TYPE_PRIVATE:uint = 1; public static const TYPE_PUBLIC:uint = 2; public static const TYPE_MODERATED:uint = 3; public function SaveGroup(_arg1:APIConnection, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:Array){ var _local7:uint; var _local8:SaveKey; var _local9:SaveRating; super(); this._connection = _arg1; this._id = _arg3; this._name = _arg2; this._type = _arg4; this._keysArray = _arg5; this._ratingsArray = _arg6; this._keys = new Object(); this._ratings = new Object(); for each (_local8 in _arg5) { this._keys[_local8.name] = _local8; }; for each (_local9 in _arg6) { this._ratings[_local9.name] = _local9; }; } public function get connection():APIConnection{ return (this._connection); } public function get name():String{ return (this._name); } public function get type():uint{ return (this._type); } public function get id():uint{ return (this._id); } public function get keys():Array{ return (this._keysArray); } public function get ratings():Array{ return (this._ratingsArray); } public function getKey(_arg1:String):SaveKey{ return (this._keys[_arg1]); } public function getRating(_arg1:String):SaveRating{ return (this._ratings[_arg1]); } public function getKeyById(_arg1:uint):SaveKey{ var _local2:SaveKey; for each (_local2 in this._keys) { if (_local2.id == _arg1){ return (_local2); }; }; return (null); } public function getRatingById(_arg1:uint):SaveRating{ var _local2:SaveRating; for each (_local2 in this._ratings) { if (_local2.id == _arg1){ return (_local2); }; }; return (null); } public function toString():String{ return (((((("SaveGroup: " + this.name) + " Keys: ") + this._keysArray) + " Ratings: ") + this._ratingsArray)); } } }//package com.newgrounds
Section 28
//SaveKey (com.newgrounds.SaveKey) package com.newgrounds { public class SaveKey { private var _name:String; private var _id:uint; private var _type:uint; public static const TYPE_FLOAT:uint = 1; public static const TYPE_INTEGER:uint = 2; public static const TYPE_STRING:uint = 3; public static const TYPE_BOOLEAN:uint = 4; public function SaveKey(_arg1:String, _arg2:uint, _arg3:uint){ this._name = _arg1; this._id = _arg2; this._type = _arg3; } public function get name():String{ return (this._name); } public function get id():uint{ return (this._id); } public function get type():uint{ return (this._type); } public function validateValue(_arg1){ var _local2:int; switch (this._type){ case TYPE_INTEGER: _arg1 = Number(_arg1); if (!isNaN(_arg1)){ _local2 = int(_arg1); if (_local2 != _arg1){ Logger.logWarning((((((("Float value " + _arg1) + " given for integer key \"") + this._name) + "\". Clamping to ") + _local2) + ".")); }; return (_local2); }; break; case TYPE_FLOAT: _arg1 = Number(_arg1); if (!isNaN(_arg1)){ return (isNaN(Number(_arg1))); }; break; case TYPE_BOOLEAN: return (Boolean(_arg1)); case TYPE_STRING: return ((_arg1) ? _arg1.toString() : ""); }; return (null); } public function toString():String{ return (this._name); } } }//package com.newgrounds
Section 29
//SaveQuery (com.newgrounds.SaveQuery) package com.newgrounds { public class SaveQuery extends APIEventDispatcher { private var _connection:APIConnection; private var _group:SaveGroup; private var _page:uint;// = 1 private var _resultsPerPage:uint;// = 10 private var _isRandomized:Boolean;// = false private var _files:Array; private var _totalResults:uint; private var _lookupKeys:Array; private var _lookupRatings:Array; private var _fileConditions:Array; private var _keyConditions:Array; private var _ratingConditions:Array; private var _sortFields:Array; public static const FILE_ID:String = "fileId"; public static const AUTHOR_ID:String = "authorId"; public static const AUTHOR_NAME:String = "authorName"; public static const FILE_NAME:String = "fileName"; public static const CREATED_ON:String = "createdOn"; public static const UPDATED_ON:String = "updatedOn"; public static const FILE_VIEWS:String = "fileViews"; public static const FILE_STATUS:String = "fileStatus"; private static const FILE_FIELDS:Array = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS]; public static const OPERATOR_EQUAL:String = "="; public static const OPERATOR_LESS_THAN:String = "<"; public static const OPERATOR_GREATER_THAN:String = ">"; public static const OPERATOR_NOT_EQUAL:String = "!="; public static const OPERATOR_LESS_OR_EQUAL:String = "<="; public static const OPERATOR_GREATER_OR_EQUAL:String = ">="; public static const OPERATOR_CONTAINS:String = "*"; public static const OPERATOR_NOT_CONTAINS:String = "!*"; public static const OPERATOR_NOT_BEGINS_WITH:String = "!*="; public static const OPERATOR_NOT_ENDS_WITH:String = "!=*"; public static const OPERATOR_BEGINS_WITH:String = "*="; public static const OPERATOR_ENDS_WITH:String = "=*"; private static const TABLE_FILES:uint = 1; private static const TABLE_KEYS:uint = 2; private static const TABLE_RATINGS:uint = 3; public function SaveQuery(_arg1:SaveGroup){ this._files = []; this._lookupKeys = []; this._lookupRatings = []; this._fileConditions = []; this._keyConditions = []; this._ratingConditions = []; this._sortFields = []; super(); this._group = _arg1; this._connection = _arg1.connection; this.includeAllFields(); } public function get group():SaveGroup{ return (this._group); } public function get resultsPerPage():uint{ return (this._resultsPerPage); } public function set resultsPerPage(_arg1:uint):void{ this._resultsPerPage = Math.min(Math.max(_arg1, 1), 100); } public function get page():uint{ return (this._page); } public function set page(_arg1:uint):void{ this._page = Math.max(_arg1, 1); } public function prevPage():void{ this.page--; } public function nextPage():void{ this.page++; } public function get isRandomized():Boolean{ return (this._isRandomized); } public function set isRandomized(_arg1:Boolean):void{ this._isRandomized = _arg1; } public function get files():Array{ return (this._files); } public function reset():void{ this._page = 1; this._resultsPerPage = 10; this._isRandomized = false; this._lookupKeys = []; this._lookupRatings = []; this._fileConditions = []; this._keyConditions = []; this._ratingConditions = []; this._files = []; this.includeAllFields(); } public function clone():SaveQuery{ var _local1:SaveQuery = new SaveQuery(this._group); _local1._page = this._page; _local1._resultsPerPage = this._resultsPerPage; _local1._isRandomized = this._isRandomized; _local1._lookupKeys = this._lookupKeys.concat(); _local1._lookupRatings = this._lookupRatings.concat(); _local1._fileConditions = this._fileConditions.concat(); _local1._keyConditions = this._keyConditions.concat(); _local1._ratingConditions = this._ratingConditions.concat(); return (_local1); } private function includeAllFields():void{ var _local1:SaveKey; var _local2:SaveRating; for each (_local1 in this._group.keys) { this._lookupKeys.push(_local1.id); }; for each (_local2 in this._group.ratings) { this._lookupRatings.push(_local2.id); }; } public function addCondition(_arg1:String, _arg2:String, _arg3):void{ var _local4:int; var _local5:SaveKey; var _local6:Array; var _local7:SaveRating; _local4 = FILE_FIELDS.indexOf(_arg1); if (_local4 >= 0){ this._fileConditions.push({field:_local4, operator:_arg2, value:_arg3}); } else { _local5 = this._group.getKey(_arg1); if (_local5){ _arg3 = _local5.validateValue(_arg3); this._keyConditions.push({key_id:_local5.id, operator:_arg2, value:_arg3}); return; }; _local6 = _arg1.split("."); _local7 = this._group.getRating(_local6[0]); if (_local7){ _arg3 = _local7.validateValue(_arg3); this._ratingConditions.push({rating_id:_local7.id, operator:_arg2, value:_arg3, column:(_local6[1]) ? _local6[1] : "score"}); return; }; Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + _arg1) + "\".")); }; } public function sortOn(_arg1:String, _arg2:Boolean=false):void{ var _local3:int; var _local4:SaveKey; var _local5:Array; var _local6:SaveRating; _local3 = FILE_FIELDS.indexOf(_arg1); if (_local3 >= 0){ this._sortFields.push({table:TABLE_FILES, field:_local3, desc:_arg2}); } else { _local4 = this._group.getKey(_arg1); if (_local4){ this._sortFields.push({table:TABLE_KEYS, field:_local4.id, desc:_arg2}); return; }; _local5 = _arg1.split("."); _local6 = this._group.getRating(_local5[0]); if (_local6){ this._sortFields.push({table:TABLE_RATINGS, field:_local6.id, desc:_arg2, extra:(_local5[1]) ? _local5[1] : "score"}); return; }; Logger.logError((((("The save group \"" + this._group.name) + "\" does not have a field named \"") + _arg1) + "\".")); }; } public function execute():void{ var _local1:Object = {}; _local1.page = this._page; _local1.num_results = this._resultsPerPage; if (this._isRandomized){ _local1.randomize = 1; }; if (((this._lookupKeys) && (this._lookupKeys.length))){ _local1.lookup_keys = this._lookupKeys; }; if (((this._lookupRatings) && (this._lookupRatings.length))){ _local1.lookup_ratings = this._lookupRatings; }; if (((this._fileConditions) && (this._fileConditions.length))){ _local1.file_conditions = this._fileConditions; }; if (((this._keyConditions) && (this._keyConditions.length))){ _local1.key_conditions = this._keyConditions; }; if (((this._ratingConditions) && (this._ratingConditions.length))){ _local1.rating_conditions = this._ratingConditions; }; if (((this._sortFields) && (this._sortFields.length))){ _local1.sort_conditions = this._sortFields; }; this._connection.sendSimpleCommand("lookupSaveFiles", this.onQueryComplete, {publisher_id:this._connection.publisherId, group_id:this._group.id, query:_local1}); } private function onQueryComplete(_arg1:APIEvent):void{ var _local2:Object; var _local3:uint; var _local4:SaveFile; if (_arg1.success){ _local2 = _arg1.data; this._files = []; if (_local2.files){ _local3 = 0; while (_local3 < _local2.files.length) { _local4 = SaveFile.fromObject(this._group, _local2.files[_local3]); if (_local4){ this._files.push(_local4); }; _local3++; }; }; dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this)); } else { Logger.logError(("Query failed: " + _arg1.error)); dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, this, _arg1.error)); }; } } }//package com.newgrounds
Section 30
//SaveRating (com.newgrounds.SaveRating) package com.newgrounds { public class SaveRating { private var _name:String; private var _id:uint; private var _isFloat:Boolean; private var _minimum:Number; private var _maximum:Number; public function SaveRating(_arg1:String, _arg2:uint, _arg3:Boolean, _arg4:Number, _arg5:Number){ this._name = _arg1; this._id = _arg2; this._isFloat = _arg3; this._minimum = _arg4; this._maximum = _arg5; } public function get name():String{ return (this._name); } public function get id():uint{ return (this._id); } public function get isFloat():Boolean{ return (this._isFloat); } public function get minimum():Number{ return (this._minimum); } public function get maximum():Number{ return (this._maximum); } public function validateValue(_arg1):Number{ var _local3:int; var _local2:Number = Number(_arg1); if (isNaN(_local2)){ Logger.logError((("Invalid value for rating \"" + this._name) + "\".")); return (NaN); }; if (_local2 < this._minimum){ Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._minimum) + ".")); return (this._minimum); }; if (_local2 > this._maximum){ Logger.logWarning((((((_local2 + " is out of acceptable range for rating \"") + this._name) + "\". Clamping to ") + this._maximum) + ".")); return (this._maximum); }; if (!this.isFloat){ _local3 = int(_local2); if (_local3 != _local2){ Logger.logWarning((((((("Float value " + _local2) + " given for integer rating \"") + this._name) + "\". Clamping to ") + _local3) + ".")); }; return (_local3); }; return (_local2); } public function toString():String{ return (this._name); } } }//package com.newgrounds
Section 31
//Score (com.newgrounds.Score) package com.newgrounds { public class Score { private var _numericValue:Number; private var _rank:uint; private var _username:String; private var _score:String; private var _tag:String; public function Score(_arg1:uint, _arg2:String, _arg3:String, _arg4:Number, _arg5:String){ this._rank = _arg1; this._username = _arg2; this._score = _arg3; this._numericValue = _arg4; this._tag = _arg5; } public function get numericValue():Number{ return (this._numericValue); } public function get rank():uint{ return (this._rank); } public function get score():String{ return (this._score); } public function get tag():String{ return (this._tag); } public function get username():String{ return (this._username); } public function toString():String{ return (((((this._rank + ".\t") + this._username) + "\t") + this._score)); } } }//package com.newgrounds
Section 32
//ScoreBoard (com.newgrounds.ScoreBoard) package com.newgrounds { public class ScoreBoard extends APIEventDispatcher { private var _connection:APIConnection; private var _name:String; private var _id:uint; private var _period:String;// = "All-Time" private var _firstResult:uint;// = 1 private var _numResults:uint;// = 10 private var _tag:String; private var _scores:Array; public static const TODAY:String = "Today"; public static const THIS_WEEK:String = "This Week"; public static const THIS_MONTH:String = "This Month"; public static const THIS_YEAR:String = "This Year"; public static const ALL_TIME:String = "All-Time"; public function ScoreBoard(_arg1:APIConnection, _arg2:String, _arg3:uint){ this._connection = _arg1; this._name = _arg2; this._id = _arg3; } public function get name():String{ return (this._name); } public function get scores():Array{ return (this._scores); } public function get period():String{ return (this._period); } public function set period(_arg1:String):void{ this._period = _arg1; } public function get firstResult():uint{ return (this._firstResult); } public function set firstResult(_arg1:uint):void{ this._firstResult = Math.max(1, _arg1); } public function get numResults():uint{ return (this._numResults); } public function set numResults(_arg1:uint):void{ this._numResults = _arg1; } public function get tag():String{ return (this._tag); } public function set tag(_arg1:String):void{ this._tag = _arg1; } public function get page():uint{ return ((Math.ceil(((this._firstResult - 1) / this._numResults)) + 1)); } public function prevPage():void{ if (this.firstResult > this._numResults){ this.firstResult = (this.firstResult - this._numResults); }; } public function nextPage():void{ this.firstResult = (this.firstResult + this._numResults); } public function loadScores():void{ this._connection.sendSimpleCommand("loadScores", this.onScoresLoaded, {publisher_id:this._connection.publisherId, board:this._id, page:(((this._firstResult - 1) / this._numResults) + 1), num_results:this._numResults, period:this._period, tag:this._tag}); } public function postScore(_arg1:Number, _arg2:String=null):void{ if (isNaN(_arg1)){ Logger.logError(("Cannot post invalid score: " + _arg1)); dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, null, APIEvent.ERROR_INVALID_ARGUMENT)); return; }; Logger.logMessage((((((("Posting a score of " + _arg1) + " by ") + this._connection.username) + " to scoreboard \"") + this._name) + "\"...")); this._connection.sendSimpleCommand("postScore", this.onScorePosted, null, {user_name:this._connection.username, board:this._id, value:_arg1, tag:_arg2}); } private function onScoresLoaded(_arg1:APIEvent):void{ var _local3:uint; var _local4:uint; var _local5:Object; var _local2:Object = _arg1.data; this._scores = []; if (_local2.first_result){ _local3 = _local2.first_result; } else { _local3 = this._firstResult; }; if (_local2.scores){ _local4 = 0; while (_local4 < _local2.scores.length) { _local5 = _local2.scores[_local4]; if (_local5){ this._scores[_local4] = new Score(_local3, _local5.username, _local5.value, _local5.numeric_value, _local5.tag); }; _local4++; _local3++; }; }; dispatchEvent(new APIEvent(APIEvent.SCORES_LOADED, this)); } private function onScorePosted(_arg1:APIEvent):void{ var _local2:Object; var _local3:Object; if (_arg1.success){ Logger.logMessage("Score posted!"); _local2 = _arg1.data; _local3 = {}; _local3.score = _local2.value; _local3.scoreBoard = this; } else { Logger.logError(("Error posting score: " + _arg1.error)); }; dispatchEvent(new APIEvent(APIEvent.SCORE_POSTED, _local3, _arg1.error)); } override public function toString():String{ return (("Scoreboard: " + this._name)); } } }//package com.newgrounds
Section 33
//BG_36 (Gay_fla.BG_36) package Gay_fla { import flash.display.*; public dynamic class BG_36 extends MovieClip { public function BG_36(){ addFrameScript(0, frame1, 15, frame16); } function frame16(){ gotoAndPlay(2); } function frame1(){ stop(); } } }//package Gay_fla
Section 34
//MainTimeline (Gay_fla.MainTimeline) package Gay_fla { import flash.utils.*; import flash.display.*; import com.newgrounds.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import com.newgrounds.components.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; import gs.*; public dynamic class MainTimeline extends MovieClip { public var pp; public var bTimer; public var btn_tjhs:SimpleButton; public var bF:Boolean; public var edwards; public var bg:MovieClip; public var h_h:MovieClip; public var __setPropDict:Dictionary; public var rTime; public var gext:TextField; public var b; public var timeleft:Number; public var g; public var __id0_:APIConnector; public var k; public var bb; public var h_jb:MovieClip; public var score; public var gTick; public var btn_instructions:SimpleButton; public var jbProb; public var __id2_:ScoreBrowser; public var fs; public var finalscore; public var jProb; public var rProb; public var btn_back:SimpleButton; public var removeQueue:Array; public var gTimer; public var bjs; public var it; public var btn_play:SimpleButton; public var btn_tehs:SimpleButton; public var timer:TextField; public var gex:MovieClip; public var text_result:TextField; public var eProb; public var jacobs; public var btn_medals:SimpleButton; public var h_tl:MovieClip; public var dsl:MovieClip; public var h_ec:MovieClip; public var removal; public var status:TextField; public function MainTimeline(){ __setPropDict = new Dictionary(true); super(); addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8); } public function countdown(_arg1):void{ var _local2:*; gext.text = String(score); if ((timeleft - 1) < 0){ gext.text = String(score); gTick.removeEventListener(TimerEvent.TIMER, tick); gTimer.removeEventListener(TimerEvent.TIMER, countdown); bTimer.removeEventListener(TimerEvent.TIMER, bfOver); bg.gotoAndStop(1); _local2 = 0; for (_local2 in removeQueue) { gex.removeChild(removeQueue[_local2]); }; removeQueue = []; bTimer.stop(); gTick.stop(); bTimer.stop(); if (score > 0){ API.unlockMedal("Team Edward"); } else { if (score < 0){ API.unlockMedal("Team Jacob"); } else { API.unlockMedal("Hater"); }; }; gotoAndStop("endgame"); }; timeleft--; timer.text = String(timeleft); } public function bieberFever(){ API.unlockMedal("Bieber Fever!"); bF = true; bg.gotoAndPlay(2); bTimer.start(); } public function bButton(_arg1:MouseEvent):void{ gotoAndStop("title"); } public function clickJacob(_arg1):void{ var _local2:*; var _local3:Array; _local2 = 0; _local3 = new Array(); for (_local2 in removeQueue) { if (removeQueue[_local2] != _arg1.target){ _local3.push(removeQueue[_local2]); }; }; removeQueue = _local3; gex.removeChild(Jacob(_arg1.target)); addScore(-1); k.play(); } public function record(_arg1:String):void{ if (_arg1 == "edward"){ edwards++; } else { if (_arg1 == "jacob"){ jacobs++; } else { if (_arg1 == "justin"){ bjs++; }; }; }; } function frame3(){ btn_back.addEventListener(MouseEvent.CLICK, bButton); btn_back.addEventListener(MouseEvent.CLICK, bButton); } function frame5(){ timeleft = 40; eProb = 0.05; finalscore = 0; jProb = 0.05; jbProb = 0.01; rProb = 0.3; gTimer = new Timer(1000); score = 0; removal = 12; rTime = 0; pp = new Pop(); k = new Kiss(); b = new Baby(); bb = new SoundChannel(); removeQueue = []; bF = false; edwards = 0; jacobs = 0; bjs = 0; gTimer.addEventListener(TimerEvent.TIMER, countdown); gTick = new Timer(60); gTick.addEventListener(TimerEvent.TIMER, tick); gTimer.start(); gTick.start(); bTimer = new Timer(11000); bTimer.addEventListener(TimerEvent.TIMER, bfOver); it = 0; while (it < 1000000) { g = Math.random(); if (g < eProb){ record("edward"); } else { if (g < (eProb + jProb)){ record("jacob"); } else { if (g < ((eProb + jProb) + jbProb)){ record("justin"); }; }; }; it++; }; status.mouseEnabled = false; timer.mouseEnabled = false; } public function clickEd(_arg1):void{ var _local2:*; var _local3:Array; _local2 = 0; _local3 = new Array(); for (_local2 in removeQueue) { if (removeQueue[_local2] != _arg1.target){ _local3.push(removeQueue[_local2]); }; }; removeQueue = _local3; gex.removeChild(Edward(_arg1.target)); addScore(1); k.play(); } public function addScore(_arg1:Number):void{ var _local2:*; var _local3:*; _local2 = _arg1; score = (score + _local2); _local3 = 2; if (_arg1 < 0){ _local3 = (_local3 * -1); }; finalscore = Math.abs((score + (Number(bF) * _local3))); if (score > 0){ status.text = (("Team Edward!\n " + finalscore) + " points <3"); } else { if (score < 0){ status.text = (("Team Jacob!\n " + finalscore) + " points <3"); } else { status.text = "team nobody :C"; }; }; gext.text = String(finalscore); } function frame1(){ if ((((__setPropDict[__id0_] == undefined)) || (!((int(__setPropDict[__id0_]) == 1))))){ __setPropDict[__id0_] = currentFrame; __setProp___id0__Scene1_Ad_1(); }; finalscore = 0; API.connect(root, "21359:1o7NJYPa", "7IHlYgoGkm6lPimKniisNVzMymB7yUkd"); stop(); stage.addEventListener(MouseEvent.MOUSE_MOVE, dslMove); dsl.mouseEnabled = false; } function frame2(){ stop(); btn_play.addEventListener(MouseEvent.CLICK, pButton); btn_instructions.addEventListener(MouseEvent.CLICK, iButton); btn_medals.addEventListener(MouseEvent.CLICK, mButton); } function frame4(){ h_h.alpha = Number(API.getMedal("Hater").unlocked); h_tl.alpha = Number(API.getMedal("Team Jacob").unlocked); h_jb.alpha = Number(API.getMedal("Bieber Fever!").unlocked); h_ec.alpha = Number(API.getMedal("Team Edward").unlocked); btn_back.addEventListener(MouseEvent.CLICK, bButton); } function frame8(){ if ((((__setPropDict[__id2_] == undefined)) || (!((int(__setPropDict[__id2_]) == 8))))){ __setPropDict[__id2_] = currentFrame; __setProp___id2__Scene1_Text_8(); }; btn_back.addEventListener(MouseEvent.CLICK, bButton); btn_tehs.addEventListener(MouseEvent.CLICK, tehsButton); btn_tjhs.addEventListener(MouseEvent.CLICK, tjhsButton); btn_back.addEventListener(MouseEvent.CLICK, bButton); } function frame7(){ if ((((__setPropDict[__id2_] == undefined)) || (!((int(__setPropDict[__id2_]) == 7))))){ __setPropDict[__id2_] = currentFrame; __setProp___id2__Scene1_Text_7(); }; btn_back.addEventListener(MouseEvent.CLICK, bButton); btn_tehs.addEventListener(MouseEvent.CLICK, tehsButton); btn_tjhs.addEventListener(MouseEvent.CLICK, tjhsButton); btn_back.addEventListener(MouseEvent.CLICK, bButton); } function frame6(){ fs = Number(gext.text); text_result.text = "You're a hater. You didn't get any points!\n I hope you die in an accident, you sad, lonely (wo)man."; if (fs > 0){ text_result.text = (("You're team Edward and you scored " + fs) + "!\n Like, GOOD JOB OMG.\n HIGHSCORES."); API.postScore("Team Edward", fs, "kisses"); }; if (fs < 0){ text_result.text = (("You're team Jacob and you scored " + fs) + "!\n Like, GOOD JOB OMG.\n HIGHSCORES."); API.postScore("Team Jacob", fs, "kisses"); }; btn_tehs.addEventListener(MouseEvent.CLICK, tehsButton); btn_tjhs.addEventListener(MouseEvent.CLICK, tjhsButton); btn_back.addEventListener(MouseEvent.CLICK, bButton); } public function tjhsButton(_arg1:MouseEvent):void{ gotoAndStop("tj_highscores"); } public function clickJB(_arg1):void{ var _local2:*; var _local3:Array; _local2 = 0; _local3 = new Array(); for (_local2 in removeQueue) { if (removeQueue[_local2] != _arg1.target){ _local3.push(removeQueue[_local2]); }; }; removeQueue = _local3; gex.removeChild(Justin(_arg1.target)); bieberFever(); bb.stop(); bb = b.play(42000); } public function iButton(_arg1:MouseEvent):void{ gotoAndStop("instructions"); } function __setProp___id0__Scene1_Ad_1(){ try { __id0_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id0_.apiId = "21359:1o7NJYPa"; __id0_.encryptionKey = "7IHlYgoGkm6lPimKniisNVzMymB7yUkd"; __id0_.debugMode = "Off"; __id0_.movieVersion = ""; __id0_.connectorType = "Flash Ad + Preloader"; __id0_.redirectOnNewVersion = true; __id0_.redirectOnHostBlocked = true; try { __id0_["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function dslMove(_arg1):void{ dsl.x = stage.mouseX; dsl.y = stage.mouseY; Mouse.hide(); } public function bfOver(_arg1){ bTimer.stop(); bF = false; bg.gotoAndStop(1); bb.stop(); } public function spawn(_arg1:String):void{ var _local2:*; pp.play(); switch (_arg1){ case "edward": _local2 = new Edward(); gex.addChild(_local2); _local2.x = (Math.random() * 275); _local2.y = (Math.random() * 200); _local2.rotation = (Math.random() * 360); _local2.addEventListener(MouseEvent.MOUSE_DOWN, clickEd, false, 0, true); removeQueue.push(_local2); break; case "jacob": _local2 = new Jacob(); gex.addChild(_local2); _local2.x = (Math.random() * 275); _local2.y = (Math.random() * 200); _local2.rotation = (Math.random() * 360); _local2.addEventListener(MouseEvent.MOUSE_DOWN, clickJacob, false, 0, true); removeQueue.push(_local2); break; case "justin": _local2 = new Justin(); gex.addChild(_local2); _local2.x = (Math.random() * 275); _local2.y = (Math.random() * 200); _local2.rotation = (Math.random() * 360); _local2.addEventListener(MouseEvent.MOUSE_DOWN, clickJB, false, 0, true); removeQueue.push(_local2); break; }; } public function tehsButton(_arg1:MouseEvent):void{ gotoAndStop("te_highscores"); } public function tick(_arg1):void{ var _local2:*; _local2 = Math.random(); if (_local2 < eProb){ spawn("edward"); } else { if (_local2 < (eProb + jProb)){ spawn("jacob"); } else { if (_local2 < ((eProb + jProb) + jbProb)){ spawn("justin"); }; }; }; rTime++; if (rTime > removal){ rTime = 0; if (removeQueue[0] != null){ if (gex.contains(removeQueue[0])){ gex.removeChild(removeQueue.shift()); }; }; }; } function __setProp___id2__Scene1_Text_7(){ try { __id2_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id2_.scoreBoardName = "TeamEdward"; __id2_.period = "All-Time"; __id2_.title = "Edward Kisses"; try { __id2_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id2__Scene1_Text_8(){ try { __id2_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id2_.scoreBoardName = "TeamJacob"; __id2_.period = "All-Time"; __id2_.title = "Jacob Kisses"; try { __id2_["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function pButton(_arg1:MouseEvent):void{ gotoAndStop("game"); } public function mButton(_arg1:MouseEvent):void{ gotoAndStop("medals"); } } }//package Gay_fla
Section 35
//MedalNameContainer_29 (Gay_fla.MedalNameContainer_29) package Gay_fla { import flash.display.*; import flash.text.*; public dynamic class MedalNameContainer_29 extends MovieClip { public var textField:TextField; } }//package Gay_fla
Section 36
//Timeline_13 (Gay_fla.Timeline_13) package Gay_fla { import flash.display.*; public dynamic class Timeline_13 extends MovieClip { public function Timeline_13(){ addFrameScript(0, frame1); } function frame1(){ stop(); buttonMode = true; } } }//package Gay_fla
Section 37
//Timeline_17 (Gay_fla.Timeline_17) package Gay_fla { import flash.display.*; public dynamic class Timeline_17 extends MovieClip { public function Timeline_17(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package Gay_fla
Section 38
//Timeline_46 (Gay_fla.Timeline_46) package Gay_fla { import flash.utils.*; import flash.display.*; import flash.text.*; import flash.events.*; import flash.net.*; import flash.media.*; import flash.geom.*; import flash.system.*; import flash.ui.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.xml.*; public dynamic class Timeline_46 extends MovieClip { public var itemClip:MovieClip; public var currentItem:MovieClip; public var _selectedItem:Object; public var _listItems:Array; public var listButton:SimpleButton; public var item2:MovieClip; public var item6:MovieClip; public var item7:MovieClip; public var item3:MovieClip; public var item4:MovieClip; public var item5:MovieClip; public var item0:MovieClip; public var i:uint; public var item1:MovieClip; public var _listDown:Boolean; public function Timeline_46(){ addFrameScript(0, frame1, 9, frame10); } public function hideList():void{ _listDown = false; gotoAndStop("sortUP"); } function frame10(){ i = 0; itemClip = item0; while (itemClip) { if (i < _listItems.length){ itemClip.item = _listItems[i]; itemClip.label.text = _listItems[i].label; itemClip.addEventListener(MouseEvent.CLICK, _onItemClick); } else { itemClip.visible = false; }; i++; itemClip = this[("item" + i)]; }; } public function _onItemClick(_arg1:MouseEvent):void{ var _local2:MovieClip; _local2 = (_arg1.currentTarget as MovieClip); if (_local2.item){ setSelectedItem(_local2.item.data); }; if (((((((_local2) && (parent))) && ((parent is MovieClip)))) && (MovieClip(parent)._onListChange))){ MovieClip(parent)._onListChange(_local2.item); }; } function frame1(){ stop(); if (listButton){ listButton.addEventListener(MouseEvent.CLICK, _onListClick); }; if (currentItem){ currentItem.addEventListener(MouseEvent.CLICK, _onListClick); if (currentItem.label){ if (_selectedItem){ currentItem.label.text = _selectedItem.label; } else { currentItem.label.text = ""; }; }; }; if (!_listItems){ _listItems = []; }; } public function setListItems(_arg1:Array):void{ var _local2:uint; if (!_arg1){ _listItems = []; } else { _listItems = _arg1.concat(); }; _local2 = 0; while (_local2 < _listItems.length) { if (typeof(_listItems[_local2]) == "string"){ _listItems[_local2] = {label:_listItems[_local2], data:_listItems[_local2]}; }; _local2++; }; setSelectedIndex(0); } public function _onListClick(_arg1:MouseEvent):void{ _listDown = !(_listDown); if (_listDown){ gotoAndStop("sortDOWN"); } else { gotoAndStop("sortUP"); }; } public function setSelectedIndex(_arg1:uint):void{ if (_arg1 < _listItems.length){ _selectedItem = _listItems[_arg1]; if (((currentItem) && (currentItem.label))){ currentItem.label.text = _selectedItem.label; }; }; } public function setSelectedItem(_arg1):void{ var _local2:uint; _local2 = 0; while (_local2 < _listItems.length) { if (_listItems[_local2].data == _arg1){ setSelectedIndex(_local2); return; }; _local2++; }; } } }//package Gay_fla
Section 39
//Timeline_47 (Gay_fla.Timeline_47) package Gay_fla { import flash.display.*; import flash.text.*; public dynamic class Timeline_47 extends MovieClip { public var label:TextField; public function Timeline_47(){ addFrameScript(0, frame1); } function frame1(){ stop(); buttonMode = true; mouseChildren = false; } } }//package Gay_fla
Section 40
//Timeline_50 (Gay_fla.Timeline_50) package Gay_fla { import flash.display.*; public dynamic class Timeline_50 extends MovieClip { public var score1:MovieClip; public var score5:MovieClip; public var score6:MovieClip; public var score0:MovieClip; public var score2:MovieClip; public var score3:MovieClip; public var score7:MovieClip; public var score8:MovieClip; public var score4:MovieClip; public var score9:MovieClip; } }//package Gay_fla
Section 41
//Timeline_51 (Gay_fla.Timeline_51) package Gay_fla { import flash.display.*; import flash.text.*; public dynamic class Timeline_51 extends MovieClip { public var usernameText:TextField; public var rankText:TextField; public var scoreText:TextField; public function Timeline_51(){ addFrameScript(0, frame1); } function frame1(){ stop(); buttonMode = true; mouseChildren = false; } } }//package Gay_fla
Section 42
//Baby (Baby) package { import flash.media.*; public dynamic class Baby extends Sound { } }//package
Section 43
//Edward (Edward) package { import flash.display.*; public dynamic class Edward extends MovieClip { } }//package
Section 44
//Jacob (Jacob) package { import flash.display.*; public dynamic class Jacob extends MovieClip { } }//package
Section 45
//Justin (Justin) package { import flash.display.*; public dynamic class Justin extends MovieClip { } }//package
Section 46
//Kiss (Kiss) package { import flash.media.*; public dynamic class Kiss extends Sound { } }//package
Section 47
//Pop (Pop) package { import flash.media.*; public dynamic class Pop extends Sound { } }//package

Library Items

Symbol 1 Sound {Baby}
Symbol 2 Sound {Pop}
Symbol 3 Sound {Kiss}
Symbol 4 BitmapUsed by:5 124
Symbol 5 GraphicUses:4Used by:6
Symbol 6 MovieClip {Edward}Uses:5
Symbol 7 BitmapUsed by:8 124
Symbol 8 GraphicUses:7Used by:9
Symbol 9 MovieClip {Justin}Uses:8
Symbol 10 BitmapUsed by:11 124
Symbol 11 GraphicUses:10Used by:12
Symbol 12 MovieClip {Jacob}Uses:11
Symbol 13 GraphicUsed by:20
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClipUses:14Used by:16
Symbol 16 MovieClipUses:15Used by:20
Symbol 17 GraphicUsed by:18 48 62 114
Symbol 18 MovieClipUses:17Used by:20 61 62 114
Symbol 19 GraphicUsed by:20
Symbol 20 MovieClip {Gay_fla.Timeline_17}Uses:13 16 18 19Used by:31
Symbol 21 GraphicUsed by:30
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClipUses:22Used by:24
Symbol 24 MovieClipUses:23Used by:30
Symbol 25 GraphicUsed by:27
Symbol 26 GraphicUsed by:27
Symbol 27 MovieClipUses:25 26Used by:30 61
Symbol 28 GraphicUsed by:30
Symbol 29 GraphicUsed by:30
Symbol 30 MovieClip {Gay_fla.Timeline_13}Uses:21 24 27 28 29Used by:31 62
Symbol 31 MovieClip {com.newgrounds.components.Preloader}Uses:20 30Used by:63
Symbol 32 GraphicUsed by:62
Symbol 33 GraphicUsed by:62
Symbol 34 GraphicUsed by:62
Symbol 35 GraphicUsed by:62
Symbol 36 BitmapUsed by:38
Symbol 37 BitmapUsed by:38
Symbol 38 GraphicUses:36 37Used by:49
Symbol 39 BitmapUsed by:40
Symbol 40 GraphicUses:39Used by:49
Symbol 41 BitmapUsed by:42
Symbol 42 GraphicUses:41Used by:47 49
Symbol 43 BitmapUsed by:44
Symbol 44 GraphicUses:43Used by:47
Symbol 45 BitmapUsed by:46
Symbol 46 GraphicUses:45Used by:47
Symbol 47 MovieClipUses:42 44 46Used by:49
Symbol 48 ButtonUses:17Used by:49
Symbol 49 ButtonUses:38 40 47 42 48Used by:62
Symbol 50 MovieClipUsed by:62 114
Symbol 51 GraphicUsed by:61
Symbol 52 GraphicUsed by:61
Symbol 53 GraphicUsed by:61
Symbol 54 GraphicUsed by:55
Symbol 55 MovieClipUses:54Used by:61
Symbol 56 GraphicUsed by:60
Symbol 57 BitmapUsed by:58
Symbol 58 GraphicUses:57Used by:59
Symbol 59 MovieClipUses:58Used by:60
Symbol 60 MovieClipUses:56 59Used by:61
Symbol 61 MovieClipUses:51 18 52 53 55 60 27Used by:62
Symbol 62 MovieClip {com.newgrounds.components.FlashAd}Uses:32 33 34 35 49 18 50 61 17 30Used by:63
Symbol 63 MovieClip {com.newgrounds.components.APIConnector}Uses:62 31Used by:Timeline
Symbol 64 GraphicUsed by:156  Timeline
Symbol 65 FontUsed by:66 69 70 71 72 75 76 79 80 115 116 117 120 121 122 123 125 128 129 131 133 136 138 140 142 144 146 148 150 152 154 155 158 159 160 161 162 163 164 167 168 171 172 218
Symbol 66 EditableTextUses:65Used by:Timeline
Symbol 67 GraphicUsed by:68
Symbol 68 MovieClipUses:67Used by:Timeline
Symbol 69 TextUses:65Used by:Timeline
Symbol 70 TextUses:65Used by:Timeline
Symbol 71 TextUses:65Used by:74
Symbol 72 TextUses:65Used by:74
Symbol 73 GraphicUsed by:74
Symbol 74 ButtonUses:71 72 73Used by:Timeline
Symbol 75 TextUses:65Used by:78
Symbol 76 TextUses:65Used by:78
Symbol 77 GraphicUsed by:78
Symbol 78 ButtonUses:75 76 77Used by:Timeline
Symbol 79 TextUses:65Used by:82
Symbol 80 TextUses:65Used by:82
Symbol 81 GraphicUsed by:82
Symbol 82 ButtonUses:79 80 81Used by:Timeline
Symbol 83 GraphicUsed by:84
Symbol 84 MovieClipUses:83Used by:114
Symbol 85 FontUsed by:86
Symbol 86 EditableTextUses:85Used by:87
Symbol 87 MovieClip {com.newgrounds.shims.FontShim}Uses:86Used by:114 217
Symbol 88 GraphicUsed by:94
Symbol 89 GraphicUsed by:90
Symbol 90 MovieClipUses:89Used by:94 114
Symbol 91 GraphicUsed by:94
Symbol 92 BitmapUsed by:93
Symbol 93 GraphicUses:92Used by:94
Symbol 94 MovieClipUses:88 90 91 93Used by:114
Symbol 95 SoundUsed by:114
Symbol 96 GraphicUsed by:114
Symbol 97 GraphicUsed by:98
Symbol 98 MovieClipUses:97Used by:114
Symbol 99 GraphicUsed by:114
Symbol 100 FontUsed by:101 105 186 200 204
Symbol 101 EditableTextUses:100Used by:114
Symbol 102 FontUsed by:103 195
Symbol 103 EditableTextUses:102Used by:104
Symbol 104 MovieClip {Gay_fla.MedalNameContainer_29}Uses:103Used by:114
Symbol 105 EditableTextUses:100Used by:106
Symbol 106 MovieClipUses:105Used by:114
Symbol 107 GraphicUsed by:108
Symbol 108 MovieClipUses:107Used by:114
Symbol 109 GraphicUsed by:110
Symbol 110 MovieClipUses:109Used by:114
Symbol 111 GraphicUsed by:112
Symbol 112 MovieClipUses:111Used by:114
Symbol 113 SoundUsed by:114
Symbol 114 MovieClip {com.newgrounds.components.MedalPopup}Uses:84 87 18 94 95 90 96 98 99 17 101 104 106 50 108 110 112 113Used by:Timeline
Symbol 115 TextUses:65Used by:Timeline
Symbol 116 TextUses:65Used by:119
Symbol 117 TextUses:65Used by:119
Symbol 118 GraphicUsed by:119
Symbol 119 ButtonUses:116 117 118Used by:Timeline
Symbol 120 TextUses:65Used by:Timeline
Symbol 121 TextUses:65Used by:Timeline
Symbol 122 TextUses:65Used by:Timeline
Symbol 123 TextUses:65Used by:Timeline
Symbol 124 GraphicUses:4 10 7Used by:Timeline
Symbol 125 TextUses:65Used by:Timeline
Symbol 126 GraphicUsed by:127
Symbol 127 MovieClipUses:126Used by:Timeline
Symbol 128 TextUses:65Used by:156
Symbol 129 TextUses:65Used by:156
Symbol 130 GraphicUsed by:156
Symbol 131 TextUses:65Used by:156
Symbol 132 GraphicUsed by:156
Symbol 133 TextUses:65Used by:156
Symbol 134 GraphicUsed by:156
Symbol 135 GraphicUsed by:156
Symbol 136 TextUses:65Used by:156
Symbol 137 GraphicUsed by:156
Symbol 138 TextUses:65Used by:156
Symbol 139 GraphicUsed by:156
Symbol 140 TextUses:65Used by:156
Symbol 141 GraphicUsed by:156
Symbol 142 TextUses:65Used by:156
Symbol 143 GraphicUsed by:156
Symbol 144 TextUses:65Used by:156
Symbol 145 GraphicUsed by:156 177
Symbol 146 TextUses:65Used by:156
Symbol 147 GraphicUsed by:156
Symbol 148 TextUses:65Used by:156
Symbol 149 GraphicUsed by:156
Symbol 150 TextUses:65Used by:156
Symbol 151 GraphicUsed by:156
Symbol 152 TextUses:65Used by:156
Symbol 153 GraphicUsed by:156
Symbol 154 TextUses:65Used by:156
Symbol 155 TextUses:65Used by:156
Symbol 156 MovieClip {Gay_fla.BG_36}Uses:64 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155Used by:Timeline
Symbol 157 MovieClipUsed by:Timeline
Symbol 158 EditableTextUses:65Used by:Timeline
Symbol 159 EditableTextUses:65Used by:Timeline
Symbol 160 TextUses:65Used by:Timeline
Symbol 161 TextUses:65Used by:Timeline
Symbol 162 TextUses:65Used by:Timeline
Symbol 163 TextUses:65Used by:166
Symbol 164 TextUses:65Used by:166
Symbol 165 GraphicUsed by:166
Symbol 166 ButtonUses:163 164 165Used by:Timeline
Symbol 167 TextUses:65Used by:170
Symbol 168 TextUses:65Used by:170
Symbol 169 GraphicUsed by:170
Symbol 170 ButtonUses:167 168 169Used by:Timeline
Symbol 171 EditableTextUses:65Used by:Timeline
Symbol 172 TextUses:65Used by:Timeline
Symbol 173 GraphicUsed by:178
Symbol 174 GraphicUsed by:178
Symbol 175 GraphicUsed by:178
Symbol 176 GraphicUsed by:178
Symbol 177 MovieClipUses:145Used by:178
Symbol 178 MovieClipUses:173 174 175 176 177Used by:217
Symbol 179 GraphicUsed by:184
Symbol 180 GraphicUsed by:181
Symbol 181 MovieClipUses:180Used by:184
Symbol 182 GraphicUsed by:183
Symbol 183 MovieClipUses:182Used by:184
Symbol 184 MovieClipUses:179 181 183Used by:217
Symbol 185 GraphicUsed by:188
Symbol 186 EditableTextUses:100Used by:188
Symbol 187 GraphicUsed by:188
Symbol 188 MovieClip {Gay_fla.Timeline_47}Uses:185 186 187Used by:194
Symbol 189 GraphicUsed by:193 199
Symbol 190 GraphicUsed by:193
Symbol 191 GraphicUsed by:193
Symbol 192 GraphicUsed by:193
Symbol 193 ButtonUses:189 190 191 192Used by:194
Symbol 194 MovieClip {Gay_fla.Timeline_46}Uses:188 193Used by:217
Symbol 195 EditableTextUses:102Used by:217
Symbol 196 GraphicUsed by:199
Symbol 197 GraphicUsed by:199
Symbol 198 GraphicUsed by:199
Symbol 199 ButtonUses:189 196 197 198Used by:217
Symbol 200 EditableTextUses:100Used by:217
Symbol 201 GraphicUsed by:207
Symbol 202 FontUsed by:203 205
Symbol 203 EditableTextUses:202Used by:207
Symbol 204 EditableTextUses:100Used by:207
Symbol 205 EditableTextUses:202Used by:207
Symbol 206 GraphicUsed by:207
Symbol 207 MovieClip {Gay_fla.Timeline_51}Uses:201 203 204 205 206Used by:208
Symbol 208 MovieClip {Gay_fla.Timeline_50}Uses:207Used by:217
Symbol 209 GraphicUsed by:210
Symbol 210 MovieClipUses:209Used by:217
Symbol 211 GraphicUsed by:216
Symbol 212 GraphicUsed by:216
Symbol 213 GraphicUsed by:216
Symbol 214 GraphicUsed by:216
Symbol 215 GraphicUsed by:216
Symbol 216 ButtonUses:211 212 213 214 215Used by:217
Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser}Uses:178 184 194 195 199 200 87 208 210 216Used by:Timeline
Symbol 218 TextUses:65Used by:Timeline

Instance Names

"gext"Frame 1Symbol 66 EditableText
"__id0_"Frame 1Symbol 63 MovieClip {com.newgrounds.components.APIConnector}
"dsl"Frame 1Symbol 68 MovieClip
"btn_play"Frame 2Symbol 74 Button
"btn_instructions"Frame 2Symbol 78 Button
"btn_medals"Frame 2Symbol 82 Button
"btn_back"Frame 3Symbol 119 Button
"h_jb"Frame 4Symbol 127 MovieClip
"h_ec"Frame 4Symbol 127 MovieClip
"h_tl"Frame 4Symbol 127 MovieClip
"h_h"Frame 4Symbol 127 MovieClip
"bg"Frame 5Symbol 156 MovieClip {Gay_fla.BG_36}
"gex"Frame 5Symbol 157 MovieClip
"status"Frame 5Symbol 158 EditableText
"timer"Frame 5Symbol 159 EditableText
"btn_tehs"Frame 6Symbol 166 Button
"btn_tjhs"Frame 6Symbol 170 Button
"btn_back"Frame 6Symbol 119 Button
"text_result"Frame 6Symbol 171 EditableText
"__id2_"Frame 7Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser}
"btn_tehs"Frame 8Symbol 166 Button
"loadingBar"Symbol 31 MovieClip {com.newgrounds.components.Preloader} Frame 1Symbol 20 MovieClip {Gay_fla.Timeline_17}
"playButton"Symbol 31 MovieClip {com.newgrounds.components.Preloader} Frame 10Symbol 30 MovieClip {Gay_fla.Timeline_13}
"newgroundsButton"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 1Symbol 49 Button
"adContainer"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 1Symbol 50 MovieClip
"playButton"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 30Symbol 30 MovieClip {Gay_fla.Timeline_13}
"ad"Symbol 63 MovieClip {com.newgrounds.components.APIConnector} Frame 1Symbol 62 MovieClip {com.newgrounds.components.FlashAd}
"loader"Symbol 63 MovieClip {com.newgrounds.components.APIConnector} Frame 1Symbol 31 MovieClip {com.newgrounds.components.Preloader}
"textField"Symbol 104 MovieClip {Gay_fla.MedalNameContainer_29} Frame 1Symbol 103 EditableText
"medalPointsText"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 15Symbol 101 EditableText
"medalNameClip"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 15Symbol 104 MovieClip {Gay_fla.MedalNameContainer_29}
"medalIcon"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 23Symbol 50 MovieClip
"label"Symbol 188 MovieClip {Gay_fla.Timeline_47} Frame 1Symbol 186 EditableText
"currentItem"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 1Symbol 188 MovieClip {Gay_fla.Timeline_47}
"listButton"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 1Symbol 193 Button
"item0"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item1"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item2"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item3"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item4"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item5"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item6"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"item7"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10Symbol 188 MovieClip {Gay_fla.Timeline_47}
"rankText"Symbol 207 MovieClip {Gay_fla.Timeline_51} Frame 1Symbol 203 EditableText
"usernameText"Symbol 207 MovieClip {Gay_fla.Timeline_51} Frame 1Symbol 204 EditableText
"scoreText"Symbol 207 MovieClip {Gay_fla.Timeline_51} Frame 1Symbol 205 EditableText
"score0"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score1"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score2"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score3"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score4"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score5"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score6"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score7"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score8"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"score9"Symbol 208 MovieClip {Gay_fla.Timeline_50} Frame 1Symbol 207 MovieClip {Gay_fla.Timeline_51}
"listBox"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 1Symbol 194 MovieClip {Gay_fla.Timeline_46}
"titleText"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 1Symbol 195 EditableText
"nextButton"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 1Symbol 199 Button
"prevButton"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 1Symbol 199 Button
"pageText"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 1Symbol 200 EditableText
"scoreContainer"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 11Symbol 208 MovieClip {Gay_fla.Timeline_50}
"reloadButton"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 21Symbol 216 Button

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.

Labels

"preloader"Frame 1
"title"Frame 2
"instructions"Frame 3
"medals"Frame 4
"game"Frame 5
"endgame"Frame 6
"te_highscores"Frame 7
"tj_highscores"Frame 8
"_up"Symbol 30 MovieClip {Gay_fla.Timeline_13} Frame 1
"_over"Symbol 30 MovieClip {Gay_fla.Timeline_13} Frame 10
"_down"Symbol 30 MovieClip {Gay_fla.Timeline_13} Frame 20
"loading"Symbol 31 MovieClip {com.newgrounds.components.Preloader} Frame 1
"loaded"Symbol 31 MovieClip {com.newgrounds.components.Preloader} Frame 10
"idle"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 1
"loading"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 10
"loaded"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 20
"loadedPlay"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 30
"noBorder"Symbol 62 MovieClip {com.newgrounds.components.FlashAd} Frame 40
"adPreloader"Symbol 63 MovieClip {com.newgrounds.components.APIConnector} Frame 2
"ad"Symbol 63 MovieClip {com.newgrounds.components.APIConnector} Frame 12
"invisible"Symbol 63 MovieClip {com.newgrounds.components.APIConnector} Frame 22
"hidden"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 3
"medalUnlocked"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 10
"unlockComplete"Symbol 114 MovieClip {com.newgrounds.components.MedalPopup} Frame 84
"_up"Symbol 188 MovieClip {Gay_fla.Timeline_47} Frame 1
"_over"Symbol 188 MovieClip {Gay_fla.Timeline_47} Frame 6
"sortUP"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 1
"sortDOWN"Symbol 194 MovieClip {Gay_fla.Timeline_46} Frame 10
"_up"Symbol 207 MovieClip {Gay_fla.Timeline_51} Frame 1
"_over"Symbol 207 MovieClip {Gay_fla.Timeline_51} Frame 5
"loading"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 2
"scores"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 11
"error"Symbol 217 MovieClip {com.newgrounds.components.ScoreBrowser} Frame 21




http://swfchan.com/21/102779/info.shtml
Created: 19/3 -2019 16:40:58 Last modified: 19/3 -2019 16:40:58 Server time: 02/05 -2024 20:20:16