Section 1
//helpbutton_30 (baseball_fla.helpbutton_30)
package baseball_fla {
import flash.display.*;
public dynamic class helpbutton_30 extends MovieClip {
public function helpbutton_30(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package baseball_fla
Section 2
//menubutton_19 (baseball_fla.menubutton_19)
package baseball_fla {
import flash.display.*;
public dynamic class menubutton_19 extends MovieClip {
public function menubutton_19(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package baseball_fla
Section 3
//startbutton_21 (baseball_fla.startbutton_21)
package baseball_fla {
import flash.display.*;
public dynamic class startbutton_21 extends MovieClip {
public function startbutton_21(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package baseball_fla
Section 4
//SimpleStatableObject (Entity.SimpleStatableObject)
package Entity {
import flash.display.*;
public class SimpleStatableObject extends Sprite {
protected var m_state:String;// = null
protected var m_stateTime:Number;// = 0
final public function changeState(_arg1:String):void{
onChangeState(m_state, _arg1);
m_stateTime = 0;
m_state = _arg1;
}
protected function onChangeState(_arg1:String, _arg2:String):void{
}
final public function update(_arg1:Number):void{
m_stateTime = (m_stateTime + _arg1);
vUpdate(_arg1);
}
protected function vUpdate(_arg1:Number):void{
}
}
}//package Entity
Section 5
//GameState (Main.GameState)
package Main {
import flash.display.*;
import flash.events.*;
public class GameState extends MovieClip {
protected var m_liveTime:Number;
private var m_isInitiliazed:Boolean;// = false
private var m_name:String;// = "no_name"
public function onKey(_arg1:KeyboardEvent):void{
}
public function getName():String{
return (m_name);
}
public function onMouseClick(_arg1:Number, _arg2:Number):void{
}
public function isInitiliazed():Boolean{
return (m_isInitiliazed);
}
public function onCleanup():void{
}
final public function internalUpdate(_arg1:Number):void{
m_liveTime = (m_liveTime + _arg1);
update(_arg1);
}
public function onStop():void{
}
public function update(_arg1:Number):void{
}
public function onResume():void{
}
public function setName(_arg1:String):void{
m_name = _arg1;
}
public function onInit():void{
}
public function InternalInit():void{
if (!m_isInitiliazed){
m_isInitiliazed = true;
onPreInit();
};
m_liveTime = 0;
onInit();
}
public function onPreInit():void{
}
public function handleMouseDown(_arg1:Number, _arg2:Number):void{
}
}
}//package Main
Section 6
//StateManager (Main.StateManager)
package Main {
import flash.display.*;
import flash.events.*;
import States.*;
import flash.text.*;
public class StateManager extends MovieClip {
var m_lastState:GameState;// = null
public var loading_bar:MovieClip;
var m_states:Array;
public var iriy_soft:SimpleButton;
public var games96:SimpleButton;
public var loading_label:TextField;
var m_overlayLayer:MovieClip;
static var m_instance:StateManager = null;
public function StateManager(){
m_states = new Array();
m_overlayLayer = new MovieClip();
super();
stop();
m_instance = this;
pushState(CurrentPreloaderState.getInstance());
addEventListener(Event.ENTER_FRAME, update);
stage.addEventListener(MouseEvent.CLICK, onMouseClick);
stage.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function popState():void{
if (m_states.length != 0){
m_lastState = m_states[(m_states.length - 1)];
m_lastState.onCleanup();
m_states.pop();
removeChild(m_lastState);
if (m_states.length != 0){
m_states[(m_states.length - 1)].onResume();
};
};
onStateChanging();
}
public function changeState(_arg1:GameState):void{
if (m_states.length != 0){
m_lastState = m_states[(m_states.length - 1)];
};
while (m_states.length != 0) {
popState();
};
pushState(_arg1);
}
function onKey(_arg1:KeyboardEvent):void{
if (m_states.length != 0){
m_states[(m_states.length - 1)].onKey(_arg1);
};
}
public function hitTestOverlays(_arg1:Number, _arg2:Number):Boolean{
var _local3:int;
while (_local3 < m_overlayLayer.numChildren) {
if (m_overlayLayer.getChildAt(_local3).hitTestPoint(_arg1, _arg2)){
return (true);
};
_local3++;
};
return (false);
}
function update(_arg1:Event):void{
if (m_states.length != 0){
m_states[(m_states.length - 1)].internalUpdate((1 / stage.frameRate));
};
}
public function pushState(_arg1:GameState):void{
if (m_states.length != 0){
m_lastState = m_states[(m_states.length - 1)];
m_lastState.onStop();
} else {
m_lastState = _arg1;
};
m_states.push(_arg1);
addChild(_arg1);
_arg1.InternalInit();
onStateChanging();
}
function handleMouseDown(_arg1:MouseEvent):void{
if (m_states.length != 0){
m_states[(m_states.length - 1)].handleMouseDown(_arg1.stageX, _arg1.stageY);
};
}
function onMouseClick(_arg1:MouseEvent):void{
if (m_states.length != 0){
m_states[(m_states.length - 1)].onMouseClick(_arg1.stageX, _arg1.stageY);
};
}
public function getLastState():GameState{
return (m_lastState);
}
public function addOverlay(_arg1:DisplayObject):void{
m_overlayLayer.addChild(_arg1);
}
public function getTopState():GameState{
return (m_states[(m_states.length - 1)]);
}
public function coolChangeState(_arg1:GameState):void{
pushState(ShadeInState.getInstance());
ShadeInState.getInstance().setNextState(_arg1);
}
function onStateChanging():void{
addChild(m_overlayLayer);
}
public static function getInstance():StateManager{
return (m_instance);
}
}
}//package Main
Section 7
//Ball (States.PlayState.Ball)
package States.PlayState {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class Ball extends PhysicalObject {
const m_maxDeadTime:Number = 0.7;
var m_isDead:Boolean;// = false
var m_animation:MovieClip;// = null
var m_wasRebound:Boolean;// = false
var m_rotationSpeed:Number;
var m_deadTime:Number;// = 0
var m_liveTime:Number;// = 0
var m_shadow:MovieClip;// = null
public function Ball(){
addGravity();
m_shadow = ResCreator.createMC("shadow");
addChild(m_shadow);
m_animation = ResCreator.createMC("ball");
addChild(m_animation);
m_rotationSpeed = Utils.RandomRange(-800, 800);
}
function wasRebound():Boolean{
return (m_wasRebound);
}
override public function setSpeed(_arg1:Vector3):void{
super.setSpeed(_arg1);
}
function setScale(_arg1:Number):void{
m_animation.scaleX = _arg1;
m_animation.scaleY = _arg1;
m_shadow.scaleX = _arg1;
m_shadow.scaleY = _arg1;
}
override public function update(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
m_liveTime = (m_liveTime + _arg1);
if (!m_isDead){
super.update(_arg1);
m_animation.rotation = (m_liveTime * m_rotationSpeed);
} else {
_local2 = (m_liveTime - m_deadTime);
_local3 = (1 - (_local2 / m_maxDeadTime));
if (_local3 > 1){
_local3 = 1;
};
m_animation.alpha = _local3;
m_shadow.alpha = _local3;
if (_local2 > m_maxDeadTime){
PlayState.getInstance().dispatchEvent(new Event(PlayState.eKillBall));
};
};
}
public function getScreenCoordinates():Point{
return (new Point(m_animation.x, m_animation.y));
}
function kill():void{
m_isDead = true;
m_animation.stop();
m_deadTime = m_liveTime;
}
function setScreenCoordinates(_arg1:Point, _arg2:Point):void{
m_animation.x = _arg1.x;
m_animation.y = _arg1.y;
m_shadow.x = _arg2.x;
m_shadow.y = _arg2.y;
}
function rebound():void{
m_wasRebound = true;
m_rotationSpeed = Utils.RandomRange(-300, 300);
if (m_speed.y < 20){
kill();
};
}
function isDead():Boolean{
return (m_isDead);
}
}
}//package States.PlayState
Section 8
//Beater (States.PlayState.Beater)
package States.PlayState {
import flash.display.*;
import flash.geom.*;
import Entity.*;
public class Beater extends SimpleStatableObject {
const m_beatFramesCount:int = 6;
const m_centerFrame:int = 4;
var m_beatAnim:MovieClip;
var m_handAnim:MovieClip;
var m_position:Point;
var m_ghost:MovieClip;
static const stNormal:String = "normal";
static const stBeat:String = "beat";
public function Beater(){
m_beatAnim = ResCreator.createMC("man_beat");
m_handAnim = ResCreator.createMC("man_hand");
m_ghost = ResCreator.createMC("ghost");
m_position = new Point(0, 0);
super();
addChild(m_beatAnim);
addChild(m_handAnim);
addChild(m_ghost);
m_ghost.x = -10;
changeState(stNormal);
}
public function beat(){
if (m_state == stNormal){
SoundManager.play("bit");
changeState(stBeat);
};
}
public function canMove():Boolean{
return ((m_state == stNormal));
}
public function isBeating():Boolean{
return ((((((m_state == stBeat)) && ((m_beatAnim.currentFrame > (m_centerFrame - (m_beatFramesCount / 2)))))) && ((m_beatAnim.currentFrame < (m_centerFrame + (m_beatFramesCount / 2))))));
}
public function setYOffset(_arg1:Number):void{
m_position.y = _arg1;
m_ghost.rotation = (_arg1 * 20);
m_handAnim.y = ((_arg1 * 20) + 40);
m_ghost.y = (40 + (_arg1 * 10));
}
override protected function onChangeState(_arg1:String, _arg2:String):void{
switch (_arg2){
case stNormal:
(m_ghost.visible = true);
m_beatAnim.gotoAndStop(1);
m_handAnim.gotoAndStop(1);
break;
case stBeat:
(m_ghost.visible = false);
m_beatAnim.gotoAndPlay(1);
m_handAnim.gotoAndPlay(1);
break;
};
}
public function getXDirection():Number{
return (((m_beatAnim.currentFrame - m_centerFrame) / m_beatFramesCount));
}
override protected function vUpdate(_arg1:Number):void{
switch (m_state){
case stNormal:
break;
case stBeat:
if (m_beatAnim.currentFrame == m_beatAnim.totalFrames){
changeState(stNormal);
};
break;
};
}
}
}//package States.PlayState
Section 9
//PhysicalObject (States.PlayState.PhysicalObject)
package States.PlayState {
import flash.display.*;
public class PhysicalObject extends Sprite {
const GRAVITY_ACCELERATION:Vector3;
var m_powers:Vector3;
var m_speed:Vector3;
var m_position:Vector3;
public function PhysicalObject(){
GRAVITY_ACCELERATION = new Vector3(0, -400, 0);
m_position = Vector3.ZERO;
m_speed = Vector3.ZERO;
m_powers = Vector3.ZERO;
super();
}
public function addPower(_arg1:Vector3):void{
m_powers = m_powers.add(_arg1);
}
public function setSpeed(_arg1:Vector3):void{
m_speed = _arg1;
}
public function getPosition():Vector3{
return (m_position);
}
public function update(_arg1:Number):void{
m_speed = m_speed.add(m_powers.mul(_arg1));
m_position = m_position.add(m_speed.mul(_arg1));
}
public function setPosition(_arg1:Vector3):void{
m_position = _arg1;
}
public function addGravity():void{
addPower(GRAVITY_ACCELERATION);
}
public function getSpeed():Vector3{
return (m_speed);
}
public function resetGravity():void{
m_powers = Vector3.ZERO;
}
}
}//package States.PlayState
Section 10
//Pitcher (States.PlayState.Pitcher)
package States.PlayState {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import Entity.*;
public class Pitcher extends SimpleStatableObject {
const m_leftHandPos:Vector3;
const m_rightHandPos:Vector3;
var m_position:Vector3;
var m_handHeight:Number;// = 55
var m_catcherAnimation:MovieClip;
var m_ball:MovieClip;// = null
var m_rightHand:MovieClip;
var m_leftHand:MovieClip;
var m_filingAnimation:MovieClip;
public static const stWait:String = "wait";
public static const stCatch:String = "catch";
public static const stPitch:String = "pitch";
public function Pitcher(){
m_filingAnimation = ResCreator.createMC("pither");
m_catcherAnimation = ResCreator.createMC("catcher");
m_leftHand = ResCreator.createMC("catcher_left_hand");
m_rightHand = ResCreator.createMC("catcher_right_hand");
m_position = Vector3.ZERO;
m_leftHandPos = new Vector3(30, -70, 40);
m_rightHandPos = new Vector3(-30, -70, -40);
super();
changeState(stWait);
addChild(m_filingAnimation);
m_filingAnimation.stop();
}
public function throwBall():void{
changeState(stPitch);
}
public function setScale(_arg1:Number):void{
scaleX = _arg1;
scaleY = _arg1;
}
public function catchBall():void{
m_ball = ResCreator.createMC("ball");
m_leftHand.addChild(m_ball);
}
public function getPosition():Vector3{
return (m_position);
}
override protected function vUpdate(_arg1:Number):void{
if (m_filingAnimation.currentFrame == 10){
PlayState.getInstance().dispatchEvent(new Event(PlayState.eThrowBall));
};
if ((((m_state == stPitch)) && ((m_filingAnimation.currentFrame == m_filingAnimation.totalFrames)))){
changeState(stCatch);
};
}
override protected function onChangeState(_arg1:String, _arg2:String):void{
while (numChildren != 0) {
removeChildAt(0);
};
switch (_arg2){
case stWait:
addChild(m_filingAnimation);
m_filingAnimation.stop();
break;
case stPitch:
addChild(m_filingAnimation);
m_filingAnimation.gotoAndPlay(1);
break;
case stCatch:
addChild(m_catcherAnimation);
addChild(m_leftHand);
addChild(m_rightHand);
m_leftHand.x = m_leftHandPos.x;
m_leftHand.y = m_leftHandPos.y;
m_leftHand.rotation = m_leftHandPos.z;
m_rightHand.x = m_rightHandPos.x;
m_rightHand.y = m_rightHandPos.y;
m_rightHand.rotation = m_rightHandPos.z;
break;
};
}
public function setPosition(_arg1:Vector3):void{
m_position = _arg1;
}
public function resetBall():void{
if (m_ball){
if (m_ball.parent != null){
m_ball.parent.removeChild(m_ball);
m_ball = null;
};
};
m_leftHand.x = m_leftHandPos.x;
m_leftHand.y = m_leftHandPos.y;
m_leftHand.rotation = m_leftHandPos.z;
m_rightHand.x = m_rightHandPos.x;
m_rightHand.y = m_rightHandPos.y;
m_rightHand.rotation = m_rightHandPos.z;
}
public function recalcHands(_arg1:Point, _arg2:Point):void{
var _local4:Vector3;
var _local5:Vector3;
var _local3:Number = scaleX;
_local4 = new Vector3((_arg1.x - (_arg2.x + (m_leftHandPos.x * _local3))), (_arg1.y - (_arg2.y + (m_leftHandPos.y * _local3))), 0);
_local5 = new Vector3((_arg1.x - (_arg2.x + (m_rightHandPos.x * _local3))), (_arg1.y - (_arg2.y + (m_rightHandPos.y * _local3))), 0);
var _local6:Number = Math.min(_local4.length(), _local5.length(), 40);
_local5.normalize();
_local4.normalize();
m_leftHand.x = (m_leftHandPos.x + (_local4.x * _local6));
m_leftHand.y = (m_leftHandPos.y + (_local4.y * _local6));
m_rightHand.x = (m_rightHandPos.x + (_local5.x * _local6));
m_rightHand.y = (m_rightHandPos.y + (_local5.y * _local6));
}
}
}//package States.PlayState
Section 11
//PlayState (States.PlayState.PlayState)
package States.PlayState {
import flash.display.*;
import flash.geom.*;
import Main.*;
import flash.events.*;
import States.*;
import flash.utils.*;
public class PlayState extends GameState {
const m_manTopEdge:Number;
const m_manLeftEdge:Number;
const m_frameCenterPosition:Point;
const m_homeRunHeight:Number = 135;
const m_manBottomEdge:Number;
const m_frameSize:Number = 120;
const m_distanceToWall:Number = 300;
const m_manRightEdge:Number;
const m_magic:Number = 300;
const m_pitcherPosition:Vector3;
public var m_totalOuts:int;
var m_man:Beater;
public var m_balls:int;// = 20
var m_ball:Ball;// = null
var m_pointsPlace:MovieClip;
var m_pitcher:Pitcher;
var m_throwTimer:Timer;
var m_catchersPlace:MovieClip;
var m_caption:MovieClip;// = null
public var m_strikesInARaw:int;
public var m_scores:int;
var m_shadow:MovieClip;// = null
public var m_totalStrikesInARaw:int;
var m_state:String;// = null
public var m_round:int;// = 1
public var m_totalScores:int;
var m_catchers:Array;
var m_captions:Array;
var m_captionsPlace:MovieClip;
public var m_gui:MovieClip;
var m_fieldPlayers:Array;
var m_ballPlace:MovieClip;
public var m_outs:int;
var m_clickPoint:Point;
static const eThrowBall:String = "throw_ball";
static const stRebound:String = "rebound";
static const eKillBall:String = "kill_ball";
static const stFiling:String = "filing";
static var m_instance:PlayState = null;
public function PlayState(){
m_man = new Beater();
m_frameCenterPosition = new Point(350, 370);
m_manLeftEdge = (m_frameCenterPosition.x - (m_frameSize / 2));
m_manTopEdge = (m_frameCenterPosition.y - (m_frameSize / 2));
m_manRightEdge = (m_frameCenterPosition.x + (m_frameSize / 2));
m_manBottomEdge = (m_frameCenterPosition.y + (m_frameSize / 2));
m_fieldPlayers = new Array();
m_catchers = new Array();
m_catchersPlace = new MovieClip();
m_pitcher = new Pitcher();
m_ballPlace = new MovieClip();
m_captionsPlace = new MovieClip();
m_pointsPlace = new MovieClip();
m_pitcherPosition = new Vector3(90, 80, 190);
m_throwTimer = new Timer(2000, 1);
m_captions = new Array();
super();
}
override public function onKey(_arg1:KeyboardEvent):void{
if (_arg1.charCode == 32){
};
}
override public function onStop():void{
m_man.changeState(Beater.stNormal);
}
function recalcCatchers():void{
var _local3:Pitcher;
var _local4:Point;
while (m_catchersPlace.numChildren) {
m_catchersPlace.removeChildAt(0);
};
m_catchers.length = 0;
m_catchers.push(m_pitcher);
var _local1:Array = [new Vector3(-400, 0, 230), new Vector3(400, 0, 200), new Vector3(-600, 0, 180)];
var _local2:int;
while (_local2 < m_round) {
_local3 = new Pitcher();
m_catchersPlace.addChild(_local3);
_local3.setScale(getScale(_local1[_local2]));
_local4 = projectToScreen(_local1[_local2]);
_local3.x = _local4.x;
_local3.y = _local4.y;
_local3.setPosition(_local1[_local2]);
_local3.changeState(Pitcher.stCatch);
m_catchers.push(_local3);
_local2++;
};
}
function addCaption(_arg1:String):void{
m_captions.push(_arg1);
}
function projectToScreen(_arg1:Vector3):Point{
var _local2:Number = getScale(_arg1);
return (new Point((350 + (_arg1.x * _local2)), ((450 - (_arg1.y * _local2)) - ((_arg1.z * _local2) * 2.15))));
}
public function restart():void{
m_totalStrikesInARaw = 0;
m_totalOuts = 0;
m_totalScores = 0;
m_round = 1;
}
function recalcGui():void{
var _local1:MovieClip;
if (m_gui){
if (m_gui["stats_anim"]){
_local1 = m_gui["stats_anim"];
if (_local1["strikes"]){
_local1["strikes"].text = m_strikesInARaw.toString();
};
if (_local1["outs"]){
_local1["outs"].text = m_outs.toString();
};
if (_local1["scores"]){
_local1["scores"].text = m_scores.toString();
};
if (_local1["round"]){
_local1["round"].text = (m_round + "/3");
};
if (_local1["balls"]){
_local1["balls"].text = m_balls;
};
};
};
}
override public function onInit():void{
m_balls = 20;
SoundManager.getInstance().playLoop("ambient");
recalcCatchers();
killBall(null);
m_strikesInARaw = 0;
m_outs = 0;
m_scores = 0;
m_gui.visible = true;
recalcGui();
m_captions.length = 0;
m_caption = null;
while (m_captionsPlace.numChildren != 0) {
m_captionsPlace.removeChildAt(0);
};
addChild(new RoundCaption(m_round));
}
function getScale(_arg1:Vector3):Number{
var _local2:Number = ((3 / 7) * m_distanceToWall);
return ((_local2 / (_local2 + _arg1.z)));
}
override public function handleMouseDown(_arg1:Number, _arg2:Number):void{
if (!StateManager.getInstance().hitTestOverlays(_arg1, _arg2)){
m_clickPoint = new Point(_arg1, _arg2);
m_man.beat();
};
}
function showPoints(_arg1:int, _arg2:Vector3):void{
var _local3:Point = projectToScreen(_arg2);
var _local4:Points = new Points(("+" + _arg1), _local3.x, _local3.y);
_local4.scaleX = getScale(_arg2);
_local4.scaleY = getScale(_arg2);
m_pointsPlace.addChild(_local4);
recalcGui();
}
function resetStrikes():void{
m_strikesInARaw = 0;
recalcGui();
}
override public function update(_arg1:Number):void{
var _local2:Number;
var _local3:Vector3;
var _local4:Vector3;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Pitcher;
var _local20:Vector3;
updateCaptions();
m_man.update(_arg1);
m_pitcher.update(_arg1);
if (m_man.canMove()){
if ((((stage.mouseX >= m_manLeftEdge)) && ((stage.mouseX <= m_manRightEdge)))){
m_man.x = (stage.mouseX - 105);
} else {
if (stage.mouseX < m_manLeftEdge){
m_man.x = (m_manLeftEdge - 105);
} else {
if (stage.mouseX > m_manRightEdge){
m_man.x = (m_manRightEdge - 105);
};
};
};
_local2 = stage.mouseY;
if (_local2 < m_manTopEdge){
_local2 = m_manTopEdge;
};
if (_local2 > m_manBottomEdge){
_local2 = m_manBottomEdge;
};
m_man.setYOffset(((_local2 - m_frameCenterPosition.y) / (m_frameSize / 2)));
};
if (m_ball){
m_ball.update(_arg1);
};
if (m_ball){
_local3 = m_ball.getPosition();
_local4 = m_ball.getSpeed();
if (_local3.z > m_distanceToWall){
_local5 = 0.3;
_local3.z = m_distanceToWall;
_local4 = new Vector3((_local4.x * _local5), (_local4.y * _local5), -(Math.abs((_local4.z * _local5))));
if (_local3.y > m_homeRunHeight){
addCaption("home_run");
m_ball.kill();
_local6 = (2000 + ((_local3.y - m_homeRunHeight) * 10));
m_scores = (m_scores + _local6);
m_totalScores = (m_totalScores + _local6);
showPoints(_local6, _local3);
SoundManager.play("homerun");
} else {
SoundManager.play("rebound");
};
};
if (((((Utils.InRange(_local3.z, -20, 20)) && (m_man.isBeating()))) && ((_local4.z < 0)))){
_local7 = 60;
_local8 = 20;
_local9 = (m_ball.getScreenCoordinates().x - m_clickPoint.x);
_local10 = 0;
_local11 = 0;
if (_local9 < 0){
if (Math.abs(_local9) > _local7){
_local10 = 0;
} else {
_local11 = ((_local9 / _local7) + Utils.RandomRange(-0.4, 0));
_local10 = (1.1 - (Math.abs(_local9) / _local7));
};
} else {
if (_local9 > _local8){
_local10 = 0;
} else {
_local11 = (_local9 / _local8);
if ((_local9 / _local8) < 0.5){
_local10 = (1 + ((_local9 / _local8) * 0.5));
} else {
_local10 = (1 + ((1 - (_local9 / _local8)) * 0.5));
};
};
};
_local12 = 25;
_local13 = 40;
_local14 = (m_ball.getScreenCoordinates().y - m_clickPoint.y);
_local15 = 0;
_local16 = 0;
if (_local14 > 0){
if (_local14 > _local12){
_local15 = 0;
} else {
_local15 = (_local14 / _local12);
_local16 = (0.3 - (_local14 / _local12));
};
} else {
if (Math.abs(_local14) > _local13){
_local15 = 0;
} else {
_local15 = (Math.abs(_local14) / _local13);
_local16 = (Math.abs(_local14) / _local13);
};
};
if (((!((_local10 == 0))) && (!((_local15 == 0))))){
_local17 = ((_local10 + _local15) * 300);
_local4 = new Vector3((_local17 * _local11), (_local17 * _local16), ((_local17 > 300)) ? (_local17 * Utils.RandomRange(0.2, 0.5)) : (_local17 * Utils.RandomRange(0.5, 1)));
resetStrikes();
SoundManager.play("bam");
};
};
if (_local3.y < 0){
_local3.y = 0;
_local4.y = Math.abs((_local4.y * 0.5));
_local4.z = (_local4.z * 0.5);
_local4.x = (_local4.x * 0.5);
if (!m_ball.wasRebound()){
if (_local3.z > 0){
_local18 = (Math.abs(_local3.z) * 4);
m_scores = (m_scores + _local18);
m_totalScores = (m_totalScores + _local18);
showPoints(_local18, _local3);
};
};
m_ball.rebound();
if (_local4.y > 40){
SoundManager.play("rebound");
};
};
m_ball.setPosition(_local3);
m_ball.setSpeed(_local4);
m_ball.setScale(getScale(_local3));
m_ball.setScreenCoordinates(projectToScreen(_local3), projectToScreen(new Vector3(_local3.x, 0, _local3.z)));
if (_local3.z < -100){
strike();
};
};
if (((m_ball) && ((m_ball.getSpeed().z > 0)))){
for each (_local19 in m_catchers) {
_local20 = _local19.getPosition().sub(m_ball.getPosition());
if (((((((_local20.x * _local20.x) < (200 * 200))) && (((_local20.z * _local20.z) < (200 * 200))))) && ((_local4.z > 0)))){
_local19.recalcHands(m_ball.getScreenCoordinates(), new Point(_local19.x, _local19.y));
};
if (((((_local20.x * _local20.x) < (60 * 60))) && (((_local20.z * _local20.z) < (30 * 30))))){
if (m_ball.getPosition().y < 180){
if (((((_local20.y * _local20.y) > (10 * 10))) && (!(m_ball.wasRebound())))){
_local19.catchBall();
out();
} else {
m_ball.setSpeed(new Vector3(0, m_ball.getSpeed().y, 0));
};
break;
};
};
_local19.update(_arg1);
};
};
}
function strike():void{
m_totalStrikesInARaw++;
killBall(null);
if (++m_strikesInARaw == 3){
out();
};
addCaption("strike");
recalcGui();
}
function out():void{
m_totalOuts++;
killBall(null);
SoundManager.play("out_sound");
addCaption("out");
m_strikesInARaw = 0;
if (++m_outs == 3){
StateManager.getInstance().pushState(CalcPointsState.getInstance());
};
recalcGui();
}
function updateCaptions():void{
if (((m_caption) && ((m_caption.currentFrame == m_caption.totalFrames)))){
m_captions.pop();
m_caption = null;
while (m_captionsPlace.numChildren != 0) {
m_captionsPlace.removeChildAt(0);
};
};
if (((!(m_caption)) && (!((m_captions.length == 0))))){
m_caption = ResCreator.createMC(m_captions[(m_captions.length - 1)]);
m_captionsPlace.addChild(m_caption);
};
}
function onThrowBall(_arg1:Event):void{
var _local2:Pitcher;
while (m_ballPlace.numChildren != 0) {
m_ballPlace.removeChildAt(0);
};
m_ball = new Ball();
m_ball.setPosition(m_pitcherPosition);
m_ball.setSpeed(new Vector3(Utils.RandomRange(-240, -60), Utils.RandomRange(50, 170), -300));
m_ballPlace.addChild(m_ball);
for each (_local2 in m_catchers) {
_local2.resetBall();
};
m_balls--;
recalcGui();
}
override public function onResume():void{
}
override public function onPreInit():void{
addEventListener(eThrowBall, onThrowBall);
addEventListener(eKillBall, killBall);
m_throwTimer.addEventListener(TimerEvent.TIMER, function (_arg1:TimerEvent):void{
m_pitcher.throwBall();
});
addChild(ResCreator.createMC("back"));
m_gui = ResCreator.createMC("stats_board");
addChild(m_gui);
m_gui.stop();
if (m_gui["menu"]){
m_gui["menu"].stop();
};
if (m_gui["replay"]){
m_gui["replay"].stop();
};
m_gui.scaleX = 1.14;
m_gui.scaleY = 1.14;
addChild(m_catchersPlace);
addChild(m_pitcher);
m_pitcher.setScale(getScale(m_pitcherPosition));
var pitcher_pos:Point = projectToScreen(new Vector3(m_pitcherPosition.x, 0, m_pitcherPosition.z));
m_pitcher.x = pitcher_pos.x;
m_pitcher.y = pitcher_pos.y;
m_pitcher.setPosition(m_pitcherPosition);
addChild(m_ballPlace);
addChild(m_man);
m_man.y = 330;
var frame:MovieClip = ResCreator.createMC("frame");
frame.x = m_frameCenterPosition.x;
frame.y = m_frameCenterPosition.y;
addChild(frame);
addChild(m_pointsPlace);
addChild(m_captionsPlace);
m_captionsPlace.x = 350;
m_captionsPlace.y = 200;
recalcGui();
}
function killBall(_arg1:Event):void{
while (m_ballPlace.numChildren != 0) {
m_ballPlace.removeChildAt(0);
};
m_ball = null;
if (m_balls == 0){
StateManager.getInstance().pushState(CalcPointsState.getInstance());
} else {
m_throwTimer.start();
};
}
public static function getInstance():PlayState{
if (m_instance == null){
m_instance = new (PlayState);
};
return (m_instance);
}
}
}//package States.PlayState
Section 12
//CalcPointsState (States.CalcPointsState)
package States {
import flash.display.*;
import Main.*;
import flash.events.*;
import States.PlayState.*;
public class CalcPointsState extends GameState {
var m_clip:MovieClip;
var m_inShader:InShader;
static var m_instance:CalcPointsState = null;
public function CalcPointsState(){
m_inShader = new InShader(1, 0.5);
super();
}
override public function update(_arg1:Number):void{
m_inShader.update(_arg1);
}
override public function onPreInit():void{
addChild(m_inShader);
m_clip = ResCreator.createMC("stats_board");
addChild(m_clip);
m_clip.scaleX = 1.14;
m_clip.scaleY = 1.14;
if (m_clip["replay"]){
m_clip["replay"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
PlayState.getInstance().m_round++;
StateManager.getInstance().coolChangeState(PlayState.getInstance());
});
};
if (m_clip["menu"]){
m_clip["menu"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
StateManager.getInstance().coolChangeState(MainMenuState.getInstance());
});
};
}
override public function onInit():void{
var _local2:MovieClip;
PlayState.getInstance().m_gui.visible = false;
SoundManager.getInstance().playLoop("music");
m_clip.gotoAndPlay(1);
m_inShader.restart();
var _local1:PlayState = PlayState.getInstance();
if (m_clip["stats_anim"]){
_local2 = m_clip["stats_anim"];
if (_local1.m_round != 3){
if (_local2["strikes"]){
_local2["strikes"].text = _local1.m_strikesInARaw.toString();
};
if (_local2["outs"]){
_local2["outs"].text = _local1.m_outs.toString();
};
if (_local2["scores"]){
_local2["scores"].text = _local1.m_scores.toString();
};
if (_local2["balls"]){
_local2["balls"].text = _local1.m_balls.toString();
};
if (_local2["round"]){
_local2["round"].text = _local1.m_round.toString();
};
if (_local2["head"]){
_local2["head"].text = "stats";
};
} else {
if (_local2["strikes"]){
_local2["strikes"].text = _local1.m_totalStrikesInARaw.toString();
};
if (_local2["outs"]){
_local2["outs"].text = _local1.m_totalOuts.toString();
};
if (_local2["scores"]){
_local2["scores"].text = _local1.m_totalScores.toString();
};
if (_local2["balls"]){
_local2["balls"].text = _local1.m_balls.toString();
};
if (_local2["round"]){
_local2["round"].text = _local1.m_round.toString();
};
if (_local2["head"]){
_local2["head"].text = "final stats";
};
};
};
if (m_clip["replay"]){
m_clip["replay"].visible = !((_local1.m_round == 3));
};
if (m_clip["menu"]){
m_clip["menu"].visible = (_local1.m_round == 3);
};
}
public static function getInstance():CalcPointsState{
if (m_instance == null){
m_instance = new (CalcPointsState);
};
return (m_instance);
}
}
}//package States
Section 13
//CurrentPreloaderState (States.CurrentPreloaderState)
package States {
import flash.display.*;
import Main.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class CurrentPreloaderState extends PreloaderState {
var m_loadingBar:MovieClip;// = null
var m_loadingLabel:TextField;// = null
static var m_instance:CurrentPreloaderState = null;
override function onFinishLoading():void{
StateManager.getInstance().changeState(MainMenuState.getInstance());
}
override public function update(_arg1:Number):void{
super.update(_arg1);
if (m_loadingBar){
m_loadingBar.gotoAndStop((int((m_loadingBar.totalFrames * getPercent())) + 1));
};
if (m_loadingLabel){
m_loadingLabel.text = ("Loading: " + getPercentCaption());
};
}
override public function onInit():void{
super.onInit();
m_loadingLabel = StateManager.getInstance()["loading_label"];
m_loadingBar = StateManager.getInstance()["loading_bar"];
if (m_scene["games96"]){
m_scene["games96"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.games96.com"), "_blank");
});
};
if (m_scene["iriy_soft"]){
m_scene["iriy_soft"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.iriysoft.ru"), "_blank");
});
};
}
public static function getInstance():CurrentPreloaderState{
if (m_instance == null){
m_instance = new (CurrentPreloaderState);
};
return (m_instance);
}
}
}//package States
Section 14
//InstructionState (States.InstructionState)
package States {
import flash.display.*;
import Main.*;
import flash.events.*;
import States.PlayState.*;
public class InstructionState extends GameState {
static var m_instance:InstructionState = null;
override public function onPreInit():void{
var instructions_mc:MovieClip = ResCreator.createMC("instructions");
instructions_mc.cacheAsBitmap = true;
addChild(instructions_mc);
instructions_mc["back"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
PlayState.getInstance().restart();
StateManager.getInstance().coolChangeState(PlayState.getInstance());
});
}
public static function getInstance():InstructionState{
if (m_instance == null){
m_instance = new (InstructionState);
};
return (m_instance);
}
}
}//package States
Section 15
//MainMenuState (States.MainMenuState)
package States {
import flash.display.*;
import Main.*;
import flash.events.*;
import States.PlayState.*;
public class MainMenuState extends GameState {
var m_title:MovieClip;
var m_inShader:InShader;
static var m_instance:MainMenuState = null;
override public function onPreInit():void{
addChild(ResCreator.createMC("back"));
m_inShader = new InShader(1, 0.3);
addChild(m_inShader);
m_title = ResCreator.createMC("logo_anim");
addChild(m_title);
if (m_title["start"]){
m_title["start"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
PlayState.getInstance().restart();
StateManager.getInstance().coolChangeState(PlayState.getInstance());
});
};
if (m_title["how_to_play"]){
m_title["how_to_play"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent){
StateManager.getInstance().coolChangeState(InstructionState.getInstance());
});
};
StateManager.getInstance().addOverlay(new SoundButton());
StateManager.getInstance().addOverlay(new Links());
}
override public function update(_arg1:Number):void{
m_inShader.update(_arg1);
}
override public function onInit():void{
m_title.gotoAndPlay(1);
m_inShader.restart();
SoundManager.getInstance().playLoop("music");
}
public static function getInstance():MainMenuState{
if (m_instance == null){
m_instance = new (MainMenuState);
};
return (m_instance);
}
}
}//package States
Section 16
//PreloaderState (States.PreloaderState)
package States {
import flash.display.*;
import Main.*;
import flash.events.*;
public class PreloaderState extends GameState {
protected var m_scene:MovieClip;
private var m_minimalLoadTime:Number;// = 5
private var m_bytesTotal:Number;// = 100
private var m_isLoadingFinished:Boolean;// = false
private var m_loaderInfo:LoaderInfo;// = null
private var m_percent:Number;// = 0
private var m_bytesLoaded:Number;// = 100
static var m_instance:PreloaderState = null;
private function onLoadComplete(_arg1:Event):void{
m_loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoadProgress);
m_loaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
m_isLoadingFinished = true;
}
override public function onInit():void{
m_scene = StateManager.getInstance();
m_loaderInfo = StateManager.getInstance().loaderInfo;
if (m_loaderInfo.bytesLoaded == m_loaderInfo.bytesTotal){
m_isLoadingFinished = true;
} else {
m_loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
m_loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
};
}
override public function update(_arg1:Number):void{
m_percent = Math.min((m_bytesLoaded / m_bytesTotal), (m_liveTime / m_minimalLoadTime));
if (((m_isLoadingFinished) && ((m_liveTime >= m_minimalLoadTime)))){
StateManager.getInstance().gotoAndStop(2);
onFinishLoading();
};
}
function onFinishLoading():void{
}
public function getPercent():Number{
return (m_percent);
}
public function getPercentCaption():String{
return (int((m_percent * 100)).toString());
}
public function setMinimalLoadTime(_arg1:Number):void{
m_minimalLoadTime = _arg1;
}
private function onLoadProgress(_arg1:ProgressEvent):void{
m_bytesTotal = _arg1.bytesTotal;
m_bytesLoaded = _arg1.bytesLoaded;
}
public static function getInstance():PreloaderState{
if (m_instance == null){
m_instance = new (PreloaderState);
};
return (m_instance);
}
}
}//package States
Section 17
//ShadeInState (States.ShadeInState)
package States {
import Main.*;
public class ShadeInState extends GameState {
var m_nextState:GameState;// = null
var m_shader:InShader;// = null
static var m_instance:ShadeInState = null;
override public function onPreInit():void{
m_shader = new InShader(0.3, 1);
addChild(m_shader);
}
override public function update(_arg1:Number):void{
m_shader.update(_arg1);
if (m_shader.isMaxTime()){
if (m_nextState != null){
StateManager.getInstance().changeState(m_nextState);
m_nextState = null;
StateManager.getInstance().pushState(ShadeOutState.getInstance());
};
};
}
public function setNextState(_arg1:GameState):void{
m_nextState = _arg1;
}
override public function onInit():void{
m_shader.restart();
}
public static function getInstance():ShadeInState{
if (m_instance == null){
m_instance = new (ShadeInState);
};
return (m_instance);
}
}
}//package States
Section 18
//ShadeOutState (States.ShadeOutState)
package States {
import Main.*;
public class ShadeOutState extends GameState {
var m_shader:OutShader;
static var m_instance:ShadeOutState = null;
override public function update(_arg1:Number):void{
m_shader.update(_arg1);
if (m_shader.isMaxTime()){
StateManager.getInstance().popState();
};
}
override public function onInit():void{
while (numChildren) {
removeChildAt(0);
};
m_shader = new OutShader(0.3, 1);
addChild(m_shader);
}
public static function getInstance():ShadeOutState{
if (m_instance == null){
m_instance = new (ShadeOutState);
};
return (m_instance);
}
}
}//package States
Section 19
//ambient (ambient)
package {
import flash.media.*;
public dynamic class ambient extends Sound {
}
}//package
Section 20
//back (back)
package {
import flash.display.*;
public dynamic class back extends MovieClip {
}
}//package
Section 21
//ball (ball)
package {
import flash.display.*;
public dynamic class ball extends MovieClip {
}
}//package
Section 22
//bam (bam)
package {
import flash.media.*;
public dynamic class bam extends Sound {
}
}//package
Section 23
//bit (bit)
package {
import flash.media.*;
public dynamic class bit extends Sound {
}
}//package
Section 24
//black_square (black_square)
package {
import flash.display.*;
public dynamic class black_square extends MovieClip {
}
}//package
Section 25
//catcher (catcher)
package {
import flash.display.*;
public dynamic class catcher extends MovieClip {
}
}//package
Section 26
//catcher_left_hand (catcher_left_hand)
package {
import flash.display.*;
public dynamic class catcher_left_hand extends MovieClip {
}
}//package
Section 27
//catcher_right_hand (catcher_right_hand)
package {
import flash.display.*;
public dynamic class catcher_right_hand extends MovieClip {
}
}//package
Section 28
//fall_ball (fall_ball)
package {
import flash.display.*;
public dynamic class fall_ball extends MovieClip {
public function fall_ball(){
addFrameScript(7, frame8, 29, frame30);
}
function frame30(){
stop();
}
function frame8(){
}
}
}//package
Section 29
//frame (frame)
package {
import flash.display.*;
public dynamic class frame extends MovieClip {
}
}//package
Section 30
//ghost (ghost)
package {
import flash.display.*;
public dynamic class ghost extends MovieClip {
}
}//package
Section 31
//home_run (home_run)
package {
import flash.display.*;
public dynamic class home_run extends MovieClip {
public function home_run(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 32
//homerun (homerun)
package {
import flash.media.*;
public dynamic class homerun extends Sound {
}
}//package
Section 33
//InShader (InShader)
package {
import flash.display.*;
public class InShader extends MovieClip {
var m_maxShade:Number;
var m_maxShadeTime:Number;
var m_blackSquare:MovieClip;
var m_liveTime:Number;// = 0
public function InShader(_arg1:Number, _arg2:Number){
m_blackSquare = ResCreator.createMC("black_square");
super();
m_maxShadeTime = _arg1;
m_maxShade = _arg2;
m_blackSquare.alpha = 0;
addChild(m_blackSquare);
}
public function isMaxTime():Boolean{
return ((m_liveTime >= m_maxShadeTime));
}
public function update(_arg1:Number):void{
if ((m_liveTime = (m_liveTime + _arg1)) > m_maxShadeTime){
m_liveTime = m_maxShadeTime;
};
m_blackSquare.alpha = ((m_liveTime / m_maxShadeTime) * m_maxShade);
}
public function restart():void{
m_liveTime = 0;
m_blackSquare.alpha = 0;
}
}
}//package
Section 34
//instructions (instructions)
package {
import flash.display.*;
public dynamic class instructions extends MovieClip {
public var back:MovieClip;
}
}//package
Section 35
//Links (Links)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Links extends MovieClip {
public function Links(){
super();
var picture:MovieClip = ResCreator.createMC("links");
addChild(picture);
if (picture["play_more_games"]){
picture["play_more_games"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.games96.com"), "_blank");
});
};
if (picture["games96"]){
picture["games96"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.games96.com"), "_blank");
});
};
if (picture["free_games"]){
picture["free_games"].addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.games96.com/free_online_games.php"), "_blank");
});
};
}
}
}//package
Section 36
//links (links)
package {
import flash.display.*;
public dynamic class links extends MovieClip {
public var play_more_games:SimpleButton;
public var games96:SimpleButton;
public var free_games:SimpleButton;
}
}//package
Section 37
//logo_anim (logo_anim)
package {
import flash.display.*;
public dynamic class logo_anim extends MovieClip {
public var start:MovieClip;
public var how_to_play:MovieClip;
public function logo_anim(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 38
//man_beat (man_beat)
package {
import flash.display.*;
public dynamic class man_beat extends MovieClip {
}
}//package
Section 39
//man_hand (man_hand)
package {
import flash.display.*;
public dynamic class man_hand extends MovieClip {
}
}//package
Section 40
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 41
//out (out)
package {
import flash.display.*;
public dynamic class out extends MovieClip {
public function out(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 42
//out_sound (out_sound)
package {
import flash.media.*;
public dynamic class out_sound extends Sound {
}
}//package
Section 43
//OutShader (OutShader)
package {
import flash.display.*;
public class OutShader extends MovieClip {
var m_maxShade:Number;
var m_maxShadeTime:Number;
var m_blackSquare:MovieClip;
var m_liveTime:Number;// = 0
public function OutShader(_arg1:Number, _arg2){
m_blackSquare = ResCreator.createMC("black_square");
super();
m_maxShadeTime = _arg1;
m_maxShade = _arg2;
m_blackSquare.alpha = 1;
addChild(m_blackSquare);
}
public function isMaxTime():Boolean{
return ((m_liveTime >= m_maxShadeTime));
}
public function update(_arg1:Number):void{
if ((m_liveTime = (m_liveTime + _arg1)) > m_maxShadeTime){
m_liveTime = m_maxShadeTime;
};
m_blackSquare.alpha = ((1 - (m_liveTime / m_maxShadeTime)) * m_maxShade);
}
public function restart():void{
m_liveTime = 0;
m_blackSquare.alpha = m_maxShade;
}
}
}//package
Section 44
//pither (pither)
package {
import flash.display.*;
public dynamic class pither extends MovieClip {
public function pither(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 45
//Points (Points)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class Points extends MovieClip {
var m_position:Point;
var m_pic:MovieClip;
var m_liveTime:Number;
public function Points(_arg1:String, _arg2:Number, _arg3:Number){
m_pic = ResCreator.createMC("points");
addChild(m_pic);
m_position = new Point(_arg2, _arg3);
m_liveTime = 0;
if (m_pic["text"]){
m_pic["text"].text = _arg1;
};
alpha = 1.8;
addEventListener(Event.ENTER_FRAME, update);
update(null);
}
function update(_arg1:Event):void{
m_liveTime = (m_liveTime + (1 / 24));
m_position.y = (m_position.y - 2);
alpha = (alpha - (1 / 24));
x = (m_position.x + (Math.cos((m_liveTime * 5)) * 10));
y = m_position.y;
if ((((alpha < 0)) && (!((parent == null))))){
removeEventListener(Event.ENTER_FRAME, update);
parent.removeChild(this);
};
}
}
}//package
Section 46
//points (points)
package {
import flash.display.*;
import flash.text.*;
public dynamic class points extends MovieClip {
public var text:TextField;
}
}//package
Section 47
//rebound (rebound)
package {
import flash.media.*;
public dynamic class rebound extends Sound {
}
}//package
Section 48
//ResCreator (ResCreator)
package {
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class ResCreator {
public static function createSimpleButton(_arg1:String):SimpleButton{
var type:Class;
var name = _arg1;
try {
type = (getDefinitionByName(name) as Class);
} catch(e:ReferenceError) {
trace(e, "resource name:", name);
return (null);
};
return (new (type));
}
public static function createMC(_arg1:String):MovieClip{
var type:Class;
var name = _arg1;
try {
type = (getDefinitionByName(name) as Class);
} catch(e:ReferenceError) {
trace(e, "resource name:", name);
return (null);
};
return (new (type));
}
public static function createSound(_arg1:String):Sound{
return (new ((getDefinitionByName(_arg1) as Class)));
}
}
}//package
Section 49
//round (round)
package {
import flash.display.*;
import flash.text.*;
public dynamic class round extends MovieClip {
public var text:TextField;
}
}//package
Section 50
//RoundCaption (RoundCaption)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class RoundCaption extends MovieClip {
var cap:round;
var num:int;
var m_position:Point;
var m_liveTime:Number;
public function RoundCaption(_arg1:int){
cap = new round();
num = _arg1;
addChild(cap);
x = 350;
y = 150;
m_liveTime = 0;
addEventListener(Event.ENTER_FRAME, update);
update(null);
}
function update(_arg1:Event):void{
if (((cap) && (cap["text"]))){
cap["text"].text = ("ROUND " + num.toString());
};
m_liveTime = (m_liveTime + (1 / 24));
if (((!((parent == null))) && ((cap.currentFrame == cap.totalFrames)))){
removeEventListener(Event.ENTER_FRAME, update);
parent.removeChild(this);
};
}
}
}//package
Section 51
//shadow (shadow)
package {
import flash.display.*;
public dynamic class shadow extends MovieClip {
}
}//package
Section 52
//sound_off (sound_off)
package {
import flash.display.*;
public dynamic class sound_off extends SimpleButton {
}
}//package
Section 53
//sound_on (sound_on)
package {
import flash.display.*;
public dynamic class sound_on extends SimpleButton {
}
}//package
Section 54
//SoundButton (SoundButton)
package {
import flash.display.*;
import flash.events.*;
public class SoundButton extends MovieClip {
private var m_isSoundOn:Boolean;// = false
private var m_sound:SimpleButton;// = null
public function SoundButton(){
onSoundClick(null);
}
function onSoundClick(_arg1:MouseEvent):void{
m_isSoundOn = !(m_isSoundOn);
if (m_sound){
m_sound.removeEventListener(MouseEvent.CLICK, onSoundClick);
removeChild(m_sound);
};
if (m_isSoundOn){
m_sound = ResCreator.createSimpleButton("sound_on");
} else {
m_sound = ResCreator.createSimpleButton("sound_off");
};
m_sound.x = 645;
m_sound.y = 45;
addChild(m_sound);
m_sound.addEventListener(MouseEvent.CLICK, onSoundClick);
SoundManager.getInstance().setSoundEnable(m_isSoundOn);
}
}
}//package
Section 55
//SoundManager (SoundManager)
package {
import flash.media.*;
public class SoundManager {
var m_isSoundEnable:Boolean;// = true
var m_currentLoopName:String;
var m_currentLoop:SoundChannel;
static var m_instance:SoundManager = null;
public function setSoundEnable(_arg1:Boolean):void{
m_isSoundEnable = _arg1;
if (m_isSoundEnable){
if (m_currentLoopName != null){
m_currentLoop = ResCreator.createSound(m_currentLoopName).play(0, int.MAX_VALUE);
};
} else {
if (m_currentLoop){
m_currentLoop.stop();
};
};
}
public function playLoop(_arg1:String):void{
if (m_isSoundEnable){
if (m_currentLoopName != _arg1){
if (m_currentLoop != null){
m_currentLoop.stop();
};
m_currentLoop = ResCreator.createSound(_arg1).play(0, int.MAX_VALUE);
};
};
m_currentLoopName = _arg1;
}
public static function getInstance():SoundManager{
if (m_instance == null){
m_instance = new (SoundManager);
};
return (m_instance);
}
public static function play(_arg1:String):void{
if (SoundManager.getInstance().m_isSoundEnable){
ResCreator.createSound(_arg1).play();
};
}
}
}//package
Section 56
//stats_board (stats_board)
package {
import flash.display.*;
public dynamic class stats_board extends MovieClip {
public var stats_anim:MovieClip;
public var replay:MovieClip;
public var menu:MovieClip;
public function stats_board(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package
Section 57
//strike (strike)
package {
import flash.display.*;
public dynamic class strike extends MovieClip {
public function strike(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 58
//Utils (Utils)
package {
import flash.display.*;
import flash.geom.*;
public class Utils {
public static function RandomRange(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
public static function AnyOf(_arg1:Array){
return (_arg1[int((Math.random() * _arg1.length))]);
}
public static function InRange(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return ((((_arg1 >= _arg2)) && ((_arg1 <= _arg3))));
}
public static function IsContain(_arg1:Array, _arg2:Object){
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function SetPosition(_arg1:DisplayObject, _arg2:Point):void{
_arg1.x = _arg2.x;
_arg1.y = _arg2.y;
}
public static function Sign(_arg1:Number):Number{
if (_arg1 == 0){
return (0);
};
return (((_arg1 < 0)) ? -1 : 1);
}
}
}//package
Section 59
//Vector3 (Vector3)
package {
public final class Vector3 {
public var x:Number;
public var y:Number;
public var z:Number;
public static const ZERO:Vector3 = new Vector3(0, 0, 0);
;
public function Vector3(_arg1:Number, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function sub(_arg1:Vector3):Vector3{
return (new Vector3((x - _arg1.x), (y - _arg1.y), (z - _arg1.z)));
}
public function add(_arg1:Vector3):Vector3{
return (new Vector3((x + _arg1.x), (y + _arg1.y), (z + _arg1.z)));
}
public function mul(_arg1:Number):Vector3{
return (new Vector3((x * _arg1), (y * _arg1), (z * _arg1)));
}
public function length():Number{
return (Math.sqrt(squaredLength()));
}
public function toString():String{
return ((((((((("v: " + "x=") + x.toFixed(2)) + ", ") + "y=") + y.toFixed(2)) + ", ") + "z=") + z.toFixed(2)));
}
public function normalize():void{
var _local1:Number = (1 / length());
x = (x * _local1);
y = (y * _local1);
z = (z * _local1);
}
public function squaredLength():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
}
}//package