Section 1
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 2
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 3
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 4
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 5
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 6
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 7
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 8
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 9
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 10
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 11
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 12
//AbstractLoader (AbstractLoader)
package {
import flash.events.*;
import flash.display.*;
public class AbstractLoader extends Sprite {
public function AbstractLoader(){
allowDomains();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
protected function onAddedToStage(_arg1:Event):void{
if (_arg1.target == this){
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
createLoader();
};
}
protected function allowDomains():void{
}
protected function createLoader():void{
}
}
}//package
Section 13
//arcadeLoader (arcadeLoader)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.external.*;
public class arcadeLoader extends BaseLoader {
private var errorField:TextField;
private var gameLogo:Bitmap;
public static const origin:String = "newgrounds";
public static const RELEASE:Boolean = true;
public static const gameID:String = "ballracer";
public static var taglineAsset:Class = arcadeLoader_taglineAsset;
public static var vectorLogo:Class = arcadeLoader_vectorLogo;
public static var gameLogoAsset:Class = arcadeLoader_gameLogoAsset;
override protected function buildTagline():void{
tagline = new taglineAsset();
tagline.x = ((indicatorWidth / 2) - (tagline.width / 2));
tagline.y = 52;
tagline.alpha = 0.2;
indicators.addChild(tagline);
}
override protected function onResize(_arg1:Event):void{
super.onResize(_arg1);
gameLogo.y = Math.floor(((stage.stageHeight - gameLogo.height) / 2));
gameLogo.x = Math.floor(((stage.stageWidth / 2) - (gameLogo.width / 2)));
errorField.y = 20;
errorField.width = (stage.stageWidth - 50);
errorField.x = 25;
}
override protected function initProperties():void{
super.initProperties();
}
override protected function load():void{
try {
super.load();
} catch(e:Error) {
errorField.text = e.toString();
};
}
protected function buildErrorField():void{
errorField = new TextField();
var _local1:TextFormat = new TextFormat("_sans", 12, 0xFFFFFF);
_local1.align = TextFormatAlign.CENTER;
errorField.defaultTextFormat = _local1;
addChild(errorField);
errorField.autoSize = TextFieldAutoSize.LEFT;
errorField.multiline = true;
errorField.wordWrap = true;
addChild(errorField);
}
override protected function onSecurityError(_arg1:SecurityErrorEvent):void{
super.onSecurityError(_arg1);
errorField.text = _arg1.text;
}
override protected function onIOError(_arg1:IOErrorEvent):void{
super.onIOError(_arg1);
errorField.text = ((_arg1.type + ": ") + _arg1.text);
}
protected function buildGameLogo():void{
gameLogo = new gameLogoAsset();
addChild(gameLogo);
}
override protected function getIndicatorWidth():Number{
return (Math.min(400, (stage.stageWidth - 30)));
}
override protected function build():void{
super.build();
buildGameLogo();
buildErrorField();
}
override protected function buildLogo():void{
logo = new vectorLogo();
logo.scaleX = (logo.scaleY = (200 / logo.width));
logo.x = ((indicatorWidth / 2) - (logo.width / 2));
logo.y = 70;
var _local1:Sprite = Sprite(Object(logo).fill);
var _local2:Sprite = Sprite(Object(logo).stroke);
_local1.blendMode = BlendMode.SUBTRACT;
_local1.alpha = 0.5;
_local2.blendMode = BlendMode.OVERLAY;
_local2.alpha = 1;
indicators.addChild(logo);
}
override protected function buildLoadURL():void{
var baseURL:String;
var docLoc:String;
var params:* = loaderInfo.parameters;
var key:String = params.key;
try {
docLoc = ExternalInterface.call("document.location.toString");
} catch(e:Error) {
};
if (RELEASE){
baseURL = "http://flashcdn.iminlikewithyou.com/";
} else {
if (((!((docLoc == null))) && ((docLoc.indexOf("flash.dev") > -1)))){
baseURL = "http://flash.dev.iminlikewithyou.com/";
} else {
baseURL = "../../flashsite/bin-debug/";
};
};
var cache:String = String(Math.floor((new Date().time / ((1000 * 60) * 10))));
loadURL = (((((((((((((baseURL + "externalArcade.swf") + "?") + "gameID=") + gameID) + "&") + "origin=") + origin) + "&") + "release=") + RELEASE) + "&") + "cache=") + cache);
}
override protected function onLoadComplete(_arg1:Event):void{
super.onLoadComplete(_arg1);
removeChild(gameLogo);
removeChild(errorField);
}
}
}//package
Section 14
//arcadeLoader_gameLogoAsset (arcadeLoader_gameLogoAsset)
package {
import mx.core.*;
public class arcadeLoader_gameLogoAsset extends BitmapAsset {
}
}//package
Section 15
//arcadeLoader_taglineAsset (arcadeLoader_taglineAsset)
package {
import flash.display.*;
import mx.core.*;
public class arcadeLoader_taglineAsset extends SpriteAsset {
public var stroke:DisplayObject;
public var fill:DisplayObject;
}
}//package
Section 16
//arcadeLoader_vectorLogo (arcadeLoader_vectorLogo)
package {
import flash.display.*;
import mx.core.*;
public class arcadeLoader_vectorLogo extends SpriteAsset {
public var stroke:DisplayObject;
public var fill:DisplayObject;
}
}//package
Section 17
//BaseLoader (BaseLoader)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.filters.*;
public class BaseLoader extends AbstractLoader {
protected var indicatorBar:Sprite;
protected var tagline:Sprite;
protected var loader:Loader;
protected var request:URLRequest;
protected var loadURL:String;
protected var logo:Sprite;
protected var context:LoaderContext;
protected var preloaderBackground:Sprite;
protected var indicators:Sprite;
protected var indicatorTray:Sprite;
protected var preloader:Sprite;
protected var indicatorWidth:Number;// = 500
protected function onSecurityError(_arg1:SecurityErrorEvent):void{
}
protected function buildIndicatorBar():void{
indicatorBar = new Sprite();
renderGradient(indicatorBar, [2574743415, 2576980377, 2579217339], (Math.PI / 2), 0, 0, 30, 14, 14);
renderRoundRect(indicatorBar, 1157627903, 6, 2, 18, 4, 4);
indicatorBar.scale9Grid = new Rectangle(10, 1, 10, 10);
indicatorBar.x = 4;
indicatorBar.y = 4;
indicatorBar.width = 0;
indicatorBar.filters = [new DropShadowFilter(3, 90, 0, 0.9, 10, 10, 1, 1, false, false, false)];
indicators.addChild(indicatorBar);
}
protected function buildIndicatorTray():void{
indicatorTray = new Sprite();
renderRoundRect(indicatorTray, 620756992, 0, 0, indicatorWidth, 22, 22);
renderGradient(indicatorTray, [301989887, 587202559], (Math.PI / 2), 2, 2, (indicatorWidth - 4), 18, 18);
indicators.addChild(indicatorTray);
}
protected function renderRoundRect(_arg1:Sprite, _arg2:uint, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
_arg1.graphics.beginFill(_arg2, getAlpha(_arg2));
_arg1.graphics.drawRoundRect(_arg3, _arg4, _arg5, _arg6, _arg7, _arg7);
_arg1.graphics.endFill();
}
protected function renderStripedWindowBackground(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Boolean=true):void{
if (_arg4){
renderGradient(_arg1, [0x4C4C4C, 0x181818], (Math.PI / 2), 0, 0, _arg2, _arg3);
};
var _local5:Number = 4;
var _local6:Number = 80;
var _local7:Number = 0;
var _local8:Number = 0;
var _local9:Number = 872415231;
var _local10:Array = [872415231, 872415231, 872415231, _local9];
var _local11:Array = [0.015, 0.015, 0, 0];
var _local12:Array = [0, _local6, _local6, 0xFF];
var _local13:Matrix = new Matrix();
_local13.createGradientBox((_local5 * 2), (_local5 * 2), (0.25 * Math.PI), _local7, _local8);
_arg1.graphics.beginGradientFill(GradientType.LINEAR, _local10, _local11, _local12, _local13, SpreadMethod.REPEAT);
_arg1.graphics.drawRect(_local7, _local8, _arg2, _arg3);
_arg1.graphics.endFill();
}
protected function buildLoader():void{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
addChild(loader);
}
protected function buildPreloader():void{
preloader = new Sprite();
indicatorWidth = getIndicatorWidth();
preloaderBackground = new Sprite();
preloader.addChild(preloaderBackground);
indicators = new Sprite();
preloader.addChild(indicators);
buildLogo();
buildTagline();
buildIndicatorTray();
buildIndicatorBar();
addChild(preloader);
}
override protected function allowDomains():void{
super.allowDomains();
Security.allowDomain("http://localhost");
Security.allowDomain("*");
Security.allowDomain("http://flashcdn.iminlikewithyou.com");
Security.allowDomain("http://flash.iminlikewithyou.com");
Security.allowDomain("http://static.iminlikewithyou.com");
}
protected function buildURLRequest():void{
request = new URLRequest(loadURL);
}
protected function onLoadProgress(_arg1:ProgressEvent):void{
var _local2:Number = (_arg1.bytesLoaded / _arg1.bytesTotal);
indicatorBar.width = (_local2 * (indicatorWidth - 8));
}
override protected function createLoader():void{
super.createLoader();
initStage();
initProperties();
build();
stage.addEventListener(Event.RESIZE, onResize);
onResize(null);
load();
}
protected function getAlpha(_arg1:Number):Number{
var _local2:Number = (((_arg1 >>> 24) % 0x0100) / 0xFF);
if (_local2 == 0){
_local2 = 1;
};
return (_local2);
}
protected function buildLogo():void{
}
protected function onLoadComplete(_arg1:Event):void{
preloaderBackground.graphics.clear();
removeChild(preloader);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoadProgress);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
stage.removeEventListener(Event.RESIZE, onResize);
}
protected function buildTagline():void{
}
protected function onIOError(_arg1:IOErrorEvent):void{
}
protected function initStage():void{
stage.frameRate = 60;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.HIGH;
stage.stageFocusRect = false;
}
protected function buildLoaderContext():void{
context = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;
if (loadURL.indexOf("http://") > -1){
context.securityDomain = SecurityDomain.currentDomain;
};
}
protected function buildLoadURL():void{
throw (new Error("Concrete class must implement the get buildLoadURL method."));
}
protected function initProperties():void{
}
protected function renderBackground():void{
renderStripedWindowBackground(preloaderBackground, stage.stageWidth, stage.stageHeight);
}
protected function load():void{
loader.load(request, context);
}
protected function getIndicatorWidth():Number{
throw (new Error("Concrete class must implement the get getIndicatorWidth method."));
}
protected function createGradientFill(_arg1:Graphics, _arg2:Array, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
var _local8:Array = [];
var _local9:Array = [];
var _local10:Array = [];
var _local11:Number = 0;
while (_local11 < _arg2.length) {
_local8.push(_arg2[_local11]);
_local9.push(getAlpha(_arg2[_local11]));
_local10.push(Math.floor((_local11 * (0xFF / (_arg2.length - 1)))));
_local11++;
};
var _local12:Matrix = new Matrix();
_local12.createGradientBox(_arg6, _arg7, _arg3, _arg4, _arg5);
_arg1.beginGradientFill(GradientType.LINEAR, _local8, _local9, _local10, _local12, SpreadMethod.PAD);
}
protected function onResize(_arg1:Event):void{
preloaderBackground.graphics.clear();
renderBackground();
indicators.x = Math.floor(((stage.stageWidth / 2) - (indicatorWidth / 2)));
indicators.y = Math.floor((stage.stageHeight * 0.75));
}
protected function renderGradient(_arg1:Sprite, _arg2:Array, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8=0):void{
var canvas = _arg1;
var colors = _arg2;
var radians = _arg3;
var x = _arg4;
var y = _arg5;
var width = _arg6;
var height = _arg7;
var radius = _arg8;
try {
createGradientFill(canvas.graphics, colors, radians, x, y, width, height);
if ((radius is Number)){
canvas.graphics.drawRoundRect(x, y, width, height, radius, radius);
};
canvas.graphics.endFill();
} catch(e:Error) {
};
}
protected function build():void{
buildLoadURL();
buildLoaderContext();
buildURLRequest();
buildLoader();
buildPreloader();
}
}
}//package