Section 1
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 2
//Cubic (gs.easing.Cubic)
package gs.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 3
//Linear (gs.easing.Linear)
package gs.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package gs.easing
Section 4
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _subTweens:Array;
protected var _initted:Boolean;
public var startTime:int;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _isDisplayObject:Boolean;
protected var _active:Boolean;
public var tweens:Array;
public var vars:Object;
public var initTime:int;
protected var _timeScale:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 8.16;
protected static var _all:Dictionary = new Dictionary();
private static var _sprite:Sprite = new Sprite();
protected static var _curTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _listening:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:*;
super();
if (_arg1 == null){
return;
};
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
_timeScale = ((_arg3.timeScale) || (1));
_active = (((_arg2 == 0)) && ((this.delay == 0)));
this.target = _arg1;
_isDisplayObject = (_arg1 is DisplayObject);
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = (this.vars.alpha > 0);
};
this.tweens = [];
_subTweens = [];
_hst = (_initted = false);
this.initTime = _curTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((_all[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
delete _all[_arg1];
_all[_arg1] = new Dictionary(true);
} else {
if ((((_local4 > 1)) && ((this.delay == 0)))){
overwriteManager.manageOverwrites(this, _all[_arg1]);
};
};
_all[_arg1][this] = this;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
_local5 = this.vars.visible;
if (this.vars.isTV == true){
_local5 = this.vars.exposedProps.visible;
};
if (((((!((_local5 == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = Boolean(_local5);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local7:String;
var _local6:Object = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
_subTweens[_subTweens.length] = _local6;
for (_local7 in _arg4) {
if (typeof(_arg4[_local7]) == "number"){
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:(_arg4[_local7] - _arg3[_local7]), sub:_local6, name:_arg1};
} else {
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:Number(_arg4[_local7]), sub:_local6, name:_arg1};
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local6:Array;
var _local7:ColorTransform;
var _local8:ColorTransform;
var _local9:Object;
var _local5:Object = this.vars;
if (_local5.isTV == true){
_local5 = _local5.exposedProps;
};
if (((((!(_arg1)) && (!((this.delay == 0))))) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, _all[this.target]);
};
if ((this.target is Array)){
_local6 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local6.length) {
if (((!((this.target[_local4] == _local6[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = {o:this.target, p:_local4.toString(), s:this.target[_local4], c:(_local6[_local4] - this.target[_local4]), name:_local4.toString()};
};
_local4++;
};
} else {
if (((((!((typeof(_local5.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local7 = this.target.transform.colorTransform;
_local8 = new ColorTransform();
if (_local5.alpha != undefined){
_local8.alphaMultiplier = _local5.alpha;
delete _local5.alpha;
} else {
_local8.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_local5.tint == null))) && (!((_local5.tint == ""))))) || ((_local5.tint == 0)))))){
_local8.color = _local5.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local7, endColor:_local8});
};
if (((!((_local5.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_local5.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
for (_local3 in _local5) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((((_local3 == "timeScale")) && (!((this.target is _slot1))))))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_local5[_local3]) == "number"){
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:(_local5[_local3] - this.target[_local3]), name:_local3};
} else {
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:Number(_local5[_local3]), name:_local3};
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local9 = this.tweens[_local4];
this.tweens[_local4].s = (_local9.s + _local9.c);
_local9.c = (_local9.c * -1);
_local4--;
};
};
if ((((_local5.visible == true)) && (_isDisplayObject))){
this.target.visible = true;
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (_curTime >= this.startTime){
_active = true;
if (!_initted){
initTweenVals();
} else {
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) / 1000);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = 1;
} else {
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!_initted){
initTweenVals();
};
this.startTime = (_curTime - ((this.duration * 1000) / _timeScale));
render(_curTime);
return;
};
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
if (((!(isNaN(this.vars.autoAlpha))) && ((this.target.alpha == 0)))){
this.target.visible = false;
} else {
if (this.vars.runBackwards != true){
this.target.visible = this.vars.visible;
};
};
};
if (this.vars.persist != true){
removeTween(this);
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
_all[_arg1.target][_arg1] = null;
delete _all[_arg1.target][_arg1];
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function executeAll(_arg1:Event=null):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:Object;
var _local2:uint = (_curTime = getTimer());
if (_listening){
_local3 = _all;
for each (_local4 in _local3) {
for (_local5 in _local4) {
if (((!((_local4[_local5] == undefined))) && (_local4[_local5].active))){
_local4[_local5].render(_local2);
};
};
};
};
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local3:Boolean;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local2:uint;
for (_local4 in _all) {
_local3 = false;
for (_local5 in _all[_local4]) {
_local3 = true;
break;
};
if (!_local3){
delete _all[_local4];
} else {
_local2++;
};
};
if (_local2 == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy(_arg1:Object):void{
var _local2:Number = _arg1.target.progress;
var _local3:Number = (1 - _local2);
var _local4:Object = _arg1.info.color;
var _local5:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local4.redMultiplier * _local3) + (_local5.redMultiplier * _local2)), ((_local4.greenMultiplier * _local3) + (_local5.greenMultiplier * _local2)), ((_local4.blueMultiplier * _local3) + (_local5.blueMultiplier * _local2)), ((_local4.alphaMultiplier * _local3) + (_local5.alphaMultiplier * _local2)), ((_local4.redOffset * _local3) + (_local5.redOffset * _local2)), ((_local4.greenOffset * _local3) + (_local5.greenOffset * _local2)), ((_local4.blueOffset * _local3) + (_local5.blueOffset * _local2)), ((_local4.alphaOffset * _local3) + (_local5.alphaOffset * _local2)));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 5
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 6
//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 7
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 8
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 9
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 10
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 11
//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 12
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 13
//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 14
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_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 15
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 16
//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 17
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 18
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
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 19
//BigagigaBatArmBelow (net.odd1.bobbleheadBaseball.animations.bigagiga.bat.BigagigaBatArmBelow)
package net.odd1.bobbleheadBaseball.animations.bigagiga.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaBatArmBelow extends Animation {
private const ORIGIN_Y:int = -81;
private const ORIGIN_X:int = 28;
public function BigagigaBatArmBelow(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.bat
Section 20
//BigagigaBatArmOver (net.odd1.bobbleheadBaseball.animations.bigagiga.bat.BigagigaBatArmOver)
package net.odd1.bobbleheadBaseball.animations.bigagiga.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaBatArmOver extends Animation {
private const ORIGIN_Y:int = -81;
private const ORIGIN_X:int = 28;
public function BigagigaBatArmOver(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.bat
Section 21
//BigagigaBatArmShow (net.odd1.bobbleheadBaseball.animations.bigagiga.bat.BigagigaBatArmShow)
package net.odd1.bobbleheadBaseball.animations.bigagiga.bat {
import flash.display.*;
public final class BigagigaBatArmShow extends Sprite {
private const ORIGIN_Y:int = -81;
private const ORIGIN_X:int = 28;
public function BigagigaBatArmShow(){
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.bat
Section 22
//BigagigaBatBody (net.odd1.bobbleheadBaseball.animations.bigagiga.bat.BigagigaBatBody)
package net.odd1.bobbleheadBaseball.animations.bigagiga.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaBatBody extends Animation {
private const ORIGIN_Y:int = -97;
private const ORIGIN_X:int = 139;
public function BigagigaBatBody(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.bat
Section 23
//BigagigaCatchCatchBig (net.odd1.bobbleheadBaseball.animations.bigagiga.catcher.BigagigaCatchCatchBig)
package net.odd1.bobbleheadBaseball.animations.bigagiga.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaCatchCatchBig extends Animation {
private const ORIGIN_Y:int = -45;
private const ORIGIN_X:int = 5;
public function BigagigaCatchCatchBig(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.catcher
Section 24
//BigagigaCatchCatchSmall (net.odd1.bobbleheadBaseball.animations.bigagiga.catcher.BigagigaCatchCatchSmall)
package net.odd1.bobbleheadBaseball.animations.bigagiga.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaCatchCatchSmall extends Animation {
private const ORIGIN_Y:int = -35;
private const ORIGIN_X:int = 7;
public function BigagigaCatchCatchSmall(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.catcher
Section 25
//BigagigaPitchPitch (net.odd1.bobbleheadBaseball.animations.bigagiga.pitch.BigagigaPitchPitch)
package net.odd1.bobbleheadBaseball.animations.bigagiga.pitch {
import net.odd1.bobbleheadBaseball.animations.*;
public final class BigagigaPitchPitch extends Animation {
private const ORIGIN_Y:int = -45;
private const ORIGIN_X:int = 12;
public function BigagigaPitchPitch(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.bigagiga.pitch
Section 26
//CaramilkaBatArmBelow (net.odd1.bobbleheadBaseball.animations.caramilka.bat.CaramilkaBatArmBelow)
package net.odd1.bobbleheadBaseball.animations.caramilka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaBatArmBelow extends Animation {
private const ORIGIN_Y:int = -61;
private const ORIGIN_X:int = 58;
public function CaramilkaBatArmBelow(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.bat
Section 27
//CaramilkaBatArmOver (net.odd1.bobbleheadBaseball.animations.caramilka.bat.CaramilkaBatArmOver)
package net.odd1.bobbleheadBaseball.animations.caramilka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaBatArmOver extends Animation {
private const ORIGIN_Y:int = -61;
private const ORIGIN_X:int = 58;
public function CaramilkaBatArmOver(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.bat
Section 28
//CaramilkaBatArmShow (net.odd1.bobbleheadBaseball.animations.caramilka.bat.CaramilkaBatArmShow)
package net.odd1.bobbleheadBaseball.animations.caramilka.bat {
import flash.display.*;
public final class CaramilkaBatArmShow extends Sprite {
private const ORIGIN_Y:int = -61;
private const ORIGIN_X:int = 58;
public function CaramilkaBatArmShow(){
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.bat
Section 29
//CaramilkaBatBody (net.odd1.bobbleheadBaseball.animations.caramilka.bat.CaramilkaBatBody)
package net.odd1.bobbleheadBaseball.animations.caramilka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaBatBody extends Animation {
private const ORIGIN_Y:int = -92;
private const ORIGIN_X:int = 116;
public function CaramilkaBatBody(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.bat
Section 30
//CaramilkaCatchCatchBig (net.odd1.bobbleheadBaseball.animations.caramilka.catcher.CaramilkaCatchCatchBig)
package net.odd1.bobbleheadBaseball.animations.caramilka.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaCatchCatchBig extends Animation {
private const ORIGIN_Y:int = -40;
private const ORIGIN_X:int = 7;
public function CaramilkaCatchCatchBig(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.catcher
Section 31
//CaramilkaCatchCatchSmall (net.odd1.bobbleheadBaseball.animations.caramilka.catcher.CaramilkaCatchCatchSmall)
package net.odd1.bobbleheadBaseball.animations.caramilka.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaCatchCatchSmall extends Animation {
private const ORIGIN_Y:int = -30;
private const ORIGIN_X:int = 0;
public function CaramilkaCatchCatchSmall(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.catcher
Section 32
//CaramilkaPitchPitch (net.odd1.bobbleheadBaseball.animations.caramilka.pitch.CaramilkaPitchPitch)
package net.odd1.bobbleheadBaseball.animations.caramilka.pitch {
import net.odd1.bobbleheadBaseball.animations.*;
public final class CaramilkaPitchPitch extends Animation {
private const ORIGIN_Y:int = -40;
private const ORIGIN_X:int = 0;
public function CaramilkaPitchPitch(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.caramilka.pitch
Section 33
//LimpheadBatArmBelow (net.odd1.bobbleheadBaseball.animations.limphead.bat.LimpheadBatArmBelow)
package net.odd1.bobbleheadBaseball.animations.limphead.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadBatArmBelow extends Animation {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 52;
public function LimpheadBatArmBelow(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.bat
Section 34
//LimpheadBatArmOver (net.odd1.bobbleheadBaseball.animations.limphead.bat.LimpheadBatArmOver)
package net.odd1.bobbleheadBaseball.animations.limphead.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadBatArmOver extends Animation {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 52;
public function LimpheadBatArmOver(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.bat
Section 35
//LimpheadBatArmShow (net.odd1.bobbleheadBaseball.animations.limphead.bat.LimpheadBatArmShow)
package net.odd1.bobbleheadBaseball.animations.limphead.bat {
import flash.display.*;
public final class LimpheadBatArmShow extends Sprite {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 52;
public function LimpheadBatArmShow(){
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.bat
Section 36
//LimpheadBatBody (net.odd1.bobbleheadBaseball.animations.limphead.bat.LimpheadBatBody)
package net.odd1.bobbleheadBaseball.animations.limphead.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadBatBody extends Animation {
private const ORIGIN_Y:int = -140;
private const ORIGIN_X:int = 120;
public function LimpheadBatBody(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.bat
Section 37
//LimpheadCatchCatchBig (net.odd1.bobbleheadBaseball.animations.limphead.catcher.LimpheadCatchCatchBig)
package net.odd1.bobbleheadBaseball.animations.limphead.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadCatchCatchBig extends Animation {
private const ORIGIN_Y:int = -50;
private const ORIGIN_X:int = 15;
public function LimpheadCatchCatchBig(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.catcher
Section 38
//LimpheadCatchCatchSmall (net.odd1.bobbleheadBaseball.animations.limphead.catcher.LimpheadCatchCatchSmall)
package net.odd1.bobbleheadBaseball.animations.limphead.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadCatchCatchSmall extends Animation {
private const ORIGIN_Y:int = -44;
private const ORIGIN_X:int = 12;
public function LimpheadCatchCatchSmall(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.catcher
Section 39
//LimpheadPitchPitch (net.odd1.bobbleheadBaseball.animations.limphead.pitch.LimpheadPitchPitch)
package net.odd1.bobbleheadBaseball.animations.limphead.pitch {
import net.odd1.bobbleheadBaseball.animations.*;
public final class LimpheadPitchPitch extends Animation {
private const ORIGIN_Y:int = -60;
private const ORIGIN_X:int = 0;
public function LimpheadPitchPitch(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.limphead.pitch
Section 40
//MotafukaBatArmBelow (net.odd1.bobbleheadBaseball.animations.motafuka.bat.MotafukaBatArmBelow)
package net.odd1.bobbleheadBaseball.animations.motafuka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaBatArmBelow extends Animation {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 50;
public function MotafukaBatArmBelow(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.bat
Section 41
//MotafukaBatArmOver (net.odd1.bobbleheadBaseball.animations.motafuka.bat.MotafukaBatArmOver)
package net.odd1.bobbleheadBaseball.animations.motafuka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaBatArmOver extends Animation {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 50;
public function MotafukaBatArmOver(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.bat
Section 42
//MotafukaBatArmShow (net.odd1.bobbleheadBaseball.animations.motafuka.bat.MotafukaBatArmShow)
package net.odd1.bobbleheadBaseball.animations.motafuka.bat {
import flash.display.*;
public final class MotafukaBatArmShow extends Sprite {
private const ORIGIN_Y:int = -85;
private const ORIGIN_X:int = 50;
public function MotafukaBatArmShow(){
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.bat
Section 43
//MotafukaBatBody (net.odd1.bobbleheadBaseball.animations.motafuka.bat.MotafukaBatBody)
package net.odd1.bobbleheadBaseball.animations.motafuka.bat {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaBatBody extends Animation {
private const ORIGIN_Y:int = -125;
private const ORIGIN_X:int = 145;
public function MotafukaBatBody(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.bat
Section 44
//MotafukaCatchCatchBig (net.odd1.bobbleheadBaseball.animations.motafuka.catcher.MotafukaCatchCatchBig)
package net.odd1.bobbleheadBaseball.animations.motafuka.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaCatchCatchBig extends Animation {
private const ORIGIN_Y:int = -47;
private const ORIGIN_X:int = 18;
public function MotafukaCatchCatchBig(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.catcher
Section 45
//MotafukaCatchCatchSmall (net.odd1.bobbleheadBaseball.animations.motafuka.catcher.MotafukaCatchCatchSmall)
package net.odd1.bobbleheadBaseball.animations.motafuka.catcher {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaCatchCatchSmall extends Animation {
private const ORIGIN_Y:int = -42;
private const ORIGIN_X:int = 12;
public function MotafukaCatchCatchSmall(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.catcher
Section 46
//MotafukaPitchPitch (net.odd1.bobbleheadBaseball.animations.motafuka.pitch.MotafukaPitchPitch)
package net.odd1.bobbleheadBaseball.animations.motafuka.pitch {
import net.odd1.bobbleheadBaseball.animations.*;
public final class MotafukaPitchPitch extends Animation {
private const ORIGIN_Y:int = -50;
private const ORIGIN_X:int = 0;
public function MotafukaPitchPitch(_arg1:int){
super(_arg1);
x = ORIGIN_X;
y = ORIGIN_Y;
}
}
}//package net.odd1.bobbleheadBaseball.animations.motafuka.pitch
Section 47
//Animation (net.odd1.bobbleheadBaseball.animations.Animation)
package net.odd1.bobbleheadBaseball.animations {
import net.odd1.bobbleheadBaseball.events.*;
import flash.display.*;
import flash.utils.*;
public class Animation extends MovieClip implements IAnimation {
private var playFrame:int;
public var isPlaying:Boolean;
public var deltaTime:int;
private var fps:int;
private var time:int;
private var stopFrame:int;
private var msPerFrame:int;
public function Animation(_arg1:int){
playFrame = currentFrame;
setFPS(_arg1);
stopFrame = -1;
time = getTimer();
stop();
}
public function destroy():void{
stopAnim();
}
public function setFPS(_arg1:int):void{
this.fps = _arg1;
msPerFrame = (1000 / _arg1);
}
public function stopAnim():void{
isPlaying = false;
deltaTime = 0;
dispatchEvent(new AnimationEvent(AnimationEvent.STOP));
}
public function getPercFrame():Number{
return (((deltaTime % msPerFrame) / msPerFrame));
}
public function playAnim(_arg1:int=-1, _arg2:int=-1):void{
stopFrame = _arg1;
if (_arg2 != -1){
gotoAndStop((_arg2 + 1));
};
if (!isPlaying){
isPlaying = true;
time = getTimer();
playFrame = currentFrame;
dispatchEvent(new AnimationEvent(AnimationEvent.PLAY));
};
}
public function render(_arg1:Number):void{
var _local2:int;
var _local3:int;
if (isPlaying){
deltaTime = (getTimer() - time);
_local2 = (playFrame + ((deltaTime % (msPerFrame * totalFrames)) / msPerFrame));
if (stopFrame != -1){
if (playFrame < stopFrame){
_local3 = (stopFrame - playFrame);
} else {
_local3 = ((totalFrames - playFrame) + stopFrame);
};
if (deltaTime > (_local3 * msPerFrame)){
_local2 = stopFrame;
gotoAndStop((_local2 + 1));
stopAnim();
};
};
if (currentFrame != (_local2 + 1)){
gotoAndStop((_local2 + 1));
};
};
}
}
}//package net.odd1.bobbleheadBaseball.animations
Section 48
//DisplayAnimation (net.odd1.bobbleheadBaseball.animations.DisplayAnimation)
package net.odd1.bobbleheadBaseball.animations {
import flash.display.*;
public class DisplayAnimation extends Sprite implements IAnimation {
private var animationLayer:Sprite;
private var animations:Array;
public function DisplayAnimation(_arg1:Array){
var _local2:Animation;
super();
animationLayer = new Sprite();
this.animations = _arg1;
for each (_local2 in _arg1) {
animationLayer.addChild(_local2);
};
addChild(animationLayer);
}
public function playLabel(_arg1:String):void{
var _local2:Animation;
var _local3:FrameLabel;
var _local4:int;
var _local5:int;
for each (_local2 in animations) {
_local5 = _local2.currentLabels.length;
_local4 = 0;
while (_local4 < _local5) {
_local3 = _local2.currentLabels[_local4];
if (_local3.name == _arg1){
if (_local4 == (_local5 - 1)){
_local2.playAnim(0, _local3.frame);
} else {
_local2.playAnim((FrameLabel(_local2.currentLabels[(_local4 + 1)]).frame - 1), (_local3.frame - 1));
};
break;
};
_local4++;
};
};
}
public function destroy():void{
var _local1:Animation;
for each (_local1 in animations) {
_local1.destroy();
animationLayer.removeChild(_local1);
};
removeChild(animationLayer);
animationLayer = null;
}
public function stopAnim():void{
var _local1:Animation;
for each (_local1 in animations) {
_local1.stopAnim();
};
}
public function isPlaying():Boolean{
if (animations.length > 0){
return (Animation(animations[0]).isPlaying);
};
return (false);
}
public function setFPS(_arg1:int):void{
var _local2:Animation;
for each (_local2 in animations) {
_local2.setFPS(_arg1);
};
}
public function getCurrentPerc(_arg1:int=-1):Number{
var _local2:Animation;
_local2 = Animation(animations[0]);
if (_arg1 == -1){
_arg1 = _local2.totalFrames;
};
if (animations.length > 0){
return ((((_local2.currentFrame - 1) + _local2.getPercFrame()) / _arg1));
};
return (-1);
}
public function getCurrentFrame():int{
if (animations.length > 0){
return (Animation(animations[0]).currentFrame);
};
return (-1);
}
public function getCurrentPercFrame():Number{
if (animations.length > 0){
return (Animation(animations[0]).getPercFrame());
};
return (-1);
}
public function playAnim(_arg1:int=-1, _arg2:int=-1):void{
var _local3:Animation;
for each (_local3 in animations) {
_local3.playAnim(_arg1, _arg2);
};
}
public function getCurrentTime():int{
if (animations.length > 0){
return (Animation(animations[0]).deltaTime);
};
return (-1);
}
public function render(_arg1:Number):void{
var _local2:Animation;
for each (_local2 in animations) {
_local2.render(_arg1);
};
}
}
}//package net.odd1.bobbleheadBaseball.animations
Section 49
//IAnimation (net.odd1.bobbleheadBaseball.animations.IAnimation)
package net.odd1.bobbleheadBaseball.animations {
public interface IAnimation {
function destroy():void;
function stopAnim():void;
function playAnim(_arg1:int=-1, _arg2:int=-1):void;
function render(_arg1:Number):void;
}
}//package net.odd1.bobbleheadBaseball.animations
Section 50
//Background (net.odd1.bobbleheadBaseball.backgrounds.Background)
package net.odd1.bobbleheadBaseball.backgrounds {
import flash.display.*;
import flash.text.*;
public class Background extends Sprite {
public var strikes:TextField;
public var balls:TextField;
public var points:TextField;
public function textfieldScore(_arg1:TextField, _arg2:int):void{
var _local3:TextFormat;
_local3 = new TextFormat("Score", _arg2);
_arg1.defaultTextFormat = _local3;
_arg1.embedFonts = true;
_arg1.mouseEnabled = false;
}
public function destroy():void{
var _local1:int;
var _local2:int;
_local1 = numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeChildAt(0);
_local2++;
};
}
}
}//package net.odd1.bobbleheadBaseball.backgrounds
Section 51
//Background0 (net.odd1.bobbleheadBaseball.backgrounds.Background0)
package net.odd1.bobbleheadBaseball.backgrounds {
public class Background0 extends Background {
public function Background0(){
textfieldScore(balls, 16);
textfieldScore(strikes, 16);
textfieldScore(points, 13);
}
}
}//package net.odd1.bobbleheadBaseball.backgrounds
Section 52
//Background1 (net.odd1.bobbleheadBaseball.backgrounds.Background1)
package net.odd1.bobbleheadBaseball.backgrounds {
public class Background1 extends Background {
public function Background1(){
textfieldScore(balls, 11);
textfieldScore(strikes, 11);
textfieldScore(points, 12);
}
}
}//package net.odd1.bobbleheadBaseball.backgrounds
Section 53
//Background2 (net.odd1.bobbleheadBaseball.backgrounds.Background2)
package net.odd1.bobbleheadBaseball.backgrounds {
public class Background2 extends Background {
public function Background2(){
textfieldScore(balls, 9);
textfieldScore(strikes, 9);
textfieldScore(points, 8);
}
}
}//package net.odd1.bobbleheadBaseball.backgrounds
Section 54
//Background3 (net.odd1.bobbleheadBaseball.backgrounds.Background3)
package net.odd1.bobbleheadBaseball.backgrounds {
public class Background3 extends Background {
public function Background3(){
textfieldScore(balls, 9);
textfieldScore(strikes, 9);
textfieldScore(points, 8);
}
}
}//package net.odd1.bobbleheadBaseball.backgrounds
Section 55
//BigagigaBat (net.odd1.bobbleheadBaseball.characters.bigagiga.BigagigaBat)
package net.odd1.bobbleheadBaseball.characters.bigagiga {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.*;
import net.odd1.bobbleheadBaseball.animations.bigagiga.bat.*;
public final class BigagigaBat extends Batter {
private const FPS:int = 3;
public function BigagigaBat(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
var _local4:Animation;
var _local5:Animation;
var _local6:Animation;
_local4 = new BigagigaBatBody(FPS);
_local5 = new BigagigaBatArmBelow(FPS);
_local6 = new BigagigaBatArmOver(FPS);
super([_local5, _local4, _local6], [_local5, _local6], new BigagigaBatArmShow(), _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.bigagiga
Section 56
//BigagigaCatchBig (net.odd1.bobbleheadBaseball.characters.bigagiga.BigagigaCatchBig)
package net.odd1.bobbleheadBaseball.characters.bigagiga {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.bigagiga.catcher.*;
public final class BigagigaCatchBig extends Catcher {
private static const FPS:int = 60;
public function BigagigaCatchBig(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new BigagigaCatchCatchBig(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.bigagiga
Section 57
//BigagigaCatchSmall (net.odd1.bobbleheadBaseball.characters.bigagiga.BigagigaCatchSmall)
package net.odd1.bobbleheadBaseball.characters.bigagiga {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.bigagiga.catcher.*;
public final class BigagigaCatchSmall extends Catcher {
private static const FPS:int = 60;
public function BigagigaCatchSmall(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new BigagigaCatchCatchSmall(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.bigagiga
Section 58
//BigagigaPitch (net.odd1.bobbleheadBaseball.characters.bigagiga.BigagigaPitch)
package net.odd1.bobbleheadBaseball.characters.bigagiga {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.bigagiga.pitch.*;
public final class BigagigaPitch extends Pitcher {
private static const FPS:int = 60;
public function BigagigaPitch(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new BigagigaPitchPitch(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.bigagiga
Section 59
//CaramilkaBat (net.odd1.bobbleheadBaseball.characters.caramilka.CaramilkaBat)
package net.odd1.bobbleheadBaseball.characters.caramilka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.*;
import net.odd1.bobbleheadBaseball.animations.caramilka.bat.*;
public final class CaramilkaBat extends Batter {
private const FPS:int = 3;
public function CaramilkaBat(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
var _local4:Animation;
var _local5:Animation;
var _local6:Animation;
_local4 = new CaramilkaBatBody(FPS);
_local5 = new CaramilkaBatArmBelow(FPS);
_local6 = new CaramilkaBatArmOver(FPS);
super([_local5, _local4, _local6], [_local5, _local6], new CaramilkaBatArmShow(), _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.caramilka
Section 60
//CaramilkaCatchBig (net.odd1.bobbleheadBaseball.characters.caramilka.CaramilkaCatchBig)
package net.odd1.bobbleheadBaseball.characters.caramilka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.caramilka.catcher.*;
public final class CaramilkaCatchBig extends Catcher {
private static const FPS:int = 60;
public function CaramilkaCatchBig(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new CaramilkaCatchCatchBig(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.caramilka
Section 61
//CaramilkaCatchSmall (net.odd1.bobbleheadBaseball.characters.caramilka.CaramilkaCatchSmall)
package net.odd1.bobbleheadBaseball.characters.caramilka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.caramilka.catcher.*;
public final class CaramilkaCatchSmall extends Catcher {
private static const FPS:int = 60;
public function CaramilkaCatchSmall(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new CaramilkaCatchCatchSmall(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.caramilka
Section 62
//CaramilkaPitch (net.odd1.bobbleheadBaseball.characters.caramilka.CaramilkaPitch)
package net.odd1.bobbleheadBaseball.characters.caramilka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.caramilka.pitch.*;
public final class CaramilkaPitch extends Pitcher {
private static const FPS:int = 60;
public function CaramilkaPitch(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new CaramilkaPitchPitch(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.caramilka
Section 63
//LimpheadBat (net.odd1.bobbleheadBaseball.characters.limphead.LimpheadBat)
package net.odd1.bobbleheadBaseball.characters.limphead {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.*;
import net.odd1.bobbleheadBaseball.animations.limphead.bat.*;
public final class LimpheadBat extends Batter {
private const FPS:int = 3;
public function LimpheadBat(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
var _local4:Animation;
var _local5:Animation;
var _local6:Animation;
_local4 = new LimpheadBatBody(FPS);
_local5 = new LimpheadBatArmBelow(FPS);
_local6 = new LimpheadBatArmOver(FPS);
super([_local5, _local4, _local6], [_local5, _local6], new LimpheadBatArmShow(), _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.limphead
Section 64
//LimpheadCatchBig (net.odd1.bobbleheadBaseball.characters.limphead.LimpheadCatchBig)
package net.odd1.bobbleheadBaseball.characters.limphead {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.limphead.catcher.*;
public final class LimpheadCatchBig extends Catcher {
private static const FPS:int = 60;
public function LimpheadCatchBig(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new LimpheadCatchCatchBig(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.limphead
Section 65
//LimpheadCatchSmall (net.odd1.bobbleheadBaseball.characters.limphead.LimpheadCatchSmall)
package net.odd1.bobbleheadBaseball.characters.limphead {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.limphead.catcher.*;
public final class LimpheadCatchSmall extends Catcher {
private static const FPS:int = 60;
public function LimpheadCatchSmall(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new LimpheadCatchCatchSmall(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.limphead
Section 66
//LimpheadPitch (net.odd1.bobbleheadBaseball.characters.limphead.LimpheadPitch)
package net.odd1.bobbleheadBaseball.characters.limphead {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.limphead.pitch.*;
public final class LimpheadPitch extends Pitcher {
private static const FPS:int = 60;
public function LimpheadPitch(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new LimpheadPitchPitch(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.limphead
Section 67
//MotafukaBat (net.odd1.bobbleheadBaseball.characters.motafuka.MotafukaBat)
package net.odd1.bobbleheadBaseball.characters.motafuka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.*;
import net.odd1.bobbleheadBaseball.animations.motafuka.bat.*;
public final class MotafukaBat extends Batter {
private const FPS:int = 3;
public function MotafukaBat(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
var _local4:Animation;
var _local5:Animation;
var _local6:Animation;
_local4 = new MotafukaBatBody(FPS);
_local5 = new MotafukaBatArmBelow(FPS);
_local6 = new MotafukaBatArmOver(FPS);
super([_local5, _local4, _local6], [_local5, _local6], new MotafukaBatArmShow(), _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.motafuka
Section 68
//MotafukaCatchBig (net.odd1.bobbleheadBaseball.characters.motafuka.MotafukaCatchBig)
package net.odd1.bobbleheadBaseball.characters.motafuka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.motafuka.catcher.*;
public final class MotafukaCatchBig extends Catcher {
private static const FPS:int = 60;
public function MotafukaCatchBig(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new MotafukaCatchCatchBig(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.motafuka
Section 69
//MotafukaCatchSmall (net.odd1.bobbleheadBaseball.characters.motafuka.MotafukaCatchSmall)
package net.odd1.bobbleheadBaseball.characters.motafuka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.motafuka.catcher.*;
public final class MotafukaCatchSmall extends Catcher {
private static const FPS:int = 60;
public function MotafukaCatchSmall(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new MotafukaCatchCatchSmall(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.motafuka
Section 70
//MotafukaPitch (net.odd1.bobbleheadBaseball.characters.motafuka.MotafukaPitch)
package net.odd1.bobbleheadBaseball.characters.motafuka {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.animations.motafuka.pitch.*;
public final class MotafukaPitch extends Pitcher {
private static const FPS:int = 60;
public function MotafukaPitch(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super([new MotafukaPitchPitch(FPS)], _arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.characters.motafuka
Section 71
//Batter (net.odd1.bobbleheadBaseball.characters.Batter)
package net.odd1.bobbleheadBaseball.characters {
import flash.display.*;
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.animations.*;
public class Batter extends Sprite3D implements IAnimation {
private const SHOW_TRANSITION:Number = 0.05;
private const ALPHA_SHOW:Number = 0.25;
public var animation:DisplayAnimation;
private var bat:Array;
public var show:Sprite;
public function Batter(_arg1:Array, _arg2:Array, _arg3:Sprite, _arg4:Engine3D, _arg5:Vector3D=null, _arg6:Vector3D=null){
super(_arg4, _arg5, _arg6);
this.bat = _arg2;
this.show = _arg3;
_arg3.alpha = ALPHA_SHOW;
addChild(_arg3);
animation = new DisplayAnimation(_arg1);
addChild(animation);
}
public function rotateBat(_arg1:Number, _arg2:Number):void{
var _local3:Animation;
for each (_local3 in bat) {
_local3.rotation = (_local3.rotation + ((_arg1 - _local3.rotation) / (1 + (SHOW_TRANSITION / _arg2))));
show.rotation = (show.rotation + ((_arg1 - show.rotation) / (1 + (SHOW_TRANSITION / _arg2))));
};
}
public function playAnim(_arg1:int=-1, _arg2:int=-1):void{
animation.playAnim(_arg1, _arg2);
}
public function destroy():void{
bat = null;
animation.destroy();
}
public function stopAnim():void{
animation.stopAnim();
}
public function render(_arg1:Number):void{
animation.render(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.characters
Section 72
//Catcher (net.odd1.bobbleheadBaseball.characters.Catcher)
package net.odd1.bobbleheadBaseball.characters {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.animations.*;
public class Catcher extends Sprite3D implements IAnimation {
private const DOWN:String = "down";
private const JUMP:String = "jump";
private const UP:String = "up";
public var animation:DisplayAnimation;
public function Catcher(_arg1:Array, _arg2:Engine3D, _arg3:Vector3D=null, _arg4:Vector3D=null){
super(_arg2, _arg3, _arg4);
animation = new DisplayAnimation(_arg1);
addChild(animation);
}
public function destroy():void{
animation.destroy();
}
public function playAnim(_arg1:int=-1, _arg2:int=-1):void{
animation.playAnim(_arg1, _arg2);
}
public function playJump():void{
animation.playLabel(JUMP);
}
public function playUp():void{
animation.playLabel(UP);
}
public function render(_arg1:Number):void{
animation.render(_arg1);
}
public function stopAnim():void{
animation.stopAnim();
}
public function playDown():void{
animation.playLabel(DOWN);
}
}
}//package net.odd1.bobbleheadBaseball.characters
Section 73
//Pitcher (net.odd1.bobbleheadBaseball.characters.Pitcher)
package net.odd1.bobbleheadBaseball.characters {
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.animations.*;
public class Pitcher extends Sprite3D implements IAnimation {
public var animation:DisplayAnimation;
public function Pitcher(_arg1:Array, _arg2:Engine3D, _arg3:Vector3D=null, _arg4:Vector3D=null){
super(_arg2, _arg3, _arg4);
animation = new DisplayAnimation(_arg1);
addChild(animation);
}
public function destroy():void{
animation.destroy();
}
public function render(_arg1:Number):void{
animation.render(_arg1);
}
public function stopAnim():void{
animation.stopAnim();
}
public function playAnim(_arg1:int=-1, _arg2:int=-1):void{
animation.playAnim(_arg1, _arg2);
}
}
}//package net.odd1.bobbleheadBaseball.characters
Section 74
//Data (net.odd1.bobbleheadBaseball.data.Data)
package net.odd1.bobbleheadBaseball.data {
import net.odd1.bobbleheadBaseball.events.*;
import flash.events.*;
import flash.net.*;
public class Data extends URLLoader {
private var index:int;
public var loadedData:Array;
private var url:Array;
public function Data(_arg1:Array, _arg2:String){
index = 0;
this.url = _arg1;
dataFormat = _arg2;
loadedData = [];
loadNextData();
addEventListener(Event.COMPLETE, completeHandler);
}
private function completeHandler(_arg1:Event):void{
dispatchEvent(new DataEvent(DataEvent.DATA_COMPLETE));
loadNextData();
}
private function loadNextData():void{
if (index < url.length){
load(new URLRequest(url[index++]));
} else {
index = -1;
url = null;
dispatchEvent(new DataEvent(DataEvent.LOAD_COMPLETE));
removeEventListener(Event.COMPLETE, completeHandler);
loadedData = null;
};
}
}
}//package net.odd1.bobbleheadBaseball.data
Section 75
//XMLLoader (net.odd1.bobbleheadBaseball.data.XMLLoader)
package net.odd1.bobbleheadBaseball.data {
import net.odd1.bobbleheadBaseball.events.*;
import flash.net.*;
public final class XMLLoader extends Data {
public function XMLLoader(_arg1:Array){
super(_arg1, URLLoaderDataFormat.TEXT);
addEventListener(DataEvent.DATA_COMPLETE, dataCompleteHandler);
addEventListener(DataEvent.LOAD_COMPLETE, loadCompleteHandler);
}
private function loadCompleteHandler(_arg1:DataEvent):void{
removeEventListener(DataEvent.DATA_COMPLETE, dataCompleteHandler);
removeEventListener(DataEvent.LOAD_COMPLETE, loadCompleteHandler);
}
private function dataCompleteHandler(_arg1:DataEvent):void{
loadedData.push(new XML(data));
}
}
}//package net.odd1.bobbleheadBaseball.data
Section 76
//AnimationEvent (net.odd1.bobbleheadBaseball.events.AnimationEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
public final class AnimationEvent extends Event {
public static const STOP:String = "animationStop";
public static const PLAY:String = "animationPlay";
public function AnimationEvent(_arg1:String){
super(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 77
//DataEvent (net.odd1.bobbleheadBaseball.events.DataEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
public final class DataEvent extends Event {
public static const LOAD_COMPLETE:String = "dataLoadComplete";
public static const DATA_COMPLETE:String = "dataComplete";
public function DataEvent(_arg1:String){
super(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 78
//PopupEvent (net.odd1.bobbleheadBaseball.events.PopupEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
public final class PopupEvent extends Event {
public static const FINISH:String = "popupFinish";
public function PopupEvent(_arg1:String){
super(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 79
//ScreenEvent (net.odd1.bobbleheadBaseball.events.ScreenEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
import net.odd1.bobbleheadBaseball.transitions.*;
public final class ScreenEvent extends Event {
public var transition:Transition;
public var nextScreen:int;
public static const QUIT:String = "screenQuit";
public function ScreenEvent(_arg1:String, _arg2:int=-1, _arg3:Transition=null){
super(_arg1);
this.nextScreen = _arg2;
this.transition = _arg3;
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 80
//SplashEvent (net.odd1.bobbleheadBaseball.events.SplashEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
public final class SplashEvent extends Event {
public static const END:String = "splashEnd";
public function SplashEvent(_arg1:String){
super(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 81
//TransitionEvent (net.odd1.bobbleheadBaseball.events.TransitionEvent)
package net.odd1.bobbleheadBaseball.events {
import flash.events.*;
public final class TransitionEvent extends Event {
public static const FINISH:String = "transitionFinish";
public function TransitionEvent(_arg1:String){
super(_arg1);
}
}
}//package net.odd1.bobbleheadBaseball.events
Section 82
//BallFlash (net.odd1.bobbleheadBaseball.flash.BallFlash)
package net.odd1.bobbleheadBaseball.flash {
import flash.display.*;
public class BallFlash extends Sprite {
}
}//package net.odd1.bobbleheadBaseball.flash
Section 83
//CharactersFlash (net.odd1.bobbleheadBaseball.flash.CharactersFlash)
package net.odd1.bobbleheadBaseball.flash {
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import flash.net.*;
import flash.media.*;
import net.odd1.bobbleheadBaseball.game.*;
public class CharactersFlash extends Sprite {
private const MOUSE_OVER:String = "on";
private const MOUSE_OUT:String = "off";
public var btn_chilleux:MovieClip;
public var fx_line1:MovieClip;
public var fx_line2:MovieClip;
public var fx_line3:MovieClip;
public var fx_line4:MovieClip;
public var title:MovieClip;
public var choose:MovieClip;
public var btn_girl:MovieClip;
public var btn_bigBlack:MovieClip;
public var characterSelected:int;
private var soundManager:SoundManager;
public var agButton:SimpleButton;
public var odd1:MovieClip;
public var btn_affro:MovieClip;
public var btn_start:MovieClip;
public function CharactersFlash(_arg1:SoundManager){
this.soundManager = _arg1;
characterSelected = -1;
odd1.useHandCursor = true;
odd1.buttonMode = true;
btn_affro.stop();
btn_chilleux.stop();
btn_girl.stop();
btn_bigBlack.stop();
btn_start.stop();
fx_line1.stop();
fx_line2.stop();
fx_line3.stop();
fx_line4.stop();
title.mouseEnabled = false;
title.mouseChildren = false;
choose.mouseEnabled = false;
choose.mouseChildren = false;
btn_affro.mouseEnabled = false;
btn_affro.mouseChildren = false;
btn_chilleux.mouseEnabled = false;
btn_chilleux.mouseChildren = false;
btn_girl.mouseEnabled = false;
btn_girl.mouseChildren = false;
btn_bigBlack.mouseEnabled = false;
btn_bigBlack.mouseChildren = false;
listeners();
charSelection();
}
private function agHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/"), "_blank");
}
private function listeners():void{
btn_start.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_start.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_start.useHandCursor = true;
btn_start.buttonMode = true;
fx_line1.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line1.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line1.addEventListener(MouseEvent.CLICK, char01_clickHandler);
fx_line1.useHandCursor = true;
fx_line1.buttonMode = true;
fx_line2.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line2.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line2.addEventListener(MouseEvent.CLICK, char02_clickHandler);
fx_line2.useHandCursor = true;
fx_line2.buttonMode = true;
fx_line3.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line3.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line3.addEventListener(MouseEvent.CLICK, char03_clickHandler);
fx_line3.useHandCursor = true;
fx_line3.buttonMode = true;
fx_line4.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line4.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line4.addEventListener(MouseEvent.CLICK, char04_clickHandler);
fx_line4.useHandCursor = true;
fx_line4.buttonMode = true;
odd1.addEventListener(MouseEvent.CLICK, odd1Handler);
agButton.addEventListener(MouseEvent.CLICK, agHandler);
}
private function char01_clickHandler(_arg1:MouseEvent):void{
characterSelected = 1;
charSelection();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
}
private function odd1Handler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.odd1.net/"), "_blank");
}
private function charSelection():void{
switch (characterSelected){
case 1:
btn_affro.splash.visible = true;
btn_affro.shadowChar.visible = false;
btn_chilleux.splash.visible = false;
btn_chilleux.shadowChar.visible = true;
btn_girl.splash.visible = false;
btn_girl.shadowChar.visible = true;
btn_bigBlack.splash.visible = false;
btn_bigBlack.shadowChar.visible = true;
break;
case 2:
btn_affro.splash.visible = false;
btn_affro.shadowChar.visible = true;
btn_chilleux.splash.visible = true;
btn_chilleux.shadowChar.visible = false;
btn_girl.splash.visible = false;
btn_girl.shadowChar.visible = true;
btn_bigBlack.splash.visible = false;
btn_bigBlack.shadowChar.visible = true;
break;
case 3:
btn_affro.splash.visible = false;
btn_affro.shadowChar.visible = true;
btn_chilleux.splash.visible = false;
btn_chilleux.shadowChar.visible = true;
btn_girl.splash.visible = true;
btn_girl.shadowChar.visible = false;
btn_bigBlack.splash.visible = false;
btn_bigBlack.shadowChar.visible = true;
break;
case 4:
btn_affro.splash.visible = false;
btn_affro.shadowChar.visible = true;
btn_chilleux.splash.visible = false;
btn_chilleux.shadowChar.visible = true;
btn_girl.splash.visible = false;
btn_girl.shadowChar.visible = true;
btn_bigBlack.splash.visible = true;
btn_bigBlack.shadowChar.visible = false;
break;
default:
btn_affro.splash.visible = false;
btn_affro.shadowChar.visible = false;
btn_chilleux.splash.visible = false;
btn_chilleux.shadowChar.visible = false;
btn_girl.splash.visible = false;
btn_girl.shadowChar.visible = false;
btn_bigBlack.splash.visible = false;
btn_bigBlack.shadowChar.visible = false;
break;
};
}
private function char03_clickHandler(_arg1:MouseEvent):void{
characterSelected = 3;
charSelection();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
}
private function mouseOutHandler(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
_local2.gotoAndStop(MOUSE_OUT);
}
private function char04_clickHandler(_arg1:MouseEvent):void{
characterSelected = 4;
charSelection();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
}
private function char02_clickHandler(_arg1:MouseEvent):void{
characterSelected = 2;
charSelection();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
}
private function mouseOverHandler(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
_local2.gotoAndStop(MOUSE_OVER);
}
public function destroy():void{
var _local1:int;
var _local2:int;
btn_start.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_start.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line1.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line1.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line1.removeEventListener(MouseEvent.CLICK, char01_clickHandler);
fx_line2.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line2.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line2.removeEventListener(MouseEvent.CLICK, char02_clickHandler);
fx_line3.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line3.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line3.removeEventListener(MouseEvent.CLICK, char03_clickHandler);
fx_line4.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
fx_line4.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
fx_line4.removeEventListener(MouseEvent.CLICK, char04_clickHandler);
odd1.removeEventListener(MouseEvent.CLICK, odd1Handler);
agButton.removeEventListener(MouseEvent.CLICK, agHandler);
_local1 = numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeChildAt(0);
_local2++;
};
}
}
}//package net.odd1.bobbleheadBaseball.flash
Section 84
//LevelsFlash (net.odd1.bobbleheadBaseball.flash.LevelsFlash)
package net.odd1.bobbleheadBaseball.flash {
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import gs.*;
import net.odd1.bobbleheadBaseball.game.*;
import gs.easing.*;
import flash.filters.*;
public class LevelsFlash extends Sprite {
private const TWEEN_DURATION:Number = 0.75;
private const MAX_LEVEL:int = 3;
private const TWEEN_WIDTH:int = 300;
private const MOUSE_OVER:String = "on";
private const MOUSE_OUT:String = "off";
public var maxLevel:int;
public var strikes:TextField;
public var hs:MovieClip;
public var btn_rightArrow:MovieClip;
public var mute:MovieClip;
public var sound:MovieClip;
public var btn_leftArrow:MovieClip;
public var homeruns:TextField;
public var check0:MovieClip;
public var selectedLevel:int;
public var check2:MovieClip;
public var btn_go:MovieClip;
public var music:MovieClip;
public var totalScore:TextField;
private var soundManager:SoundManager;
public var highscore:TextField;
private var startingX:int;
public var hits:TextField;
public var help:MovieClip;
public var items:TextField;
public var check1:MovieClip;
public var task2:TextField;
public var task0:TextField;
public var odd1:MovieClip;
public var question:MovieClip;
public var btn_back:MovieClip;
public var balls:TextField;
public var task1:TextField;
public var levels:MovieClip;
public var cr:MovieClip;
public var agButton:SimpleButton;
public var credit:MovieClip;
public function LevelsFlash(_arg1:int, _arg2:int, _arg3:SoundManager){
this.soundManager = _arg3;
this.maxLevel = _arg2;
help.mouseEnabled = false;
help.mouseChildren = false;
credit.mouseEnabled = false;
credit.mouseChildren = false;
if (GlobalVariables.firstTime){
help.visible = false;
};
credit.visible = false;
hs.useHandCursor = true;
hs.buttonMode = true;
question.useHandCursor = true;
question.buttonMode = true;
cr.useHandCursor = true;
cr.buttonMode = true;
odd1.useHandCursor = true;
odd1.buttonMode = true;
music.useHandCursor = true;
music.buttonMode = true;
sound.useHandCursor = true;
sound.buttonMode = true;
hs.addEventListener(MouseEvent.CLICK, hsHandler);
question.addEventListener(MouseEvent.CLICK, questionHandler);
cr.addEventListener(MouseEvent.CLICK, creditHandler);
odd1.addEventListener(MouseEvent.CLICK, odd1Handler);
agButton.addEventListener(MouseEvent.CLICK, agHandler);
sound.addEventListener(MouseEvent.CLICK, soundHandler);
music.addEventListener(MouseEvent.CLICK, musicHandler);
startingX = levels.x;
this.selectedLevel = _arg1;
levels.x = (startingX - (_arg1 * TWEEN_WIDTH));
btn_leftArrow.stop();
btn_rightArrow.stop();
btn_go.stop();
btn_back.stop();
textfieldTask(task0);
textfieldTask(task1);
textfieldTask(task2);
textfieldScore(totalScore);
textfieldScore(highscore, 12);
textfieldScore(homeruns);
textfieldScore(strikes);
textfieldScore(hits);
textfieldScore(balls);
textfieldScore(items);
listeners();
check0.stop();
check1.stop();
check2.stop();
GlobalVariables.firstTime = true;
if (_arg1 != 0){
btn_leftArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_leftArrow.filters = [];
};
if (_arg1 < _arg2){
btn_rightArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_rightArrow.filters = [];
};
}
private function questionHandler(_arg1:MouseEvent):void{
help.visible = true;
credit.visible = false;
}
private function mouseOverHandler(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
_local2.gotoAndStop(MOUSE_OVER);
}
private function odd1Handler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.odd1.net/"), "_blank");
}
private function creditHandler(_arg1:MouseEvent):void{
credit.visible = true;
help.visible = false;
}
private function textfieldTask(_arg1:TextField):void{
var _local2:TextFormat;
_local2 = new TextFormat("Task", 16);
_arg1.defaultTextFormat = _local2;
_arg1.embedFonts = true;
_arg1.mouseEnabled = false;
}
private function mouseOutHandler(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.currentTarget as MovieClip);
_local2.gotoAndStop(MOUSE_OUT);
}
private function textfieldScore(_arg1:TextField, _arg2:int=15):void{
var _local3:TextFormat;
_local3 = new TextFormat("Score", _arg2);
_arg1.defaultTextFormat = _local3;
_arg1.embedFonts = true;
_arg1.mouseEnabled = false;
}
private function setTween():void{
TweenLite.killTweensOf(levels);
TweenLite.to(levels, TWEEN_DURATION, {x:(startingX - (selectedLevel * TWEEN_WIDTH)), ease:Back.easeInOut});
}
private function soundHandler(_arg1:MouseEvent):void{
soundManager.muteSound();
}
private function listeners():void{
btn_leftArrow.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_leftArrow.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_leftArrow.addEventListener(MouseEvent.CLICK, leftArrow_clickHandler);
btn_leftArrow.useHandCursor = true;
btn_leftArrow.buttonMode = true;
btn_rightArrow.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_rightArrow.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_rightArrow.addEventListener(MouseEvent.CLICK, rightArrow_clickHandler);
btn_rightArrow.useHandCursor = true;
btn_rightArrow.buttonMode = true;
btn_go.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_go.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_go.useHandCursor = true;
btn_go.buttonMode = true;
btn_back.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_back.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_back.useHandCursor = true;
btn_back.buttonMode = true;
}
private function agHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/"), "_blank");
}
private function hsHandler(_arg1:MouseEvent):void{
help.visible = false;
credit.visible = false;
}
private function rightArrow_clickHandler(_arg1:MouseEvent):void{
if (selectedLevel < maxLevel){
selectedLevel++;
setTween();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
} else {
soundManager.playSound((new GlobalVariables.click1Sound() as Sound));
};
if (selectedLevel != 0){
btn_leftArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_leftArrow.filters = [];
};
if (selectedLevel < maxLevel){
btn_rightArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_rightArrow.filters = [];
};
}
private function musicHandler(_arg1:MouseEvent):void{
soundManager.muteMusic();
}
private function muteHandler(_arg1:MouseEvent):void{
soundManager.mute();
}
public function destroy():void{
var _local1:int;
var _local2:int;
TweenLite.killTweensOf(levels);
btn_leftArrow.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_leftArrow.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_leftArrow.removeEventListener(MouseEvent.CLICK, leftArrow_clickHandler);
btn_rightArrow.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_rightArrow.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_rightArrow.removeEventListener(MouseEvent.CLICK, rightArrow_clickHandler);
btn_go.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_go.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn_back.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn_back.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
hs.removeEventListener(MouseEvent.CLICK, hsHandler);
question.removeEventListener(MouseEvent.CLICK, questionHandler);
cr.removeEventListener(MouseEvent.CLICK, creditHandler);
odd1.removeEventListener(MouseEvent.CLICK, odd1Handler);
agButton.removeEventListener(MouseEvent.CLICK, agHandler);
sound.removeEventListener(MouseEvent.CLICK, soundHandler);
music.removeEventListener(MouseEvent.CLICK, musicHandler);
_local1 = numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeChildAt(0);
_local2++;
};
}
private function leftArrow_clickHandler(_arg1:MouseEvent):void{
if (selectedLevel > 0){
selectedLevel--;
setTween();
soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
} else {
soundManager.playSound((new GlobalVariables.click1Sound() as Sound));
};
if (selectedLevel != 0){
btn_leftArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_leftArrow.filters = [];
};
if (selectedLevel < maxLevel){
btn_rightArrow.filters = [new GlowFilter(0xFF00, 1, 12, 12, 2, 1)];
} else {
btn_rightArrow.filters = [];
};
}
}
}//package net.odd1.bobbleheadBaseball.flash
Section 85
//PreloaderFlash (net.odd1.bobbleheadBaseball.flash.PreloaderFlash)
package net.odd1.bobbleheadBaseball.flash {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class PreloaderFlash extends Sprite {
public var odd1:MovieClip;
public var agButton:SimpleButton;
private function agHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/"), "_blank");
}
private function odd1Handler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.odd1.net/"), "_blank");
}
public function destroy():void{
}
}
}//package net.odd1.bobbleheadBaseball.flash
Section 86
//Ball (net.odd1.bobbleheadBaseball.game.Ball)
package net.odd1.bobbleheadBaseball.game {
import flash.display.*;
import flash.geom.*;
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.flash.*;
public final class Ball extends Object3D implements IObject3D {
private const SHADOW:int = 25;
private const BALL_COLOR:int = 0xFFFFFF;
private const SHADOW_COLOR:int = 0;
private const SHADOW_HEIGHT:Number = 0.75;
private const SHADOW_WIDTH:Number = 2;
private const LINE_THICK:int = 0;
private const LINE_COLOR:int = 0x999999;
private const SHADOW_ALPHA:Number = 0.5;
public var ball:Sprite;
public var radius:int;
public function Ball(_arg1:Engine3D, _arg2:int=0, _arg3:Vector3D=null, _arg4:Vector3D=null, _arg5:Vector3D=null){
super(_arg1, _arg3, _arg4, _arg5);
this.radius = _arg2;
ball = new BallFlash();
addChild(ball);
}
public function destroy():void{
radius = -1;
engine = null;
position = null;
force = null;
}
public function draw():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
graphics.clear();
_local1 = engine.renderPoint(position);
x = _local1.x;
y = _local1.y;
_local2 = position.x;
_local3 = position.y;
position.x = (position.x + radius);
_local1 = engine.renderPoint(position);
_local4 = (_local1.x - x);
position.y = 0;
_local1 = engine.renderPoint(position);
position.x = _local2;
position.y = _local3;
_local5 = (1 + (-(position.y) / (engine.ratio * SHADOW)));
if (_local5 < 0){
_local5 = 0;
};
_local6 = ((_local4 * _local5) * SHADOW_HEIGHT);
if (_local4 > 0){
graphics.beginFill(SHADOW_COLOR, SHADOW_ALPHA);
graphics.drawEllipse(-(_local4), (((_local1.y - y) + _local4) - (_local6 >> 1)), ((_local4 * _local5) * SHADOW_WIDTH), _local6);
graphics.endFill();
};
ball.scaleX = (_local4 / 9);
ball.scaleY = (_local4 / 9);
}
}
}//package net.odd1.bobbleheadBaseball.game
Section 87
//Engine (net.odd1.bobbleheadBaseball.game.Engine)
package net.odd1.bobbleheadBaseball.game {
import net.odd1.bobbleheadBaseball.events.*;
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import flash.media.*;
import net.odd1.bobbleheadBaseball.popups.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import gs.*;
import net.odd1.bobbleheadBaseball.screens.*;
import net.odd1.bobbleheadBaseball.graphics.*;
import net.odd1.bobbleheadBaseball.utils.*;
import gs.easing.*;
import net.odd1.bobbleheadBaseball.characters.*;
import net.odd1.bobbleheadBaseball.backgrounds.*;
import net.odd1.bobbleheadBaseball.powerups.*;
import net.odd1.bobbleheadBaseball.characters.limphead.*;
import net.odd1.bobbleheadBaseball.characters.motafuka.*;
import net.odd1.bobbleheadBaseball.characters.bigagiga.*;
import net.odd1.bobbleheadBaseball.characters.caramilka.*;
import flash.filters.*;
public class Engine extends Sprite {
private const FADEOUT:Number = 1;
private const DEFAULT_FORCE:Number = 0.45;
private const NO_PARTICLE:Boolean = true;
private const PRECISION:int = 20;
private const BAR_SCALE:Number = 0.8;
private var strikes:int;
private var time2:int;
private var angleCap:Number;
private var batRadius:int;
private var bLeftWall:Number;
private var angles:Array;
public var bar:ForceBar;
private var pitchFrame:int;
public var bat:Line3D;
private var taskWin:Boolean;
private var nTask:int;
private var strikesLocale:String;
private var ballsLocale:String;
public var canPlay:Boolean;
private var wallAngle:Number;
public var engine3D:Engine3D;
private var text:TextField;
public var catcherBig:Catcher;
private var xAngle:Number;
private var adrenaline:int;
public var catcherSmall:Catcher;
private var batterIndex:int;
private var homerun:Boolean;
private var ballsTotal:int;
private var batLength:int;
private var batterForce:int;
private var streakTotal:int;
private var ballRemaning:int;
private var taskText:TextField;
private var screen:Background;
public var isSwinging:Boolean;
private var triplesTotal:int;
private var itemsTotal:int;
private var d:Vector3D;
public var powerUp:Powerup;
private var screenIndex:int;
private var screenGame:Game;
private var posZ:int;
private var wallCollision:Boolean;
private var pitchForce:int;
private var gameFinished:Boolean;
private var dimension:Vector3D;
private var screenManager:ScreenManager;
private var doublesTotal:int;
private var currentTask:int;
private var rForce:int;
private var wallCollision2:Boolean;
private var hit:Boolean;
private var aRightWall:Number;
public var batterRange:int;
private var screenHeight:int;
private var anglePrec:Number;
private var batWidth:int;
private var isGoingPitching:Boolean;
private var powerUpPick:Boolean;
private var gameFinishedExit:Boolean;
private var bRightWall:Number;
private var b:Point;
private var screenWidth:int;
private var strikesTotal:int;
private var time:int;
private var firstBall:Boolean;
private var singlesTotal:int;
private var homerunsTotal:int;
private var yAngle:Number;
private var ballDisapearing:Boolean;
private var points:int;
private var isDebugging:Boolean;
private var floorHit:Boolean;
public var batX:int;
private var hitsTotal:int;
public var batter:Batter;
public var pitcher:Pitcher;
private var force:Number;
public var isPitching:Boolean;
private var cLeftWall:Number;
private var aLeftWall:Number;
private var cRightWall:Number;
private var pitcherIndex:int;
public var ball:Ball;
public function Engine(_arg1:int, _arg2:int, _arg3:Game){
d = new Vector3D();
b = new Point();
super();
this.screenWidth = _arg1;
this.screenHeight = _arg2;
engine3D = new Engine3D();
this.screenGame = _arg3;
}
public function swingBat():void{
isSwinging = true;
}
public function popupFinished():void{
if (gameFinishedExit){
gameFinishedExit = false;
if (currentTask < 3){
if (taskWin){
screenGame.addPopup(new MissionAccomplishedPopup());
} else {
screenGame.addPopup(new MissionFailedPopup());
};
} else {
if (points >= int(screenManager.save.characters.character[GlobalVariables.characterSelected].levels.level[screenIndex].@highscore)){
screenGame.addPopup(new HighscorePopup());
} else {
screenGame.addPopup(new MissionFailedPopup());
};
};
} else {
if (gameFinished){
if ((((currentTask == 2)) && (taskWin))){
taskWin = false;
screenGame.addPopup(new UnlockedPopup());
} else {
screenGame.dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.LEVELS_SCREEN, new CircleIn(FADEOUT, screenManager)));
};
};
};
}
private function updateScore():void{
screen.balls.text = ((ballRemaning + " ") + ballsLocale);
screen.strikes.text = ((strikes + " ") + strikesLocale);
screen.points.text = StringUtil.separateThousand(points);
}
public function launchBall():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Number;
_local5 = (((bat.position.y - int(screenManager.data.game.levels.level[screenIndex].characters.character[2].batter.@y)) / 80) * 0.15);
ballRemaning--;
updateScore();
updateScore();
_local2 = (Math.sin(((pitcher.rotate.x + (Math.random() * xAngle)) + _local5)) * (pitchForce + (Math.random() * rForce)));
_local4 = (Math.cos(((pitcher.rotate.x + (Math.random() * xAngle)) + _local5)) * (pitchForce + (Math.random() * rForce)));
_local3 = (Math.cos((pitcher.rotate.y - (Math.random() * yAngle))) * _local4);
_local1 = (Math.sin((pitcher.rotate.y - (Math.random() * yAngle))) * _local4);
ball.position = ball.startingPosition.clone();
ball.force = new Vector3D(_local1, _local2, _local3);
ball.visible = true;
powerUpPick = false;
hit = false;
isPitching = true;
homerun = false;
isGoingPitching = false;
wallCollision = false;
wallCollision2 = false;
ballDisapearing = false;
floorHit = false;
posZ = -1;
if (text){
engine3D.removeChild(text);
};
trace("launch");
ballsTotal++;
}
private function checkPopup():void{
var _local1:Boolean;
if (strikes == 3){
_local1 = true;
strikes = 0;
};
if (_local1){
screenGame.addPopup(new StrikeOutPopup());
} else {
screenGame.addPopup(new StrikePopup());
};
strikesTotal++;
updateScore();
}
private function distanceLinePoint(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Point;
_local4 = nearestPointLine(_arg1, _arg2, _arg3);
return (Math.sqrt((Math.pow((_arg1.x - _local4.x), 2) + Math.pow((_arg1.y - _local4.y), 2))));
}
private function distanceLinePointNeg(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Point;
_local4 = nearestPointLine(_arg1, _arg2, _arg3);
if (_local4.y < _arg1.y){
return (-(Math.sqrt((Math.pow((_arg1.x - _local4.x), 2) + Math.pow((_arg1.y - _local4.y), 2)))));
};
return (Math.sqrt((Math.pow((_arg1.x - _local4.x), 2) + Math.pow((_arg1.y - _local4.y), 2))));
}
public function releaseBat():void{
isSwinging = false;
force = bar.bar.scaleY;
batter.animation.setFPS(((force * 60) + 45));
batter.playAnim(0);
}
public function render(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Point;
var _local9:Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Point;
var _local17:Graphics;
var _local18:Point;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:XML;
var _local25:Vector3D;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Point;
var _local32:Boolean;
var _local33:int;
var _local34:Vector3D;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Graphics;
var _local42:Vector3D;
var _local43:Vector3D;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
var _local48:Point;
var _local49:Vector3D;
var _local50:Vector3D;
var _local51:Vector3D;
var _local52:Vector3D;
var _local53:int;
var _local54:Number;
var _local55:int;
var _local56:int;
var _local57:int;
var _local58:Number;
var _local59:Vector3D;
var _local60:Number;
var _local61:Number;
var _local62:Number;
var _local63:Number;
var _local64:Number;
var _local65:TextFormat;
_local22 = 0;
_local55 = engine3D.ratio;
batter.render(_arg1);
pitcher.render(_arg1);
catcherSmall.render(_arg1);
catcherBig.render(_arg1);
if (isSwinging){
bar.bar.scaleY = (bar.bar.scaleY + (_arg1 * BAR_SCALE));
if (bar.bar.scaleY > 1){
bar.bar.scaleY = 1;
};
} else {
bar.bar.scaleY = (bar.bar.scaleY - (_arg1 * 3));
if (bar.bar.scaleY < 0){
bar.bar.scaleY = 0;
};
};
_local25 = bat.rotate.clone();
_local53 = (batter.animation.getCurrentFrame() - 1);
if ((((_local53 >= 0)) && ((_local53 < (angles.length - 1))))){
bat.rotate.y = (angles[_local53] + ((angles[(_local53 + 1)] - angles[_local53]) * batter.animation.getCurrentPercFrame()));
} else {
bat.rotate.y = angles[(angles.length - 1)];
};
if (((isDebugging) && (0))){
_local17 = engine3D.debug.graphics;
engine3D.clearDebug();
_local17.lineStyle(2, 0xFF00FF);
_local48 = engine3D.renderPoint(new Vector3D(bat.position.x, 0, bat.position.z));
_local17.moveTo(_local48.x, _local48.y);
_local48 = engine3D.renderPoint(new Vector3D(bat.position.x, 300, bat.position.z));
_local17.lineTo(_local48.x, _local48.y);
_local45 = (Math.sin(bat.rotate.x) * batLength);
_local47 = (Math.cos(bat.rotate.x) * batLength);
_local46 = (Math.cos(bat.rotate.y) * _local47);
_local44 = (Math.sin(bat.rotate.y) * _local47);
_local49 = new Vector3D((bat.position.x + _local44), ((bat.position.y + _local45) - batRadius), (bat.position.z + _local46));
_local45 = (Math.sin(bat.rotate.x) * bat.length);
_local47 = (Math.cos(bat.rotate.x) * bat.length);
_local46 = (Math.cos(bat.rotate.y) * _local47);
_local44 = (Math.sin(bat.rotate.y) * _local47);
_local50 = new Vector3D((bat.position.x + _local44), ((bat.position.y + _local45) - batRadius), (bat.position.z + _local46));
_local17.lineStyle(2, 0xFF0000);
_local48 = engine3D.renderPoint(_local49);
_local17.moveTo(_local48.x, _local48.y);
_local48 = engine3D.renderPoint(_local50);
_local17.lineTo(_local48.x, _local48.y);
_local45 = (Math.sin(bat.rotate.x) * batLength);
_local47 = (Math.cos(bat.rotate.x) * batLength);
_local46 = (Math.cos(bat.rotate.y) * _local47);
_local44 = (Math.sin(bat.rotate.y) * _local47);
_local49 = new Vector3D((bat.position.x + _local44), ((bat.position.y + _local45) + batRadius), (bat.position.z + _local46));
_local45 = (Math.sin(bat.rotate.x) * bat.length);
_local47 = (Math.cos(bat.rotate.x) * bat.length);
_local46 = (Math.cos(bat.rotate.y) * _local47);
_local44 = (Math.sin(bat.rotate.y) * _local47);
_local50 = new Vector3D((bat.position.x + _local44), ((bat.position.y + _local45) + batRadius), (bat.position.z + _local46));
_local17.lineStyle(2, 0xFF0000);
_local48 = engine3D.renderPoint(_local49);
_local17.moveTo(_local48.x, _local48.y);
_local48 = engine3D.renderPoint(_local50);
_local17.lineTo(_local48.x, _local48.y);
_local17.lineStyle(2, 0xFF);
_local48 = engine3D.renderPoint(_local50);
_local17.moveTo(ball.x, ball.y);
_local17.lineTo(_local48.x, _local48.y);
_local48 = engine3D.renderPoint(_local49);
_local17.moveTo(ball.x, ball.y);
_local17.lineTo(_local48.x, _local48.y);
_local17.lineStyle(2, 0xFFFF00);
_local48 = engine3D.renderPoint(new Vector3D(ball.position.x, 0, ball.position.z));
_local17.moveTo(ball.x, ball.y);
_local17.lineTo(_local48.x, _local48.y);
_local48 = engine3D.renderPoint(_local50);
_local17.moveTo(_local48.x, _local48.y);
_local50.y = 0;
_local48 = engine3D.renderPoint(_local50);
_local17.lineTo(_local48.x, _local48.y);
engine3D.updateDebug();
};
if (isPitching){
_local2 = 3;
_local4 = 10;
_local3 = 3;
_local10 = 0.01;
_local11 = -1500;
_local12 = 0.01;
_local59 = ball.position.clone();
ball.position.x = (ball.position.x + (ball.force.x * _arg1));
ball.position.y = (ball.position.y + (ball.force.y * _arg1));
ball.position.z = (ball.position.z + (ball.force.z * _arg1));
_local19 = 2;
_local20 = -2;
_local21 = 2;
_local27 = 5;
_local28 = 10.5;
_local29 = 5;
_local35 = 0;
_local36 = 0;
_local37 = 200;
_local38 = (dimension.x * _local55);
_local39 = (dimension.y * _local55);
_local40 = (dimension.z * _local55);
_local32 = false;
if (((!(ballDisapearing)) && (hit))){
_local8 = new Point(_local59.x, _local59.z);
_local9 = new Point(ball.position.x, ball.position.z);
if (((!(powerUpPick)) && (powerUp.collision(_local8, _local9)))){
powerUpPick = true;
itemsTotal++;
TweenLite.to(powerUp, 0.5, {y:(powerUp.y - 40), alpha:0, ease:Cubic.easeIn});
_local65 = new TextFormat("Score", 20);
text = new TextField();
text.embedFonts = true;
text.textColor = 15353347;
text.defaultTextFormat = _local65;
text.filters = [new GlowFilter(0, 1, 2, 2, 4, BitmapFilterQuality.HIGH), new GlowFilter(0xFFFFFF, 1, 2, 2, 4, BitmapFilterQuality.HIGH)];
text.selectable = false;
if ((powerUp is Precision)){
angleCap = (angleCap + 0.05);
bar.iconPack04.visible = true;
text.text = "Precise Hitter";
} else {
if ((powerUp is KnockBack)){
bar.iconPack05.visible = true;
text.text = "KnockBack";
} else {
if ((powerUp is PrecisionCap)){
anglePrec = (anglePrec + 0.1);
bar.iconPack03.visible = true;
text.text = "Consistent Hitter";
} else {
if ((powerUp is DeathBat)){
batterForce = (batterForce + 1000);
bar.iconPack02.visible = true;
text.text = "Homerun Hitter";
} else {
if ((powerUp is Power)){
batterForce = (batterForce + 500);
bar.iconPack01.visible = true;
text.text = "Heavy Hitter";
};
};
};
};
};
text.width = 350;
text.height = 130;
text.x = (powerUp.x - (text.textWidth >> 1));
text.y = (powerUp.y - (text.textHeight >> 1));
TweenLite.to(text, 1.5, {y:(text.y - 50), alpha:0, ease:Cubic.easeIn});
_local57 = 0;
engine3D.addChild(text);
screenManager.soundManager.playSound(new GlobalVariables.powerupSound());
};
if (((!(_local32)) && (catcherSmall.collision(_local8, _local9)))){
if (ball.position.y < (catcherSmall.position.y + catcherSmall.yLength)){
if (ball.position.y > (catcherSmall.position.y + (catcherSmall.yLength * 0.6))){
catcherSmall.playJump();
} else {
if (ball.position.y > (catcherSmall.position.y + (catcherSmall.yLength * 0.3))){
catcherSmall.playUp();
} else {
catcherSmall.playDown();
};
};
_local32 = true;
screenManager.soundManager.playSound((new GlobalVariables.catchSound() as Sound));
};
};
if (((!(_local32)) && (catcherBig.collision(_local8, _local9)))){
if (ball.position.y < (catcherBig.position.y + catcherBig.yLength)){
if (ball.position.y > (catcherBig.position.y + (catcherBig.yLength * 0.8))){
catcherBig.playJump();
} else {
if (ball.position.y > (catcherBig.position.y + (catcherBig.yLength * 0.3))){
catcherBig.playUp();
} else {
catcherBig.playDown();
};
};
_local32 = true;
screenManager.soundManager.playSound((new GlobalVariables.catchSound() as Sound));
};
};
};
if (!_local32){
if (!ballDisapearing){
if (ball.position.x > _local38){
_local16 = engine3D.lineIntersectLine(new Point(_local59.x, _local59.z), new Point(ball.position.x, ball.position.z), new Point(_local38, _local40), new Point((_local38 + (Math.tan(wallAngle) * _local40)), 0));
if (_local16){
switch (screenIndex){
case 1:
if (ball.position.y > 1500){
ballDisapearing = true;
};
break;
case 3:
if (ball.position.y > 225){
ballDisapearing = true;
};
break;
};
if (!ballDisapearing){
ball.position.x = _local16.x;
ball.position.z = _local16.y;
_local30 = (Math.abs((((aRightWall * _local59.x) + (bRightWall * _local59.z)) + cRightWall)) / Math.sqrt(((aRightWall * aRightWall) + (bRightWall * bRightWall))));
_local14 = (ball.position.x - _local59.x);
_local15 = (ball.position.z - _local59.z);
_local13 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local23 = (Math.PI - (Math.asin((_local30 / _local13)) * 2));
ball.force.x = (ball.force.x / -(_local27));
ball.force.z = (ball.force.z / -(_local29));
_local60 = ball.force.x;
_local61 = ball.force.z;
ball.force.x = ((_local60 * Math.cos(_local23)) + (_local61 * Math.sin(_local23)));
ball.force.z = ((_local61 * Math.cos(_local23)) - (_local60 * Math.sin(_local23)));
ball.position.x = (_local59.x + (ball.force.x * _arg1));
ball.position.y = (_local59.y + (ball.force.y * _arg1));
ball.position.z = (_local59.z + (ball.force.z * _arg1));
};
wallCollision = true;
};
} else {
if (ball.position.x < _local35){
_local16 = engine3D.lineIntersectLine(new Point(_local59.x, _local59.z), new Point(ball.position.x, ball.position.z), new Point(_local35, _local40), new Point((_local35 - (Math.tan(wallAngle) * _local40)), 0));
if (_local16){
switch (screenIndex){
case 1:
if (ball.position.y > 1500){
ballDisapearing = true;
};
break;
case 3:
if (ball.position.y > 225){
ballDisapearing = true;
};
break;
};
if (!ballDisapearing){
ball.position.x = _local16.x;
ball.position.z = _local16.y;
_local30 = (Math.abs((((aLeftWall * _local59.x) + (bLeftWall * _local59.z)) + cLeftWall)) / Math.sqrt(((aLeftWall * aLeftWall) + (bLeftWall * bLeftWall))));
_local14 = (ball.position.x - _local59.x);
_local15 = (ball.position.z - _local59.z);
_local13 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local23 = (-(Math.PI) + (Math.asin((_local30 / _local13)) * 2));
ball.force.x = (ball.force.x / -(_local27));
ball.force.z = (ball.force.z / -(_local29));
_local60 = ball.force.x;
_local61 = ball.force.z;
ball.force.x = ((_local60 * Math.cos(_local23)) + (_local61 * Math.sin(_local23)));
ball.force.z = ((_local61 * Math.cos(_local23)) - (_local60 * Math.sin(_local23)));
ball.position.x = (_local59.x + (ball.force.x * _arg1));
ball.position.y = (_local59.y + (ball.force.y * _arg1));
ball.position.z = (_local59.z + (ball.force.z * _arg1));
};
wallCollision = true;
};
};
};
if (ball.position.y < _local36){
ball.position.y = _local36;
ball.force.x = (ball.force.x / _local19);
ball.force.y = (ball.force.y / _local20);
ball.force.z = (ball.force.z / _local21);
ball.position.x = (_local59.x + (ball.force.x * _arg1));
ball.position.y = (_local59.y + (ball.force.y * _arg1));
ball.position.z = (_local59.z + (ball.force.z * _arg1));
floorHit = true;
};
if (((((!(hit)) && (batter.animation.isPlaying()))) && ((_local53 <= angles.length)))){
_local33 = 0;
while (_local33 < PRECISION) {
_local34 = _local25.clone();
_local25.clone().y = (_local34.y + ((bat.rotate.y - _local25.y) * (_local33 / PRECISION)));
_local45 = (Math.sin(_local34.x) * batLength);
_local47 = (Math.cos(_local34.x) * batLength);
_local46 = (Math.cos(_local34.y) * _local47);
_local44 = (Math.sin(_local34.y) * _local47);
_local49 = new Vector3D((bat.position.x + _local44), (bat.position.y + _local45), ((bat.position.z + _local46) + 50));
_local45 = (Math.sin(_local34.x) * bat.length);
_local47 = (Math.cos(_local34.x) * bat.length);
_local46 = (Math.cos(_local34.y) * _local47);
_local44 = (Math.sin(_local34.y) * _local47);
_local50 = new Vector3D((bat.position.x + _local44), (bat.position.y + _local45), ((bat.position.z + _local46) + 50));
if ((((((((distanceLinePoint(new Point(ball.position.x, ball.position.z), new Point(_local49.x, _local49.z), new Point(_local50.x, _local50.z)) < batWidth)) && ((ball.position.x > _local49.x)))) && ((ball.position.x < _local50.x)))) || (engine3D.lineIntersectLine(new Point(_local49.x, _local49.z), new Point(_local50.x, _local50.z), new Point(_local59.x, _local59.z), new Point(ball.position.x, ball.position.z))))){
if (distanceLinePoint(new Point(ball.position.x, ball.position.y), new Point(_local49.x, _local49.y), new Point(_local50.x, _local50.y)) < batRadius){
_local26 = (distanceLinePointNeg(new Point(_local49.x, _local49.y), new Point(_local50.x, _local50.y), new Point(ball.position.x, ball.position.y)) / batRadius);
_local45 = ((Math.sin((_local34.x * 0.05)) * batterForce) * (((force * 0.35) * (1 + (adrenaline / 4))) + 0.2));
_local47 = ((Math.cos((_local34.x * 0.05)) * batterForce) * (((force * 0.35) * (1 + (adrenaline / 4))) + 0.2));
_local46 = (Math.cos((_local34.y - (Math.PI / 2.1))) * _local47);
_local44 = (Math.sin((_local34.y - (Math.PI / 2.1))) * _local47);
ball.force.z = _local46;
ball.force.x = _local44;
if (_local26 > 0){
ball.force.y = ((_local45 + (_local26 * 600)) + 400);
} else {
ball.force.y = ((_local45 + (_local26 * 500)) + 300);
};
hitsTotal++;
hit = true;
if (++adrenaline > 3){
adrenaline = 3;
};
bar.putFire(adrenaline);
TweenLite.to(batter.show, 0.25, {alpha:0, ease:Linear.easeNone});
streakTotal++;
strikes = 0;
batter.playAnim(11);
screenManager.soundManager.playSound((new GlobalVariables.hitSound() as Sound));
_local33 = PRECISION;
break;
};
};
_local33++;
};
};
if (ball.position.z > _local40){
switch (screenIndex){
case 0:
if ((((((ball.position.x > 3200)) && ((ball.position.x < 5500)))) && ((ball.position.y > 740)))){
ballDisapearing = true;
};
break;
case 1:
ballDisapearing = true;
break;
case 2:
if ((((((ball.position.x > 6800)) && ((ball.position.y > 725)))) || ((((ball.position.x > 9000)) && ((ball.position.x < 10500)))))){
ballDisapearing = true;
};
break;
case 3:
if (ball.position.y > 225){
ballDisapearing = true;
};
break;
};
if (!ballDisapearing){
ball.position.z = _local40;
ball.force.x = (ball.force.x / _local27);
ball.force.z = (ball.force.z / (-(_local29) / 2));
ball.position.x = (_local59.x + (ball.force.x * _arg1));
ball.position.y = (_local59.y + (ball.force.y * _arg1));
ball.position.z = (_local59.z + (ball.force.z * _arg1));
};
wallCollision = true;
};
if (ball.position.z < _local37){
if (!wallCollision){
isPitching = false;
ball.visible = false;
time = getTimer();
TweenLite.to(batter.show, 0.5, {alpha:0.25, ease:Linear.easeNone});
streakTotal = 0;
strikes++;
adrenaline = 0;
bar.putFire(adrenaline);
if (strikes == 3){
ballRemaning--;
};
finishRound();
checkPopup();
screenManager.soundManager.playSound((new GlobalVariables.missSound() as Sound), 200);
} else {
_local32 = true;
};
};
if (((wallCollision) && (!(wallCollision2)))){
wallCollision2 = true;
posZ = ball.position.z;
if (((!(homerun)) && (!(floorHit)))){
switch (screenIndex){
case 0:
if (ball.position.y > 740){
homerun = true;
};
break;
case 1:
if (ball.position.y > 800){
homerun = true;
};
break;
case 2:
if (ball.position.y > 450){
homerun = true;
};
break;
case 3:
if (ball.position.y > 225){
homerun = true;
};
break;
};
if (homerun){
firstBall = false;
ballRemaning++;
homerunsTotal++;
_local57 = (ball.position.z * 10);
points = (points + _local57);
updateScore();
screenGame.addPopup(new HomerunPopup());
screenManager.soundManager.playSound((new GlobalVariables.homerunsSound() as Sound));
_local65 = new TextFormat("Score", 16);
text = new TextField();
text.embedFonts = true;
text.textColor = 52479;
text.defaultTextFormat = _local65;
text.filters = [new GlowFilter(0, 1, 2, 2, 4, BitmapFilterQuality.HIGH), new GlowFilter(0xFFFFFF, 1, 2, 2, 4, BitmapFilterQuality.HIGH)];
text.text = StringUtil.separateThousand(_local57);
text.selectable = false;
text.x = (ball.x - (text.textWidth >> 1));
text.y = (ball.y - (text.textHeight >> 1));
TweenLite.to(text, 1, {y:(text.y - 40), alpha:0, ease:Cubic.easeIn});
_local57 = 0;
engine3D.addChild(text);
};
};
};
};
ball.force.x = (ball.force.x / (1 + (_local10 * _arg1)));
ball.force.y = (ball.force.y + (_local11 * _arg1));
ball.force.z = (ball.force.z / (1 + (_local12 * _arg1)));
if (ballDisapearing){
ball.alpha = (ball.alpha - (1 * _arg1));
switch (screenIndex){
case 0:
if ((((((ball.position.y < 740)) || ((ball.position.x < 3200)))) || ((ball.position.x > 5500)))){
ball.alpha = 0;
};
break;
case 1:
if ((((((ball.position.z > 5700)) && ((((((ball.position.x < 0)) || ((ball.position.x > 1500)))) || ((ball.position.y < 0)))))) || ((((ball.position.z < 5700)) && ((ball.position.y < 1500)))))){
ball.alpha = 0;
};
break;
case 2:
if ((((((ball.position.x > 6800)) && ((ball.position.y < 725)))) || ((ball.position.x < 6800)))){
ball.alpha = 0;
};
case 3:
if ((((((ball.position.y < 225)) || ((ball.position.x < -200)))) || ((ball.position.x > 8800)))){
ball.alpha = 0;
};
};
if (ball.position.y < 0){
ball.alpha = 0;
};
};
if ((((((ball.force.x > 0)) && ((ball.force.x < _local2)))) || ((((ball.force.x < 0)) && ((ball.force.x > -(_local2))))))){
ball.force.x = 0;
};
if ((((((ball.force.y > 0)) && ((ball.force.y < _local4)))) || ((((ball.force.y < 0)) && ((ball.force.y > -(_local4))))))){
ball.force.y = 0;
};
if ((((((ball.force.z > 0)) && ((ball.force.z < _local3)))) || ((((ball.force.z < 0)) && ((ball.force.z > -(_local3))))))){
ball.force.z = 0;
};
};
if (((((_local32) || ((ball.alpha <= 0)))) || ((((((ball.force.x == 0)) && ((ball.force.y == 0)))) && ((ball.force.z == 0)))))){
TweenLite.to(batter.show, 0.5, {alpha:0.25, ease:Linear.easeNone});
if (((((_local32) && (!(wallCollision)))) && (!(floorHit)))){
streakTotal = 0;
screenGame.addPopup(new OutPopup());
} else {
if (!homerun){
if (posZ == -1){
posZ = ball.position.z;
};
_local57 = posZ;
if (posZ > ((dimension.z * _local55) * 0.9)){
triplesTotal++;
_local57 = (_local57 * 3);
screenGame.addPopup(new TriplePopup());
} else {
if (posZ > ((dimension.z * _local55) * 0.8)){
doublesTotal++;
_local57 = (_local57 * 2);
screenGame.addPopup(new DoublePopup());
} else {
singlesTotal++;
screenGame.addPopup(new SimplePopup());
};
};
points = (points + _local57);
};
};
if (_local57 > 0){
_local65 = new TextFormat("Score", 16);
text = new TextField();
text.embedFonts = true;
text.textColor = 52479;
text.defaultTextFormat = _local65;
text.filters = [new GlowFilter(0, 1, 2, 2, 4, BitmapFilterQuality.HIGH), new GlowFilter(0xFFFFFF, 1, 2, 2, 4, BitmapFilterQuality.HIGH)];
text.text = StringUtil.separateThousand(_local57);
text.selectable = false;
text.x = (ball.x - (text.textWidth >> 1));
text.y = (ball.y - (text.textHeight >> 1));
TweenLite.to(text, 1, {y:(text.y - 40), alpha:0, ease:Cubic.easeIn});
engine3D.addChild(text);
};
finishRound();
};
} else {
if (!screenGame.popup){
if (((!(gameFinished)) && (!(isGoingPitching)))){
time = getTimer();
isGoingPitching = true;
};
if (firstBall){
if ((getTimer() - time) > 1000){
pitcher.playAnim(pitchFrame);
};
} else {
if ((getTimer() - time) > 2500){
firstBall = true;
pitcher.playAnim(pitchFrame);
};
};
if (pitcher.animation.getCurrentFrame() >= (pitchFrame - 1)){
pitcher.playAnim(0);
launchBall();
};
};
};
bat.position.x = (batter.position.x + 100);
engine3D.render(_arg1);
engine3D.putOnFront(batter);
}
public function reload():void{
var _local1:XML;
var _local2:XML;
var _local3:XML;
var _local4:XML;
var _local5:Vector3D;
var _local6:int;
_local1 = screenManager.data.game.levels.level[screenIndex];
engine3D.reload(_local1);
wallAngle = Number(_local1.@wallAngle);
dimension = engine3D.readVector(_local1.dimension);
rForce = int(_local1.pitcher.@rForce);
xAngle = Number(_local1.pitcher.@xAngle);
yAngle = Number(_local1.pitcher.@yAngle);
_local3 = _local1.characters.character[pitcherIndex];
pitchForce = int(_local1.pitcher.@force);
pitchFrame = int(_local3.@pitchFrame);
pitcher.position = engine3D.readVector(_local1.pitcher.position);
pitcher.rotate = engine3D.readVector(_local1.pitcher.rotation);
_local5 = engine3D.readVector(_local3.rotation);
pitcher.rotate.x = (pitcher.rotate.x + _local5.x);
pitcher.rotate.y = (pitcher.rotate.y + _local5.y);
pitcher.rotate.z = (pitcher.rotate.z + _local5.z);
if ((((batterIndex == 2)) && ((screenIndex == 3)))){
pitcher.rotate.x = (pitcher.rotate.x + 0.05);
};
_local6 = ((Math.random() > 0.5)) ? -1 : 1;
catcherSmall.position = pitcher.position.clone();
catcherSmall.position.x = (catcherSmall.position.x + (_local6 * ((Math.random() * 1000) + 200)));
catcherSmall.position.z = 3500;
catcherBig.position = pitcher.position.clone();
catcherBig.position.x = (catcherBig.position.x - (_local6 * ((Math.random() * 1000) + 200)));
catcherBig.position.z = 2500;
if (screenIndex == 2){
if (_local6 == -1){
catcherSmall.position.x = (catcherSmall.position.x - 1000);
} else {
catcherBig.position.x = (catcherBig.position.x - 900);
};
};
catcherSmall.xLength = 200;
catcherSmall.yLength = 600;
catcherSmall.zLength = 200;
catcherBig.xLength = 200;
catcherBig.yLength = 600;
catcherBig.zLength = 200;
_local4 = _local1.characters.character[batterIndex];
batterRange = int(_local4.@batRange);
batterForce = int(_local1.batter.@force);
batter.position = engine3D.readVector(_local1.batter.position);
_local5 = engine3D.readVector(_local3.ball);
ball.position = new Vector3D((pitcher.position.x + _local5.x), (pitcher.position.y + _local5.y), (pitcher.position.z + _local5.z));
ball.radius = int(screenManager.data.game.@ballRadius);
batRadius = int(_local4.bat.@height);
batWidth = int(_local4.bat.@width);
batLength = int(_local4.@batLength);
_local5 = engine3D.readVector(_local4.batter);
batter.startingPosition.x = (batter.startingPosition.x + _local5.x);
bat.position = new Vector3D(batter.position.x, (batter.position.y + _local5.y), ((batter.position.z + _local5.z) - 0.1));
bat.length = int(_local4.bat.@length);
angles = new Array();
for each (_local2 in _local4.bat.frame) {
angles.push(Number(_local2.@angle));
};
ballsLocale = screenManager.locale.common.@balls;
strikesLocale = screenManager.locale.common.@strikes;
if (currentTask < 3){
nTask = int(screenManager.data.game.levels.level[screenIndex].tasks.task[currentTask].@n);
taskText.text = StringUtil.printf(screenManager.locale.levels.level[screenIndex].tasks.task[currentTask].@text, StringUtil.separateThousand(nTask, " "));
} else {
taskText.text = "Highscore Mode";
};
}
private function finishRound():void{
var _local1:XML;
if (hit){
batter.animation.setFPS(60);
batter.playAnim(0);
};
isPitching = false;
_local1 = screenManager.save.characters.character[GlobalVariables.characterSelected].levels.level[screenIndex];
ball.position = ball.startingPosition.clone();
ball.force = new Vector3D();
ball.visible = false;
ball.alpha = 1;
updateScore();
newPowerUp();
switch (screenIndex){
case 0:
switch (currentTask){
case 0:
if (streakTotal == 0){
} else {
taskWin = (streakTotal == nTask);
};
break;
case 1:
taskWin = (points >= nTask);
break;
case 2:
taskWin = (((((singlesTotal > 0)) && ((homerunsTotal > 0)))) && ((itemsTotal > 0)));
break;
};
break;
case 1:
switch (currentTask){
case 0:
taskWin = (homerunsTotal == nTask);
break;
case 1:
taskWin = (((((singlesTotal > 1)) && ((triplesTotal > 1)))) && ((homerunsTotal > 1)));
break;
case 2:
if (streakTotal == 0){
} else {
taskWin = (streakTotal == nTask);
};
break;
};
break;
case 2:
switch (currentTask){
case 0:
taskWin = (points >= nTask);
break;
case 1:
taskWin = (itemsTotal == nTask);
break;
case 2:
taskWin = (homerunsTotal == nTask);
break;
};
break;
case 3:
switch (currentTask){
case 0:
taskWin = (((((singlesTotal > 2)) && ((triplesTotal > 2)))) && ((homerunsTotal > 2)));
break;
case 1:
taskWin = (points >= nTask);
break;
case 2:
taskWin = (homerunsTotal == nTask);
break;
};
break;
};
if ((((ballRemaning <= 0)) || (taskWin))){
ballRemaning = 0;
gameFinished = true;
gameFinishedExit = true;
if (int(_local1.@highscore) < points){
_local1.@highscore = points;
};
_local1.@totalscore = (int(_local1.@totalscore) + points);
_local1.@strikes = (int(_local1.@strikes) + strikesTotal);
_local1.@balls = (int(_local1.@balls) + ballsTotal);
_local1.@homeruns = (int(_local1.@homeruns) + homerunsTotal);
_local1.@hits = (int(_local1.@hits) + hitsTotal);
_local1.@items = (int(_local1.@items) + itemsTotal);
};
if (taskWin){
_local1.tasks.task[currentTask].@isComplete = "true";
};
time = getTimer();
}
private function newPowerUp():void{
if (((powerUp) && ((powerUp.alpha > 0)))){
TweenLite.to(powerUp, 0.25, {alpha:0, ease:Linear.easeNone});
};
switch (int((Math.random() * 4))){
case 0:
powerUp = new DeathBat(engine3D);
break;
case 1:
powerUp = new Power(engine3D);
break;
case 2:
powerUp = new Precision(engine3D);
break;
case 3:
powerUp = new PrecisionCap(engine3D);
break;
case 4:
powerUp = new KnockBack(engine3D);
break;
};
powerUp.alpha = 0;
powerUp.position.z = 2750;
powerUp.position.x = (pitcher.position.x + ((Math.random() * 3000) - 1500));
engine3D.addObject(powerUp);
TweenLite.to(powerUp, 0.5, {alpha:1, ease:Linear.easeNone});
}
private function completeHandler(_arg1:Event):void{
bar.removeEventListener(Event.COMPLETE, completeHandler);
bar.bar.scaleY = 0;
canPlay = true;
}
private function nearestPointLine(_arg1:Point, _arg2:Point, _arg3:Point):Point{
var _local4:Point;
var _local5:Number;
var _local6:Point;
var _local7:Number;
var _local8:Point;
_local4 = new Point((_arg3.x - _arg2.x), (_arg3.y - _arg2.y));
_local5 = Math.sqrt(((_local4.x * _local4.x) + (_local4.y * _local4.y)));
_local4.x = (_local4.x / _local5);
_local4.y = (_local4.y / _local5);
_local6 = new Point((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
_local7 = ((_local6.x * _local4.x) + (_local6.y * _local4.y));
return (new Point(((_local4.x * _local7) + _arg2.x), ((_local4.y * _local7) + _arg2.y)));
}
public function destroy():void{
removeChild(screen);
screen = null;
screenManager = null;
dimension = null;
engine3D.removeAllObjects();
engine3D.destroy();
removeChild(engine3D);
batter.destroy();
pitcher.destroy();
ball.destroy();
batter = null;
pitcher = null;
ball = null;
d = null;
b = null;
screenGame.removeChild(bar);
bar.destroy();
bar = null;
}
public function create(_arg1:ScreenManager, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):void{
var _local8:Point;
var _local9:Point;
var _local10:TextFormat;
this.screenIndex = _arg2;
this.batterIndex = _arg4;
this.pitcherIndex = _arg5;
this.currentTask = _arg3;
taskWin = false;
time = getTimer();
adrenaline = 0;
streakTotal = 0;
switch (_arg2){
case 0:
screen = new Background0();
break;
case 1:
screen = new Background1();
break;
case 2:
screen = new Background2();
break;
case 3:
screen = new Background3();
break;
};
switch (_arg4){
case 0:
batter = new LimpheadBat(engine3D);
break;
case 1:
batter = new MotafukaBat(engine3D);
break;
case 2:
batter = new CaramilkaBat(engine3D);
break;
case 3:
batter = new BigagigaBat(engine3D);
break;
};
switch (_arg5){
case 0:
pitcher = new LimpheadPitch(engine3D);
break;
case 1:
pitcher = new MotafukaPitch(engine3D);
break;
case 2:
pitcher = new CaramilkaPitch(engine3D);
break;
case 3:
pitcher = new BigagigaPitch(engine3D);
break;
};
switch (_arg6){
case 0:
this.catcherSmall = new LimpheadCatchSmall(engine3D);
break;
case 1:
this.catcherSmall = new MotafukaCatchSmall(engine3D);
break;
case 2:
this.catcherSmall = new CaramilkaCatchSmall(engine3D);
break;
case 3:
this.catcherSmall = new BigagigaCatchSmall(engine3D);
break;
};
switch (_arg7){
case 0:
this.catcherBig = new LimpheadCatchBig(engine3D);
break;
case 1:
this.catcherBig = new MotafukaCatchBig(engine3D);
break;
case 2:
this.catcherBig = new CaramilkaCatchBig(engine3D);
break;
case 3:
this.catcherBig = new BigagigaCatchBig(engine3D);
break;
};
isPitching = false;
isSwinging = false;
isGoingPitching = false;
time = getTimer();
this.screenManager = _arg1;
isDebugging = _arg1.isDebugging;
screen.x = (-((screenWidth - _arg1.stageWidth)) >> 1);
screen.y = (-((screenHeight - _arg1.stageHeight)) >> 1);
screen.cacheAsBitmap = true;
addChild(screen);
engine3D.x = (_arg1.stageWidth >> 1);
engine3D.y = (_arg1.stageHeight >> 1);
ball = new Ball(engine3D);
ball.visible = false;
bat = new Line3D(engine3D, 450);
bat.visible = false;
taskText = new TextField();
_local10 = new TextFormat("Score", 18, 0xFFFFFF);
_local10.align = TextFormatAlign.CENTER;
taskText.defaultTextFormat = _local10;
taskText.embedFonts = true;
taskText.mouseEnabled = false;
taskText.y = 4;
taskText.width = _arg1.stageWidth;
taskText.filters = [new GlowFilter(0, 1, 7, 7, 5)];
reload();
ballRemaning = 10;
strikes = 0;
points = 0;
strikesTotal = 0;
ballsTotal = 0;
homerunsTotal = 0;
hitsTotal = 0;
itemsTotal = 0;
singlesTotal = 0;
doublesTotal = 0;
triplesTotal = 0;
updateScore();
engine3D.addObject(ball);
engine3D.addObject(pitcher);
engine3D.addObject(batter);
engine3D.addObject(bat);
engine3D.addObject(this.catcherSmall);
engine3D.addObject(this.catcherBig);
addChild(engine3D);
powerUp = null;
bar = new ForceBar();
screenGame.addChild(bar);
screenGame.addChild(taskText);
gameFinished = false;
_local8 = new Point();
_local9 = new Point();
_local8.x = 0;
_local8.y = (dimension.z * engine3D.ratio);
_local9.x = (Math.tan(wallAngle) * _local8.y);
_local9.y = _local8.y;
aLeftWall = _local9.y;
bLeftWall = -(_local9.x);
cLeftWall = ((_local9.y * -(_local8.x)) + (_local9.x * _local8.y));
_local8.x = (dimension.x * engine3D.ratio);
_local8.y = (dimension.z * engine3D.ratio);
_local9.x = (-(Math.tan(wallAngle)) * _local8.y);
_local9.y = _local8.y;
aRightWall = _local9.y;
bRightWall = -(_local9.x);
cRightWall = ((_local9.y * -(_local8.x)) + (_local9.x * _local8.y));
newPowerUp();
if (NO_PARTICLE){
canPlay = true;
bar.bar.scaleY = 0;
} else {
bar.addEventListener(Event.COMPLETE, completeHandler);
canPlay = false;
};
}
}
}//package net.odd1.bobbleheadBaseball.game
Section 88
//ForceBar (net.odd1.bobbleheadBaseball.game.ForceBar)
package net.odd1.bobbleheadBaseball.game {
import flash.display.*;
public final class ForceBar extends Sprite {
private const STAGE_0:String = "stage0";
private const STAGE_1:String = "stage1";
public const DEATH_BAT:String = "deathBat";
private const STAGE_3:String = "stage3";
private const STAGE_2:String = "stage2";
public const KNOCKBACK:String = "knockBack";
public const POWER:String = "power";
public const PRECISION:String = "precision";
public const CAP:String = "Cap";
public const NO_ICON:String = "noIcon";
public var iconPack01:MovieClip;
public var iconPack03:MovieClip;
public var bar:Sprite;
private var powerups:Array;
public var fireFx:MovieClip;
public var iconPack02:MovieClip;
public var iconPack04:MovieClip;
public var iconPack05:MovieClip;
public function ForceBar(){
powerups = new Array();
iconPack04.gotoAndStop(PRECISION);
iconPack05.gotoAndStop(KNOCKBACK);
iconPack03.gotoAndStop(CAP);
iconPack02.gotoAndStop(DEATH_BAT);
iconPack01.gotoAndStop(POWER);
iconPack05.visible = false;
iconPack04.visible = false;
iconPack03.visible = false;
iconPack02.visible = false;
iconPack01.visible = false;
}
public function putFire(_arg1:int):void{
}
public function destroy():void{
removeChild(bar);
bar = null;
}
}
}//package net.odd1.bobbleheadBaseball.game
Section 89
//GlobalVariables (net.odd1.bobbleheadBaseball.game.GlobalVariables)
package net.odd1.bobbleheadBaseball.game {
import net.odd1.bobbleheadBaseball.screens.*;
public final class GlobalVariables {
public static const ODD1SPLASH_SCREEN:int = 3;
public static const GAME_SCREEN:int = 0;
public static const CHARACTERS_SCREEN:int = 1;
public static const AGSPLASH_SCREEN:int = 4;
public static const LEVELS_SCREEN:int = 2;
public static var menuMusic:Class = GlobalVariables_menuMusic;
public static var screens:Array = [(Game as Class), (Characters as Class), (Levels as Class), (Odd1Splash as Class), (AGSplash as Class)];
public static var powerupSound:Class = GlobalVariables_powerupSound;
public static var gameMusic:Class = GlobalVariables_gameMusic;
public static var hitSound:Class = GlobalVariables_hitSound;
public static var click0Sound:Class = GlobalVariables_click0Sound;
public static var locale:String = "";
public static var catchSound:Class = GlobalVariables_catchSound;
public static var firstTime:Boolean = false;
public static var currentTask:int = 0;
public static var characterSelected:int = -1;
public static var selectedLevel:int = 0;
public static var homerunsSound:Class = GlobalVariables_homerunsSound;
public static var missSound:Class = GlobalVariables_missSound;
public static var click1Sound:Class = GlobalVariables_click1Sound;
}
}//package net.odd1.bobbleheadBaseball.game
Section 90
//GlobalVariables_catchSound (net.odd1.bobbleheadBaseball.game.GlobalVariables_catchSound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_catchSound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 91
//GlobalVariables_click0Sound (net.odd1.bobbleheadBaseball.game.GlobalVariables_click0Sound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_click0Sound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 92
//GlobalVariables_click1Sound (net.odd1.bobbleheadBaseball.game.GlobalVariables_click1Sound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_click1Sound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 93
//GlobalVariables_gameMusic (net.odd1.bobbleheadBaseball.game.GlobalVariables_gameMusic)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_gameMusic extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 94
//GlobalVariables_hitSound (net.odd1.bobbleheadBaseball.game.GlobalVariables_hitSound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_hitSound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 95
//GlobalVariables_homerunsSound (net.odd1.bobbleheadBaseball.game.GlobalVariables_homerunsSound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_homerunsSound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 96
//GlobalVariables_menuMusic (net.odd1.bobbleheadBaseball.game.GlobalVariables_menuMusic)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_menuMusic extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 97
//GlobalVariables_missSound (net.odd1.bobbleheadBaseball.game.GlobalVariables_missSound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_missSound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 98
//GlobalVariables_powerupSound (net.odd1.bobbleheadBaseball.game.GlobalVariables_powerupSound)
package net.odd1.bobbleheadBaseball.game {
import mx.core.*;
public class GlobalVariables_powerupSound extends SoundAsset {
}
}//package net.odd1.bobbleheadBaseball.game
Section 99
//Engine3D (net.odd1.bobbleheadBaseball.graphics.Engine3D)
package net.odd1.bobbleheadBaseball.graphics {
import flash.display.*;
import flash.geom.*;
public class Engine3D extends Sprite {
public var ratio:int;
public var debug:Shape;
private var objects:Array;
public var theta:Vector3D;
private var b:Point;
public var e:Vector3D;
public var c:Vector3D;
private var d:Vector3D;
public static const POS_X:String = "x";
public static const POS_Y:String = "y";
public static const POS_Z:String = "z";
public function Engine3D(){
d = new Vector3D();
b = new Point();
super();
objects = new Array();
debug = new Shape();
addChild(debug);
}
public function addObject(_arg1:Object3D):void{
objects.push(_arg1);
addChild(_arg1);
}
public function clearDebug():void{
debug.graphics.clear();
}
public function updateDebug():void{
setChildIndex(debug, (numChildren - 1));
}
public function removeAllObjects():void{
while (objects.length != 0) {
removeObject(objects[0]);
};
}
public function reload(_arg1:XML):void{
ratio = int(_arg1.@ratio);
c = readVector(_arg1.camera);
theta = readVector(_arg1.theta);
e = readVector(_arg1.viewer);
}
public function renderPoint(_arg1:Vector3D):Point{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = (_arg1.x - c.x);
_local3 = (_arg1.y - c.y);
_local4 = (_arg1.z - c.z);
_local5 = ((Math.cos(theta.y) * _local4) + (Math.sin(theta.y) * ((Math.sin(theta.z) * _local3) + (Math.cos(theta.z) * _local2))));
_local6 = ((Math.cos(theta.z) * _local3) - (Math.sin(theta.z) * _local2));
_local7 = Math.cos(theta.x);
_local8 = Math.sin(theta.x);
d.x = ((Math.cos(theta.y) * ((Math.sin(theta.z) * _local3) + (Math.cos(theta.z) * _local2))) - (Math.sin(theta.y) * _local4));
d.y = ((_local8 * _local5) + (_local7 * _local6));
d.z = ((_local7 * _local5) - (_local8 * _local6));
b.x = ((d.x - e.x) * (e.z / d.z));
b.y = ((d.y - e.y) * (e.z / d.z));
return (b);
}
public function determinePosition(_arg1:Object3D, _arg2:Number, _arg3:Number, _arg4:String):Number{
var _local5:Number;
switch (_arg4){
case POS_X:
_local5 = ((_arg3 - _arg1.position.x) / (_arg1.force.x * _arg2));
_arg1.position.x = _arg3;
_arg1.position.y = (_arg1.position.y + ((_arg1.force.y * _arg2) * _local5));
_arg1.position.z = (_arg1.position.z + ((_arg1.force.z * _arg2) * _local5));
break;
case POS_Y:
_local5 = ((_arg3 - _arg1.position.y) / (_arg1.force.y * _arg2));
_arg1.position.y = _arg3;
_arg1.position.x = (_arg1.position.x + ((_arg1.force.x * _arg2) * _local5));
_arg1.position.z = (_arg1.position.z + ((_arg1.force.z * _arg2) * _local5));
break;
case POS_Z:
_local5 = ((_arg3 - _arg1.position.z) / (_arg1.force.z * _arg2));
_arg1.position.z = _arg3;
_arg1.position.y = (_arg1.position.y + ((_arg1.force.y * _arg2) * _local5));
_arg1.position.x = (_arg1.position.x + ((_arg1.force.x * _arg2) * _local5));
break;
};
return (_local5);
}
public function render(_arg1:Number):void{
var _local2:Object3D;
objects.sort(sortOnZ);
for each (_local2 in objects) {
IObject3D(_local2).draw();
setChildIndex(_local2, 0);
};
}
public function lineIntersectLine(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Boolean=true):Point{
var _local6:Point;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
_local7 = (_arg2.y - _arg1.y);
_local9 = (_arg1.x - _arg2.x);
_local11 = ((_arg2.x * _arg1.y) - (_arg1.x * _arg2.y));
_local8 = (_arg4.y - _arg3.y);
_local10 = (_arg3.x - _arg4.x);
_local12 = ((_arg4.x * _arg3.y) - (_arg3.x * _arg4.y));
_local13 = ((_local7 * _local10) - (_local8 * _local9));
if (_local13 == 0){
return (null);
};
_local6 = new Point();
_local6.x = (((_local9 * _local12) - (_local10 * _local11)) / _local13);
_local6.y = (((_local8 * _local11) - (_local7 * _local12)) / _local13);
if (_arg5){
if (Point.distance(_local6, _arg2) > Point.distance(_arg1, _arg2)){
return (null);
};
if (Point.distance(_local6, _arg1) > Point.distance(_arg1, _arg2)){
return (null);
};
if (Point.distance(_local6, _arg4) > Point.distance(_arg3, _arg4)){
return (null);
};
if (Point.distance(_local6, _arg3) > Point.distance(_arg3, _arg4)){
return (null);
};
};
return (_local6);
}
public function removeObject(_arg1:Object3D):void{
objects.splice(objects.indexOf(_arg1), 1);
removeChild(_arg1);
}
private function sortOnZ(_arg1:Object3D, _arg2:Object3D):Number{
var _local3:Number;
var _local4:Number;
_local3 = _arg1.position.z;
_local4 = _arg2.position.z;
if (_local3 > _local4){
return (1);
};
if (_local3 < _local4){
return (-1);
};
return (0);
}
public function drawBox(_arg1:Object3D):void{
var _local2:Point;
var _local3:Point;
var _local4:Point;
var _local5:Point;
var _local6:Vector3D;
debug.graphics.lineStyle(1, 0xFF00);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x - _arg1.xLength);
_local6.z = (_local6.z - _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.moveTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x - _arg1.xLength);
_local6.y = (_local6.y + _arg1.yLength);
_local6.z = (_local6.z - _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.lineTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x + _arg1.xLength);
_local6.z = (_local6.z - _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.moveTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x + _arg1.xLength);
_local6.y = (_local6.y + _arg1.yLength);
_local6.z = (_local6.z - _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.lineTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x + _arg1.xLength);
_local6.z = (_local6.z + _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.moveTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x + _arg1.xLength);
_local6.y = (_local6.y + _arg1.yLength);
_local6.z = (_local6.z + _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.lineTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x - _arg1.xLength);
_local6.z = (_local6.z + _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.moveTo(_local2.x, _local2.y);
_local6 = _arg1.position.clone();
_arg1.position.clone().x = (_local6.x - _arg1.xLength);
_local6.y = (_local6.y + _arg1.yLength);
_local6.z = (_local6.z + _arg1.zLength);
_local2 = renderPoint(_local6);
debug.graphics.lineTo(_local2.x, _local2.y);
}
public function readVector(_arg1:XMLList):Vector3D{
return (new Vector3D(Number(_arg1.@x), Number(_arg1.@y), Number(_arg1.@z)));
}
public function destroy():void{
ratio = -1;
c = null;
theta = null;
e = null;
}
public function putOnFront(_arg1:Object3D):void{
setChildIndex(_arg1, (numChildren - 1));
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 100
//IObject3D (net.odd1.bobbleheadBaseball.graphics.IObject3D)
package net.odd1.bobbleheadBaseball.graphics {
public interface IObject3D {
function draw():void;
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 101
//Line3D (net.odd1.bobbleheadBaseball.graphics.Line3D)
package net.odd1.bobbleheadBaseball.graphics {
import flash.geom.*;
public class Line3D extends Object3D implements IObject3D {
private const THICK:int = 2;
public var color:int;
public var length:int;
public function Line3D(_arg1:Engine3D, _arg2:int, _arg3:int=0xFF00, _arg4:Vector3D=null, _arg5:Vector3D=null, _arg6:Vector3D=null){
super(_arg1, _arg4, _arg5, _arg6);
this.color = _arg3;
this.length = _arg2;
}
public function draw():void{
var _local1:Point;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
graphics.clear();
graphics.lineStyle(THICK, color);
_local1 = engine.renderPoint(position);
this.x = _local1.x;
this.y = _local1.y;
_local3 = (Math.sin(rotate.x) * length);
_local5 = (Math.cos(rotate.x) * length);
_local4 = (Math.cos(rotate.y) * _local5);
_local2 = (Math.sin(rotate.y) * _local5);
_local1 = engine.renderPoint(new Vector3D((position.x + _local2), (position.y + _local3), (position.z + _local4)));
graphics.lineTo((_local1.x - this.x), (_local1.y - this.y));
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 102
//Object3D (net.odd1.bobbleheadBaseball.graphics.Object3D)
package net.odd1.bobbleheadBaseball.graphics {
import flash.display.*;
import flash.geom.*;
public class Object3D extends Sprite {
public var zLength:int;// = 100
public var engine:Engine3D;
private var _position:Vector3D;
public var startingPosition:Vector3D;
public var startingRotate:Vector3D;
public var force:Vector3D;
private var _rotate:Vector3D;
public var xLength:int;// = 100
public var yLength:int;// = 1000
public function Object3D(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null, _arg4:Vector3D=null){
this.engine = _arg1;
if (_arg2){
this.position = _arg2;
} else {
this.position = new Vector3D();
};
if (_arg3){
this.rotate = _arg3;
} else {
this.rotate = new Vector3D();
};
if (_arg4){
this.force = _arg4;
} else {
this.force = new Vector3D();
};
mouseEnabled = false;
mouseChildren = false;
}
public function get position():Vector3D{
return (_position);
}
public function set position(_arg1:Vector3D):void{
_position = _arg1;
if (_arg1){
startingPosition = _arg1.clone();
};
}
public function collision(_arg1:Point, _arg2:Point):Point{
var _local3:Point;
var _local4:Point;
var _local5:Boolean;
var _local6:Point;
_local6 = null;
_local5 = false;
_local3 = new Point();
_local4 = new Point();
_local3.x = (position.x - xLength);
_local3.y = (position.z - zLength);
_local4.x = (position.x + xLength);
_local4.y = (position.z - zLength);
if (((!(_local5)) && (engine.lineIntersectLine(_arg1, _arg2, _local3, _local4)))){
_local5 = true;
};
_local3.x = (position.x + xLength);
_local3.y = (position.z - zLength);
_local4.x = (position.x + xLength);
_local4.y = (position.z + zLength);
if (((!(_local5)) && (engine.lineIntersectLine(_arg1, _arg2, _local3, _local4)))){
_local5 = true;
};
_local3.x = (position.x + xLength);
_local3.y = (position.z + zLength);
_local4.x = (position.x - xLength);
_local4.y = (position.z + zLength);
if (((!(_local5)) && (engine.lineIntersectLine(_arg1, _arg2, _local3, _local4)))){
_local5 = true;
};
_local3.x = (position.x - xLength);
_local3.y = (position.z + zLength);
_local4.x = (position.x - xLength);
_local4.y = (position.z - zLength);
if (((!(_local5)) && (engine.lineIntersectLine(_arg1, _arg2, _local3, _local4)))){
_local5 = true;
};
return (_local6);
}
public function get rotate():Vector3D{
return (_rotate);
}
public function set rotate(_arg1:Vector3D):void{
_rotate = _arg1;
startingRotate = _arg1.clone();
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 103
//Raster (net.odd1.bobbleheadBaseball.graphics.Raster)
package net.odd1.bobbleheadBaseball.graphics {
import flash.display.*;
import flash.geom.*;
public class Raster {
private static var rect:Rectangle = new Rectangle(0, 0, 0, 1);
public static function drawInvertCircle(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
_local6 = 0;
_local7 = _arg4;
_local10 = (_arg2 >> 1);
_local11 = (_arg3 >> 1);
rect.x = 0;
rect.y = (_local11 + _local6);
rect.width = (_local10 - _local7);
_arg1.fillRect(rect, _arg5);
rect.x = ((_local10 - _local7) + (_local7 << 1));
rect.y = (_local11 + _local6);
rect.width = (_arg2 - rect.x);
_arg1.fillRect(rect, _arg5);
_local8 = (1 - _arg4);
while (_local6 < (_local7 - 1)) {
_local9 = _local7;
if (_local8 < 0){
_local6++;
} else {
_local6++;
_local7--;
};
if (_local8 < 0){
_local8 = ((_local8 + (_local6 << 1)) + 1);
} else {
_local8 = ((_local8 + ((_local6 - _local7) << 1)) + 1);
};
if ((((_local7 < _local9)) && ((_local6 < _local7)))){
rect.x = 0;
rect.y = (_local11 + _local7);
rect.width = (_local10 - _local6);
_arg1.fillRect(rect, _arg5);
rect.x = ((_local10 - _local6) + (_local6 << 1));
rect.y = (_local11 + _local7);
rect.width = (_arg2 - rect.x);
_arg1.fillRect(rect, _arg5);
rect.x = 0;
rect.y = (_local11 - _local7);
rect.width = (_local10 - _local6);
_arg1.fillRect(rect, _arg5);
rect.x = ((_local10 - _local6) + (_local6 << 1));
rect.y = (_local11 - _local7);
rect.width = (_arg2 - rect.x);
_arg1.fillRect(rect, _arg5);
};
rect.x = 0;
rect.y = (_local11 + _local6);
rect.width = (_local10 - _local7);
_arg1.fillRect(rect, _arg5);
rect.x = ((_local10 - _local7) + (_local7 << 1));
rect.y = (_local11 + _local6);
rect.width = (_arg2 - rect.x);
_arg1.fillRect(rect, _arg5);
rect.x = 0;
rect.y = (_local11 - _local6);
rect.width = (_local10 - _local7);
_arg1.fillRect(rect, _arg5);
rect.x = ((_local10 - _local7) + (_local7 << 1));
rect.y = (_local11 - _local6);
rect.width = (_arg2 - rect.x);
_arg1.fillRect(rect, _arg5);
};
}
public static function drawCircle(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int):void{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
_local6 = 0;
_local7 = _arg4;
rect.x = (_arg2 - _local7);
rect.y = (_arg3 + _local6);
rect.width = (_local7 << 1);
_arg1.fillRect(rect, _arg5);
_local8 = (1 - _arg4);
while (_local6 < (_local7 - 1)) {
_local9 = _local7;
if (_local8 < 0){
_local6++;
} else {
_local6++;
_local7--;
};
if (_local8 < 0){
_local8 = ((_local8 + (_local6 << 1)) + 1);
} else {
_local8 = ((_local8 + ((_local6 - _local7) << 1)) + 1);
};
if ((((_local7 < _local9)) && ((_local6 < _local7)))){
rect.x = (_arg2 - _local6);
rect.y = (_arg3 + _local7);
rect.width = (_local6 << 1);
_arg1.fillRect(rect, _arg5);
rect.x = (_arg2 - _local6);
rect.y = (_arg3 - _local7);
rect.width = (_local6 << 1);
_arg1.fillRect(rect, _arg5);
};
rect.x = (_arg2 - _local7);
rect.y = (_arg3 + _local6);
rect.width = (_local7 << 1);
_arg1.fillRect(rect, _arg5);
rect.x = (_arg2 - _local7);
rect.y = (_arg3 - _local6);
rect.width = (_local7 << 1);
_arg1.fillRect(rect, _arg5);
};
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 104
//Sprite3D (net.odd1.bobbleheadBaseball.graphics.Sprite3D)
package net.odd1.bobbleheadBaseball.graphics {
import flash.geom.*;
public class Sprite3D extends Object3D implements IObject3D {
public function Sprite3D(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null, _arg4:Vector3D=null){
super(_arg1, _arg2, _arg3, _arg4);
}
public function draw():void{
var _local1:Point;
_local1 = engine.renderPoint(position);
x = _local1.x;
y = _local1.y;
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 105
//Vector3D (net.odd1.bobbleheadBaseball.graphics.Vector3D)
package net.odd1.bobbleheadBaseball.graphics {
public class Vector3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Vector3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function hypothenuseXZ(_arg1:Number=1):Number{
return (Math.sqrt((((x * _arg1) * (x * _arg1)) + ((z * _arg1) * (z * _arg1)))));
}
public function toString():String{
return ((((((("( " + x.toFixed(2)) + ", ") + y.toFixed(2)) + ", ") + z.toFixed(2)) + " )"));
}
public function clone():Vector3D{
return (new Vector3D(x, y, z));
}
}
}//package net.odd1.bobbleheadBaseball.graphics
Section 106
//ScreenManager (net.odd1.bobbleheadBaseball.managers.ScreenManager)
package net.odd1.bobbleheadBaseball.managers {
import net.odd1.bobbleheadBaseball.events.*;
import flash.display.*;
import flash.net.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import net.odd1.bobbleheadBaseball.screens.*;
public class ScreenManager extends Sprite {
public var stageHeight:int;
private var screens:Array;
private var sharedObject:SharedObject;
private var transition:Transition;
public var locale:XML;
private var initScreen:int;
public var soundManager:SoundManager;
private var transitionManager:TransitionManager;
public var stageWidth:int;
private var firstScreen:IBitmapDrawable;
public var data:XML;
public var isDebugging:Boolean;
public var screen:IScreen;
public var save:XML;
public function ScreenManager(_arg1:int, _arg2:int, _arg3:Array, _arg4:int, _arg5:SharedObject, _arg6:IBitmapDrawable=null, _arg7:Transition=null, _arg8:Boolean=false){
data = null;
save = null;
this.isDebugging = _arg8;
this.stageWidth = _arg1;
this.stageHeight = _arg2;
this.sharedObject = _arg5;
this.screens = _arg3;
transitionManager = new TransitionManager(this);
addChild(transitionManager);
soundManager = new SoundManager();
this.firstScreen = _arg6;
this.transition = _arg7;
initScreen = _arg4;
}
public function flush():void{
sharedObject.data.save = save;
sharedObject.flush();
}
public function render(_arg1:Number):void{
screen.render(_arg1);
transitionManager.render(_arg1);
soundManager.render(_arg1);
}
public function reload():void{
screen.reload();
}
public function mouseUp():void{
screen.mouseUp();
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
screen.keyPress(_arg1, _arg2);
}
public function mouseDown():void{
screen.mouseDown();
}
private function loadScreen(_arg1:int, _arg2:Transition=null):void{
if (screen){
if (((_arg2) && (!(isDebugging)))){
transitionManager.loadTransition((screen as IBitmapDrawable), _arg2);
};
screen.destroy();
removeChild((screen as Screen));
};
screen = (new (screens[_arg1]) as IScreen);
addChildAt((screen as Screen), 0);
screen.create(this);
screen.addEventListener(ScreenEvent.QUIT, quitHandler);
}
private function quitHandler(_arg1:ScreenEvent):void{
screen.removeEventListener(ScreenEvent.QUIT, quitHandler);
loadScreen(_arg1.nextScreen, _arg1.transition);
}
public function create():void{
if (((((firstScreen) && (transition))) && (!(isDebugging)))){
transitionManager.loadTransition(firstScreen, transition);
};
loadScreen(initScreen);
firstScreen = null;
transition = null;
initScreen = -1;
}
}
}//package net.odd1.bobbleheadBaseball.managers
Section 107
//SoundManager (net.odd1.bobbleheadBaseball.managers.SoundManager)
package net.odd1.bobbleheadBaseball.managers {
import flash.media.*;
import net.odd1.bobbleheadBaseball.game.*;
public class SoundManager {
private var isMuteMusic:Boolean;
private var isMute:Boolean;
private var isMuteSound:Boolean;
private var newSong:SoundChannel;
private var newVolume:Number;
private var song:SoundChannel;
public function SoundManager(){
isMute = false;
isMuteSound = false;
isMuteMusic = false;
song = null;
newSong = null;
}
public function playSong(_arg1:Sound, _arg2:Number=1):void{
var _local3:SoundTransform;
if (!isMuteMusic){
if (newSong){
newSong.stop();
};
newVolume = _arg2;
newSong = _arg1.play(0, 9999);
_local3 = newSong.soundTransform;
_local3.volume = 0;
newSong.soundTransform = _local3;
};
}
public function muteMusic():void{
isMuteMusic = !(isMuteMusic);
if (!isMuteMusic){
playSong(new GlobalVariables.menuMusic());
} else {
song.stop();
};
}
public function muteSound():void{
isMuteSound = !(isMuteSound);
}
public function mute():void{
isMute = !(isMute);
if (isMute){
SoundMixer.soundTransform = new SoundTransform(0);
} else {
SoundMixer.soundTransform = new SoundTransform(1);
};
}
public function playSound(_arg1:Sound, _arg2:int=0):void{
if (!isMuteSound){
_arg1.play(_arg2);
};
}
public function render(_arg1:Number):void{
var _local2:SoundTransform;
if (newSong){
if (song){
_local2 = song.soundTransform;
_local2.volume = (_local2.volume - (2 * _arg1));
song.soundTransform = _local2;
if (_local2.volume <= 0){
song.stop();
song = null;
};
} else {
_local2 = newSong.soundTransform;
_local2.volume = (_local2.volume + ((2 * newVolume) * _arg1));
newSong.soundTransform = _local2;
if (_local2.volume >= newVolume){
_local2.volume = newVolume;
newSong.soundTransform = _local2;
song = newSong;
newSong = null;
};
};
};
}
}
}//package net.odd1.bobbleheadBaseball.managers
Section 108
//TransitionManager (net.odd1.bobbleheadBaseball.managers.TransitionManager)
package net.odd1.bobbleheadBaseball.managers {
import net.odd1.bobbleheadBaseball.events.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.transitions.*;
public class TransitionManager extends Sprite {
private const WAIT:int = 2;
private var screenManager:ScreenManager;
private var transitions:Array;
public function TransitionManager(_arg1:ScreenManager){
this.screenManager = _arg1;
transitions = [];
mouseEnabled = false;
mouseChildren = false;
}
public function render(_arg1:Number):void{
var _local2:Transition;
for each (_local2 in transitions) {
if (_local2.wait++ > WAIT){
ITransition(_local2).render(_arg1);
};
};
}
private function finishHandler(_arg1:TransitionEvent):void{
var _local2:Transition;
_local2 = (_arg1.currentTarget as Transition);
(_local2 as ITransition).destroy();
transitions.splice(transitions.indexOf(_local2), 1);
removeChild(_local2);
_local2.removeEventListener(TransitionEvent.FINISH, finishHandler);
}
public function loadTransition(_arg1:IBitmapDrawable, _arg2:Transition):void{
_arg2.setScreen(_arg1, screenManager.stageWidth, screenManager.stageHeight);
transitions.push(_arg2);
addChildAt(_arg2, 0);
_arg2.addEventListener(TransitionEvent.FINISH, finishHandler);
}
}
}//package net.odd1.bobbleheadBaseball.managers
Section 109
//DoublePopup (net.odd1.bobbleheadBaseball.popups.DoublePopup)
package net.odd1.bobbleheadBaseball.popups {
public class DoublePopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 110
//HighscorePopup (net.odd1.bobbleheadBaseball.popups.HighscorePopup)
package net.odd1.bobbleheadBaseball.popups {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class HighscorePopup extends Popup {
public var agButton:SimpleButton;
public function HighscorePopup(){
agButton.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/sportsgames.html"), "_blank");
}
}
}//package net.odd1.bobbleheadBaseball.popups
Section 111
//HomerunPopup (net.odd1.bobbleheadBaseball.popups.HomerunPopup)
package net.odd1.bobbleheadBaseball.popups {
public class HomerunPopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 112
//MissionAccomplishedPopup (net.odd1.bobbleheadBaseball.popups.MissionAccomplishedPopup)
package net.odd1.bobbleheadBaseball.popups {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class MissionAccomplishedPopup extends Popup {
public var agButton:SimpleButton;
public function MissionAccomplishedPopup(){
agButton.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/sportsgames.html"), "_blank");
}
}
}//package net.odd1.bobbleheadBaseball.popups
Section 113
//MissionFailedPopup (net.odd1.bobbleheadBaseball.popups.MissionFailedPopup)
package net.odd1.bobbleheadBaseball.popups {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class MissionFailedPopup extends Popup {
public var agButton:SimpleButton;
public function MissionFailedPopup(){
agButton.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/sportsgames.html"), "_blank");
}
}
}//package net.odd1.bobbleheadBaseball.popups
Section 114
//OutPopup (net.odd1.bobbleheadBaseball.popups.OutPopup)
package net.odd1.bobbleheadBaseball.popups {
public class OutPopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 115
//Popup (net.odd1.bobbleheadBaseball.popups.Popup)
package net.odd1.bobbleheadBaseball.popups {
import net.odd1.bobbleheadBaseball.events.*;
import flash.display.*;
import flash.utils.*;
import gs.*;
import gs.easing.*;
public class Popup extends Sprite {
private const TIME_APPEAR:Number = 0.1;
private const TWEEN_DURATION:Number = 1.5;
private const TIME_DISAPEAR:Number = 1.5;
private var appeared:Boolean;
private var time:int;
public function Popup(){
appeared = false;
cacheAsBitmap = true;
x = -600;
TweenLite.to(this, 0.5, {x:135, ease:Back.easeOut});
time = getTimer();
}
public function render(_arg1:Number):void{
if (!appeared){
if (((((((getTimer() - time) >= 1000)) && (((((((!((this is MissionAccomplishedPopup))) && (!((this is MissionFailedPopup))))) && (!((this is HighscorePopup))))) && (!((this is UnlockedPopup))))))) || (((getTimer() - time) >= 3000)))){
appeared = true;
time = getTimer();
TweenLite.to(this, 1.5, {x:1240, ease:Back.easeIn});
};
} else {
if ((getTimer() - time) >= 2000){
dispatchEvent(new PopupEvent(PopupEvent.FINISH));
};
};
}
}
}//package net.odd1.bobbleheadBaseball.popups
Section 116
//SimplePopup (net.odd1.bobbleheadBaseball.popups.SimplePopup)
package net.odd1.bobbleheadBaseball.popups {
public class SimplePopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 117
//StrikeOutPopup (net.odd1.bobbleheadBaseball.popups.StrikeOutPopup)
package net.odd1.bobbleheadBaseball.popups {
public class StrikeOutPopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 118
//StrikePopup (net.odd1.bobbleheadBaseball.popups.StrikePopup)
package net.odd1.bobbleheadBaseball.popups {
public class StrikePopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 119
//TriplePopup (net.odd1.bobbleheadBaseball.popups.TriplePopup)
package net.odd1.bobbleheadBaseball.popups {
public class TriplePopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 120
//UnlockedPopup (net.odd1.bobbleheadBaseball.popups.UnlockedPopup)
package net.odd1.bobbleheadBaseball.popups {
public class UnlockedPopup extends Popup {
}
}//package net.odd1.bobbleheadBaseball.popups
Section 121
//DeathBat (net.odd1.bobbleheadBaseball.powerups.DeathBat)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class DeathBat extends Powerup {
public function DeathBat(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 122
//KnockBack (net.odd1.bobbleheadBaseball.powerups.KnockBack)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class KnockBack extends Powerup {
public function KnockBack(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 123
//Power (net.odd1.bobbleheadBaseball.powerups.Power)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class Power extends Powerup {
public function Power(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 124
//Powerup (net.odd1.bobbleheadBaseball.powerups.Powerup)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class Powerup extends Sprite3D {
public function Powerup(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
cacheAsBitmap = true;
xLength = 200;
yLength = 200;
zLength = 200;
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 125
//Precision (net.odd1.bobbleheadBaseball.powerups.Precision)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class Precision extends Powerup {
public function Precision(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 126
//PrecisionCap (net.odd1.bobbleheadBaseball.powerups.PrecisionCap)
package net.odd1.bobbleheadBaseball.powerups {
import net.odd1.bobbleheadBaseball.graphics.*;
public class PrecisionCap extends Powerup {
public function PrecisionCap(_arg1:Engine3D, _arg2:Vector3D=null, _arg3:Vector3D=null){
super(_arg1, _arg2, _arg3);
}
}
}//package net.odd1.bobbleheadBaseball.powerups
Section 127
//AGSplash (net.odd1.bobbleheadBaseball.screens.AGSplash)
package net.odd1.bobbleheadBaseball.screens {
import net.odd1.bobbleheadBaseball.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import flash.media.*;
import net.odd1.bobbleheadBaseball.game.*;
public final class AGSplash extends Screen implements IScreen {
private const AG_WIDTH:int = 550;
private const AG_HEIGHT:int = 400;
private const BACKGROUND:int = 0xFFFFFF;
private const FADEOUT:Number = 0.5;
private var screenManager:ScreenManager;
private var ag:MovieClip;
private static var SPLASH_AG:Class = AGSplash_SPLASH_AG;
public function AGSplash(){
screenManager = null;
}
public function render(_arg1:Number):void{
}
public function reload():void{
}
private function ag_endHandler(_arg1:SplashEvent):void{
stage.removeEventListener(SplashEvent.END, ag_endHandler);
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.CHARACTERS_SCREEN, new Fadeout(FADEOUT)));
}
public function mouseUp():void{
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
}
public function mouseDown():void{
}
public function destroy():void{
graphics.clear();
removeChild(ag);
screenManager.soundManager.playSong((new GlobalVariables.menuMusic() as Sound));
ag = null;
screenManager = null;
}
public function create(_arg1:ScreenManager):void{
this.screenManager = _arg1;
graphics.beginFill(BACKGROUND);
graphics.drawRect(0, 0, _arg1.stageWidth, _arg1.stageHeight);
graphics.endFill();
ag = new AGSplash.SPLASH_AG();
ag.scaleX = (_arg1.stageWidth / AG_WIDTH);
ag.scaleY = (_arg1.stageHeight / AG_HEIGHT);
addChild(ag);
stage.frameRate = 30;
stage.addEventListener(SplashEvent.END, ag_endHandler);
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 128
//AGSplash_SPLASH_AG (net.odd1.bobbleheadBaseball.screens.AGSplash_SPLASH_AG)
package net.odd1.bobbleheadBaseball.screens {
import mx.core.*;
import flash.utils.*;
public class AGSplash_SPLASH_AG extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function AGSplash_SPLASH_AG(){
dataClass = AGSplash_SPLASH_AG_dataClass;
super();
initialWidth = (11000 / 20);
initialHeight = (8000 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 129
//AGSplash_SPLASH_AG_dataClass (net.odd1.bobbleheadBaseball.screens.AGSplash_SPLASH_AG_dataClass)
package net.odd1.bobbleheadBaseball.screens {
import mx.core.*;
public class AGSplash_SPLASH_AG_dataClass extends ByteArrayAsset {
}
}//package net.odd1.bobbleheadBaseball.screens
Section 130
//Characters (net.odd1.bobbleheadBaseball.screens.Characters)
package net.odd1.bobbleheadBaseball.screens {
import net.odd1.bobbleheadBaseball.events.*;
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import flash.media.*;
import net.odd1.bobbleheadBaseball.game.*;
import net.odd1.bobbleheadBaseball.flash.*;
public final class Characters extends Screen implements IScreen {
private const FADEOUT:Number = 1;
private var screenManager:ScreenManager;
private var menu:CharactersFlash;
public function Characters(){
screenManager = null;
menu = null;
}
private function clickHandler(_arg1:MouseEvent):void{
if (menu.characterSelected != -1){
GlobalVariables.characterSelected = (menu.characterSelected - 1);
screenManager.soundManager.playSound((new GlobalVariables.click0Sound() as Sound));
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.LEVELS_SCREEN, new CircleIn(FADEOUT, screenManager)));
};
}
public function create(_arg1:ScreenManager):void{
this.screenManager = _arg1;
menu = new CharactersFlash(_arg1.soundManager);
menu.btn_start.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(menu);
stage.frameRate = 60;
}
public function mouseDown():void{
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
}
public function mouseUp():void{
}
public function render(_arg1:Number):void{
}
public function reload():void{
}
public function destroy():void{
menu.btn_start.removeEventListener(MouseEvent.CLICK, clickHandler);
removeChild(menu);
menu.destroy();
menu = null;
screenManager = null;
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 131
//Game (net.odd1.bobbleheadBaseball.screens.Game)
package net.odd1.bobbleheadBaseball.screens {
import net.odd1.bobbleheadBaseball.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import flash.media.*;
import net.odd1.bobbleheadBaseball.popups.*;
import flash.text.*;
import gs.*;
import net.odd1.bobbleheadBaseball.game.*;
import net.odd1.bobbleheadBaseball.utils.*;
import gs.easing.*;
import net.odd1.bobbleheadBaseball.characters.*;
import flash.filters.*;
public final class Game extends Screen implements IScreen {
private const LEVEL_WIDTH:int = 940;
private const BAT_LINE_SIZE:int = 60;
private const MAX_DEGREE:int = 15;
private const FADEOUT:Number = 1;
private const BAT_MIN_X:int = 250;
private const BAT_MAX_X:int = 390;
private const BAT_LINE_Y:int = 350;
private const LEVEL_HEIGHT:int = 480;
private const POPUP_X:int = 145;
private const BAT_TRANSITION:Number = 0.05;
private const POPUP_Y:int = 140;
private var realX:Number;
private var screenManager:ScreenManager;
private var mouseDeltaY:int;
private var mouseDeltaX:int;
public var popup:Popup;
private var engine:Engine;
private var pauseText:TextField;
private var isDebugging:Boolean;
private var pause:Boolean;
private var engineContainer:Sprite;
public function Game(){
pause = false;
isDebugging = false;
screenManager = null;
engineContainer = null;
engine = new Engine(LEVEL_WIDTH, LEVEL_HEIGHT, this);
}
public function destroy():void{
screenManager.soundManager.playSong((new GlobalVariables.menuMusic() as Sound));
screenManager = null;
isDebugging = false;
engine.destroy();
engineContainer.removeChild(engine);
removeChild(engineContainer);
engineContainer = null;
}
public function addPopup(_arg1:Popup):void{
if (this.popup){
killPopup(this.popup);
};
this.popup = _arg1;
_arg1.y = POPUP_Y;
addChild(_arg1);
_arg1.addEventListener(PopupEvent.FINISH, finishedHandler);
}
public function render(_arg1:Number):void{
var batter:Batter;
var degree:Number;
var destX:int;
var mouseX:int;
var mouseY:int;
var batDeltaX:Number;
var delta = _arg1;
if (((!(pause)) && (engine.canPlay))){
batter = engine.batter;
if (!batter.animation.isPlaying()){
if (!engine.isSwinging){
mouseX = (stage.mouseX - mouseDeltaX);
if (mouseX < (BAT_MIN_X - mouseDeltaX)){
mouseX = (BAT_MIN_X - mouseDeltaX);
} else {
if (mouseX > (BAT_MAX_X - mouseDeltaX)){
mouseX = (BAT_MAX_X - mouseDeltaX);
};
};
destX = (batter.startingPosition.x + (((mouseX - BAT_MIN_X) / (BAT_MAX_X - BAT_MIN_X)) * engine.batterRange));
batDeltaX = ((destX - batter.position.x) / (1 + (BAT_TRANSITION / delta)));
engine.batter.position.x = (engine.batter.position.x + batDeltaX);
};
mouseY = (stage.mouseY - mouseDeltaY);
if (mouseY < ((BAT_LINE_Y - BAT_LINE_SIZE) - mouseDeltaY)){
mouseY = ((BAT_LINE_Y - BAT_LINE_SIZE) - mouseDeltaY);
} else {
if (mouseY > ((BAT_LINE_Y + BAT_LINE_SIZE) + mouseDeltaY)){
mouseY = ((BAT_LINE_Y + BAT_LINE_SIZE) + mouseDeltaY);
};
};
degree = (((mouseY - BAT_LINE_Y) / BAT_LINE_SIZE) * MAX_DEGREE);
engine.bat.rotate.x = ((-(degree) / 360) * (Math.PI << 1));
engine.batter.rotateBat(degree, delta);
};
if (engine.isPitching){
realX = (realX + ((-(engine.ball.x) - realX) / (1 + (1 / delta))));
} else {
realX = (realX + ((0 - realX) / (1 + (0.2 / delta))));
};
engineContainer.x = int(realX);
if (engineContainer.x < -150){
engineContainer.x = -150;
} else {
if (engineContainer.x > 150){
engineContainer.x = 150;
};
};
try {
engine.render(delta);
} catch(e:Error) {
};
if (popup){
popup.render(delta);
};
};
}
public function reload():void{
engine.reload();
xmlLoad();
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
switch (_arg1){
case 81:
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.LEVELS_SCREEN, new CircleIn(FADEOUT, screenManager)));
break;
case 80:
pause = !(pause);
if (!pause){
pauseText.alpha = 0.75;
TweenLite.to(pauseText, 0.25, {alpha:0, ease:Cubic.easeIn});
} else {
TweenLite.to(pauseText, 0.25, {alpha:0.75, ease:Cubic.easeIn});
};
break;
};
}
private function xmlLoad():void{
mouseDeltaX = int(screenManager.data.game.levels.level[GlobalVariables.selectedLevel].characters.character[GlobalVariables.characterSelected].@mouseDeltaX);
mouseDeltaY = int(screenManager.data.game.levels.level[GlobalVariables.selectedLevel].characters.character[GlobalVariables.characterSelected].@mouseDeltaY);
}
public function mouseUp():void{
if (((!(pause)) && ((engine.batter.animation.getCurrentFrame() == 1)))){
engine.releaseBat();
};
}
public function mouseDown():void{
if (((!(pause)) && ((engine.batter.animation.getCurrentFrame() == 1)))){
engine.swingBat();
};
}
public function killPopup(_arg1:Popup):void{
removeChild(_arg1);
_arg1.removeEventListener(PopupEvent.FINISH, finishedHandler);
this.popup = null;
engine.popupFinished();
}
private function finishedHandler(_arg1:PopupEvent):void{
killPopup(popup);
}
public function create(_arg1:ScreenManager):void{
var _local2:Bitmap;
var _local3:Batter;
var _local4:Array;
engineContainer = new Sprite();
this.screenManager = _arg1;
isDebugging = _arg1.isDebugging;
engineContainer.x = 0;
realX = engineContainer.x;
_local4 = [0, 1, 2, 3];
ArrayUtil.removeElement(_local4, GlobalVariables.characterSelected);
engine.create(_arg1, GlobalVariables.selectedLevel, GlobalVariables.currentTask, GlobalVariables.characterSelected, ArrayUtil.randomArray(_local4), ArrayUtil.randomArray(_local4), ArrayUtil.randomArray(_local4));
engineContainer.addChild(engine);
addChildAt(engineContainer, 0);
pauseText = new TextField();
var _local5:TextFormat = new TextFormat("Score", 36);
pauseText.embedFonts = true;
pauseText.textColor = 0xFFFFFF;
pauseText.defaultTextFormat = _local5;
pauseText.filters = [new GlowFilter(0, 1, 6, 6, 4, BitmapFilterQuality.HIGH)];
pauseText.text = "Pause";
pauseText.selectable = false;
pauseText.width = 350;
pauseText.alpha = 0;
pauseText.x = ((_arg1.stageWidth / 2) - (pauseText.textWidth / 2));
pauseText.y = ((_arg1.stageHeight / 2) - (pauseText.textHeight / 2));
addChild(pauseText);
stage.frameRate = 60;
xmlLoad();
_arg1.soundManager.playSong((new GlobalVariables.gameMusic() as Sound), 0.5);
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 132
//IScreen (net.odd1.bobbleheadBaseball.screens.IScreen)
package net.odd1.bobbleheadBaseball.screens {
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
public interface IScreen extends IEventDispatcher {
function mouseUp():void;
function keyPress(_arg1:int, _arg2:Boolean):void;
function render(_arg1:Number):void;
function mouseDown():void;
function reload():void;
function destroy():void;
function create(_arg1:ScreenManager):void;
}
}//package net.odd1.bobbleheadBaseball.screens
Section 133
//Levels (net.odd1.bobbleheadBaseball.screens.Levels)
package net.odd1.bobbleheadBaseball.screens {
import net.odd1.bobbleheadBaseball.events.*;
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import net.odd1.bobbleheadBaseball.game.*;
import net.odd1.bobbleheadBaseball.flash.*;
import net.odd1.bobbleheadBaseball.utils.*;
public final class Levels extends Screen implements IScreen {
private const CHECKED:String = "checked";
private const TRUE:String = "true";
private const FADEOUT:Number = 1;
private const NOT_CHECKED:String = "noCheck";
private var currentTask:int;
private var menu:LevelsFlash;
private var screenManager:ScreenManager;
public function Levels(){
screenManager = null;
menu = null;
}
public function destroy():void{
removeChild(menu);
menu.btn_go.removeEventListener(MouseEvent.CLICK, go_clickHandler);
menu.btn_back.removeEventListener(MouseEvent.CLICK, back_clickHandler);
menu.btn_leftArrow.removeEventListener(MouseEvent.CLICK, arrow_clickHandler);
menu.btn_rightArrow.removeEventListener(MouseEvent.CLICK, arrow_clickHandler);
menu.destroy();
menu = null;
screenManager = null;
}
private function back_clickHandler(_arg1:MouseEvent):void{
GlobalVariables.selectedLevel = 0;
screenManager.soundManager.playSound(new GlobalVariables.click0Sound());
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.CHARACTERS_SCREEN, new CircleIn(FADEOUT, screenManager)));
}
private function arrow_clickHandler(_arg1:MouseEvent):void{
updateText();
}
public function reload():void{
updateText();
}
private function updateText():void{
var _local2:XMLList;
var _local3:XMLList;
var _local4:XML;
var _local1 = " ";
_local3 = screenManager.locale.levels.level[menu.selectedLevel].tasks;
_local2 = screenManager.data.game.levels.level[menu.selectedLevel].tasks;
menu.task0.text = StringUtil.printf(_local3.task[0].@text, StringUtil.separateThousand(int(_local2.task[0].@n), _local1));
menu.task1.text = StringUtil.printf(_local3.task[1].@text, StringUtil.separateThousand(int(_local2.task[1].@n), _local1));
menu.task2.text = StringUtil.printf(_local3.task[2].@text, StringUtil.separateThousand(int(_local2.task[2].@n), _local1));
_local4 = screenManager.save.characters.character[GlobalVariables.characterSelected].levels.level[menu.selectedLevel];
menu.totalScore.text = StringUtil.separateThousand(int(_local4.@totalscore));
menu.highscore.text = StringUtil.separateThousand(int(_local4.@highscore));
menu.homeruns.text = StringUtil.separateThousand(int(_local4.@homeruns));
menu.strikes.text = StringUtil.separateThousand(int(_local4.@strikes));
menu.hits.text = StringUtil.separateThousand(int(_local4.@hits));
menu.balls.text = StringUtil.separateThousand(int(_local4.@balls));
menu.items.text = StringUtil.separateThousand(int(_local4.@items));
currentTask = 0;
if (_local4.tasks.task[0].@isComplete == TRUE){
currentTask = 1;
menu.check0.gotoAndStop(CHECKED);
} else {
menu.check0.gotoAndStop(NOT_CHECKED);
};
if (_local4.tasks.task[1].@isComplete == TRUE){
currentTask = 2;
menu.check1.gotoAndStop(CHECKED);
} else {
menu.check1.gotoAndStop(NOT_CHECKED);
};
if (_local4.tasks.task[2].@isComplete == TRUE){
currentTask = 3;
menu.check2.gotoAndStop(CHECKED);
} else {
menu.check2.gotoAndStop(NOT_CHECKED);
};
}
public function mouseUp():void{
}
public function render(_arg1:Number):void{
}
public function mouseDown():void{
}
private function go_clickHandler(_arg1:MouseEvent):void{
GlobalVariables.currentTask = currentTask;
GlobalVariables.selectedLevel = menu.selectedLevel;
screenManager.soundManager.playSound(new GlobalVariables.click0Sound());
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.GAME_SCREEN, new CircleIn(FADEOUT, screenManager)));
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
}
public function create(_arg1:ScreenManager):void{
var _local2:XMLList;
var _local3:int;
this.screenManager = _arg1;
_local2 = _arg1.save.characters.character[GlobalVariables.characterSelected].levels;
if (_local2.level[2].tasks.task[2].@isComplete == TRUE){
_local3 = 3;
} else {
if (_local2.level[1].tasks.task[2].@isComplete == TRUE){
_local3 = 2;
} else {
if (_local2.level[0].tasks.task[2].@isComplete == TRUE){
_local3 = 1;
};
};
};
if (_arg1.isDebugging){
_local3 = 3;
};
menu = new LevelsFlash(GlobalVariables.selectedLevel, _local3, _arg1.soundManager);
addChild(menu);
reload();
stage.frameRate = 60;
menu.btn_go.addEventListener(MouseEvent.CLICK, go_clickHandler);
menu.btn_back.addEventListener(MouseEvent.CLICK, back_clickHandler);
menu.btn_leftArrow.addEventListener(MouseEvent.CLICK, arrow_clickHandler);
menu.btn_rightArrow.addEventListener(MouseEvent.CLICK, arrow_clickHandler);
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 134
//Odd1Splash (net.odd1.bobbleheadBaseball.screens.Odd1Splash)
package net.odd1.bobbleheadBaseball.screens {
import net.odd1.bobbleheadBaseball.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import net.odd1.bobbleheadBaseball.game.*;
public final class Odd1Splash extends Screen implements IScreen {
private const BACKGROUND:int = 0xFFFFFF;
private const FADEOUT:Number = 1;
private var screenManager:ScreenManager;
private var odd1:MovieClip;
private static var SPLASH_ODD1:Class = Odd1Splash_SPLASH_ODD1;
public function Odd1Splash(){
screenManager = null;
}
public function reload():void{
}
public function mouseDown():void{
}
private function odd1_endHandler(_arg1:SplashEvent):void{
stage.removeEventListener(SplashEvent.END, odd1_endHandler);
dispatchEvent(new ScreenEvent(ScreenEvent.QUIT, GlobalVariables.AGSPLASH_SCREEN, new Fadeout(FADEOUT)));
}
public function mouseUp():void{
}
public function create(_arg1:ScreenManager):void{
this.screenManager = _arg1;
graphics.beginFill(BACKGROUND);
graphics.drawRect(0, 0, _arg1.stageWidth, _arg1.stageHeight);
graphics.endFill();
odd1 = new Odd1Splash.SPLASH_ODD1();
addChild(odd1);
stage.frameRate = 30;
stage.addEventListener(SplashEvent.END, odd1_endHandler);
}
public function render(_arg1:Number):void{
}
public function destroy():void{
graphics.clear();
Loader(odd1.getChildAt(0)).unload();
removeChild(odd1);
odd1 = null;
screenManager = null;
}
public function keyPress(_arg1:int, _arg2:Boolean):void{
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 135
//Odd1Splash_SPLASH_ODD1 (net.odd1.bobbleheadBaseball.screens.Odd1Splash_SPLASH_ODD1)
package net.odd1.bobbleheadBaseball.screens {
import mx.core.*;
import flash.utils.*;
public class Odd1Splash_SPLASH_ODD1 extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function Odd1Splash_SPLASH_ODD1(){
dataClass = Odd1Splash_SPLASH_ODD1_dataClass;
super();
initialWidth = (0x3200 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package net.odd1.bobbleheadBaseball.screens
Section 136
//Odd1Splash_SPLASH_ODD1_dataClass (net.odd1.bobbleheadBaseball.screens.Odd1Splash_SPLASH_ODD1_dataClass)
package net.odd1.bobbleheadBaseball.screens {
import mx.core.*;
public class Odd1Splash_SPLASH_ODD1_dataClass extends ByteArrayAsset {
}
}//package net.odd1.bobbleheadBaseball.screens
Section 137
//Screen (net.odd1.bobbleheadBaseball.screens.Screen)
package net.odd1.bobbleheadBaseball.screens {
import flash.display.*;
public class Screen extends Sprite {
}
}//package net.odd1.bobbleheadBaseball.screens
Section 138
//CircleIn (net.odd1.bobbleheadBaseball.transitions.CircleIn)
package net.odd1.bobbleheadBaseball.transitions {
import net.odd1.bobbleheadBaseball.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import net.odd1.bobbleheadBaseball.graphics.*;
public final class CircleIn extends Transition implements ITransition {
private const MASK_COLOR:int = 0;
private var radiusTarget:Number;
private var radiusDelta:Number;
private var radius:Number;
public function CircleIn(_arg1:Number, _arg2:ScreenManager){
super(_arg2);
this.screenManager = _arg2;
radius = 0;
radiusTarget = Math.sqrt((((_arg2.stageWidth >> 1) * (_arg2.stageWidth >> 1)) + ((_arg2.stageHeight >> 1) * (_arg2.stageHeight >> 1))));
radiusDelta = (radiusTarget / _arg1);
}
public function destroy():void{
radiusDelta = -1;
radiusTarget = -1;
radius = -1;
dispose();
}
public function render(_arg1:Number):void{
radius = (radius + (radiusDelta * _arg1));
if (radius >= radiusTarget){
dispatchEvent(new TransitionEvent(TransitionEvent.FINISH));
} else {
if (radius > 1){
Raster.drawCircle(bitmapData, (screenManager.stageWidth >> 1), (screenManager.stageHeight >> 1), radius, MASK_COLOR);
};
};
}
}
}//package net.odd1.bobbleheadBaseball.transitions
Section 139
//Fadeout (net.odd1.bobbleheadBaseball.transitions.Fadeout)
package net.odd1.bobbleheadBaseball.transitions {
import net.odd1.bobbleheadBaseball.events.*;
public final class Fadeout extends Transition implements ITransition {
private var alphaDelta:Number;
public function Fadeout(_arg1:Number){
super(null);
alpha = 1;
alphaDelta = (1 / _arg1);
}
public function destroy():void{
alphaDelta = -1;
dispose();
}
public function render(_arg1:Number):void{
alpha = (alpha - (alphaDelta * _arg1));
if (alpha <= 0){
alpha = 0;
dispatchEvent(new TransitionEvent(TransitionEvent.FINISH));
};
}
}
}//package net.odd1.bobbleheadBaseball.transitions
Section 140
//ITransition (net.odd1.bobbleheadBaseball.transitions.ITransition)
package net.odd1.bobbleheadBaseball.transitions {
import flash.events.*;
public interface ITransition extends IEventDispatcher {
function destroy():void;
function render(_arg1:Number):void;
}
}//package net.odd1.bobbleheadBaseball.transitions
Section 141
//Transition (net.odd1.bobbleheadBaseball.transitions.Transition)
package net.odd1.bobbleheadBaseball.transitions {
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
public class Transition extends Bitmap {
private const DEFAULT_COLOR:uint = 0;
private const TRANSPARENT:Boolean = true;
private const SMOOTHING:Boolean = false;
public var screenManager:ScreenManager;
public var wait:int;
public function Transition(_arg1:ScreenManager){
wait = 0;
this.screenManager = _arg1;
super(null, PixelSnapping.ALWAYS, SMOOTHING);
}
public function setScreen(_arg1:IBitmapDrawable, _arg2:int, _arg3:int):void{
bitmapData = new BitmapData(_arg2, _arg3, TRANSPARENT, DEFAULT_COLOR);
bitmapData.draw(_arg1);
}
public function dispose():void{
screenManager = null;
bitmapData.dispose();
}
}
}//package net.odd1.bobbleheadBaseball.transitions
Section 142
//TextShadow (net.odd1.bobbleheadBaseball.ui.TextShadow)
package net.odd1.bobbleheadBaseball.ui {
import flash.display.*;
import flash.text.*;
import flash.filters.*;
public final class TextShadow extends Sprite {
private const SPACE:int = 5;
private const BACKGROUND_Y:int = 1;
private var foreground:TextField;
private var background:TextField;
public function TextShadow(_arg1:Boolean=false, _arg2:int=0xFFFFFF, _arg3:int=0x666666){
var _local4:TextFormat;
super();
mouseEnabled = false;
mouseChildren = false;
_local4 = new TextFormat("Default", 10);
foreground = new TextField();
background = new TextField();
foreground.mouseEnabled = false;
background.mouseEnabled = false;
foreground.textColor = _arg2;
background.textColor = _arg3;
foreground.defaultTextFormat = _local4;
background.defaultTextFormat = _local4;
foreground.selectable = false;
background.selectable = false;
foreground.embedFonts = true;
background.embedFonts = true;
background.y = BACKGROUND_Y;
addChild(background);
addChild(foreground);
if (_arg1){
filters = [new GlowFilter(0, 1, 3, 3, 4, 1, false, false)];
};
}
public function set text(_arg1:String):void{
foreground.text = _arg1;
background.text = _arg1;
foreground.width = (foreground.textWidth + SPACE);
foreground.height = (foreground.textHeight + SPACE);
background.width = (background.textWidth + SPACE);
background.height = (background.textHeight + SPACE);
}
public function get text():String{
return (foreground.text);
}
}
}//package net.odd1.bobbleheadBaseball.ui
Section 143
//ArrayUtil (net.odd1.bobbleheadBaseball.utils.ArrayUtil)
package net.odd1.bobbleheadBaseball.utils {
public final class ArrayUtil {
public static function removeElement(_arg1:Array, _arg2):void{
_arg1.splice(_arg1.indexOf(_arg2), 1);
}
public static function randomArray(_arg1:Array){
var _local2:int;
var _local3:*;
_local2 = (Math.random() * _arg1.length);
_local3 = _arg1[_local2];
_arg1.splice(_local2, 1);
return (_local3);
}
}
}//package net.odd1.bobbleheadBaseball.utils
Section 144
//StringUtil (net.odd1.bobbleheadBaseball.utils.StringUtil)
package net.odd1.bobbleheadBaseball.utils {
public final class StringUtil {
public static function printf(_arg1:String, _arg2:String):String{
return (_arg1.replace("%d", _arg2));
}
public static function separateThousand(_arg1:int, _arg2:String=","):String{
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:String;
_local6 = "";
_local5 = _arg1.toString();
_local4 = (Math.ceil((_local5.length / 3)) - 1);
_local3 = 1;
while (_local3 <= _local4) {
_local6 = ((_arg2 + _local5.substr((_local5.length - (_local3 * 3)), 3)) + _local6);
_local3++;
};
_local6 = (_local5.substr(0, (_local5.length - (_local4 * 3))) + _local6);
return (_local6);
}
}
}//package net.odd1.bobbleheadBaseball.utils
Section 145
//Preloader (net.odd1.bobbleheadBaseball.Preloader)
package net.odd1.bobbleheadBaseball {
import flash.events.*;
import flash.display.*;
import net.odd1.bobbleheadBaseball.flash.*;
import flash.utils.*;
public class Preloader extends MovieClip {
private const BAR_WIDTH:int = 450;
private const STAGE_WIDTH:int = 640;
private const STAGE_HEIGHT:int = 480;
private const FRAMERATE:int = 0xFFFF;
private const BACKGROUND_COLOR:int = 0xFFFFFF;
private const BAR_HEIGHT:int = 10;
private const CLASS:String = "BobbleheadBaseball";
private const BAR_COLOR:int = 0xAA0000;
private var bar:Sprite;
private var preloader:Sprite;
private var background:PreloaderFlash;
public function Preloader(){
stop();
stage.frameRate = FRAMERATE;
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.quality = StageQuality.HIGH;
preloader = new Sprite();
bar = new Sprite();
graphics.beginFill(BACKGROUND_COLOR);
graphics.drawRect(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
graphics.endFill();
preloader.addChild(bar);
background = new PreloaderFlash();
addChild(background);
addChild(preloader);
stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
public function destroy():void{
removeChild(background);
removeChild(preloader);
bar = null;
preloader = null;
background.destroy();
background = null;
}
public function enterFrameHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Class;
var _local4:Object;
var _local5:Graphics;
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
_local5 = bar.graphics;
_local5.clear();
_local5.beginFill(BAR_COLOR);
_local5.drawRect(((STAGE_WIDTH / 2) - (BAR_WIDTH / 2)), (((STAGE_HEIGHT / 2) - (BAR_HEIGHT / 2)) + 100), (BAR_WIDTH * _local2), BAR_HEIGHT);
_local5.endFill();
if (framesLoaded == totalFrames){
nextFrame();
_local3 = Class(getDefinitionByName(CLASS));
if (_local3){
_local4 = new _local3(this);
addChild((_local4 as DisplayObject));
};
stage.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
};
}
}
}//package net.odd1.bobbleheadBaseball
Section 146
//_FontFaceRules (_FontFaceRules)
package {
import mx.core.*;
import flash.display.*;
public class _FontFaceRules extends Sprite {
private static var _embed__font_Default_bold_normal_2083184882:Class = _FontFaceRules__embed__font_Default_bold_normal_2083184882;
private static var _embed__font_Score_medium_normal_194636306:Class = _FontFaceRules__embed__font_Score_medium_normal_194636306;
private static var _embed__font_Task_medium_normal_1919842245:Class = _FontFaceRules__embed__font_Task_medium_normal_1919842245;
public static function init(_arg1:IFlexModuleFactory):void{
}
}
}//package
Section 147
//_FontFaceRules__embed__font_Default_bold_normal_2083184882 (_FontFaceRules__embed__font_Default_bold_normal_2083184882)
package {
import mx.core.*;
public class _FontFaceRules__embed__font_Default_bold_normal_2083184882 extends FontAsset {
}
}//package
Section 148
//_FontFaceRules__embed__font_Score_medium_normal_194636306 (_FontFaceRules__embed__font_Score_medium_normal_194636306)
package {
import mx.core.*;
public class _FontFaceRules__embed__font_Score_medium_normal_194636306 extends FontAsset {
}
}//package
Section 149
//_FontFaceRules__embed__font_Task_medium_normal_1919842245 (_FontFaceRules__embed__font_Task_medium_normal_1919842245)
package {
import mx.core.*;
public class _FontFaceRules__embed__font_Task_medium_normal_1919842245 extends FontAsset {
}
}//package
Section 150
//BobbleheadBaseball (BobbleheadBaseball)
package {
import net.odd1.bobbleheadBaseball.*;
import net.odd1.bobbleheadBaseball.events.*;
import flash.events.*;
import net.odd1.bobbleheadBaseball.managers.*;
import flash.display.*;
import flash.net.*;
import net.odd1.bobbleheadBaseball.transitions.*;
import flash.media.*;
import flash.utils.*;
import flash.ui.*;
import net.odd1.bobbleheadBaseball.data.*;
import net.odd1.bobbleheadBaseball.ui.*;
import net.odd1.bobbleheadBaseball.game.*;
import flash.system.*;
public class BobbleheadBaseball extends Sprite {
private const XML_VERSION_URL:String = "version";
private const XML_DATA_URL:String = "data";
private const DEFAULT_PATH:String = "";
private const STAGE_WIDTH:int = 640;
private const ONE_SECOND:int = 1000;
private const XML_LOCALE_POS:int = 1;
private const MEGABYTES:Number = 0x100000;
private const XML_LOCALE:Array;
private const MOCHIBOT_CODE:String = "07d1e2e6";
private const STAGE_HEIGHT:int = 480;
private const FRAMERATE:int = 30;
private const DEBUG_PATH:String = "../src/";
private const XML_LOCALE_URL:String = "locale/";
private const XML_SAVE_POS:int = 3;
private const BORDER_WIDTH:int = 1000;
private const XML_SAVE_URL:String = "save";
private const XML_EXTENSION:String = ".xml";
private const SHARED_OBJECT:String = "bobbleheadBaseball";
private const PRELOADER_TRANSITION:Number = 0.4;
private const XML_VERSION_POS:int = 2;
private const XML_DATA_POS:int = 0;
private const XML_PATH:String = "GameAssets/Dynamic/Global/data/";
private const BORDER_COLOR:int = 0;
private const BACKGROUND_COLOR:int = 0x666666;
private const XML_DEFAULT_LANGUAGE:int = 0;
private var fps:int;
private var customContext:ContextMenu;
private var lastTime:int;
private var firstTime:Boolean;
private var buildAuthor:String;
private var screenManager:ScreenManager;
private var xmlLoader:XMLLoader;
private var fpsCount:int;
private var fpsTime:int;
private var buildTime:String;
private var buildNumber:String;
private var infoText:TextShadow;
private var preloader:Preloader;
public static const IS_INFO_DISPLAY:Boolean = false;
public static const IS_DEBUGGING:Boolean = false;
private static var XML_LOCALE_EN_US_BYTES:Class = BobbleheadBaseball_XML_LOCALE_EN_US_BYTES;
private static var XML_VERSION_BYTES:Class = BobbleheadBaseball_XML_VERSION_BYTES;
private static var XML_SAVE_BYTES:Class = BobbleheadBaseball_XML_SAVE_BYTES;
private static var XML_DATA_BYTES:Class = BobbleheadBaseball_XML_DATA_BYTES;
public function BobbleheadBaseball(_arg1:Preloader){
var _local2:String;
var _local3:Fadeout;
var _local4:SharedObject;
var _local5:ContextMenuItem;
var _local6:Array;
XML_LOCALE = ["en-US"];
super();
this.preloader = _arg1;
if (IS_DEBUGGING){
_local2 = DEBUG_PATH;
} else {
_local2 = DEFAULT_PATH;
};
_local6 = [(((_local2 + XML_PATH) + XML_DATA_URL) + XML_EXTENSION)];
_local4 = SharedObject.getLocal(SHARED_OBJECT);
_local3 = new Fadeout(PRELOADER_TRANSITION);
if (IS_DEBUGGING){
screenManager = new ScreenManager(STAGE_WIDTH, STAGE_HEIGHT, GlobalVariables.screens, GlobalVariables.CHARACTERS_SCREEN, _local4, _arg1, _local3, IS_DEBUGGING);
screenManager.soundManager.playSong((new GlobalVariables.menuMusic() as Sound));
} else {
screenManager = new ScreenManager(STAGE_WIDTH, STAGE_HEIGHT, GlobalVariables.screens, GlobalVariables.ODD1SPLASH_SCREEN, _local4, _arg1, _local3, IS_DEBUGGING);
};
if (_local4.data.save == undefined){
firstTime = true;
GlobalVariables.locale = XML_LOCALE[XML_DEFAULT_LANGUAGE];
_local6.push(((((_local2 + XML_PATH) + XML_LOCALE_URL) + GlobalVariables.locale) + XML_EXTENSION));
_local6.push((((_local2 + XML_PATH) + XML_VERSION_URL) + XML_EXTENSION));
_local6.push((((_local2 + XML_PATH) + XML_SAVE_URL) + XML_EXTENSION));
} else {
firstTime = false;
screenManager.save = _local4.data.save;
GlobalVariables.locale = screenManager.save.global.@locale;
GlobalVariables.firstTime = true;
_local6.push(((((_local2 + XML_PATH) + XML_LOCALE_URL) + GlobalVariables.locale) + XML_EXTENSION));
_local6.push((((_local2 + XML_PATH) + XML_VERSION_URL) + XML_EXTENSION));
};
if (IS_DEBUGGING){
loadEmbedded();
} else {
loadEmbedded();
};
customContext = new ContextMenu();
customContext.hideBuiltInItems();
_local5 = new ContextMenuItem("AddictingGames.com");
_local5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, ag_menuItemSelectHandler);
customContext.customItems.push(_local5);
_local5 = new ContextMenuItem("Odd1.net");
_local5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, odd1_menuItemSelectHandler);
customContext.customItems.push(_local5);
contextMenu = customContext;
}
private function create():void{
var _local1:Shape;
var _local2:Graphics;
if (!IS_DEBUGGING){
MochiBot.track(this, MOCHIBOT_CODE);
};
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.quality = StageQuality.HIGH;
stage.frameRate = FRAMERATE;
lastTime = getTimer();
addChild(screenManager);
screenManager.create();
preloader.destroy();
if (IS_INFO_DISPLAY){
fps = 0;
fpsCount = 0;
fpsTime = getTimer();
infoText = new TextShadow(true);
addChild(infoText);
};
_local1 = new Shape();
_local2 = _local1.graphics;
_local2.beginFill(BORDER_COLOR);
_local2.drawRect(-(BORDER_WIDTH), -(BORDER_WIDTH), ((BORDER_WIDTH << 1) + STAGE_WIDTH), BORDER_WIDTH);
_local2.drawRect(-(BORDER_WIDTH), STAGE_HEIGHT, ((BORDER_WIDTH << 1) + STAGE_WIDTH), BORDER_WIDTH);
_local2.drawRect(-(BORDER_WIDTH), 0, BORDER_WIDTH, STAGE_HEIGHT);
_local2.drawRect(STAGE_WIDTH, 0, BORDER_WIDTH, STAGE_HEIGHT);
_local2.endFill();
addChild(_local1);
graphics.beginFill(BACKGROUND_COLOR);
graphics.drawRect(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
graphics.endFill();
stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(Event.DEACTIVATE, deactivateHandler);
}
private function loadEmbedded():void{
var _local1:XMLList;
_local1 = new XML(new _slot1.XML_VERSION_BYTES()).version;
buildAuthor = _local1.@author;
buildNumber = _local1.@build;
buildTime = _local1.@time;
screenManager.data = new XML(new _slot1.XML_DATA_BYTES());
switch (GlobalVariables.locale){
default:
screenManager.locale = new XML(new _slot1.XML_LOCALE_EN_US_BYTES());
break;
};
if (firstTime){
screenManager.save = new XML(new _slot1.XML_SAVE_BYTES());
screenManager.flush();
};
if (stage){
create();
} else {
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
};
}
private function mouseUpHandler(_arg1:MouseEvent):void{
screenManager.mouseUp();
}
private function loadCompleteHandler(_arg1:DataEvent):void{
var _local2:XMLList;
xmlLoader.removeEventListener(DataEvent.LOAD_COMPLETE, loadCompleteHandler);
_local2 = XML(xmlLoader.loadedData[XML_VERSION_POS]).version;
buildAuthor = _local2.@author;
buildNumber = _local2.@build;
buildTime = _local2.@time;
screenManager.data = xmlLoader.loadedData[XML_DATA_POS];
screenManager.locale = xmlLoader.loadedData[XML_LOCALE_POS];
if (firstTime){
screenManager.save = xmlLoader.loadedData[XML_SAVE_POS];
screenManager.flush();
};
xmlLoader = null;
if (stage){
create();
} else {
addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
};
}
private function enterFrameHandler(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = getTimer();
screenManager.render(((_local2 - lastTime) / ONE_SECOND));
lastTime = _local2;
if (IS_INFO_DISPLAY){
_local3 = getTimer();
fpsCount++;
if ((_local3 - fpsTime) > ONE_SECOND){
fps = fpsCount;
fpsCount = 0;
fpsTime = _local3;
};
infoText.text = (((((((((((((((("FPS : " + fps) + "\n") + "Memory : ") + (System.totalMemory / MEGABYTES).toFixed(2)) + " MB\n") + "Code : ") + (_local3 - _local2)) + " ms\n\n") + "Author : ") + buildAuthor) + "\n") + "Build : ") + buildNumber) + "\n") + "Date : ") + buildTime);
};
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
screenManager.keyPress(_arg1.keyCode, true);
}
private function addedToStageHandler(_arg1:Event):void{
create();
removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
}
private function odd1_menuItemSelectHandler(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.odd1.net/"), "_blank");
}
private function deactivateHandler(_arg1:Event):void{
}
private function mouseDownHandler(_arg1:MouseEvent):void{
screenManager.mouseDown();
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:Array;
_local2 = _arg1.keyCode;
if (IS_DEBUGGING){
switch (_local2){
case 82:
_local3 = [(((DEBUG_PATH + XML_PATH) + XML_DATA_URL) + XML_EXTENSION), ((((DEBUG_PATH + XML_PATH) + XML_LOCALE_URL) + GlobalVariables.locale) + XML_EXTENSION)];
xmlLoader = new XMLLoader(_local3);
xmlLoader.addEventListener(DataEvent.LOAD_COMPLETE, reloadCompleteHandler);
};
};
screenManager.keyPress(_local2, false);
}
private function ag_menuItemSelectHandler(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.addictinggames.com/"), "_blank");
}
private function reloadCompleteHandler(_arg1:DataEvent):void{
xmlLoader.removeEventListener(DataEvent.LOAD_COMPLETE, loadCompleteHandler);
screenManager.data = xmlLoader.loadedData[XML_DATA_POS];
screenManager.locale = xmlLoader.loadedData[XML_LOCALE_POS];
xmlLoader = null;
screenManager.reload();
}
}
}//package
Section 151
//BobbleheadBaseball_XML_DATA_BYTES (BobbleheadBaseball_XML_DATA_BYTES)
package {
import mx.core.*;
public class BobbleheadBaseball_XML_DATA_BYTES extends ByteArrayAsset {
}
}//package
Section 152
//BobbleheadBaseball_XML_LOCALE_EN_US_BYTES (BobbleheadBaseball_XML_LOCALE_EN_US_BYTES)
package {
import mx.core.*;
public class BobbleheadBaseball_XML_LOCALE_EN_US_BYTES extends ByteArrayAsset {
}
}//package
Section 153
//BobbleheadBaseball_XML_SAVE_BYTES (BobbleheadBaseball_XML_SAVE_BYTES)
package {
import mx.core.*;
public class BobbleheadBaseball_XML_SAVE_BYTES extends ByteArrayAsset {
}
}//package
Section 154
//BobbleheadBaseball_XML_VERSION_BYTES (BobbleheadBaseball_XML_VERSION_BYTES)
package {
import mx.core.*;
public class BobbleheadBaseball_XML_VERSION_BYTES extends ByteArrayAsset {
}
}//package
Section 155
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package