Section 1
//BubbleBoxAPI (com.bubblebox.BubbleBoxAPI)
package com.bubblebox {
import flash.display.*;
import flash.net.*;
public dynamic class BubbleBoxAPI extends Sprite {
public static function submit(_arg1:String, _arg2:Number, _arg3:int):URLLoader{
var _local4:BubbleBoxAPI;
var _local5:String;
var _local6:URLVariables;
var _local7:URLRequest;
var _local8:URLLoader;
_local4 = new (BubbleBoxAPI);
_local5 = ((((("name=" + escape(_arg1)) + "&score=") + _arg2) + "&game=") + _arg3);
_local6 = new URLVariables(_local5);
_local7 = new URLRequest("http://www.bubblebox.com/scripts/insertscore.php");
_local7.data = _local6;
_local7.method = URLRequestMethod.POST;
_local8 = new URLLoader();
_local8.dataFormat = URLLoaderDataFormat.TEXT;
_local8.load(_local7);
return (_local8);
}
}
}//package com.bubblebox
Section 2
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 3
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 4
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 5
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 6
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 7
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 8
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.utils.*;
import fl.events.*;
import flash.text.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 9
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 10
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 11
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 12
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 13
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 14
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 15
//Animator (fl.motion.Animator)
package fl.motion {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
public class Animator extends EventDispatcher {
private var targetState:Object;
public var transformationPoint:Point;
private var _isPlaying:Boolean;// = false
private var _time:int;// = -1
private var _target:DisplayObject;
public var repeatCount:int;// = 1
private var _lastRenderedTime:int;// = -1
private var playCount:int;// = 0
private var _motion:Motion;
public var orientToPath:Boolean;// = false
public var autoRewind:Boolean;// = false
public var positionMatrix:Matrix;
private static var enterFrameBeacon:MovieClip = new MovieClip();
public function Animator(_arg1:XML=null, _arg2:DisplayObject=null){
orientToPath = false;
autoRewind = false;
repeatCount = 1;
_isPlaying = false;
_lastRenderedTime = -1;
_time = -1;
playCount = 0;
super();
this.motion = new Motion(_arg1);
this.target = _arg2;
}
public function stop():void{
enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
this._isPlaying = false;
this.playCount = 0;
this.rewind();
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function get target():DisplayObject{
return (this._target);
}
public function set time(_arg1:int):void{
var _local2:Motion;
var _local3:Keyframe;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Point;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Matrix;
var _local13:Point;
var _local14:Number;
var _local15:Number;
var _local16:ColorTransform;
var _local17:Number;
var _local18:Number;
var _local19:Number;
if (_arg1 == this._time){
return;
};
_local2 = this.motion;
if (_arg1 > (_local2.duration - 1)){
_arg1 = (_local2.duration - 1);
} else {
if (_arg1 < 0){
_arg1 = 0;
};
};
this._time = _arg1;
this.dispatchEvent(new MotionEvent(MotionEvent.TIME_CHANGE));
_local3 = _local2.getCurrentKeyframe(_arg1);
_local4 = (((_local3.index == this._lastRenderedTime)) && (!(_local3.tweens.length)));
if (_local4){
return;
};
this._target.visible = false;
if (!_local3.blank){
_local5 = _local2.getValue(_arg1, Tweenables.X);
_local6 = _local2.getValue(_arg1, Tweenables.Y);
_local7 = new Point(_local5, _local6);
if (this.positionMatrix){
_local7 = this.positionMatrix.transformPoint(_local7);
};
_local7.x = (_local7.x + this.targetState.x);
_local7.y = (_local7.y + this.targetState.y);
_local8 = (_local2.getValue(_arg1, Tweenables.SCALE_X) * this.targetState.scaleX);
_local9 = (_local2.getValue(_arg1, Tweenables.SCALE_Y) * this.targetState.scaleY);
_local10 = 0;
_local11 = 0;
if (this.orientToPath){
_local17 = _local2.getValue((_arg1 + 1), Tweenables.X);
_local18 = _local2.getValue((_arg1 + 1), Tweenables.Y);
_local19 = (Math.atan2((_local18 - _local6), (_local17 - _local5)) * (180 / Math.PI));
if (!isNaN(_local19)){
_local10 = (_local19 + this.targetState.skewX);
_local11 = (_local19 + this.targetState.skewY);
};
} else {
_local10 = (_local2.getValue(_arg1, Tweenables.SKEW_X) + this.targetState.skewX);
_local11 = (_local2.getValue(_arg1, Tweenables.SKEW_Y) + this.targetState.skewY);
};
_local12 = new Matrix((_local8 * Math.cos((_local11 * (Math.PI / 180)))), (_local8 * Math.sin((_local11 * (Math.PI / 180)))), (-(_local9) * Math.sin((_local10 * (Math.PI / 180)))), (_local9 * Math.cos((_local10 * (Math.PI / 180)))), _local7.x, _local7.y);
_local13 = _local12.transformPoint(this.targetState.transformPointInternal);
_local14 = (_local12.tx - _local13.x);
_local15 = (_local12.ty - _local13.y);
_local12.tx = (_local12.tx + _local14);
_local12.ty = (_local12.ty + _local15);
this._target.rotation = _local11;
this._target.transform.matrix = _local12;
this._target.scaleX = _local8;
this._target.scaleY = _local9;
_local16 = _local2.getColorTransform(_arg1);
if (_local16){
this._target.transform.colorTransform = _local16;
};
this._target.filters = _local2.getFilters(_arg1);
this._target.blendMode = _local3.blendMode;
this._target.cacheAsBitmap = _local3.cacheAsBitmap;
this._target.visible = true;
};
this._lastRenderedTime = this._time;
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_UPDATE));
}
private function enterFrameHandler(_arg1:Event):void{
this.nextFrame();
}
public function set target(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Point;
if (!_arg1){
return;
};
this._target = _arg1;
this.targetState = {};
this.targetState.scaleX = this._target.scaleX;
this.targetState.scaleY = this._target.scaleY;
this.targetState.skewX = MatrixTransformer.getSkewX(this._target.transform.matrix);
this.targetState.skewY = MatrixTransformer.getSkewY(this._target.transform.matrix);
this.targetState.matrix = this._target.transform.matrix;
_local2 = (this.targetState.bounds = this._target.getBounds(this._target));
if (this.transformationPoint){
_local3 = ((this.transformationPoint.x * _local2.width) + _local2.left);
_local4 = ((this.transformationPoint.y * _local2.height) + _local2.top);
this.targetState.transformPointInternal = new Point(_local3, _local4);
_local5 = this.targetState.matrix.transformPoint(this.targetState.transformPointInternal);
this.targetState.x = _local5.x;
this.targetState.y = _local5.y;
} else {
this.targetState.transformPointInternal = new Point(0, 0);
this.targetState.x = this._target.x;
this.targetState.y = this._target.y;
};
}
public function get isPlaying():Boolean{
return (_isPlaying);
}
public function resume():void{
enterFrameBeacon.addEventListener(Event.ENTER_FRAME, this.enterFrameHandler, false, 0, true);
this._isPlaying = true;
}
private function handleLastFrame():void{
this.playCount++;
if ((((this.repeatCount == 0)) || ((this.playCount < this.repeatCount)))){
this.rewind();
} else {
this.end();
};
}
public function get motion():Motion{
return (this._motion);
}
public function nextFrame():void{
if (this.time >= (this.motion.duration - 1)){
this.handleLastFrame();
} else {
this.time++;
};
}
public function play():void{
if (!this._isPlaying){
enterFrameBeacon.addEventListener(Event.ENTER_FRAME, this.enterFrameHandler, false, 0, true);
this._isPlaying = true;
};
this.playCount = 0;
this.rewind();
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_START));
}
public function rewind():void{
this.time = 0;
}
public function end():void{
enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
this._isPlaying = false;
this.playCount = 0;
if (this.autoRewind){
this.rewind();
} else {
if (this.time != (this.motion.duration - 1)){
this.time = (this.motion.duration - 1);
};
};
this.dispatchEvent(new MotionEvent(MotionEvent.MOTION_END));
}
public function get time():int{
return (this._time);
}
public function pause():void{
enterFrameBeacon.removeEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
this._isPlaying = false;
}
public function set motion(_arg1:Motion):void{
this._motion = _arg1;
if (((_arg1.source) && (_arg1.source.transformationPoint))){
this.transformationPoint = _arg1.source.transformationPoint.clone();
};
}
public static function fromXMLString(_arg1:String, _arg2:DisplayObject=null):Animator{
return (new Animator(new XML(_arg1), _arg2));
}
}
}//package fl.motion
Section 16
//BezierEase (fl.motion.BezierEase)
package fl.motion {
import flash.geom.*;
public class BezierEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var _target:String;// = ""
private var lastNode:Point;
public function BezierEase(_arg1:XML=null){
_target = "";
super();
this.points = [];
this.parseXML(_arg1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Array;
var _local7:Number;
if (_arg4 <= 0){
return (NaN);
};
_local5 = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
this.firstNode = new Point(0, _arg2);
this.lastNode = new Point(1, (_arg2 + _arg3));
_local6 = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
_local7 = CustomEase.getYForPercent(_local5, _local6);
return (_local7);
}
private function parseXML(_arg1:XML=null):BezierEase{
var _local2:XMLList;
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
_local2 = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
}
}//package fl.motion
Section 17
//BezierSegment (fl.motion.BezierSegment)
package fl.motion {
import flash.geom.*;
public class BezierSegment {
public var a:Point;
public var c:Point;
public var b:Point;
public var d:Point;
public function BezierSegment(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
}
public function getYForX(_arg1:Number, _arg2:Array=null):Number{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (this.a.x < this.d.x){
if (_arg1 <= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 >= (this.d.x - 1E-16)){
return (this.d.y);
};
} else {
if (_arg1 >= (this.a.x + 1E-16)){
return (this.a.y);
};
if (_arg1 <= (this.d.x - 1E-16)){
return (this.d.y);
};
};
if (!_arg2){
_arg2 = getCubicCoefficients(this.a.x, this.b.x, this.c.x, this.d.x);
};
_local3 = getCubicRoots(_arg2[0], _arg2[1], _arg2[2], (_arg2[3] - _arg1));
_local4 = NaN;
if (_local3.length == 0){
_local4 = 0;
} else {
if (_local3.length == 1){
_local4 = _local3[0];
} else {
for each (_local6 in _local3) {
if ((((0 <= _local6)) && ((_local6 <= 1)))){
_local4 = _local6;
break;
};
};
};
};
if (isNaN(_local4)){
return (NaN);
};
_local5 = getSingleValue(_local4, this.a.y, this.b.y, this.c.y, this.d.y);
return (_local5);
}
public function getValue(_arg1:Number):Point{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = this.a.x;
_local3 = (((((_arg1 * _arg1) * (this.d.x - _local2)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.x - _local2)) + ((1 - _arg1) * (this.b.x - _local2))))) * _arg1) + _local2);
_local4 = this.a.y;
_local5 = (((((_arg1 * _arg1) * (this.d.y - _local4)) + ((3 * (1 - _arg1)) * ((_arg1 * (this.c.y - _local4)) + ((1 - _arg1) * (this.b.y - _local4))))) * _arg1) + _local4);
return (new Point(_local3, _local5));
}
public static function getCubicCoefficients(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Array{
return ([(((-(_arg1) + (3 * _arg2)) - (3 * _arg3)) + _arg4), (((3 * _arg1) - (6 * _arg2)) + (3 * _arg3)), ((-3 * _arg1) + (3 * _arg2)), _arg1]);
}
public static function getSingleValue(_arg1:Number, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0):Number{
return ((((((_arg1 * _arg1) * (_arg5 - _arg2)) + ((3 * (1 - _arg1)) * ((_arg1 * (_arg4 - _arg2)) + ((1 - _arg1) * (_arg3 - _arg2))))) * _arg1) + _arg2));
}
public static function getCubicRoots(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):Array{
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:int;
var _local16:Number;
if (!_arg1){
return (BezierSegment.getQuadraticRoots(_arg2, _arg3, _arg4));
};
if (_arg1 != 1){
_arg2 = (_arg2 / _arg1);
_arg3 = (_arg3 / _arg1);
_arg4 = (_arg4 / _arg1);
};
_local5 = (((_arg2 * _arg2) - (3 * _arg3)) / 9);
_local6 = (((((_arg2 * _arg2) - (3 * _arg3)) / 9) * _local5) * _local5);
_local7 = ((((((2 * _arg2) * _arg2) * _arg2) - ((9 * _arg2) * _arg3)) + (27 * _arg4)) / 54);
_local8 = (_local6 - (_local7 * _local7));
if (_local8 >= 0){
if (!_local5){
return ([0]);
};
_local9 = Math.acos((_local7 / Math.sqrt(_local6)));
_local10 = Math.sqrt(_local5);
_local11 = (((-2 * _local10) * Math.cos((_local9 / 3))) - (_arg2 / 3));
_local12 = (((-2 * _local10) * Math.cos(((_local9 + (2 * Math.PI)) / 3))) - (_arg2 / 3));
_local13 = (((-2 * _local10) * Math.cos(((_local9 + (4 * Math.PI)) / 3))) - (_arg2 / 3));
return ([_local11, _local12, _local13]);
//unresolved jump
};
_local14 = Math.pow((Math.sqrt(-(_local8)) + Math.abs(_local7)), (1 / 3));
_local15 = ((_local7)>0) ? 1 : ((_local7 < 0)) ? -1 : 0;
_local16 = ((-(_local15) * (_local14 + (_local5 / _local14))) - (_arg2 / 3));
return ([_local16]);
}
public static function getQuadraticRoots(_arg1:Number, _arg2:Number, _arg3:Number):Array{
var _local4:Array;
var _local5:Number;
var _local6:int;
var _local7:Number;
_local4 = [];
if (!_arg1){
if (!_arg2){
return ([]);
};
_local4[0] = (-(_arg3) / _arg2);
return (_local4);
};
_local5 = ((_arg2 * _arg2) - ((4 * _arg1) * _arg3));
_local6 = ((_local5)>0) ? 1 : ((_local5 < 0)) ? -1 : 0;
if (_local6 < 0){
return ([]);
};
if (!_local6){
_local4[0] = (-(_arg2) / (2 * _arg1));
} else {
_local4[0] = (_local4[1] = (-(_arg2) / (2 * _arg1)));
_local7 = (Math.sqrt(_local5) / (2 * _arg1));
_local4[0] = (_local4[0] - _local7);
_local4[1] = (_local4[1] + _local7);
};
return (_local4);
}
}
}//package fl.motion
Section 18
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 19
//CustomEase (fl.motion.CustomEase)
package fl.motion {
import flash.geom.*;
public class CustomEase implements ITween {
public var points:Array;
private var firstNode:Point;
private var _target:String;// = ""
private var lastNode:Point;
public function CustomEase(_arg1:XML=null){
_target = "";
super();
this.points = [];
this.parseXML(_arg1);
this.firstNode = new Point(0, 0);
this.lastNode = new Point(1, 1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Array;
var _local7:Number;
if (_arg4 <= 0){
return (NaN);
};
_local5 = (_arg1 / _arg4);
if (_local5 <= 0){
return (_arg2);
};
if (_local5 >= 1){
return ((_arg2 + _arg3));
};
_local6 = [this.firstNode].concat(this.points);
_local6.push(this.lastNode);
_local7 = getYForPercent(_local5, _local6);
return ((_arg2 + (_local7 * _arg3)));
}
private function parseXML(_arg1:XML=null):CustomEase{
var _local2:XMLList;
var _local3:XML;
if (!_arg1){
return (this);
};
if (_arg1.@target.length()){
this.target = _arg1.@target;
};
_local2 = _arg1.elements();
for each (_local3 in _local2) {
this.points.push(new Point(Number(_local3.@x), Number(_local3.@y)));
};
return (this);
}
static function getYForPercent(_arg1:Number, _arg2:Array):Number{
var _local3:BezierSegment;
var _local4:Array;
var _local5:int;
var _local6:BezierSegment;
var _local7:Number;
var _local8:int;
var _local9:BezierSegment;
_local3 = new BezierSegment(_arg2[0], _arg2[1], _arg2[2], _arg2[3]);
_local4 = [_local3];
_local5 = 3;
while (_local5 < (_arg2.length - 3)) {
_local4.push(new BezierSegment(_arg2[_local5], _arg2[(_local5 + 1)], _arg2[(_local5 + 2)], _arg2[(_local5 + 3)]));
_local5 = (_local5 + 3);
};
_local6 = _local3;
if (_arg2.length >= 5){
_local8 = 0;
while (_local8 < _local4.length) {
_local9 = _local4[_local8];
if ((((_local9.a.x <= _arg1)) && ((_arg1 <= _local9.d.x)))){
_local6 = _local9;
break;
};
_local8++;
};
};
_local7 = _local6.getYForX(_arg1);
return (_local7);
}
}
}//package fl.motion
Section 20
//FunctionEase (fl.motion.FunctionEase)
package fl.motion {
import flash.utils.*;
public class FunctionEase implements ITween {
private var _functionName:String;// = ""
public var parameters:Array;// = null
private var _target:String;// = ""
public var easingFunction:Function;// = null
public function FunctionEase(_arg1:XML=null){
_functionName = "";
easingFunction = null;
parameters = null;
_target = "";
super();
this.parseXML(_arg1);
}
public function get functionName():String{
return (this._functionName);
}
public function set functionName(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:Class;
_local2 = _arg1.split(".");
_local3 = _local2.pop();
_local4 = _local2.join(".");
_local5 = (getDefinitionByName(_local4) as Class);
if ((_local5[_local3] is Function)){
this.easingFunction = _local5[_local3];
this._functionName = _arg1;
};
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Array;
if ((this.parameters is Array)){
_local5 = [_arg1, _arg2, _arg3, _arg4].concat(this.parameters);
return (this.easingFunction.apply(null, _local5));
};
return (this.easingFunction(_arg1, _arg2, _arg3, _arg4));
}
private function parseXML(_arg1:XML=null):FunctionEase{
if (!_arg1){
return (this);
};
if (_arg1.@functionName.length()){
this.functionName = _arg1.@functionName;
};
return (this);
}
}
}//package fl.motion
Section 21
//ITween (fl.motion.ITween)
package fl.motion {
public interface ITween {
function get target():String;
function set target(_arg1:String):void;
function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number;
}
}//package fl.motion
Section 22
//Keyframe (fl.motion.Keyframe)
package fl.motion {
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
public class Keyframe {
public var skewX:Number;// = NAN
public var blendMode:String;
public var skewY:Number;// = NAN
public var firstFrame:String;
public var tweenScale:Boolean;// = true
public var cacheAsBitmap:Boolean;// = false
public var rotateTimes:uint;// = 0
public var tweenSync:Boolean;// = false
public var loop:String;
public var scaleX:Number;// = NAN
private var _index:int;// = -1
public var blank:Boolean;// = false
public var tweenSnap:Boolean;// = false
public var scaleY:Number;// = NAN
public var color:Color;
public var rotateDirection:String;
public var orientToPath:Boolean;// = false
public var tweens:Array;
public var label:String;// = ""
public var x:Number;// = NAN
public var y:Number;// = NAN
public var filters:Array;
public function Keyframe(_arg1:XML=null){
_index = -1;
x = NaN;
y = NaN;
scaleX = NaN;
scaleY = NaN;
skewX = NaN;
skewY = NaN;
label = "";
tweenScale = true;
tweenSnap = false;
tweenSync = false;
cacheAsBitmap = false;
blendMode = BlendMode.NORMAL;
rotateDirection = RotateDirection.AUTO;
rotateTimes = 0;
orientToPath = false;
blank = false;
super();
this.tweens = [];
this.filters = [];
this.parseXML(_arg1);
}
public function set index(_arg1:int):void{
this._index = ((_arg1)<0) ? 0 : _arg1;
if (this._index == 0){
this.setDefaults();
};
}
public function getTween(_arg1:String=""):ITween{
var _local2:ITween;
for each (_local2 in this.tweens) {
if ((((((((_local2.target == _arg1)) || ((((_local2.target == "rotation")) && ((((_arg1 == "skewX")) || ((_arg1 == "skewY")))))))) || ((((_local2.target == "position")) && ((((_arg1 == "x")) || ((_arg1 == "y")))))))) || ((((_local2.target == "scale")) && ((((_arg1 == "scaleX")) || ((_arg1 == "scaleY")))))))){
return (_local2);
};
};
return (null);
}
public function setValue(_arg1:String, _arg2:Number):void{
this[_arg1] = _arg2;
}
public function getValue(_arg1:String):Number{
return (Number(this[_arg1]));
}
public function get index():int{
return (this._index);
}
private function setDefaults():void{
if (isNaN(this.x)){
this.x = 0;
};
if (isNaN(this.y)){
this.y = 0;
};
if (isNaN(this.scaleX)){
this.scaleX = 1;
};
if (isNaN(this.scaleY)){
this.scaleY = 1;
};
if (isNaN(this.skewX)){
this.skewX = 0;
};
if (isNaN(this.skewY)){
this.skewY = 0;
};
if (!this.color){
this.color = new Color();
};
}
public function affectsTweenable(_arg1:String=""):Boolean{
return (((((((((((!(_arg1)) || (!(isNaN(this[_arg1]))))) || ((((_arg1 == "color")) && (this.color))))) || ((((_arg1 == "filters")) && (this.filters.length))))) || (this.blank))) || (this.getTween())));
}
private function parseXML(_arg1:XML=null):Keyframe{
var indexString:String;
var indexValue:int;
var tweenableNames:Array;
var tweenableName:String;
var elements:XMLList;
var filtersArray:Array;
var child:XML;
var attribute:XML;
var attributeValue:String;
var name:String;
var tweenChildren:XMLList;
var tweenChild:XML;
var tweenName:String;
var filtersChildren:XMLList;
var filterXML:XML;
var filterName:String;
var filterClassName:String;
var filterClass:Object;
var filterInstance:BitmapFilter;
var filterTypeInfo:XML;
var accessorList:XMLList;
var ratios:Array;
var attrib:XML;
var attribName:String;
var accessor:XML;
var attribType:String;
var attribValue:String;
var uintValue:uint;
var valuesArray:Array;
var xml = _arg1;
if (!xml){
return (this);
};
indexString = xml.@index.toXMLString();
indexValue = parseInt(indexString);
if (indexString){
this.index = indexValue;
} else {
throw (new Error("<Keyframe> is missing the required attribute \"index\"."));
};
if (xml.@label.length()){
this.label = xml.@label;
};
if (xml.@tweenScale.length()){
this.tweenScale = (xml.@tweenScale.toString() == "true");
};
if (xml.@tweenSnap.length()){
this.tweenSnap = (xml.@tweenSnap.toString() == "true");
};
if (xml.@tweenSync.length()){
this.tweenSync = (xml.@tweenSync.toString() == "true");
};
if (xml.@blendMode.length()){
this.blendMode = xml.@blendMode;
};
if (xml.@cacheAsBitmap.length()){
this.cacheAsBitmap = (xml.@cacheAsBitmap.toString() == "true");
};
if (xml.@rotateDirection.length()){
this.rotateDirection = xml.@rotateDirection;
};
if (xml.@rotateTimes.length()){
this.rotateTimes = parseInt(xml.@rotateTimes);
};
if (xml.@orientToPath.length()){
this.orientToPath = (xml.@orientToPath.toString() == "true");
};
if (xml.@blank.length()){
this.blank = (xml.@blank.toString() == "true");
};
tweenableNames = ["x", "y", "scaleX", "scaleY", "rotation", "skewX", "skewY"];
for each (tweenableName in tweenableNames) {
attribute = xml.attribute(tweenableName)[0];
if (!attribute){
} else {
attributeValue = attribute.toString();
if (attributeValue){
this[tweenableName] = Number(attributeValue);
};
};
};
elements = xml.elements();
filtersArray = [];
for each (child in elements) {
name = child.localName();
if (name == "tweens"){
tweenChildren = child.elements();
for each (tweenChild in tweenChildren) {
tweenName = tweenChild.localName();
if (tweenName == "SimpleEase"){
this.tweens.push(new SimpleEase(tweenChild));
} else {
if (tweenName == "CustomEase"){
this.tweens.push(new CustomEase(tweenChild));
} else {
if (tweenName == "BezierEase"){
this.tweens.push(new BezierEase(tweenChild));
} else {
if (tweenName == "FunctionEase"){
this.tweens.push(new FunctionEase(tweenChild));
};
};
};
};
};
} else {
if (name == "filters"){
filtersChildren = child.elements();
for each (filterXML in filtersChildren) {
filterName = filterXML.localName();
filterClassName = ("flash.filters." + filterName);
if (filterName == "AdjustColorFilter"){
} else {
filterClass = getDefinitionByName(filterClassName);
filterInstance = new (filterClass);
filterTypeInfo = describeType(filterInstance);
accessorList = filterTypeInfo.accessor;
ratios = [];
for each (attrib in filterXML.attributes()) {
attribName = attrib.localName();
accessor = accessorList.(@name == attribName)[0];
attribType = accessor.@type;
attribValue = attrib.toString();
if (attribType == "int"){
filterInstance[attribName] = parseInt(attribValue);
} else {
if (attribType == "uint"){
filterInstance[attribName] = (parseInt(attribValue) as uint);
uintValue = (parseInt(attribValue) as uint);
} else {
if (attribType == "Number"){
filterInstance[attribName] = Number(attribValue);
} else {
if (attribType == "Boolean"){
filterInstance[attribName] = (attribValue == "true");
} else {
if (attribType == "Array"){
attribValue = attribValue.substring(1, (attribValue.length - 1));
valuesArray = null;
if ((((attribName == "ratios")) || ((attribName == "colors")))){
valuesArray = splitUint(attribValue);
} else {
if (attribName == "alphas"){
valuesArray = splitNumber(attribValue);
};
};
if (attribName == "ratios"){
ratios = valuesArray;
} else {
if (valuesArray){
filterInstance[attribName] = valuesArray;
};
};
} else {
if (attribType == "String"){
filterInstance[attribName] = attribValue;
};
};
};
};
};
};
};
if (ratios.length){
filterInstance["ratios"] = ratios;
};
filtersArray.push(filterInstance);
};
};
} else {
if (name == "color"){
this.color = Color.fromXML(child);
};
};
};
this.filters = filtersArray;
};
return (this);
}
public function set rotation(_arg1:Number):void{
if (((isNaN(this.skewX)) || (isNaN(this.skewY)))){
this.skewX = _arg1;
} else {
this.skewX = (this.skewX + (_arg1 - this.skewY));
};
this.skewY = _arg1;
}
public function get rotation():Number{
return (this.skewY);
}
private static function splitNumber(_arg1:String):Array{
var _local2:Array;
var _local3:int;
_local2 = _arg1.split(",");
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = Number(_local2[_local3]);
_local3++;
};
return (_local2);
}
private static function splitUint(_arg1:String):Array{
var _local2:Array;
var _local3:int;
_local2 = _arg1.split(",");
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as uint);
_local3++;
};
return (_local2);
}
private static function splitInt(_arg1:String):Array{
var _local2:Array;
var _local3:int;
_local2 = _arg1.split(",");
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = (parseInt(_local2[_local3]) as int);
_local3++;
};
return (_local2);
}
}
}//package fl.motion
Section 23
//MatrixTransformer (fl.motion.MatrixTransformer)
package fl.motion {
import flash.geom.*;
public class MatrixTransformer {
public static function getSkewY(_arg1:Matrix):Number{
return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI)));
}
public static function getScaleX(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))));
}
public static function getScaleY(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))));
}
public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
_local3 = getScaleY(_arg1);
_arg1.c = (-(_local3) * Math.sin(_arg2));
_arg1.d = (_local3 * Math.cos(_arg2));
}
public static function setRotation(_arg1:Matrix, _arg2:Number):void{
setRotationRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point;
_local5 = new Point(_arg2, _arg3);
_local5 = _arg1.transformPoint(_local5);
_arg1.tx = (_arg1.tx - _local5.x);
_arg1.ty = (_arg1.ty - _local5.y);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _local5.x);
_arg1.ty = (_arg1.ty + _local5.y);
}
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{
setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{
setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setScaleX(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = getScaleX(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.a = (_arg1.a * _local4);
_arg1.b = (_arg1.b * _local4);
} else {
_local5 = getSkewYRadians(_arg1);
_arg1.a = (Math.cos(_local5) * _arg2);
_arg1.b = (Math.sin(_local5) * _arg2);
};
}
public static function setScaleY(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = getScaleY(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.c = (_arg1.c * _local4);
_arg1.d = (_arg1.d * _local4);
} else {
_local5 = getSkewXRadians(_arg1);
_arg1.c = (-(Math.sin(_local5)) * _arg2);
_arg1.d = (Math.cos(_local5) * _arg2);
};
}
public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
_local3 = getRotationRadians(_arg1);
_local4 = getSkewXRadians(_arg1);
setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3));
setSkewYRadians(_arg1, _arg2);
}
public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number;
_local3 = getScaleX(_arg1);
_arg1.a = (_local3 * Math.cos(_arg2));
_arg1.b = (_local3 * Math.sin(_arg2));
}
public static function getSkewX(_arg1:Matrix):Number{
return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI)));
}
public static function getSkewYRadians(_arg1:Matrix):Number{
return (Math.atan2(_arg1.b, _arg1.a));
}
public static function getSkewXRadians(_arg1:Matrix):Number{
return (Math.atan2(-(_arg1.c), _arg1.d));
}
public static function getRotation(_arg1:Matrix):Number{
return ((getRotationRadians(_arg1) * (180 / Math.PI)));
}
public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.tx = (_arg1.tx - _arg2);
_arg1.ty = (_arg1.ty - _arg3);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _arg2);
_arg1.ty = (_arg1.ty + _arg3);
}
public static function getRotationRadians(_arg1:Matrix):Number{
return (getSkewYRadians(_arg1));
}
public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{
var _local4:Point;
var _local5:Number;
var _local6:Number;
_local4 = _arg1.transformPoint(_arg2);
_local5 = (_arg3.x - _local4.x);
_local6 = (_arg3.y - _local4.y);
_arg1.tx = (_arg1.tx + _local5);
_arg1.ty = (_arg1.ty + _local6);
}
}
}//package fl.motion
Section 24
//Motion (fl.motion.Motion)
package fl.motion {
import flash.filters.*;
import flash.geom.*;
import flash.utils.*;
public class Motion {
private var _keyframesCompact:Array;
public var keyframes:Array;
public var source:Source;
private var _duration:int;// = 0
private static var typeCache:Object = {};
public function Motion(_arg1:XML=null){
var _local2:Keyframe;
_duration = 0;
super();
this.keyframes = [];
this.parseXML(_arg1);
if (!this.source){
this.source = new Source();
};
if (this.duration == 0){
_local2 = new Keyframe();
_local2.index = 0;
this.addKeyframe(_local2);
};
}
public function getFilters(_arg1:Number):Array{
var _local2:Array;
var _local3:Keyframe;
var _local4:Array;
var _local5:Number;
var _local6:ITween;
var _local7:Keyframe;
var _local8:Array;
var _local9:Number;
var _local10:Number;
_local2 = null;
_local3 = this.getCurrentKeyframe(_arg1, "filters");
if (((!(_local3)) || (!(_local3.filters.length)))){
return ([]);
};
_local4 = _local3.filters;
_local5 = (_arg1 - _local3.index);
_local6 = ((_local3.getTween("filters")) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = this.getNextKeyframe(_arg1, "filters");
if (((!(_local7)) || (!(_local7.filters.length)))){
_local2 = _local4;
} else {
_local8 = _local7.filters;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = interpolateFilters(_local4, _local8, _local10);
};
};
};
return (_local2);
}
public function getCurrentKeyframe(_arg1:int, _arg2:String=""):Keyframe{
var _local3:int;
var _local4:Keyframe;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
_local3 = _arg1;
while (_local3 > 0) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3--;
};
return (this.keyframes[0]);
}
public function get duration():int{
if (this._duration < this.keyframes.length){
this._duration = this.keyframes.length;
};
return (this._duration);
}
public function get keyframesCompact():Array{
var _local1:Keyframe;
this._keyframesCompact = [];
for each (_local1 in this.keyframes) {
if (_local1){
this._keyframesCompact.push(_local1);
};
};
return (this._keyframesCompact);
}
private function parseXML(_arg1:XML):Motion{
var _local2:XMLList;
var _local3:Number;
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@duration.length()){
this._duration = parseInt(_arg1.@duration);
};
_local2 = _arg1.elements();
_local3 = 0;
while (_local3 < _local2.length()) {
_local4 = _local2[_local3];
if (_local4.localName() == "source"){
_local5 = _local4.children()[0];
this.source = new Source(_local5);
} else {
if (_local4.localName() == "Keyframe"){
this.addKeyframe(new Keyframe(_local4));
};
};
_local3++;
};
return (this);
}
public function set duration(_arg1:int):void{
if (_arg1 < this.keyframes.length){
_arg1 = this.keyframes.length;
};
this._duration = _arg1;
}
private function indexOutOfRange(_arg1:int):Boolean{
return (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1)))));
}
public function addKeyframe(_arg1:Keyframe):void{
this.keyframes[_arg1.index] = _arg1;
if (this.duration < this.keyframes.length){
this.duration = this.keyframes.length;
};
}
public function setValue(_arg1:int, _arg2:String, _arg3:Number):void{
var _local4:Keyframe;
if (_arg1 == 0){
return;
};
_local4 = this.keyframes[_arg1];
if (!_local4){
_local4 = new Keyframe();
_local4.index = _arg1;
this.addKeyframe(_local4);
};
_local4.setValue(_arg2, _arg3);
}
public function getNextKeyframe(_arg1:int, _arg2:String=""):Keyframe{
var _local3:int;
var _local4:Keyframe;
if (((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > (this.duration - 1))))){
return (null);
};
_local3 = (_arg1 + 1);
while (_local3 < this.keyframes.length) {
_local4 = this.keyframes[_local3];
if (((_local4) && (_local4.affectsTweenable(_arg2)))){
return (_local4);
};
_local3++;
};
return (null);
}
public function getValue(_arg1:Number, _arg2:String):Number{
var _local3:Number;
var _local4:Keyframe;
var _local5:Number;
var _local6:Number;
var _local7:ITween;
var _local8:String;
var _local9:Keyframe;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local3 = NaN;
_local4 = this.getCurrentKeyframe(_arg1, _arg2);
if (((!(_local4)) || (_local4.blank))){
return (NaN);
};
_local5 = _local4.getValue(_arg2);
if (((isNaN(_local5)) && ((_local4.index > 0)))){
_local5 = this.getValue((_local4.index - 1), _arg2);
};
if (isNaN(_local5)){
return (NaN);
};
_local6 = (_arg1 - _local4.index);
if (_local6 == 0){
return (_local5);
};
_local7 = ((_local4.getTween(_arg2)) || (_local4.getTween()));
if (((((!(_local7)) || (((!(_local4.tweenScale)) && ((((_arg2 == Tweenables.SCALE_X)) || ((_arg2 == Tweenables.SCALE_Y)))))))) || ((((_local4.rotateDirection == RotateDirection.NONE)) && ((((((_arg2 == Tweenables.ROTATION)) || ((_arg2 == Tweenables.SKEW_X)))) || ((_arg2 == Tweenables.SKEW_Y)))))))){
return (_local5);
};
_local8 = _arg2;
if (_local7.target == ""){
_local8 = "";
};
_local9 = this.getNextKeyframe(_arg1, _local8);
if (((!(_local9)) || (_local9.blank))){
return (_local5);
};
_local10 = _local9.getValue(_arg2);
if (isNaN(_local10)){
_local10 = _local5;
};
_local11 = (_local10 - _local5);
if ((((((_arg2 == Tweenables.SKEW_X)) || ((_arg2 == Tweenables.SKEW_Y)))) || ((_arg2 == Tweenables.ROTATION)))){
if (_local4.rotateDirection == RotateDirection.AUTO){
_local11 = (_local11 % 360);
if (_local11 > 180){
_local11 = (_local11 - 360);
} else {
if (_local11 < -180){
_local11 = (_local11 + 360);
};
};
} else {
if (_local4.rotateDirection == RotateDirection.CW){
if (_local11 < 0){
_local11 = ((_local11 % 360) + 360);
};
_local11 = (_local11 + (_local4.rotateTimes * 360));
} else {
if (_local11 > 0){
_local11 = ((_local11 % 360) - 360);
};
_local11 = (_local11 - (_local4.rotateTimes * 360));
};
};
};
_local12 = (_local9.index - _local4.index);
_local3 = _local7.getValue(_local6, _local5, _local11, _local12);
return (_local3);
}
public function set keyframesCompact(_arg1:Array):void{
var _local2:Keyframe;
this._keyframesCompact = _arg1.concat();
this.keyframes = [];
for each (_local2 in this._keyframesCompact) {
this.addKeyframe(_local2);
};
}
public function getColorTransform(_arg1:int):ColorTransform{
var _local2:ColorTransform;
var _local3:Keyframe;
var _local4:ColorTransform;
var _local5:Number;
var _local6:ITween;
var _local7:Keyframe;
var _local8:ColorTransform;
var _local9:Number;
var _local10:Number;
_local2 = null;
_local3 = this.getCurrentKeyframe(_arg1, "color");
if (((!(_local3)) || (!(_local3.color)))){
return (null);
};
_local4 = _local3.color;
_local5 = (_arg1 - _local3.index);
_local6 = ((((_local3.getTween("color")) || (_local3.getTween("alpha")))) || (_local3.getTween()));
if ((((_local5 == 0)) || (!(_local6)))){
_local2 = _local4;
} else {
if (_local6){
_local7 = this.getNextKeyframe(_arg1, "color");
if (((!(_local7)) || (!(_local7.color)))){
_local2 = _local4;
} else {
_local8 = _local7.color;
_local9 = (_local7.index - _local3.index);
_local10 = _local6.getValue(_local5, 0, 1, _local9);
_local2 = Color.interpolateTransform(_local4, _local8, _local10);
};
};
};
return (_local2);
}
private static function getTypeInfo(_arg1):XML{
var _local2:String;
_local2 = "";
if ((_arg1 is String)){
_local2 = _arg1;
} else {
_local2 = getQualifiedClassName(_arg1);
};
if ((_local2 in typeCache)){
return (typeCache[_local2]);
};
if ((_arg1 is String)){
_arg1 = getDefinitionByName(_arg1);
};
return ((typeCache[_local2] = describeType(_arg1)));
}
public static function interpolateFilter(_arg1:BitmapFilter, _arg2:BitmapFilter, _arg3:Number):BitmapFilter{
var _local4:Number;
var _local5:BitmapFilter;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:String;
var _local10:String;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:Number;
var _local23:uint;
var _local24:Number;
var _local25:int;
var _local26:Number;
var _local27:uint;
var _local28:Number;
var _local29:int;
var _local30:uint;
var _local31:Number;
if (((!(_arg2)) || (!((_arg1["constructor"] == _arg2["constructor"]))))){
return (_arg1);
};
if (_arg3 > 1){
_arg3 = 1;
} else {
if (_arg3 < 0){
_arg3 = 0;
};
};
_local4 = (1 - _arg3);
_local5 = _arg1.clone();
_local6 = getTypeInfo(_arg1);
_local7 = _local6.accessor;
for each (_local8 in _local7) {
_local9 = _local8.@name.toString();
_local10 = _local8.@type;
if ((((_local10 == "Number")) || ((_local10 == "int")))){
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
} else {
if (_local10 == "uint"){
switch (_local9){
case "color":
case "highlightColor":
case "shadowColor":
_local11 = _arg1[_local9];
_local12 = _arg2[_local9];
_local13 = Color.interpolateColor(_local11, _local12, _arg3);
_local5[_local9] = _local13;
break;
default:
_local5[_local9] = ((_arg1[_local9] * _local4) + (_arg2[_local9] * _arg3));
break;
};
};
};
};
if ((((_arg1 is GradientGlowFilter)) || ((_arg1 is GradientBevelFilter)))){
_local14 = [];
_local15 = [];
_local16 = [];
_local17 = _arg1["ratios"].length;
_local18 = _arg2["ratios"].length;
_local19 = Math.max(_local17, _local18);
_local20 = 0;
while (_local20 < _local19) {
_local21 = Math.min(_local20, (_local17 - 1));
_local22 = _arg1["ratios"][_local21];
_local23 = _arg1["colors"][_local21];
_local24 = _arg1["alphas"][_local21];
_local25 = Math.min(_local20, (_local18 - 1));
_local26 = _arg2["ratios"][_local25];
_local27 = _arg2["colors"][_local25];
_local28 = _arg2["alphas"][_local25];
_local29 = ((_local22 * _local4) + (_local26 * _arg3));
_local30 = Color.interpolateColor(_local23, _local27, _arg3);
_local31 = ((_local24 * _local4) + (_local28 * _arg3));
_local14[_local20] = _local29;
_local15[_local20] = _local30;
_local16[_local20] = _local31;
_local20++;
};
_local5["colors"] = _local15;
_local5["alphas"] = _local16;
_local5["ratios"] = _local14;
};
return (_local5);
}
public static function interpolateFilters(_arg1:Array, _arg2:Array, _arg3:Number):Array{
var _local4:Array;
var _local5:int;
var _local6:BitmapFilter;
var _local7:BitmapFilter;
var _local8:BitmapFilter;
if (_arg1.length != _arg2.length){
return (null);
};
_local4 = [];
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = _arg1[_local5];
_local7 = _arg2[_local5];
_local8 = interpolateFilter(_local6, _local7, _arg3);
if (_local8){
_local4.push(_local8);
};
_local5++;
};
return (_local4);
}
public static function fromXMLString(_arg1:String):Motion{
var _local2:XML;
_local2 = new XML(_arg1);
return (new Motion(_local2));
}
}
}//package fl.motion
Section 25
//MotionEvent (fl.motion.MotionEvent)
package fl.motion {
import flash.events.*;
public class MotionEvent extends Event {
public static const MOTION_UPDATE:String = "motionUpdate";
public static const TIME_CHANGE:String = "timeChange";
public static const MOTION_START:String = "motionStart";
public static const MOTION_END:String = "motionEnd";
public function MotionEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new MotionEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package fl.motion
Section 26
//RotateDirection (fl.motion.RotateDirection)
package fl.motion {
public class RotateDirection {
public static const CW:String = "cw";
public static const CCW:String = "ccw";
public static const NONE:String = "none";
public static const AUTO:String = "auto";
}
}//package fl.motion
Section 27
//SimpleEase (fl.motion.SimpleEase)
package fl.motion {
public class SimpleEase implements ITween {
private var _ease:Number;// = 0
private var _target:String;// = ""
public function SimpleEase(_arg1:XML=null){
_ease = 0;
_target = "";
super();
this.parseXML(_arg1);
}
public function set target(_arg1:String):void{
this._target = _arg1;
}
private function parseXML(_arg1:XML=null):SimpleEase{
if (_arg1){
if (_arg1.@ease.length()){
this.ease = Number(_arg1.@ease);
};
};
return (this);
}
public function get ease():Number{
return (this._ease);
}
public function get target():String{
return (this._target);
}
public function getValue(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (easeQuadPercent(_arg1, _arg2, _arg3, _arg4, this.ease));
}
public function set ease(_arg1:Number):void{
this._ease = ((_arg1 > 1)) ? 1 : ((_arg1 < -1)) ? -1 : (isNaN(_arg1)) ? 0 : _arg1;
}
public static function easeQuadPercent(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 >= 1){
return ((_arg2 + _arg3));
};
if (!_arg5){
return (((_arg3 * _arg1) + _arg2));
};
if (_arg5 > 1){
_arg5 = 1;
} else {
if (_arg5 < -1){
_arg5 = -1;
};
};
if (_arg5 < 0){
return ((((_arg3 * _arg1) * ((_arg1 * -(_arg5)) + (1 + _arg5))) + _arg2));
};
return ((((_arg3 * _arg1) * (((2 - _arg1) * _arg5) + (1 - _arg5))) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg4 <= 0){
return (NaN);
};
if (_arg1 <= 0){
return (_arg2);
};
if (_arg1 >= _arg4){
return ((_arg2 + _arg3));
};
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.motion
Section 28
//Source (fl.motion.Source)
package fl.motion {
import flash.geom.*;
public class Source {
public var instanceName:String;// = ""
public var symbolName:String;// = ""
public var dimensions:Rectangle;
public var scaleX:Number;// = 1
public var skewY:Number;// = 0
public var skewX:Number;// = 0
public var scaleY:Number;// = 1
public var elementType:String;// = ""
public var transformationPoint:Point;
public var linkageID:String;// = ""
public var frameRate:Number;// = NAN
public var x:Number;// = 0
public var y:Number;// = 0
public var rotation:Number;// = 0
public function Source(_arg1:XML=null){
frameRate = NaN;
elementType = "";
symbolName = "";
instanceName = "";
linkageID = "";
x = 0;
y = 0;
scaleX = 1;
scaleY = 1;
skewX = 0;
skewY = 0;
rotation = 0;
super();
this.parseXML(_arg1);
}
private function parseXML(_arg1:XML=null):Source{
var _local2:XMLList;
var _local3:XML;
var _local4:XML;
var _local5:XML;
if (!_arg1){
return (this);
};
if (_arg1.@instanceName){
this.instanceName = String(_arg1.@instanceName);
};
if (_arg1.@symbolName){
this.symbolName = String(_arg1.@symbolName);
};
if (_arg1.@linkageID){
this.linkageID = String(_arg1.@linkageID);
};
if (!isNaN(_arg1.@frameRate)){
this.frameRate = Number(_arg1.@frameRate);
};
_local2 = _arg1.elements();
for each (_local3 in _local2) {
if (_local3.localName() == "transformationPoint"){
_local4 = _local3.children()[0];
this.transformationPoint = new Point(Number(_local4.@x), Number(_local4.@y));
} else {
if (_local3.localName() == "dimensions"){
_local5 = _local3.children()[0];
this.dimensions = new Rectangle(Number(_local5.@left), Number(_local5.@top), Number(_local5.@width), Number(_local5.@height));
};
};
};
return (this);
}
}
}//package fl.motion
Section 29
//Tweenables (fl.motion.Tweenables)
package fl.motion {
public class Tweenables {
public static const SCALE_X:String = "scaleX";
public static const SCALE_Y:String = "scaleY";
public static const SKEW_X:String = "skewX";
public static const SKEW_Y:String = "skewY";
public static const X:String = "x";
public static const Y:String = "y";
public static const ROTATION:String = "rotation";
}
}//package fl.motion
Section 30
//bb_bubblebox_intro_2 (xhoc4_fla.bb_bubblebox_intro_2)
package xhoc4_fla {
import flash.display.*;
public dynamic class bb_bubblebox_intro_2 extends MovieClip {
public var logo_ro:MovieClip;
public var play_latest_text:MovieClip;
}
}//package xhoc4_fla
Section 31
//bb_bubblebox_logo_ro_5 (xhoc4_fla.bb_bubblebox_logo_ro_5)
package xhoc4_fla {
import flash.display.*;
public dynamic class bb_bubblebox_logo_ro_5 extends MovieClip {
public function bb_bubblebox_logo_ro_5(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package xhoc4_fla
Section 32
//bb_bubblxbox_play_latest_text_3 (xhoc4_fla.bb_bubblxbox_play_latest_text_3)
package xhoc4_fla {
import flash.display.*;
public dynamic class bb_bubblxbox_play_latest_text_3 extends MovieClip {
public function bb_bubblxbox_play_latest_text_3(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package xhoc4_fla
Section 33
//help_mc_48 (xhoc4_fla.help_mc_48)
package xhoc4_fla {
import flash.display.*;
public dynamic class help_mc_48 extends MovieClip {
public var back:SimpleButton;
}
}//package xhoc4_fla
Section 34
//MainTimeline (xhoc4_fla.MainTimeline)
package xhoc4_fla {
import flash.display.*;
import flash.filters.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import com.bubblebox.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var tolerance:Number;
public var cpuposessioncounter:uint;
public var tempnumber:Number;
public var territory:Number;
public var cpufocus:uint;
public var myPreloader:MovieClip;
public var half:String;
public var diagonalplayerbotspeed:Number;
public var bb:URLLoader;
public var cpuname:Array;
public var playerscore:uint;
public var newtime:Number;
public var crowdsound:crowd_sound;
public var upkeydown:uint;
public var cpubotspeed:Number;
public var finished:Boolean;
public var dt:Number;
public var countdowninitialmax:Number;
public var downkeydown:uint;
public var passwordarray:Array;
public var cleaned:Boolean;
public var territorycounter:uint;
public var musicchannel1:SoundChannel;
public var playergoaliespeed:Number;
public var playerbotspeed:Number;
public var cpugoal:Boolean;
public var musicchannel2:SoundChannel;
public var maxballspeed:Number;
public var reboundsound:rebound_sound;
public var camxspeedy:Number;
public var gettingready:Boolean;
public var camxspeedx:Number;
public var fps:Number;
public var whistlesoundlong:whistle_sound_long;
public var submitsuccess:Boolean;
public var whistlesound:whistle_sound;
public var cpubotshadow:Array;
public var channel:SoundChannel;
public var countdownstarted:Boolean;
public var diagonalcpubotspeed:Number;
public var countdownnewmax:Number;
public var gui:MovieClip;
public var gotomenu:Boolean;
public var mousekeydownlocked:Boolean;
public var menu:menu_mc;
public var gameactive:Boolean;
public var playergoal:Boolean;
public var dtcumulative:Number;
public var leftkeydown:uint;
public var rating:Number;
public var redexplosion:Array;
public var botshadow:MovieClip;
public var lockmousekey:Boolean;
public var bot:MovieClip;
public var goalsound:goal_sound;
public var ot:Number;
public var cpuscore:uint;
public var rightkeydown:uint;
public var counter:uint;
public var ball:MovieClip;
public var ballfriction:Number;
public var tacklesound:tackle_sound;
public var gameended:Boolean;
public var fixture:fixture_mc;
public var loop1:loop1_sound;
public var loop2:loop2_sound;
public var restart:Boolean;
public var camsmoothness:Number;
public var lights:MovieClip;
public var passingaccuracy:Number;
public var starttime:Number;
public var countdown:Number;
public var elapsedtime:Number;
public var debug:debug_mc;
public var teamname:String;
public var gameoverbanner:MovieClip;
public var numberofbots:uint;
public var camy:Number;
public var camx:Number;
public var cputacklespeed:Number;
public var movetocamx:Number;
public var movetocamy:Number;
public var playerfocus:uint;
public var theta:Number;
public var tile:Array;
public var dtscale:Number;
public var musicon:Boolean;
public var scatter:Boolean;
public var alphavalue:Number;
public var playertackleprobability:Number;
public var soundtheta:Number;
public var playerbotdirection:int;
public var cputackleprobability:Number;
public var scalefactor:Number;
public var countdownstarttime:Number;
public var cpubot:Array;
public var soundon:Boolean;
public var mousekeydown:uint;
public var cpubotdirection:int;
public var playerposessioncounter:uint;
public var playerbot:Array;
public var skipmenu:Boolean;
public var dtcounter:uint;
public var level:uint;
public var cpugoaliespeed:Number;
public var passsound:pass_sound;
public var reloading:uint;
public var securitypassed:Boolean;
public var posession:Number;
public var playertacklespeed:Number;
public var gameover:Boolean;
public var mochiadmask:MovieClip;
public var cpufire:Boolean;
public var playerbotshadow:Array;
public var setupgame:Boolean;
public var framecounter:uint;
public var blueexplosion:Array;
public var stadium:MovieClip;
public var black:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 3, frame4);
}
public function loader(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = Math.round(((_local3 * 100) / _local2));
myPreloader.bar.width = (4 * _local4);
myPreloader.loadingtext.text = (("Loading: " + String(_local4)) + "%");
if ((((_local3 >= _local2)) && ((finished == false)))){
setTimeout(end_preload, 2000);
finished = true;
};
if (alphavalue < 1){
alphavalue = (alphavalue + 0.05);
myPreloader.alpha = alphavalue;
} else {
if (myPreloader.bb_movie.play_latest_text.visible == false){
myPreloader.bb_movie.play_latest_text.visible = true;
myPreloader.bb_movie.play_latest_text.play();
};
};
}
public function restart_game():void{
var _local1:uint;
var _local2:*;
_local1 = 0;
_local2 = 1;
while (_local2 <= numberofbots) {
if (playerbot[_local2].ready == true){
_local1++;
};
if (cpubot[_local2].ready == true){
_local1++;
};
_local2++;
};
if ((((((_local1 >= (numberofbots * 2))) && ((gettingready == false)))) && ((gameended == false)))){
gettingready = true;
setTimeout(get_ready, 3000);
setTimeout(blow_whistle, 2500);
};
}
public function find_distancex(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = (_arg2.x - _arg1.x);
return (_local4);
}
public function find_distancey(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = (_arg2.y - _arg1.y);
return (_local4);
}
public function gotohighscore(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com/highscores/931.htm";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function mouse_over(_arg1:MouseEvent):void{
myPreloader.bb_movie.logo_ro.gotoAndStop(2);
}
public function move_cpu():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local1 = 0;
_local2 = 0;
if (cpubotdirection == 1){
if (ball.zoneletter == "a"){
ball.zone = "leftback";
};
if (ball.zoneletter == "b"){
ball.zone = "rightback";
};
if (ball.zoneletter == "c"){
ball.zone = "leftmid";
};
if (ball.zoneletter == "d"){
ball.zone = "rightmid";
};
if (ball.zoneletter == "e"){
ball.zone = "leftwing";
};
if (ball.zoneletter == "f"){
ball.zone = "rightwing";
};
if (ball.zoneletter == "g"){
ball.zone = "goalmouth";
};
if (ball.zoneletter == "h"){
ball.zone = "leftwing";
};
} else {
if (ball.zoneletter == "e"){
ball.zone = "leftback";
};
if (ball.zoneletter == "f"){
ball.zone = "rightback";
};
if (ball.zoneletter == "c"){
ball.zone = "leftmid";
};
if (ball.zoneletter == "d"){
ball.zone = "rightmid";
};
if (ball.zoneletter == "a"){
ball.zone = "leftwing";
};
if (ball.zoneletter == "b"){
ball.zone = "rightwing";
};
if (ball.zoneletter == "h"){
ball.zone = "goalmouth";
};
if (ball.zoneletter == "g"){
ball.zone = "leftwing";
};
};
if (ball.posession == "cpu"){
if ((((ball.zone == "leftwing")) || ((ball.zone == "rightwing")))){
cpubot[1].target = "start";
cpubot[2].target = "startforward";
cpubot[3].target = "startforward";
cpubot[4].target = "startforward";
cpubot[5].target = "startforward";
cpubot[6].target = "supportforward";
cpubot[7].target = "supportforward";
cpubot[8].target = "supportforward";
};
if ((((ball.zone == "leftmid")) || ((ball.zone == "rightmid")))){
cpubot[1].target = "start";
cpubot[2].target = "startforward";
cpubot[3].target = "startforward";
cpubot[4].target = "support";
cpubot[5].target = "support";
cpubot[6].target = "startforward";
cpubot[7].target = "startforward";
cpubot[8].target = "startforward";
};
if ((((((ball.zone == "leftback")) || ((ball.zone == "rightback")))) || ((ball.zone == "goalmouth")))){
cpubot[1].target = "start";
cpubot[2].target = "support";
cpubot[3].target = "support";
cpubot[4].target = "startforward";
cpubot[5].target = "startforward";
cpubot[6].target = "startforward";
cpubot[7].target = "startforward";
cpubot[8].target = "startforward";
};
if ((((((ball.zone == "leftback")) || ((ball.zone == "rightback")))) || ((ball.zone == "goalmouth")))){
_local4 = find_supporter_ahead();
if ((((_local4 > 0)) && ((Math.random() > 0.9)))){
cpubot[cpufocus].target = "passtoclosestmid";
} else {
cpubot[cpufocus].target = "run";
};
};
if ((((ball.zone == "leftmid")) || ((ball.zone == "rightmid")))){
_local5 = find_supporter_ahead();
if ((((_local5 > 0)) && ((Math.random() > 0.9)))){
cpubot[cpufocus].target = "passtoclosestforward";
} else {
cpubot[cpufocus].target = "run";
};
};
if ((((ball.zone == "leftwing")) || ((ball.zone == "rightwing")))){
_local6 = find_supporter_ahead();
if (_local6 > 0){
cpubot[cpufocus].target = "passtosupportahead";
} else {
if (cpubotdirection == -1){
if (ball.virtualy < (70 * scalefactor)){
cpubot[cpufocus].target = "run";
} else {
cpubot[cpufocus].target = "shoot";
};
} else {
if (ball.virtualy > (70 * scalefactor)){
cpubot[cpufocus].target = "run";
} else {
cpubot[cpufocus].target = "shoot";
};
};
};
};
};
if (ball.posession == "player"){
if (ball.zone == "leftwing"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "startforward";
cpubot[5].target = "start";
cpubot[6].target = "ball";
cpubot[7].target = "ball";
cpubot[8].target = "start";
};
if (ball.zone == "rightwing"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "start";
cpubot[5].target = "startforward";
cpubot[6].target = "ball";
cpubot[7].target = "ball";
cpubot[8].target = "start";
};
if (ball.zone == "leftmid"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "ball";
cpubot[5].target = "supportback";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "rightmid"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "supportback";
cpubot[5].target = "ball";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "leftback"){
cpubot[1].target = "track";
cpubot[2].target = "ball";
cpubot[3].target = "supportback";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "rightback"){
cpubot[1].target = "track";
cpubot[2].target = "supportback";
cpubot[3].target = "ball";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "goalmouth"){
cpubot[1].target = "ball";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
};
if (ball.posession == "free"){
if (ball.zone == "leftwing"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "startforward";
cpubot[5].target = "startforward";
cpubot[6].target = "ball";
cpubot[7].target = "ball";
cpubot[8].target = "startforward";
};
if (ball.zone == "rightwing"){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "startforward";
cpubot[5].target = "startforward";
cpubot[6].target = "startforward";
cpubot[7].target = "ball";
cpubot[8].target = "ball";
};
if (ball.zone == "leftmid"){
cpubot[1].target = "start";
cpubot[2].target = "startforward";
cpubot[3].target = "startforward";
cpubot[4].target = "ball";
cpubot[5].target = "support";
cpubot[6].target = "startforward";
cpubot[7].target = "ball";
cpubot[8].target = "startforward";
};
if (ball.zone == "rightmid"){
cpubot[1].target = "start";
cpubot[2].target = "startforward";
cpubot[3].target = "startforward";
cpubot[4].target = "support";
cpubot[5].target = "ball";
cpubot[6].target = "startforward";
cpubot[7].target = "ball";
cpubot[8].target = "startforward";
};
if (ball.zone == "leftback"){
cpubot[1].target = "track";
cpubot[2].target = "ball";
cpubot[3].target = "start";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "rightback"){
cpubot[1].target = "track";
cpubot[2].target = "start";
cpubot[3].target = "ball";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
if (ball.zone == "goalmouth"){
cpubot[1].target = "ball";
cpubot[2].target = "ball";
cpubot[3].target = "ball";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
};
if (restart == true){
cpubot[1].target = "start";
cpubot[2].target = "start";
cpubot[3].target = "start";
cpubot[4].target = "start";
cpubot[5].target = "start";
cpubot[6].target = "start";
cpubot[7].target = "start";
cpubot[8].target = "start";
};
_local3 = 1;
while (_local3 <= numberofbots) {
if (cpubot[_local3].inactive == true){
cpubot[_local3].target = "remain";
};
cpubot[_local3].left = 0;
cpubot[_local3].right = 0;
cpubot[_local3].up = 0;
cpubot[_local3].down = 0;
cpubot[_local3].targetreachedx = false;
cpubot[_local3].targetreachedy = false;
if (cpubot[_local3].target == "start"){
_local1 = cpubot[_local3].startx;
_local2 = cpubot[_local3].starty;
};
if (cpubot[_local3].target == "ball"){
_local1 = ball.virtualx;
_local2 = ball.virtualy;
if ((((find_distance(cpubot[_local3], ball) < (5 * scalefactor))) && ((ball.posession == "player")))){
cpubot[_local3].tackle = true;
};
if ((((find_distance(cpubot[_local3], ball) < (5 * scalefactor))) && ((ball.posession == "free")))){
if ((((Math.random() < 0.1)) || ((_local3 == 1)))){
cpubot[_local3].tackle = true;
};
};
};
if (cpubot[_local3].target == "support"){
_local1 = cpubot[_local3].startx;
_local2 = cpubot[cpufocus].virtualy;
};
if (cpubot[_local3].target == "track"){
if ((((ball.virtualx > (-25 * scalefactor))) && ((ball.virtualx < (25 * scalefactor))))){
_local1 = ball.virtualx;
} else {
if (ball.virtualx < (-25 * scalefactor)){
_local1 = (-25 * scalefactor);
};
if (ball.virtualx > (25 * scalefactor)){
_local1 = (25 * scalefactor);
};
};
_local2 = cpubot[_local3].starty;
};
if (cpubot[_local3].target == "startforward"){
_local1 = cpubot[_local3].startx;
_local2 = (cpubot[_local3].starty - ((cpubotdirection * 30) * scalefactor));
};
if (cpubot[_local3].target == "supportforward"){
_local1 = cpubot[_local3].startx;
_local2 = (cpubot[cpufocus].virtualy - ((cpubotdirection * 20) * scalefactor));
if (cpubotdirection == -1){
if (_local2 < (playerbot[1].virtualy - (10 * scalefactor))){
_local2 = (playerbot[1].virtualy - (10 * scalefactor));
};
} else {
if (_local2 > (playerbot[1].virtualy + (10 * scalefactor))){
_local2 = (playerbot[1].virtualy + (10 * scalefactor));
};
};
};
if (cpubot[_local3].target == "supportback"){
_local1 = cpubot[_local3].startx;
_local2 = (cpubot[cpufocus].virtualy + ((cpubotdirection * 20) * scalefactor));
};
if (_local3 == cpufocus){
if (cpubot[cpufocus].target == "passtoclosestforward"){
cpubot[cpufocus].tempbearing = get_bearing(cpubot[cpufocus], cpubot[_local5]);
if (Math.abs((cpubot[cpufocus].tempbearing - (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45))) < passingaccuracy){
cpubot[cpufocus].rotation = (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45);
cpubotshadow[cpufocus].rotation = cpubot[cpufocus].rotation;
cpubot[cpufocus].target = "remain";
cpufire = true;
} else {
cpubot[cpufocus].target = "run";
};
};
if (cpubot[cpufocus].target == "passtoclosestmid"){
cpubot[cpufocus].tempbearing = get_bearing(cpubot[cpufocus], cpubot[_local4]);
if (Math.abs((cpubot[cpufocus].tempbearing - (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45))) < passingaccuracy){
cpubot[cpufocus].rotation = (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45);
cpubotshadow[cpufocus].rotation = cpubot[cpufocus].rotation;
cpubot[cpufocus].target = "remain";
cpufire = true;
} else {
if (Math.random() < 0.2){
cpubot[cpufocus].target = "run";
} else {
cpubot[cpufocus].target = "shoot";
};
};
};
if (cpubot[cpufocus].target == "passtosupportahead"){
cpubot[cpufocus].tempbearing = get_bearing(cpubot[cpufocus], cpubot[_local6]);
if (Math.abs((cpubot[cpufocus].tempbearing - (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45))) < passingaccuracy){
cpubot[cpufocus].rotation = (Math.round((cpubot[cpufocus].tempbearing / 45)) * 45);
cpubotshadow[cpufocus].rotation = cpubot[cpufocus].rotation;
cpubot[cpufocus].target = "remain";
cpufire = true;
} else {
if (cpubotdirection == -1){
if (ball.virtualy < (70 * scalefactor)){
cpubot[cpufocus].target = "run";
} else {
cpubot[cpufocus].target = "shoot";
};
} else {
if (ball.virtualy > (70 * scalefactor)){
cpubot[cpufocus].target = "run";
} else {
cpubot[cpufocus].target = "shoot";
};
};
};
};
if (cpubot[cpufocus].target == "run"){
_local1 = 0;
_local2 = ((-(cpubotdirection) * 100) * scalefactor);
};
if (cpubot[cpufocus].target == "shoot"){
if (cpubotdirection == -1){
if ((((cpubot[cpufocus].virtualx > (-25 * scalefactor))) && ((cpubot[cpufocus].virtualx < (25 * scalefactor))))){
cpubot[cpufocus].rotation = 180;
cpubotshadow[cpufocus].rotation = 180;
};
if (cpubot[cpufocus].virtualx <= (-25 * scalefactor)){
cpubot[cpufocus].rotation = 135;
cpubotshadow[cpufocus].rotation = 135;
};
if (cpubot[cpufocus].virtualx >= (25 * scalefactor)){
cpubot[cpufocus].rotation = 225;
cpubotshadow[cpufocus].rotation = 225;
};
} else {
if ((((cpubot[cpufocus].virtualx > (-25 * scalefactor))) && ((cpubot[cpufocus].virtualx < (25 * scalefactor))))){
cpubot[cpufocus].rotation = 0;
cpubotshadow[cpufocus].rotation = 0;
};
if (cpubot[cpufocus].virtualx <= (-25 * scalefactor)){
cpubot[cpufocus].rotation = 45;
cpubotshadow[cpufocus].rotation = 45;
};
if (cpubot[cpufocus].virtualx >= (25 * scalefactor)){
cpubot[cpufocus].rotation = -45;
cpubotshadow[cpufocus].rotation = -45;
};
};
cpubot[cpufocus].target = "remain";
cpufire = true;
};
};
tolerance = ((0.5 * cpubot[_local3].speed) * dt);
if ((((cpubot[_local3].virtualx > (_local1 - tolerance))) && ((cpubot[_local3].virtualx < (_local1 + tolerance))))){
cpubot[_local3].targetreachedx = true;
};
if ((((cpubot[_local3].virtualy > (_local2 - tolerance))) && ((cpubot[_local3].virtualy < (_local2 + tolerance))))){
cpubot[_local3].targetreachedy = true;
};
if ((((cpubot[_local3].targetreachedx == true)) && ((cpubot[_local3].targetreachedy == true)))){
cpubot[_local3].target = "remain";
if (restart == 1){
if (cpubotdirection == -1){
cpubot[_local3].rotation = 180;
cpubotshadow[_local3].rotation = 180;
} else {
cpubot[_local3].rotation = 0;
cpubotshadow[_local3].rotation = 0;
};
cpubot[_local3].ready = true;
};
};
if (cpubot[1].target == "remain"){
if (cpubotdirection == -1){
cpubot[1].rotation = 180;
cpubotshadow[1].rotation = 180;
} else {
cpubot[1].rotation = 0;
cpubotshadow[1].rotation = 0;
};
};
if (cpubot[_local3].target != "remain"){
if ((((cpubot[_local3].virtualx < _local1)) && ((cpubot[_local3].targetreachedx == false)))){
cpubot[_local3].right = 1;
};
if ((((cpubot[_local3].virtualx > _local1)) && ((cpubot[_local3].targetreachedx == false)))){
cpubot[_local3].left = 1;
};
if ((((cpubot[_local3].virtualy > _local2)) && ((cpubot[_local3].targetreachedy == false)))){
cpubot[_local3].up = 1;
};
if ((((cpubot[_local3].virtualy < _local2)) && ((cpubot[_local3].targetreachedy == false)))){
cpubot[_local3].down = 1;
};
if (cpubot[_local3].speed == diagonalcpubotspeed){
cpubot[_local3].speed = cpubotspeed;
};
cpubot[1].speed = cpugoaliespeed;
if (cpubot[_local3].speed == cpubotspeed){
if ((((cpubot[_local3].up + cpubot[_local3].down) + cpubot[_local3].left) + cpubot[_local3].right) >= 2){
cpubot[_local3].speed = diagonalcpubotspeed;
};
};
if (cpubot[_local3].up == 1){
cpubot[_local3].virtualy = (cpubot[_local3].virtualy - (cpubot[_local3].speed * dt));
};
if (cpubot[_local3].down == 1){
cpubot[_local3].virtualy = (cpubot[_local3].virtualy + (cpubot[_local3].speed * dt));
};
if (cpubot[_local3].left == 1){
cpubot[_local3].virtualx = (cpubot[_local3].virtualx - (cpubot[_local3].speed * dt));
};
if (cpubot[_local3].right == 1){
cpubot[_local3].virtualx = (cpubot[_local3].virtualx + (cpubot[_local3].speed * dt));
};
if (cpubot[_local3].virtualx > (50 * scalefactor)){
cpubot[_local3].virtualx = (50 * scalefactor);
};
if (cpubot[_local3].virtualx < (-(50) * scalefactor)){
cpubot[_local3].virtualx = (-(50) * scalefactor);
};
if (cpubot[_local3].virtualy > (100 * scalefactor)){
cpubot[_local3].virtualy = (100 * scalefactor);
};
if (cpubot[_local3].virtualy < (-(100) * scalefactor)){
cpubot[_local3].virtualy = (-(100) * scalefactor);
};
if ((((((((cpubot[_local3].up == 0)) && ((cpubot[_local3].down == 0)))) && ((cpubot[_local3].left == 0)))) && ((cpubot[_local3].right == 0)))){
} else {
cpubot[_local3].rotation = Math.round((90 + ((180 / Math.PI) * Math.atan2((cpubot[_local3].down - cpubot[_local3].up), (cpubot[_local3].right - cpubot[_local3].left)))));
cpubotshadow[_local3].rotation = cpubot[_local3].rotation;
};
};
_local3++;
};
if (ball.posession == "cpu"){
camx = cpubot[cpufocus].virtualx;
camy = cpubot[cpufocus].virtualy;
};
}
public function timing():void{
var _local1:Date;
var _local2:*;
var _local3:Number;
_local1 = new Date();
_local2 = _local1.getTime();
_local3 = ((_local2 - ot) / 1000);
dtcumulative = (dtcumulative + _local3);
dtcounter++;
if (dtcounter == 5){
dtcounter = 0;
dt = (dtcumulative / 5);
dtcumulative = 0;
};
if ((((dt < 0.01)) || ((dt > 0.2)))){
dt = 0.033;
};
ot = _local2;
}
public function BubbleBoxCompleteHandler(_arg1:Event):void{
submitsuccess = true;
gameoverbanner.popup.popuptext.text = "Score submitted!";
bb.removeEventListener(Event.COMPLETE, BubbleBoxCompleteHandler);
}
public function finish_game():void{
var _local1:gameoverbanner_mc;
var _local2:String;
var _local3:Number;
if (soundon == true){
whistlesoundlong.play();
};
Mouse.show();
_local1 = new gameoverbanner_mc();
gameoverbanner = _local1;
stage.addChild(gameoverbanner);
gameoverbanner.popup.visible = false;
gameoverbanner.continuebutton.addEventListener(MouseEvent.MOUSE_DOWN, to_nextlevel);
gameoverbanner.x = ((stage.stageWidth / 2) - (gameoverbanner.width / 2));
gameoverbanner.y = ((stage.stageHeight / 2) - (gameoverbanner.height / 2));
restart = true;
ball.posession = "free";
ball.ballspeed = 0;
ball.virtualx = 0;
ball.virtualy = 0;
countdownstarted = false;
gameended = true;
gameoverbanner.finalscore.text = ((((((teamname + " ") + String(playerscore)) + " : ") + String(cpuscore)) + " ") + cpuname[level]);
territory = Math.round(((100 * territorycounter) / framecounter));
posession = Math.round(((100 * playerposessioncounter) / (playerposessioncounter + cpuposessioncounter)));
gameoverbanner.message3.text = (("player posession: " + posession) + "%");
gameoverbanner.message4.text = (("time in opponents half: " + territory) + "%");
gameoverbanner.message5.text = ("difficulty: level " + level);
_local3 = (playerscore - cpuscore);
rating = Math.round(((1000 * (level * level)) * ((_local3 + (posession / 100)) + (territory / 100))));
if (rating <= 0){
rating = 0;
};
gameoverbanner.message6.text = rating;
gameoverbanner.nametosubmit.text = teamname;
gameoverbanner.submitbutton.addEventListener(MouseEvent.MOUSE_DOWN, submit_highscore);
if (playerscore > cpuscore){
level++;
if (level <= 6){
gameoverbanner.message1.text = (("round " + level) + " password:");
gameoverbanner.message2.text = passwordarray[level];
} else {
gameoverbanner.message1.text = "congratulations";
gameoverbanner.message2.text = (teamname + " are the x-hoc champions");
level = 1;
};
} else {
gameoverbanner.message1.text = "GAME OVER";
gameoverbanner.message2.text = "try harder";
};
}
public function clean_up():void{
var _local1:*;
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mousekey_down);
stage.removeEventListener(MouseEvent.MOUSE_UP, mousekey_up);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyup);
Mouse.show();
channel.stop();
stage.removeChild(gui);
stage.removeChild(ball);
_local1 = 1;
while (_local1 <= numberofbots) {
stage.removeChild(playerbot[_local1]);
stage.removeChild(playerbotshadow[_local1]);
stage.removeChild(cpubot[_local1]);
stage.removeChild(cpubotshadow[_local1]);
_local1++;
};
stage.removeChild(stadium);
stage.removeChild(lights);
camx = 0;
camy = 0;
movetocamx = 0;
movetocamy = 0;
leftkeydown = 0;
rightkeydown = 0;
upkeydown = 0;
downkeydown = 0;
mousekeydown = 0;
cpufire = false;
lockmousekey = false;
restart = true;
cpuscore = 0;
playerscore = 0;
playerbotdirection = 1;
cpubotdirection = -1;
half = "1st Half";
countdownnewmax = countdowninitialmax;
countdown = countdowninitialmax;
gameended = false;
reloading = 0;
playergoal = false;
cpugoal = false;
gettingready = false;
scatter = false;
countdownstarted = false;
stop_music();
}
public function toggle_sound(_arg1:MouseEvent):void{
if (soundon == true){
soundon = false;
menu.soundbox.alpha = 0;
} else {
soundon = true;
menu.soundbox.alpha = 1;
};
}
function frame4(){
stage.stageWidth = 550;
stage.stageHeight = 550;
StageScaleMode.EXACT_FIT;
scalefactor = 5.12;
dt = 0;
ot = 0;
dtcumulative = 0;
dtcounter = 0;
dtscale = (1 / 0.033);
camx = 0;
camy = 0;
playerbotspeed = 0;
playergoaliespeed = 0;
cpubotspeed = 0;
cpugoaliespeed = 0;
playertacklespeed = 0;
cputacklespeed = 0;
diagonalplayerbotspeed = 0;
diagonalcpubotspeed = 0;
playertackleprobability = 0;
cputackleprobability = 0;
passingaccuracy = 0;
maxballspeed = 0;
ballfriction = (4 * dtscale);
numberofbots = 8;
playerfocus = 1;
cpufocus = 1;
tempnumber = 0;
tolerance = 0;
playerscore = 0;
cpuscore = 0;
fps = 0;
starttime = 0;
newtime = 0;
elapsedtime = 0;
counter = 0;
theta = 0;
playerbotdirection = 1;
cpubotdirection = -1;
countdowninitialmax = 90;
countdownnewmax = countdowninitialmax;
countdownstarttime = 0;
countdown = countdowninitialmax;
half = "1st Half";
camxspeedx = 0;
movetocamx = 0;
camxspeedy = 0;
movetocamy = 0;
camsmoothness = (10 / dtscale);
soundtheta = 0;
teamname = "PLAYER 1";
level = 1;
rating = 0;
posession = 0;
territory = 0;
framecounter = 0;
playerposessioncounter = 0;
cpuposessioncounter = 0;
territorycounter = 0;
securitypassed = true;
setupgame = false;
gameactive = false;
gotomenu = true;
gameover = false;
cleaned = false;
cpufire = false;
lockmousekey = false;
playergoal = false;
cpugoal = false;
restart = true;
gettingready = false;
scatter = false;
countdownstarted = false;
gameended = false;
soundon = true;
musicon = true;
skipmenu = false;
mousekeydownlocked = false;
submitsuccess = false;
tile = new Array();
playerbot = new Array();
cpubot = new Array();
playerbotshadow = new Array();
cpubotshadow = new Array();
redexplosion = new Array();
blueexplosion = new Array();
passwordarray = new Array();
passwordarray[1] = "alpha";
passwordarray[2] = "misco";
passwordarray[3] = "naro";
passwordarray[4] = "albis";
passwordarray[5] = "sala";
passwordarray[6] = "tisia";
cpuname = new Array();
cpuname[1] = "orion";
cpuname[2] = "novatron";
cpuname[3] = "orbik";
cpuname[4] = "xenon";
cpuname[5] = "vezor";
cpuname[6] = "deltus";
channel = new SoundChannel();
crowdsound = new crowd_sound();
musicchannel1 = new SoundChannel();
loop1 = new loop1_sound();
musicchannel2 = new SoundChannel();
loop2 = new loop2_sound();
goalsound = new goal_sound();
passsound = new pass_sound();
tacklesound = new tackle_sound();
reboundsound = new rebound_sound();
whistlesound = new whistle_sound();
whistlesoundlong = new whistle_sound_long();
debug = new debug_mc();
initialise_main_loop();
}
public function show_submit_result():void{
gameoverbanner.popup.visible = true;
gameoverbanner.popup.retry.visible = false;
gameoverbanner.popup.highscore.addEventListener(MouseEvent.MOUSE_DOWN, gotohighscore);
gameoverbanner.popup.menu.addEventListener(MouseEvent.MOUSE_DOWN, backtomenu);
}
function frame1(){
stop();
finished = false;
alphavalue = 0;
myPreloader.alpha = alphavalue;
myPreloader.bb_movie.play_latest_text.visible = false;
myPreloader.link.addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
myPreloader.link.addEventListener(MouseEvent.MOUSE_DOWN, follow_link);
myPreloader.link.addEventListener(MouseEvent.MOUSE_OUT, mouse_out);
addEventListener(Event.ENTER_FRAME, loader);
try {
MochiBot.track(this, "7c2a170f");
} catch(error:IllegalOperationError) {
};
}
public function setup_game():void{
var _local1:Date;
var _local2:SoundTransform;
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousekey_down);
stage.addEventListener(MouseEvent.MOUSE_UP, mousekey_up);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyup);
make_arena();
update_skill_levels();
make_playerbots();
make_cpubots();
make_ball();
make_gui();
gui.playerscoredisplay.text = playerscore;
gui.cpuscoredisplay.text = cpuscore;
gui.playernamedisplay.text = teamname;
gui.cpunamedisplay.text = cpuname[level];
_local1 = new Date();
starttime = _local1.getTime();
ot = 0;
dtcumulative = 0;
dtcounter = 0;
restart = true;
countdownstarted = false;
countdownnewmax = countdowninitialmax;
countdownstarttime = countdowninitialmax;
countdown = countdowninitialmax;
if (soundon == true){
channel = crowdsound.play(0, 100);
};
_local2 = new SoundTransform(0);
channel.soundTransform = _local2;
stop_music();
if (musicon == true){
musicchannel2 = loop2.play(0, 100);
};
framecounter = 0;
playerposessioncounter = 0;
cpuposessioncounter = 0;
territorycounter = 0;
}
function frame3(){
gotoAndStop(4);
}
public function reset_cpuspeed(_arg1):void{
cpubot[_arg1].speed = cpubotspeed;
cpubot[_arg1].gotoAndStop(1);
}
public function mouse_out(_arg1:MouseEvent):void{
myPreloader.bb_movie.logo_ro.gotoAndStop(1);
}
public function update_gui():void{
if (gameended == false){
gui.clock.text = countdown;
};
}
public function make_playerbots():void{
var _local1:*;
var _local2:shadow_mc;
var _local3:playerbot_mc;
_local1 = 1;
while (_local1 <= numberofbots) {
_local2 = new shadow_mc();
playerbotshadow[_local1] = _local2;
stage.addChild(playerbotshadow[_local1]);
_local3 = new playerbot_mc();
playerbot[_local1] = _local3;
stage.addChild(playerbot[_local1]);
playerbot[_local1].virtualx = (-55 * scalefactor);
playerbot[_local1].virtualy = ((playerbotdirection * 5) * scalefactor);
playerbotshadow[_local1].x = (playerbot[_local1].x + 5);
playerbotshadow[_local1].y = (playerbot[_local1].y + 5);
playerbot[_local1].speed = playerbotspeed;
playerbot[1].speed = playergoaliespeed;
playerbot[_local1].drop = false;
playerbot[_local1].highlight.visible = false;
playerbot[_local1].left = 0;
playerbot[_local1].right = 0;
playerbot[_local1].up = 0;
playerbot[_local1].down = 0;
playerbot[_local1].inactive = false;
playerbot[_local1].ready = false;
playerbot[_local1].scaleX = (playerbot[_local1].scaleX * 0.6);
playerbot[_local1].scaleY = (playerbot[_local1].scaleY * 0.6);
playerbotshadow[_local1].scaleX = (playerbotshadow[_local1].scaleX * 0.6);
playerbotshadow[_local1].scaleY = (playerbotshadow[_local1].scaleY * 0.6);
_local1++;
};
playerbot[1].startx = (0 * scalefactor);
playerbot[1].starty = ((playerbotdirection * 95) * scalefactor);
playerbot[2].startx = (-20 * scalefactor);
playerbot[2].starty = ((playerbotdirection * 75) * scalefactor);
playerbot[3].startx = (20 * scalefactor);
playerbot[3].starty = ((playerbotdirection * 75) * scalefactor);
playerbot[4].startx = (-25 * scalefactor);
playerbot[4].starty = ((playerbotdirection * 43) * scalefactor);
playerbot[5].startx = (25 * scalefactor);
playerbot[5].starty = ((playerbotdirection * 43) * scalefactor);
playerbot[6].startx = (-45 * scalefactor);
playerbot[6].starty = ((playerbotdirection * 5) * scalefactor);
playerbot[7].startx = (0 * scalefactor);
playerbot[7].starty = ((playerbotdirection * 15) * scalefactor);
playerbot[8].startx = (45 * scalefactor);
playerbot[8].starty = ((playerbotdirection * 5) * scalefactor);
}
public function show_help_screen(_arg1:MouseEvent):void{
menu.help.visible = true;
menu.help.back.addEventListener(MouseEvent.MOUSE_DOWN, hide_menu_screen);
}
public function update_teamname(_arg1:MouseEvent){
menu.teamnamedisplay.text = menu.teamnameinput.text;
teamname = menu.teamnamedisplay.text;
}
public function catch_ball():void{
var _local1:Number;
var _local2:*;
_local1 = 0;
if ((((ball.posession == "free")) && ((restart == false)))){
_local2 = 1;
while (_local2 <= numberofbots) {
if (_local2 == 1){
_local1 = 7;
if (_local1 < (((0.7 * maxballspeed) * dt) / scalefactor)){
_local1 = (((0.7 * maxballspeed) * dt) / scalefactor);
};
} else {
_local1 = 5;
if (_local1 < (((0.5 * maxballspeed) * dt) / scalefactor)){
_local1 = (((0.5 * maxballspeed) * dt) / scalefactor);
};
};
if ((((find_distance(playerbot[_local2], ball) < (_local1 * scalefactor))) && ((playerbot[_local2].drop == false)))){
ball.posession = "player";
playerfocus = _local2;
break;
};
if (_local2 == 1){
_local1 = 5;
if (_local1 < (((0.5 * maxballspeed) * dt) / scalefactor)){
_local1 = (((0.5 * maxballspeed) * dt) / scalefactor);
};
} else {
_local1 = 3;
if (_local1 < (((0.4 * maxballspeed) * dt) / scalefactor)){
_local1 = (((0.4 * maxballspeed) * dt) / scalefactor);
};
};
if ((((find_distance(cpubot[_local2], ball) < (_local1 * scalefactor))) && ((cpubot[_local2].drop == false)))){
ball.posession = "cpu";
cpufocus = _local2;
break;
};
_local2++;
};
};
}
public function keyup(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == 87)))){
upkeydown = 0;
};
if ((((_arg1.keyCode == Keyboard.DOWN)) || ((_arg1.keyCode == 83)))){
downkeydown = 0;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == 65)))){
leftkeydown = 0;
};
if ((((_arg1.keyCode == Keyboard.RIGHT)) || ((_arg1.keyCode == 68)))){
rightkeydown = 0;
};
if (_arg1.keyCode == Keyboard.SPACE){
mousekeydown = 0;
mousekeydownlocked = false;
};
}
public function back_to_menu(_arg1:MouseEvent):void{
fixture.start.removeEventListener(MouseEvent.MOUSE_DOWN, click_to_start);
fixture.menu.removeEventListener(MouseEvent.MOUSE_DOWN, click_to_start);
fixture.visible = false;
skipmenu = false;
initialise_menu();
}
public function main_loop():void{
if ((((setupgame == true)) && ((gameactive == false)))){
gameactive = true;
setupgame = false;
setup_game();
};
if (gameactive == true){
game_loop();
};
if ((((gameover == true)) && ((cleaned == false)))){
clean_up();
gameactive = false;
gotomenu = true;
gameover = false;
cleaned = true;
};
if (gotomenu == true){
initialise_menu();
};
}
public function toggle_music(_arg1:MouseEvent):void{
if (musicon == true){
musicon = false;
menu.musicbox.alpha = 0;
musicchannel1.stop();
} else {
musicon = true;
menu.musicbox.alpha = 1;
musicchannel1 = loop1.play(0, 100);
};
}
public function make_arena():void{
var _local1:stadium_mc;
var _local2:light_mc;
_local1 = new stadium_mc();
stadium = _local1;
stage.addChild(stadium);
stadium.virtualx = -512;
stadium.virtualy = -768;
_local2 = new light_mc();
lights = _local2;
stage.addChild(lights);
lights.x = (stage.stageWidth / 2);
lights.y = (stage.stageHeight / 2);
lights.alpha = 0.5;
}
public function goto_main_loop(_arg1:Event):void{
main_loop();
}
public function mousekey_up(_arg1:MouseEvent):void{
mousekeydown = 0;
mousekeydownlocked = false;
}
public function update_stats():void{
if ((((countdownstarted == true)) && ((countdown > 0)))){
framecounter++;
if (ball.posession == "player"){
playerposessioncounter++;
};
if (ball.posession == "cpu"){
cpuposessioncounter++;
};
if (playerbotdirection == 1){
if (ball.virtualy <= 0){
territorycounter++;
};
} else {
if (ball.virtualy >= 0){
territorycounter++;
};
};
};
}
public function move_ball():void{
if (ball.posession == "player"){
ball.virtualx = playerbot[playerfocus].virtualx;
ball.virtualy = playerbot[playerfocus].virtualy;
};
if (ball.posession == "cpu"){
ball.virtualx = cpubot[cpufocus].virtualx;
ball.virtualy = cpubot[cpufocus].virtualy;
};
if (ball.posession == "free"){
ball.ballspeed = (ball.ballspeed - (ballfriction * dt));
if (ball.ballspeed < 0){
ball.ballspeed = 0;
};
ball.virtualx = (ball.virtualx + ((ball.ballspeed * Math.cos(((ball.ballangle - 90) * (Math.PI / 180)))) * dt));
ball.virtualy = (ball.virtualy + ((ball.ballspeed * Math.sin(((ball.ballangle - 90) * (Math.PI / 180)))) * dt));
if (ball.virtualx < (-(50) * scalefactor)){
ball.ballangle = -(ball.ballangle);
ball.virtualx = (-50 * scalefactor);
if (soundon == true){
reboundsound.play();
};
};
if (ball.virtualx > (50 * scalefactor)){
ball.ballangle = -(ball.ballangle);
ball.virtualx = (50 * scalefactor);
if (soundon == true){
reboundsound.play();
};
};
if (ball.virtualy < (-(100) * scalefactor)){
if ((((ball.virtualx > -128)) && ((ball.virtualx < 128)))){
if (playerbotdirection == 1){
playergoal = true;
if (soundon == true){
goalsound.play();
};
} else {
cpugoal = true;
if (soundon == true){
goalsound.play();
};
};
} else {
ball.ballangle = (-(ball.ballangle) + 180);
ball.virtualy = (-100 * scalefactor);
if (soundon == true){
reboundsound.play();
};
};
};
if (ball.virtualy > (100 * scalefactor)){
if ((((ball.virtualx > -128)) && ((ball.virtualx < 128)))){
if (playerbotdirection == 1){
cpugoal = true;
if (soundon == true){
goalsound.play();
};
} else {
playergoal = true;
if (soundon == true){
goalsound.play();
};
};
} else {
ball.ballangle = (-(ball.ballangle) + 180);
ball.virtualy = (100 * scalefactor);
if (soundon == true){
reboundsound.play();
};
};
};
camx = ball.virtualx;
camy = ball.virtualy;
};
if ((((ball.virtualx <= (0 * scalefactor))) && ((ball.virtualy <= (-33 * scalefactor))))){
ball.zoneletter = "e";
};
if ((((ball.virtualx > (0 * scalefactor))) && ((ball.virtualy <= (-33 * scalefactor))))){
ball.zoneletter = "f";
};
if ((((((ball.virtualx <= (0 * scalefactor))) && ((ball.virtualy > (-33 * scalefactor))))) && ((ball.virtualy < (33 * scalefactor))))){
ball.zoneletter = "c";
};
if ((((((ball.virtualx > (0 * scalefactor))) && ((ball.virtualy > (-33 * scalefactor))))) && ((ball.virtualy < (33 * scalefactor))))){
ball.zoneletter = "d";
};
if ((((ball.virtualx <= (0 * scalefactor))) && ((ball.virtualy >= (33 * scalefactor))))){
ball.zoneletter = "a";
};
if ((((ball.virtualx > (0 * scalefactor))) && ((ball.virtualy >= (33 * scalefactor))))){
ball.zoneletter = "b";
};
if ((((((ball.virtualx > (-25 * scalefactor))) && ((ball.virtualx < (25 * scalefactor))))) && ((ball.virtualy > (80 * scalefactor))))){
ball.zoneletter = "g";
};
if ((((((ball.virtualx > (-25 * scalefactor))) && ((ball.virtualx < (25 * scalefactor))))) && ((ball.virtualy < (-80 * scalefactor))))){
ball.zoneletter = "h";
};
}
public function reset_cpudrop(_arg1):void{
cpubot[_arg1].drop = false;
}
public function make_ball():void{
var _local1:ball_mc;
_local1 = new ball_mc();
ball = _local1;
ball.scaleX = (ball.scaleX * 0.6);
ball.scaleY = (ball.scaleY * 0.6);
ball.virtualx = 0;
ball.virtualy = 0;
ball.ballspeed = 0;
ball.ballangle = 0;
ball.posession = "free";
stage.addChild(ball);
}
public function gotowebsite(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.andromedus.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function initialise_main_loop():void{
mochiadmask.visible = false;
this.addEventListener(Event.ENTER_FRAME, goto_main_loop);
}
public function initialise_menu(){
gotomenu = false;
stop_music();
if (musicon == true){
musicchannel1 = loop1.play(0, 100);
};
if (skipmenu == false){
menu.help.visible = false;
level = 1;
menu.visible = true;
menu.start.addEventListener(MouseEvent.MOUSE_DOWN, click_to_play);
menu.musicbox.addEventListener(MouseEvent.MOUSE_DOWN, toggle_music);
menu.soundbox.addEventListener(MouseEvent.MOUSE_DOWN, toggle_sound);
menu.teamnamesubmit.addEventListener(MouseEvent.MOUSE_DOWN, update_teamname);
menu.teamnamedisplay.text = teamname;
menu.link.addEventListener(MouseEvent.MOUSE_DOWN, gotowebsite);
menu.bb_link.addEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
menu.highscore_link.addEventListener(MouseEvent.MOUSE_DOWN, gotohighscore);
menu.moregames_link.addEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
menu.show_help.addEventListener(MouseEvent.MOUSE_DOWN, show_help_screen);
} else {
show_fixture();
};
}
public function find_supporter_ahead():uint{
var _local1:uint;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = 0;
_local2 = 1000;
_local3 = 0;
_local4 = 4;
while (_local4 <= 8) {
if (_local4 != cpufocus){
if (cpubotdirection == -1){
if (cpubot[_local4].virtualy > cpubot[cpufocus].virtualy){
_local3 = find_distance(cpubot[_local4], cpubot[cpufocus]);
if (_local3 < _local2){
_local2 = _local3;
_local1 = _local4;
};
};
} else {
if (cpubot[_local4].virtualy < cpubot[cpufocus].virtualy){
_local3 = find_distance(cpubot[_local4], cpubot[cpufocus]);
if (_local3 < _local2){
_local2 = _local3;
_local1 = _local4;
};
};
};
};
_local4++;
};
return (_local1);
}
public function backtomenu(_arg1:MouseEvent):void{
if (gameoverbanner.popup.retry.visible == true){
gameoverbanner.popup.retry.visible = false;
gameoverbanner.popup.retry.removeEventListener(MouseEvent.MOUSE_DOWN, submit_highscore);
};
gameoverbanner.popup.visible = false;
gameoverbanner.popup.highscore.removeEventListener(MouseEvent.MOUSE_DOWN, gotohighscore);
gameoverbanner.popup.menu.removeEventListener(MouseEvent.MOUSE_DOWN, backtomenu);
submitsuccess = false;
remove_banner();
}
public function update_sound():void{
var _local1:SoundTransform;
soundtheta = (soundtheta + 0.01);
_local1 = new SoundTransform((0.3 + (0.2 * Math.sin(soundtheta))));
channel.soundTransform = _local1;
}
public function change_ends():void{
if (soundon == true){
whistlesound.play();
};
half = "2nd Half";
restart = true;
ball.posession = "free";
ball.ballspeed = 0;
ball.virtualx = 0;
ball.virtualy = 0;
countdownstarted = false;
countdown = countdowninitialmax;
playerbotdirection = -1;
cpubotdirection = 1;
playerbot[1].startx = (0 * scalefactor);
playerbot[1].starty = ((playerbotdirection * 95) * scalefactor);
playerbot[2].startx = (-20 * scalefactor);
playerbot[2].starty = ((playerbotdirection * 75) * scalefactor);
playerbot[3].startx = (20 * scalefactor);
playerbot[3].starty = ((playerbotdirection * 75) * scalefactor);
playerbot[4].startx = (-25 * scalefactor);
playerbot[4].starty = ((playerbotdirection * 43) * scalefactor);
playerbot[5].startx = (25 * scalefactor);
playerbot[5].starty = ((playerbotdirection * 43) * scalefactor);
playerbot[6].startx = (-45 * scalefactor);
playerbot[6].starty = ((playerbotdirection * 5) * scalefactor);
playerbot[7].startx = (0 * scalefactor);
playerbot[7].starty = ((playerbotdirection * 15) * scalefactor);
playerbot[8].startx = (45 * scalefactor);
playerbot[8].starty = ((playerbotdirection * 5) * scalefactor);
cpubot[1].startx = (0 * scalefactor);
cpubot[1].starty = ((cpubotdirection * 95) * scalefactor);
cpubot[2].startx = (-20 * scalefactor);
cpubot[2].starty = ((cpubotdirection * 75) * scalefactor);
cpubot[3].startx = (20 * scalefactor);
cpubot[3].starty = ((cpubotdirection * 75) * scalefactor);
cpubot[4].startx = (-25 * scalefactor);
cpubot[4].starty = ((cpubotdirection * 43) * scalefactor);
cpubot[5].startx = (25 * scalefactor);
cpubot[5].starty = ((cpubotdirection * 43) * scalefactor);
cpubot[6].startx = (-45 * scalefactor);
cpubot[6].starty = ((cpubotdirection * 5) * scalefactor);
cpubot[7].startx = (0 * scalefactor);
cpubot[7].starty = ((cpubotdirection * 15) * scalefactor);
cpubot[8].startx = (45 * scalefactor);
cpubot[8].starty = ((cpubotdirection * 5) * scalefactor);
}
public function mousekey_down(_arg1:MouseEvent):void{
if (lockmousekey == false){
mousekeydown = 1;
lockmousekey = true;
setTimeout(reset_lockmousekey, 300);
};
if (lockmousekey == true){
mousekeydownlocked = true;
};
}
public function update_countdown():void{
var _local1:Date;
if (countdownstarted == true){
_local1 = new Date();
countdown = (countdownnewmax - Math.round(((_local1.getTime() - countdownstarttime) / 1000)));
};
if ((((countdown <= 0)) && ((countdownstarted == true)))){
if (half == "1st Half"){
change_ends();
} else {
finish_game();
};
};
}
public function move_lights():void{
}
public function reset_playerdrop(_arg1):void{
playerbot[_arg1].drop = false;
}
public function fire_ball():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
if (scatter == true){
scatter = false;
ball.ballangle = (Math.random() * 360);
ball.ballspeed = (maxballspeed / 3);
cpubot[cpufocus].drop = true;
_local1 = cpufocus;
setTimeout(reset_cpudrop, 1200, _local1);
playerbot[playerfocus].drop = true;
_local2 = playerfocus;
setTimeout(reset_playerdrop, 1000, _local2);
};
if (ball.posession == "player"){
if ((((mousekeydown == 1)) || ((mousekeydownlocked == true)))){
mousekeydown = 0;
mousekeydownlocked = false;
ball.posession = "free";
ball.ballangle = playerbot[playerfocus].rotation;
ball.ballspeed = maxballspeed;
ball.virtualx = playerbot[playerfocus].virtualx;
ball.virtualy = playerbot[playerfocus].virtualy;
playerbot[playerfocus].drop = true;
_local3 = playerfocus;
setTimeout(reset_playerdrop, 300, _local3);
if (soundon == true){
passsound.play();
};
};
};
if (cpufire == true){
cpufire = false;
if (ball.posession == "cpu"){
ball.posession = "free";
ball.ballangle = cpubot[cpufocus].rotation;
ball.ballspeed = maxballspeed;
ball.virtualx = cpubot[cpufocus].virtualx;
ball.virtualy = cpubot[cpufocus].virtualy;
cpubot[cpufocus].drop = true;
_local4 = cpufocus;
setTimeout(reset_cpudrop, 300, _local4);
if (soundon == true){
passsound.play();
};
};
};
}
public function click_to_start(_arg1:MouseEvent):void{
setupgame = true;
fixture.start.removeEventListener(MouseEvent.MOUSE_DOWN, click_to_start);
fixture.menu.removeEventListener(MouseEvent.MOUSE_DOWN, click_to_start);
fixture.bb_link.removeEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
fixture.link.removeEventListener(MouseEvent.MOUSE_DOWN, gotowebsite);
fixture.visible = false;
}
public function end_preload():void{
removeChild(myPreloader);
removeEventListener(Event.ENTER_FRAME, loader);
myPreloader.link.removeEventListener(MouseEvent.MOUSE_OVER, mouse_over);
myPreloader.link.removeEventListener(MouseEvent.MOUSE_DOWN, follow_link);
myPreloader.link.removeEventListener(MouseEvent.MOUSE_OUT, mouse_out);
gotoAndStop(3);
}
public function reset_lockmousekey():void{
lockmousekey = false;
}
public function set_focus():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:*;
if (restart == false){
_local1 = 0;
if ((((ball.posession == "free")) || ((ball.posession == "cpu")))){
_local2 = (find_distance(playerbot[playerfocus], ball) - 10);
_local1 = (_local2 * _local2);
_local6 = 1;
while (_local6 <= numberofbots) {
if (playerbot[_local6].inactive == false){
_local3 = (ball.x - playerbot[_local6].x);
_local4 = (ball.y - playerbot[_local6].y);
_local5 = ((_local3 * _local3) + (_local4 * _local4));
if (_local5 < _local1){
_local1 = _local5;
playerfocus = _local6;
};
};
playerbot[_local6].highlight.visible = false;
_local6++;
};
playerbot[playerfocus].highlight.visible = true;
};
if ((((ball.posession == "free")) || ((ball.posession == "player")))){
_local7 = 100000;
_local11 = 1;
while (_local11 <= numberofbots) {
if (cpubot[_local11].inactive == false){
_local8 = (ball.x - cpubot[_local11].x);
_local9 = (ball.y - cpubot[_local11].y);
_local10 = ((_local8 * _local8) + (_local9 * _local9));
if (_local10 < _local7){
_local7 = _local10;
cpufocus = _local11;
};
};
_local11++;
};
};
};
}
public function click_to_play(_arg1:MouseEvent):void{
menu.start.removeEventListener(MouseEvent.MOUSE_DOWN, click_to_play);
menu.musicbox.removeEventListener(MouseEvent.MOUSE_DOWN, toggle_music);
menu.soundbox.removeEventListener(MouseEvent.MOUSE_DOWN, toggle_sound);
menu.teamnamesubmit.removeEventListener(MouseEvent.MOUSE_DOWN, update_teamname);
menu.link.removeEventListener(MouseEvent.MOUSE_DOWN, gotowebsite);
menu.bb_link.removeEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
menu.highscore_link.removeEventListener(MouseEvent.MOUSE_DOWN, gotohighscore);
menu.moregames_link.removeEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
menu.show_help.removeEventListener(MouseEvent.MOUSE_DOWN, show_help_screen);
menu.visible = false;
show_fixture();
}
public function show_fixture():void{
skipmenu = false;
fixture.visible = true;
fixture.displayteamname.text = teamname;
fixture.displaycpuname.text = cpuname[level];
fixture.displayround.text = (("Round " + level) + " of 6");
fixture.start.addEventListener(MouseEvent.MOUSE_DOWN, click_to_start);
fixture.menu.addEventListener(MouseEvent.MOUSE_DOWN, back_to_menu);
fixture.submitpassword.addEventListener(MouseEvent.MOUSE_DOWN, check_password);
fixture.bb_link.addEventListener(MouseEvent.MOUSE_DOWN, gotobubblebox);
fixture.link.addEventListener(MouseEvent.MOUSE_DOWN, gotowebsite);
}
public function submit_highscore(_arg1:MouseEvent):void{
if (gameoverbanner.popup.retry.visible == true){
gameoverbanner.popup.retry.visible = false;
gameoverbanner.popup.retry.removeEventListener(MouseEvent.MOUSE_DOWN, submit_highscore);
};
teamname = gameoverbanner.nametosubmit.text.toUpperCase();
bb = BubbleBoxAPI.submit(teamname, rating, 931);
bb.addEventListener(Event.COMPLETE, BubbleBoxCompleteHandler);
setTimeout(submitfail, 15000);
gameoverbanner.popup.popuptext.text = "Connecting: Please wait ...";
show_submit_result();
}
public function goal_scored():void{
if ((((playergoal == true)) || ((cpugoal == true)))){
if (playergoal == true){
playergoal = false;
playerscore++;
gui.playerscoredisplay.text = playerscore;
};
if (cpugoal == true){
cpugoal = false;
cpuscore++;
gui.cpuscoredisplay.text = cpuscore;
};
restart = true;
ball.posession = "free";
ball.ballspeed = 0;
ball.virtualx = 0;
ball.virtualy = 0;
countdownstarted = false;
};
}
public function game_loop(){
timing();
update_countdown();
move_player();
move_playerteammates();
move_cpu();
fire_ball();
set_focus();
move_ball();
goal_scored();
catch_ball();
tackle();
move_camera();
move_inactive_bots();
restart_game();
update_gui();
update_debug();
drift();
update_sound();
update_stats();
}
public function update_skill_levels():void{
if (level == 1){
playerbotspeed = (6 * dtscale);
playergoaliespeed = (8 * dtscale);
cpubotspeed = (4 * dtscale);
cpugoaliespeed = (6.5 * dtscale);
playertacklespeed = (7 * dtscale);
cputacklespeed = (5 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.95;
cputackleprobability = 0.05;
passingaccuracy = 30;
maxballspeed = (13.5 * dtscale);
ballfriction = (2.5 * dtscale);
};
if (level == 2){
playerbotspeed = (8 * dtscale);
playergoaliespeed = (10 * dtscale);
cpubotspeed = (5.5 * dtscale);
cpugoaliespeed = (8.5 * dtscale);
playertacklespeed = (9 * dtscale);
cputacklespeed = (6.5 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.8;
cputackleprobability = 0.2;
passingaccuracy = 20;
maxballspeed = (15 * dtscale);
ballfriction = (3.5 * dtscale);
};
if (level == 3){
playerbotspeed = (8 * dtscale);
playergoaliespeed = (10 * dtscale);
cpubotspeed = (6 * dtscale);
cpugoaliespeed = (9 * dtscale);
playertacklespeed = (9 * dtscale);
cputacklespeed = (7 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.65;
cputackleprobability = 0.3;
passingaccuracy = 15;
maxballspeed = (17 * dtscale);
ballfriction = (4 * dtscale);
};
if (level == 4){
playerbotspeed = (8 * dtscale);
playergoaliespeed = (10 * dtscale);
cpubotspeed = (6.5 * dtscale);
cpugoaliespeed = (9.5 * dtscale);
playertacklespeed = (9 * dtscale);
cputacklespeed = (7.5 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.55;
cputackleprobability = 0.35;
passingaccuracy = 12;
maxballspeed = (18 * dtscale);
ballfriction = (4 * dtscale);
};
if (level == 5){
playerbotspeed = (8 * dtscale);
playergoaliespeed = (10 * dtscale);
cpubotspeed = (7 * dtscale);
cpugoaliespeed = (10 * dtscale);
playertacklespeed = (9 * dtscale);
cputacklespeed = (8.5 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.5;
cputackleprobability = 0.5;
passingaccuracy = 7;
maxballspeed = (19 * dtscale);
ballfriction = (4 * dtscale);
};
if (level == 6){
playerbotspeed = (8 * dtscale);
playergoaliespeed = (10 * dtscale);
cpubotspeed = (8.5 * dtscale);
cpugoaliespeed = (11 * dtscale);
playertacklespeed = (9 * dtscale);
cputacklespeed = (9.5 * dtscale);
diagonalplayerbotspeed = (playerbotspeed * Math.sqrt(0.5));
diagonalcpubotspeed = (cpubotspeed * Math.sqrt(0.5));
playertackleprobability = 0.3;
cputackleprobability = 0.7;
passingaccuracy = 6;
maxballspeed = (20 * dtscale);
ballfriction = (4 * dtscale);
};
}
public function move_inactive_bots():void{
var _local1:*;
_local1 = 1;
while (_local1 <= numberofbots) {
if (playerbot[_local1].inactive == true){
playerbot[_local1].rotation = (playerbot[_local1].rotation + ((10 * dtscale) * dt));
playerbotshadow[_local1].rotation = (playerbotshadow[_local1].rotation + ((10 * dtscale) * dt));
};
if (cpubot[_local1].inactive == true){
cpubot[_local1].rotation = (cpubot[_local1].rotation + ((10 * dtscale) * dt));
cpubotshadow[_local1].rotation = (cpubotshadow[_local1].rotation + ((10 * dtscale) * dt));
};
_local1++;
};
}
public function reset_playerspeed(_arg1):void{
playerbot[_arg1].speed = playerbotspeed;
playerbot[_arg1].gotoAndStop(1);
}
public function reset_cpuinactive(_arg1):void{
cpubot[_arg1].inactive = false;
cpubot[_arg1].preventtackle = false;
cpubot[_arg1].drifting = false;
}
public function move_player():void{
var _local1:*;
if ((((playerbot[playerfocus].inactive == false)) && ((restart == false)))){
if (playerbot[playerfocus].speed == diagonalplayerbotspeed){
playerbot[playerfocus].speed = playerbotspeed;
};
if (playerbot[playerfocus].speed == playerbotspeed){
if ((((upkeydown + downkeydown) + leftkeydown) + rightkeydown) >= 2){
playerbot[playerfocus].speed = diagonalplayerbotspeed;
};
};
if (upkeydown == 1){
playerbot[playerfocus].virtualy = (playerbot[playerfocus].virtualy - (playerbot[playerfocus].speed * dt));
};
if (downkeydown == 1){
playerbot[playerfocus].virtualy = (playerbot[playerfocus].virtualy + (playerbot[playerfocus].speed * dt));
};
if (leftkeydown == 1){
playerbot[playerfocus].virtualx = (playerbot[playerfocus].virtualx - (playerbot[playerfocus].speed * dt));
};
if (rightkeydown == 1){
playerbot[playerfocus].virtualx = (playerbot[playerfocus].virtualx + (playerbot[playerfocus].speed * dt));
};
if (playerbot[playerfocus].virtualx > (50 * scalefactor)){
playerbot[playerfocus].virtualx = (50 * scalefactor);
};
if (playerbot[playerfocus].virtualx < (-(50) * scalefactor)){
playerbot[playerfocus].virtualx = (-(50) * scalefactor);
};
if (playerbot[playerfocus].virtualy > (100 * scalefactor)){
playerbot[playerfocus].virtualy = (100 * scalefactor);
};
if (playerbot[playerfocus].virtualy < (-(100) * scalefactor)){
playerbot[playerfocus].virtualy = (-(100) * scalefactor);
};
if ((((((((upkeydown == 0)) && ((downkeydown == 0)))) && ((leftkeydown == 0)))) && ((rightkeydown == 0)))){
} else {
playerbot[playerfocus].rotation = Math.round((90 + ((180 / Math.PI) * Math.atan2((downkeydown - upkeydown), (rightkeydown - leftkeydown)))));
playerbotshadow[playerfocus].rotation = playerbot[playerfocus].rotation;
};
if (ball.posession == "player"){
camx = playerbot[playerfocus].virtualx;
camy = playerbot[playerfocus].virtualy;
_local1 = 1;
while (_local1 <= numberofbots) {
playerbot[_local1].highlight.visible = false;
_local1++;
};
playerbot[playerfocus].highlight.visible = true;
};
};
}
public function submitfail():void{
if (submitsuccess == false){
gameoverbanner.popup.popuptext.text = "Sorry, could not connect to high score database.";
bb.removeEventListener(Event.COMPLETE, BubbleBoxCompleteHandler);
gameoverbanner.popup.retry.visible = true;
gameoverbanner.popup.retry.addEventListener(MouseEvent.MOUSE_DOWN, submit_highscore);
};
}
public function remove_banner():void{
gameoverbanner.continuebutton.removeEventListener(MouseEvent.MOUSE_DOWN, to_nextlevel);
gameoverbanner.submitbutton.removeEventListener(MouseEvent.MOUSE_DOWN, submit_highscore);
stage.removeChild(gameoverbanner);
skipmenu = true;
gameover = true;
cleaned = false;
}
public function reset_playerinactive(_arg1):void{
playerbot[_arg1].inactive = false;
playerbot[_arg1].drifting = false;
}
public function move_camera():void{
var _local1:*;
var _local2:*;
camxspeedx = ((camx - movetocamx) / camsmoothness);
movetocamx = (movetocamx + (camxspeedx * dt));
camxspeedy = ((camy - movetocamy) / camsmoothness);
movetocamy = (movetocamy + (camxspeedy * dt));
ball.x = ((ball.virtualx - movetocamx) + (stage.stageWidth / 2));
ball.y = ((ball.virtualy - movetocamy) + (stage.stageHeight / 2));
_local1 = 1;
while (_local1 <= numberofbots) {
playerbot[_local1].x = ((playerbot[_local1].virtualx - movetocamx) + (stage.stageWidth / 2));
playerbot[_local1].y = ((playerbot[_local1].virtualy - movetocamy) + (stage.stageHeight / 2));
playerbotshadow[_local1].x = (playerbot[_local1].x + 2);
playerbotshadow[_local1].y = (playerbot[_local1].y + 2);
_local1++;
};
_local2 = 1;
while (_local2 <= numberofbots) {
cpubot[_local2].x = ((cpubot[_local2].virtualx - movetocamx) + (stage.stageWidth / 2));
cpubot[_local2].y = ((cpubot[_local2].virtualy - movetocamy) + (stage.stageHeight / 2));
cpubotshadow[_local2].x = (cpubot[_local2].x + 2);
cpubotshadow[_local2].y = (cpubot[_local2].y + 2);
_local2++;
};
stadium.x = ((stadium.virtualx - movetocamx) + (stage.stageWidth / 2));
stadium.y = ((stadium.virtualy - movetocamy) + (stage.stageHeight / 2));
}
public function update_debug():void{
var _local1:Date;
_local1 = new Date();
newtime = _local1.getTime();
elapsedtime = (newtime - starttime);
counter++;
if (counter == 99){
counter = 0;
fps = int((100 / (elapsedtime / 1000)));
starttime = newtime;
};
}
public function make_gui():void{
var _local1:gamegui_mc;
_local1 = new gamegui_mc();
gui = _local1;
stage.addChild(gui);
stage.addChild(debug);
debug.alpha = 0.5;
debug.x = 0;
debug.y = (stage.stageHeight - debug.height);
debug.visible = false;
}
public function get_ready():void{
var _local1:*;
var _local2:Date;
gettingready = false;
restart = false;
_local1 = 1;
while (_local1 <= numberofbots) {
playerbot[_local1].ready = false;
cpubot[_local1].ready = false;
_local1++;
};
if (countdownstarted == false){
_local2 = new Date();
countdownstarttime = _local2.getTime();
countdownstarted = true;
countdownnewmax = countdown;
};
}
public function keydown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == 87)))){
upkeydown = 1;
};
if ((((_arg1.keyCode == Keyboard.DOWN)) || ((_arg1.keyCode == 83)))){
downkeydown = 1;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) || ((_arg1.keyCode == 65)))){
leftkeydown = 1;
};
if ((((_arg1.keyCode == Keyboard.RIGHT)) || ((_arg1.keyCode == 68)))){
rightkeydown = 1;
};
if ((((_arg1.keyCode == Keyboard.ESCAPE)) && ((gameactive == true)))){
quit_game();
};
if (_arg1.keyCode == Keyboard.SPACE){
if (lockmousekey == false){
mousekeydown = 1;
lockmousekey = true;
setTimeout(reset_lockmousekey, 300);
};
if (lockmousekey == true){
mousekeydownlocked = true;
};
};
}
public function stop_music():void{
musicchannel1.stop();
musicchannel2.stop();
}
public function to_nextlevel(_arg1:MouseEvent):void{
remove_banner();
}
public function move_playerteammates():void{
var _local1:Number;
var _local2:Number;
var _local3:*;
_local1 = 0;
_local2 = 0;
if (playerbotdirection == 1){
if (ball.zoneletter == "a"){
ball.zone = "leftback";
};
if (ball.zoneletter == "b"){
ball.zone = "rightback";
};
if (ball.zoneletter == "c"){
ball.zone = "leftmid";
};
if (ball.zoneletter == "d"){
ball.zone = "rightmid";
};
if (ball.zoneletter == "e"){
ball.zone = "leftwing";
};
if (ball.zoneletter == "f"){
ball.zone = "rightwing";
};
if (ball.zoneletter == "g"){
ball.zone = "goalmouth";
};
if (ball.zoneletter == "h"){
ball.zone = "leftwing";
};
} else {
if (ball.zoneletter == "e"){
ball.zone = "leftback";
};
if (ball.zoneletter == "f"){
ball.zone = "rightback";
};
if (ball.zoneletter == "c"){
ball.zone = "leftmid";
};
if (ball.zoneletter == "d"){
ball.zone = "rightmid";
};
if (ball.zoneletter == "a"){
ball.zone = "leftwing";
};
if (ball.zoneletter == "b"){
ball.zone = "rightwing";
};
if (ball.zoneletter == "h"){
ball.zone = "goalmouth";
};
if (ball.zoneletter == "g"){
ball.zone = "leftwing";
};
};
if (ball.posession == "player"){
if ((((ball.zone == "leftwing")) || ((ball.zone == "rightwing")))){
playerbot[1].target = "start";
playerbot[2].target = "startforward";
playerbot[3].target = "startforward";
playerbot[4].target = "startforward";
playerbot[5].target = "startforward";
playerbot[6].target = "supportforward";
playerbot[7].target = "supportforward";
playerbot[8].target = "supportforward";
};
if ((((ball.zone == "leftmid")) || ((ball.zone == "rightmid")))){
playerbot[1].target = "start";
playerbot[2].target = "startforward";
playerbot[3].target = "startforward";
playerbot[4].target = "support";
playerbot[5].target = "support";
playerbot[6].target = "startforward";
playerbot[7].target = "startforward";
playerbot[8].target = "startforward";
};
if ((((((ball.zone == "leftback")) || ((ball.zone == "rightback")))) || ((ball.zone == "goalmouth")))){
playerbot[1].target = "start";
playerbot[2].target = "support";
playerbot[3].target = "support";
playerbot[4].target = "startforward";
playerbot[5].target = "startforward";
playerbot[6].target = "startforward";
playerbot[7].target = "startforward";
playerbot[8].target = "startforward";
};
};
if (ball.posession == "cpu"){
if (ball.zone == "leftwing"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "startforward";
playerbot[5].target = "start";
playerbot[6].target = "ball";
playerbot[7].target = "ball";
playerbot[8].target = "start";
};
if (ball.zone == "rightwing"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "start";
playerbot[5].target = "startforward";
playerbot[6].target = "ball";
playerbot[7].target = "ball";
playerbot[8].target = "start";
};
if (ball.zone == "leftmid"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "ball";
playerbot[5].target = "supportback";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "rightmid"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "supportback";
playerbot[5].target = "ball";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "leftback"){
playerbot[1].target = "track";
playerbot[2].target = "ball";
playerbot[3].target = "supportback";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "rightback"){
playerbot[1].target = "track";
playerbot[2].target = "supportback";
playerbot[3].target = "ball";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "goalmouth"){
playerbot[1].target = "ball";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
};
if (ball.posession == "free"){
if (ball.zone == "leftwing"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "startforward";
playerbot[5].target = "startforward";
playerbot[6].target = "ball";
playerbot[7].target = "startforward";
playerbot[8].target = "startforward";
};
if (ball.zone == "rightwing"){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "startforward";
playerbot[5].target = "startforward";
playerbot[6].target = "startforward";
playerbot[7].target = "startforward";
playerbot[8].target = "ball";
};
if (ball.zone == "leftmid"){
playerbot[1].target = "start";
playerbot[2].target = "startforward";
playerbot[3].target = "startforward";
playerbot[4].target = "ball";
playerbot[5].target = "support";
playerbot[6].target = "startforward";
playerbot[7].target = "startforward";
playerbot[8].target = "startforward";
};
if (ball.zone == "rightmid"){
playerbot[1].target = "start";
playerbot[2].target = "startforward";
playerbot[3].target = "startforward";
playerbot[4].target = "support";
playerbot[5].target = "ball";
playerbot[6].target = "startforward";
playerbot[7].target = "startforward";
playerbot[8].target = "startforward";
};
if (ball.zone == "leftback"){
playerbot[1].target = "track";
playerbot[2].target = "ball";
playerbot[3].target = "start";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "rightback"){
playerbot[1].target = "track";
playerbot[2].target = "start";
playerbot[3].target = "ball";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
if (ball.zone == "goalmouth"){
playerbot[1].target = "ball";
playerbot[2].target = "ball";
playerbot[3].target = "ball";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
};
if (restart == true){
playerbot[1].target = "start";
playerbot[2].target = "start";
playerbot[3].target = "start";
playerbot[4].target = "start";
playerbot[5].target = "start";
playerbot[6].target = "start";
playerbot[7].target = "start";
playerbot[8].target = "start";
};
_local3 = 1;
while (_local3 <= numberofbots) {
if (((!((_local3 == playerfocus))) || ((restart == true)))){
if (playerbot[_local3].inactive == true){
playerbot[_local3].target = "remain";
};
playerbot[_local3].left = 0;
playerbot[_local3].right = 0;
playerbot[_local3].up = 0;
playerbot[_local3].down = 0;
playerbot[_local3].targetreachedx = false;
playerbot[_local3].targetreachedy = false;
if (playerbot[_local3].target == "start"){
_local1 = playerbot[_local3].startx;
_local2 = playerbot[_local3].starty;
};
if (playerbot[_local3].target == "ball"){
_local1 = ball.virtualx;
_local2 = ball.virtualy;
};
if (playerbot[_local3].target == "support"){
_local1 = playerbot[_local3].virtualx;
_local2 = playerbot[playerfocus].virtualy;
};
if (playerbot[_local3].target == "track"){
if ((((ball.virtualx > (-25 * scalefactor))) && ((ball.virtualx < (25 * scalefactor))))){
_local1 = ball.virtualx;
} else {
if (ball.virtualx < (-25 * scalefactor)){
_local1 = (-25 * scalefactor);
};
if (ball.virtualx > (25 * scalefactor)){
_local1 = (25 * scalefactor);
};
};
_local2 = playerbot[_local3].starty;
};
if (playerbot[_local3].target == "startforward"){
_local1 = playerbot[_local3].startx;
_local2 = (playerbot[_local3].starty - ((playerbotdirection * 30) * scalefactor));
};
if (playerbot[_local3].target == "supportforward"){
_local1 = playerbot[_local3].virtualx;
_local2 = (playerbot[playerfocus].virtualy - ((playerbotdirection * 20) * scalefactor));
if (playerbotdirection == 1){
if (_local2 < (cpubot[1].virtualy + (10 * scalefactor))){
_local2 = (cpubot[1].virtualy + (10 * scalefactor));
};
} else {
if (_local2 > (cpubot[1].virtualy - (10 * scalefactor))){
_local2 = (cpubot[1].virtualy - (10 * scalefactor));
};
};
};
if (playerbot[_local3].target == "supportback"){
_local1 = playerbot[_local3].virtualx;
_local2 = (playerbot[playerfocus].virtualy + ((playerbotdirection * 20) * scalefactor));
};
tolerance = ((0.6 * playerbot[_local3].speed) * dt);
if ((((playerbot[_local3].virtualx > (_local1 - tolerance))) && ((playerbot[_local3].virtualx < (_local1 + tolerance))))){
playerbot[_local3].targetreachedx = true;
};
if ((((playerbot[_local3].virtualy > (_local2 - tolerance))) && ((playerbot[_local3].virtualy < (_local2 + tolerance))))){
playerbot[_local3].targetreachedy = true;
};
if ((((playerbot[_local3].targetreachedx == true)) && ((playerbot[_local3].targetreachedy == true)))){
playerbot[_local3].target = "remain";
if (restart == 1){
if (playerbotdirection == 1){
playerbot[_local3].rotation = 0;
playerbotshadow[_local3].rotation = 0;
} else {
playerbot[_local3].rotation = 180;
playerbotshadow[_local3].rotation = 180;
};
playerbot[_local3].ready = true;
};
};
if (playerbot[1].target == "remain"){
if (playerbotdirection == 1){
playerbot[1].rotation = 0;
playerbotshadow[1].rotation = 0;
} else {
playerbot[1].rotation = 180;
playerbotshadow[1].rotation = 180;
};
};
if (playerbot[_local3].target != "remain"){
if ((((playerbot[_local3].virtualx < _local1)) && ((playerbot[_local3].targetreachedx == false)))){
playerbot[_local3].right = 1;
};
if ((((playerbot[_local3].virtualx > _local1)) && ((playerbot[_local3].targetreachedx == false)))){
playerbot[_local3].left = 1;
};
if ((((playerbot[_local3].virtualy > _local2)) && ((playerbot[_local3].targetreachedy == false)))){
playerbot[_local3].up = 1;
};
if ((((playerbot[_local3].virtualy < _local2)) && ((playerbot[_local3].targetreachedy == false)))){
playerbot[_local3].down = 1;
};
if (playerbot[_local3].speed == diagonalplayerbotspeed){
playerbot[_local3].speed = playerbotspeed;
};
playerbot[1].speed = playergoaliespeed;
if (playerbot[_local3].speed == playerbotspeed){
if ((((playerbot[_local3].up + playerbot[_local3].down) + playerbot[_local3].left) + playerbot[_local3].right) >= 2){
playerbot[_local3].speed = diagonalplayerbotspeed;
};
};
if (playerbot[_local3].up == 1){
playerbot[_local3].virtualy = (playerbot[_local3].virtualy - (playerbot[_local3].speed * dt));
};
if (playerbot[_local3].down == 1){
playerbot[_local3].virtualy = (playerbot[_local3].virtualy + (playerbot[_local3].speed * dt));
};
if (playerbot[_local3].left == 1){
playerbot[_local3].virtualx = (playerbot[_local3].virtualx - (playerbot[_local3].speed * dt));
};
if (playerbot[_local3].right == 1){
playerbot[_local3].virtualx = (playerbot[_local3].virtualx + (playerbot[_local3].speed * dt));
};
if (playerbot[_local3].virtualx > (50 * scalefactor)){
playerbot[_local3].virtualx = (50 * scalefactor);
};
if (playerbot[_local3].virtualx < (-(50) * scalefactor)){
playerbot[_local3].virtualx = (-(50) * scalefactor);
};
if (playerbot[_local3].virtualy > (100 * scalefactor)){
playerbot[_local3].virtualy = (100 * scalefactor);
};
if (playerbot[_local3].virtualy < (-(100) * scalefactor)){
playerbot[_local3].virtualy = (-(100) * scalefactor);
};
if ((((((((playerbot[_local3].up == 0)) && ((playerbot[_local3].down == 0)))) && ((playerbot[_local3].left == 0)))) && ((playerbot[_local3].right == 0)))){
} else {
playerbot[_local3].rotation = Math.round((90 + ((180 / Math.PI) * Math.atan2((playerbot[_local3].down - playerbot[_local3].up), (playerbot[_local3].right - playerbot[_local3].left)))));
playerbotshadow[_local3].rotation = playerbot[_local3].rotation;
};
};
};
_local3++;
};
}
public function find_distance(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = 0;
_local4 = (_arg2.x - _arg1.x);
_local5 = (_arg2.y - _arg1.y);
_local3 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
return (_local3);
}
public function drift():void{
var _local1:*;
_local1 = 1;
while (_local1 <= numberofbots) {
if (playerbot[_local1].drifton == true){
playerbot[_local1].drifton = false;
playerbot[_local1].drifting = true;
playerbot[_local1].driftspeedx = (((Math.random() * 10) - 5) * dtscale);
playerbot[_local1].driftspeedy = (((Math.random() * 10) - 5) * dtscale);
};
if (playerbot[_local1].drifting == true){
playerbot[_local1].virtualx = (playerbot[_local1].virtualx + (playerbot[_local1].driftspeedx * dt));
playerbot[_local1].virtualy = (playerbot[_local1].virtualy + (playerbot[_local1].driftspeedy * dt));
playerbot[_local1].driftspeedx = (playerbot[_local1].driftspeedx * 0.9);
playerbot[_local1].driftspeedy = (playerbot[_local1].driftspeedy * 0.9);
};
if (cpubot[_local1].drifton == true){
cpubot[_local1].drifton = false;
cpubot[_local1].drifting = true;
cpubot[_local1].driftspeedx = (((Math.random() * 10) - 5) * dtscale);
cpubot[_local1].driftspeedy = (((Math.random() * 10) - 5) * dtscale);
};
if (cpubot[_local1].drifting == true){
cpubot[_local1].virtualx = (cpubot[_local1].virtualx + (cpubot[_local1].driftspeedx * dt));
cpubot[_local1].virtualy = (cpubot[_local1].virtualy + (cpubot[_local1].driftspeedy * dt));
cpubot[_local1].driftspeedx = (cpubot[_local1].driftspeedx * 0.9);
cpubot[_local1].driftspeedy = (cpubot[_local1].driftspeedy * 0.9);
};
_local1++;
};
}
public function gotobubblebox(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function get_bearing(_arg1, _arg2):Number{
var _local3:Number;
_local3 = 0;
_local3 = (90 - ((180 / Math.PI) * Math.atan2(-((_arg2.y - _arg1.y)), (_arg2.x - _arg1.x))));
return (_local3);
}
public function follow_link(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.bubblebox.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function tackle():void{
var _local1:*;
var _local2:explosion_red_mc;
var _local3:*;
var _local4:explosion_red_mc;
var _local5:explosion_blue_mc;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:explosion_blue_mc;
var _local10:*;
var _local11:*;
var _local12:explosion_red_mc;
var _local13:explosion_blue_mc;
var _local14:*;
var _local15:*;
var _local16:*;
if ((((ball.posession == "cpu")) || ((ball.posession == "free")))){
if (mousekeydown == 1){
mousekeydown = 0;
playerbot[playerfocus].speed = playertacklespeed;
playerbot[playerfocus].gotoAndStop(2);
_local1 = playerfocus;
setTimeout(reset_playerspeed, 500, _local1);
};
if ((((playerbot[playerfocus].speed == playertacklespeed)) && (playerbot[playerfocus].hitTestObject(cpubot[cpufocus])))){
if (ball.posession == "cpu"){
if (Math.random() < playertackleprobability){
ball.posession = "player";
_local2 = new explosion_red_mc();
redexplosion[cpufocus] = _local2;
stage.addChild(redexplosion[cpufocus]);
redexplosion[cpufocus].x = cpubot[cpufocus].x;
redexplosion[cpufocus].y = cpubot[cpufocus].y;
cpubot[cpufocus].drifton = true;
cpubot[cpufocus].inactive = true;
cpubot[cpufocus].preventtackle = true;
_local3 = cpufocus;
setTimeout(reset_cpuinactive, 1500, _local3);
} else {
scatter = true;
ball.posession = "free";
_local4 = new explosion_red_mc();
redexplosion[cpufocus] = _local4;
stage.addChild(redexplosion[cpufocus]);
redexplosion[cpufocus].x = cpubot[cpufocus].x;
redexplosion[cpufocus].y = cpubot[cpufocus].y;
_local5 = new explosion_blue_mc();
blueexplosion[playerfocus] = _local5;
stage.addChild(blueexplosion[playerfocus]);
blueexplosion[playerfocus].x = playerbot[playerfocus].x;
blueexplosion[playerfocus].y = playerbot[playerfocus].y;
cpubot[cpufocus].drifton = true;
cpubot[cpufocus].inactive = true;
cpubot[cpufocus].preventtackle = true;
_local6 = cpufocus;
setTimeout(reset_cpuinactive, 1500, _local6);
playerbot[playerfocus].inactive = true;
playerbot[playerfocus].drifton = true;
_local7 = playerfocus;
setTimeout(reset_playerinactive, 1000, _local7);
};
if (soundon == true){
tacklesound.play();
};
};
};
};
if ((((ball.posession == "player")) || ((ball.posession == "free")))){
if ((((cpubot[cpufocus].tackle == true)) && ((cpubot[cpufocus].preventtackle == false)))){
(cpubot[cpufocus].tackle == false);
cpubot[cpufocus].speed = cputacklespeed;
cpubot[cpufocus].gotoAndStop(2);
_local8 = cpufocus;
setTimeout(reset_cpuspeed, 500, _local8);
};
if ((((cpubot[cpufocus].speed == cputacklespeed)) && (cpubot[cpufocus].hitTestObject(playerbot[playerfocus])))){
if (ball.posession == "player"){
if (Math.random() < cputackleprobability){
ball.posession = "cpu";
_local9 = new explosion_blue_mc();
blueexplosion[playerfocus] = _local9;
stage.addChild(blueexplosion[playerfocus]);
blueexplosion[playerfocus].x = playerbot[playerfocus].x;
blueexplosion[playerfocus].y = playerbot[playerfocus].y;
playerbot[playerfocus].drifton = true;
cpubot[cpufocus].preventtackle = true;
_local10 = cpufocus;
setTimeout(reset_cpupreventtackle, 2000, _local10);
playerbot[playerfocus].inactive = true;
_local11 = playerfocus;
setTimeout(reset_playerinactive, 1000, _local11);
} else {
ball.posession = "free";
_local12 = new explosion_red_mc();
redexplosion[cpufocus] = _local12;
stage.addChild(redexplosion[cpufocus]);
redexplosion[cpufocus].x = cpubot[cpufocus].x;
redexplosion[cpufocus].y = cpubot[cpufocus].y;
_local13 = new explosion_blue_mc();
blueexplosion[playerfocus] = _local13;
stage.addChild(blueexplosion[playerfocus]);
blueexplosion[playerfocus].x = playerbot[playerfocus].x;
blueexplosion[playerfocus].y = playerbot[playerfocus].y;
scatter = true;
playerbot[playerfocus].drifton = true;
cpubot[cpufocus].preventtackle = true;
_local14 = cpufocus;
setTimeout(reset_cpupreventtackle, 2000, _local14);
cpubot[cpufocus].inactive = true;
cpubot[cpufocus].drifton = true;
_local15 = cpufocus;
setTimeout(reset_cpuinactive, 1500, _local15);
playerbot[playerfocus].inactive = true;
_local16 = playerfocus;
setTimeout(reset_playerinactive, 1000, _local16);
};
if (soundon == true){
tacklesound.play();
};
};
};
};
}
public function hide_menu_screen(_arg1:MouseEvent):void{
menu.help.visible = false;
menu.help.back.removeEventListener(MouseEvent.MOUSE_DOWN, hide_menu_screen);
}
public function blow_whistle():void{
if (soundon == true){
whistlesound.play();
};
}
public function quit_game():void{
gameover = true;
gameended = true;
cleaned = false;
ball.posession = "free";
ball.ballspeed = 0;
ball.virtualx = 0;
ball.virtualy = 0;
countdownstarted = false;
}
public function make_cpubots():void{
var _local1:*;
var _local2:shadow_mc;
var _local3:cpubot_mc;
_local1 = 1;
while (_local1 <= numberofbots) {
_local2 = new shadow_mc();
cpubotshadow[_local1] = _local2;
stage.addChild(cpubotshadow[_local1]);
_local3 = new cpubot_mc();
cpubot[_local1] = _local3;
stage.addChild(cpubot[_local1]);
cpubot[_local1].virtualx = (-55 * scalefactor);
cpubot[_local1].virtualy = ((cpubotdirection * 5) * scalefactor);
cpubotshadow[_local1].x = (cpubot[_local1].x + 5);
cpubotshadow[_local1].y = (cpubot[_local1].y + 5);
cpubot[_local1].speed = cpubotspeed;
cpubot[1].speed = cpugoaliespeed;
cpubot[_local1].drop = false;
cpubot[_local1].inactive = false;
cpubot[_local1].preventtackle = false;
cpubot[_local1].ready = false;
cpubot[_local1].scaleX = (cpubot[_local1].scaleX * 0.6);
cpubot[_local1].scaleY = (cpubot[_local1].scaleY * 0.6);
cpubotshadow[_local1].scaleX = (cpubotshadow[_local1].scaleX * 0.6);
cpubotshadow[_local1].scaleY = (cpubotshadow[_local1].scaleY * 0.6);
_local1++;
};
cpubot[1].startx = (0 * scalefactor);
cpubot[1].starty = ((cpubotdirection * 95) * scalefactor);
cpubot[2].startx = (-20 * scalefactor);
cpubot[2].starty = ((cpubotdirection * 75) * scalefactor);
cpubot[3].startx = (20 * scalefactor);
cpubot[3].starty = ((cpubotdirection * 75) * scalefactor);
cpubot[4].startx = (-25 * scalefactor);
cpubot[4].starty = ((cpubotdirection * 43) * scalefactor);
cpubot[5].startx = (25 * scalefactor);
cpubot[5].starty = ((cpubotdirection * 43) * scalefactor);
cpubot[6].startx = (-45 * scalefactor);
cpubot[6].starty = ((cpubotdirection * 5) * scalefactor);
cpubot[7].startx = (0 * scalefactor);
cpubot[7].starty = ((cpubotdirection * 15) * scalefactor);
cpubot[8].startx = (45 * scalefactor);
cpubot[8].starty = ((cpubotdirection * 5) * scalefactor);
}
public function reset_cpupreventtackle(_arg1):void{
cpubot[_arg1].preventtackle = false;
}
public function check_password(_arg1:MouseEvent):void{
var _local2:*;
_local2 = 1;
while (_local2 <= 6) {
if ((((fixture.password.text.toLowerCase() == passwordarray[_local2])) || ((fixture.password.text.toUpperCase() == passwordarray[_local2])))){
level = _local2;
fixture.displaycpuname.text = cpuname[_local2];
fixture.displayround.text = (("Round " + _local2) + " of 6");
};
_local2++;
};
}
}
}//package xhoc4_fla
Section 35
//preloader_mc_1 (xhoc4_fla.preloader_mc_1)
package xhoc4_fla {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_mc_1 extends MovieClip {
public var link:SimpleButton;
public var bar:MovieClip;
public var loadingtext:TextField;
public var bb_movie:MovieClip;
}
}//package xhoc4_fla
Section 36
//Symbol18_33 (xhoc4_fla.Symbol18_33)
package xhoc4_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol18_33 extends MovieClip {
public var highscore:SimpleButton;
public var menu:SimpleButton;
public var retry:SimpleButton;
public var popuptext:TextField;
}
}//package xhoc4_fla
Section 37
//ball_mc (ball_mc)
package {
import flash.display.*;
public dynamic class ball_mc extends MovieClip {
}
}//package
Section 38
//Button_disabledSkin (Button_disabledSkin)
package {
import flash.display.*;
public dynamic class Button_disabledSkin extends MovieClip {
}
}//package
Section 39
//Button_downSkin (Button_downSkin)
package {
import flash.display.*;
public dynamic class Button_downSkin extends MovieClip {
}
}//package
Section 40
//Button_emphasizedSkin (Button_emphasizedSkin)
package {
import flash.display.*;
public dynamic class Button_emphasizedSkin extends MovieClip {
}
}//package
Section 41
//Button_overSkin (Button_overSkin)
package {
import flash.display.*;
public dynamic class Button_overSkin extends MovieClip {
}
}//package
Section 42
//Button_selectedDisabledSkin (Button_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDisabledSkin extends MovieClip {
}
}//package
Section 43
//Button_selectedDownSkin (Button_selectedDownSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDownSkin extends MovieClip {
}
}//package
Section 44
//Button_selectedOverSkin (Button_selectedOverSkin)
package {
import flash.display.*;
public dynamic class Button_selectedOverSkin extends MovieClip {
}
}//package
Section 45
//Button_selectedUpSkin (Button_selectedUpSkin)
package {
import flash.display.*;
public dynamic class Button_selectedUpSkin extends MovieClip {
}
}//package
Section 46
//Button_upSkin (Button_upSkin)
package {
import flash.display.*;
public dynamic class Button_upSkin extends MovieClip {
}
}//package
Section 47
//cpubot_mc (cpubot_mc)
package {
import flash.display.*;
public dynamic class cpubot_mc extends MovieClip {
public var flame:MovieClip;
public function cpubot_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 48
//crowd_sound (crowd_sound)
package {
import flash.media.*;
public dynamic class crowd_sound extends Sound {
}
}//package
Section 49
//debug_mc (debug_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class debug_mc extends MovieClip {
public var debugtext:TextField;
}
}//package
Section 50
//dustringblue (dustringblue)
package {
import flash.display.*;
public dynamic class dustringblue extends MovieClip {
}
}//package
Section 51
//dustringred (dustringred)
package {
import flash.display.*;
public dynamic class dustringred extends MovieClip {
}
}//package
Section 52
//explosion_blue_mc (explosion_blue_mc)
package {
import flash.display.*;
import fl.motion.*;
public dynamic class explosion_blue_mc extends MovieClip {
public var this_animator:Animator;
public var this_xml:XML;
public function explosion_blue_mc(){
addFrameScript(0, frame1);
}
function frame1(){
this_xml = <Motion duration="31" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="50" x="-1" y="0" scaleX="0.159" scaleY="0.159" rotation="0" elementType="graphic" symbolName="Tween 5">
<dimensions>
<geom:Rectangle left="-82.05" top="-82.05" width="164.1" height="164.1"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5" y="0.5"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0"/>
</tweens>
</Keyframe>
<Keyframe index="30" scaleX="6.289308176100628" scaleY="6.289308176100628">
<color>
<Color alphaMultiplier="0"/>
</color>
</Keyframe>
</Motion>
;
this_animator = new Animator(this_xml, this);
this_animator.play();
this_animator.addEventListener(MotionEvent.MOTION_END, remove);
}
public function remove(_arg1:MotionEvent):void{
this.parent.removeChild(this);
}
}
}//package
Section 53
//explosion_red_mc (explosion_red_mc)
package {
import flash.display.*;
import fl.motion.*;
public dynamic class explosion_red_mc extends MovieClip {
public var this_animator:Animator;
public var this_xml:XML;
public function explosion_red_mc(){
addFrameScript(0, frame1);
}
function frame1(){
this_xml = <Motion duration="31" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="50" x="0" y="1" scaleX="1" scaleY="1" rotation="0" elementType="graphic" symbolName="Tween 2">
<dimensions>
<geom:Rectangle left="-10" top="-9.95" width="19.95" height="19.9"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5012531328320802" y="0.5"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0"/>
</tweens>
</Keyframe>
<Keyframe index="30" tweenSnap="true" tweenSync="true" firstFrame="30" x="-1" y="-1" scaleX="6.528" scaleY="6.528">
<color>
<Color alphaMultiplier="0"/>
</color>
<tweens>
<SimpleEase ease="0"/>
</tweens>
</Keyframe>
</Motion>
;
this_animator = new Animator(this_xml, this);
this_animator.play();
this_animator.addEventListener(MotionEvent.MOTION_END, remove);
}
public function remove(_arg1:MotionEvent):void{
this.parent.removeChild(this);
}
}
}//package
Section 54
//fixture_mc (fixture_mc)
package {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class fixture_mc extends MovieClip {
public var link:SimpleButton;
public var displayround:TextField;
public var bluebot:playerbot_mc;
public var displayteamname:TextField;
public var displaycpuname:TextField;
public var menu:SimpleButton;
public var start:SimpleButton;
public var bb_link:SimpleButton;
public var redbot:cpubot_mc;
public var password:TextField;
public var submitpassword:Button;
public function fixture_mc(){
addFrameScript(0, frame1);
__setProp_submitpassword_fixture_mc_buttons_1();
}
function frame1(){
bluebot.highlight.visible = false;
this.addEventListener(Event.ENTER_FRAME, rotate_bots);
}
function __setProp_submitpassword_fixture_mc_buttons_1(){
try {
submitpassword["componentInspectorSetting"] = true;
} catch(e:Error) {
};
submitpassword.emphasized = false;
submitpassword.enabled = true;
submitpassword.label = "Submit";
submitpassword.labelPlacement = "right";
submitpassword.selected = false;
submitpassword.toggle = false;
submitpassword.visible = true;
try {
submitpassword["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function rotate_bots(_arg1:Event):void{
redbot.rotation = (redbot.rotation + 1);
bluebot.rotation = (bluebot.rotation + 1);
}
}
}//package
Section 55
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 56
//gamegui_mc (gamegui_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gamegui_mc extends MovieClip {
public var clock:TextField;
public var cpunamedisplay:TextField;
public var playernamedisplay:TextField;
public var playerscoredisplay:TextField;
public var cpuscoredisplay:TextField;
}
}//package
Section 57
//gameoverbanner_mc (gameoverbanner_mc)
package {
import fl.controls.*;
import flash.display.*;
import flash.text.*;
public dynamic class gameoverbanner_mc extends MovieClip {
public var finalscore:TextField;
public var message2:TextField;
public var message4:TextField;
public var message5:TextField;
public var message3:TextField;
public var message6:TextField;
public var message1:TextField;
public var submitbutton:Button;
public var continuebutton:SimpleButton;
public var popup:MovieClip;
public var nametosubmit:TextField;
public function gameoverbanner_mc(){
__setProp_submitbutton_gameoverbanner_mc_submit_1();
}
function __setProp_submitbutton_gameoverbanner_mc_submit_1(){
try {
submitbutton["componentInspectorSetting"] = true;
} catch(e:Error) {
};
submitbutton.emphasized = false;
submitbutton.enabled = true;
submitbutton.label = "Submit Rating";
submitbutton.labelPlacement = "right";
submitbutton.selected = false;
submitbutton.toggle = false;
submitbutton.visible = true;
try {
submitbutton["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 58
//goal_sound (goal_sound)
package {
import flash.media.*;
public dynamic class goal_sound extends Sound {
}
}//package
Section 59
//light_mc (light_mc)
package {
import flash.display.*;
public dynamic class light_mc extends MovieClip {
}
}//package
Section 60
//loop1_sound (loop1_sound)
package {
import flash.media.*;
public dynamic class loop1_sound extends Sound {
}
}//package
Section 61
//loop2_sound (loop2_sound)
package {
import flash.media.*;
public dynamic class loop2_sound extends Sound {
}
}//package
Section 62
//menu_mc (menu_mc)
package {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class menu_mc extends MovieClip {
public var link:SimpleButton;
public var show_help:SimpleButton;
public var help:MovieClip;
public var soundbox:MovieClip;
public var start:SimpleButton;
public var bot2:cpubot_mc;
public var teamnameinput:TextField;
public var bot1:playerbot_mc;
public var teamnamedisplay:TextField;
public var teamnamesubmit:Button;
public var bb_link:SimpleButton;
public var musicbox:MovieClip;
public var highscore_link:SimpleButton;
public var moregames_link:SimpleButton;
public function menu_mc(){
addFrameScript(0, frame1);
__setProp_teamnamesubmit_menu_mc_teamname_1();
}
function frame1(){
bot1.highlight.visible = false;
this.addEventListener(Event.ENTER_FRAME, rotate_bots);
}
function __setProp_teamnamesubmit_menu_mc_teamname_1(){
try {
teamnamesubmit["componentInspectorSetting"] = true;
} catch(e:Error) {
};
teamnamesubmit.emphasized = false;
teamnamesubmit.enabled = true;
teamnamesubmit.label = "Update";
teamnamesubmit.labelPlacement = "left";
teamnamesubmit.selected = false;
teamnamesubmit.toggle = false;
teamnamesubmit.visible = true;
try {
teamnamesubmit["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function rotate_bots(_arg1:Event):void{
bot1.rotation = (bot1.rotation + 1);
bot2.rotation = (bot2.rotation + 1);
}
}
}//package
Section 63
//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{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 64
//pass_sound (pass_sound)
package {
import flash.media.*;
public dynamic class pass_sound extends Sound {
}
}//package
Section 65
//playerbot_mc (playerbot_mc)
package {
import flash.display.*;
public dynamic class playerbot_mc extends MovieClip {
public var flame:MovieClip;
public var highlight:MovieClip;
public function playerbot_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 66
//rebound_sound (rebound_sound)
package {
import flash.media.*;
public dynamic class rebound_sound extends Sound {
}
}//package
Section 67
//shadow_mc (shadow_mc)
package {
import flash.display.*;
public dynamic class shadow_mc extends MovieClip {
}
}//package
Section 68
//sounds (sounds)
package {
import flash.display.*;
public dynamic class sounds extends MovieClip {
}
}//package
Section 69
//stadium_mc (stadium_mc)
package {
import flash.display.*;
public dynamic class stadium_mc extends MovieClip {
}
}//package
Section 70
//tackle_sound (tackle_sound)
package {
import flash.media.*;
public dynamic class tackle_sound extends Sound {
}
}//package
Section 71
//whistle_sound (whistle_sound)
package {
import flash.media.*;
public dynamic class whistle_sound extends Sound {
}
}//package
Section 72
//whistle_sound_long (whistle_sound_long)
package {
import flash.media.*;
public dynamic class whistle_sound_long extends Sound {
}
}//package