Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
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 2
//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 3
//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 4
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
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 5
//TextInput (fl.controls.TextInput)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
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();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//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.text.*;
import flash.utils.*;
import fl.events.*;
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 flash.events.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
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.text.*;
import flash.utils.*;
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
//ButtonBasedOn (General.ButtonBasedOn)
package General {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class ButtonBasedOn extends SimpleButton {
public function ButtonBasedOn(){
addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, Menu.GenericRollover, false, 0, true);
}
public function OnPress(_arg1:MouseEvent){
var _local2:menuclick;
navigateToURL(new URLRequest("http://www.newgrounds.com/portal/view/221483"), "_blank");
_local2 = new menuclick();
_local2.play();
}
}
}//package General
Section 16
//ButtonLoaderPlay (General.ButtonLoaderPlay)
package General {
import flash.display.*;
import flash.events.*;
public class ButtonLoaderPlay extends SimpleButton {
public function ButtonLoaderPlay(){
addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, Menu.GenericRollover, false, 0, true);
}
public function OnPress(_arg1:MouseEvent){
var _local2:menuclick;
Main.m_Loader.bar.gotoAndPlay("play_button");
_local2 = new menuclick();
_local2.play();
}
}
}//package General
Section 17
//ButtonMenu (General.ButtonMenu)
package General {
import flash.display.*;
import flash.events.*;
public class ButtonMenu extends SimpleButton {
public function ButtonMenu(){
addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, Menu.GenericRollover, false, 0, true);
}
public function OnPress(_arg1:MouseEvent){
var _local2:menuclick;
if (Main.m_State == "menu"){
Main.m_Menu.m_InstructionMenu.gotoAndStop(1);
} else {
if (Main.m_State == "game"){
Main.continuous = false;
Main.SetMode("summary");
} else {
if (Main.m_State == "summary"){
Main.SetMode("menu");
};
};
};
_local2 = new menuclick();
_local2.play();
}
}
}//package General
Section 18
//ButtonNext (General.ButtonNext)
package General {
import flash.display.*;
import flash.events.*;
public class ButtonNext extends SimpleButton {
public function ButtonNext(){
addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, Menu.GenericRollover, false, 0, true);
}
public function OnPress(_arg1:MouseEvent){
var _local2:menuclick;
if (Main.m_State == "menu"){
Main.m_Menu.m_InstructionMenu.play();
};
_local2 = new menuclick();
_local2.play();
}
}
}//package General
Section 19
//Game (General.Game)
package General {
import flash.display.*;
import Levels.*;
import flash.media.*;
import Guys.*;
public class Game {
public var m_Metronome:Metronome;
public var m_ClickSound2:ClickSound2;
var m_Level:Level;
var m_TimeLine:int;
var m_Speed:int;
var m_Effects:Sprite;
var m_Arrow:Sprite;
public var m_State:String;
public var m_Score:Score;
public var m_ClickSound:ClickSound;
var m_MetTimeLine:int;
public var m_NumGuys:int;
public static var m_Guys:Array;
public function Game(_arg1:int, _arg2:int){
var _local3:ButtonMenu;
super();
Main.stageMc.silenceStream.play();
m_Guys = new Array();
m_Guys[1] = new Guy1();
m_Guys[2] = new Guy2();
m_Guys[3] = new Guy3();
m_Guys[4] = new Guy4();
m_Guys[5] = new Guy5();
m_Guys[6] = new Guy6();
m_Guys[7] = new Guy7();
m_Guys[1].m_TimeOffset = 6;
m_Guys[2].m_TimeOffset = 18;
m_Guys[3].m_TimeOffset = 12;
m_Guys[4].m_TimeOffset = 7;
m_Guys[5].m_TimeOffset = 10;
m_Guys[6].m_TimeOffset = 6;
m_Guys[7].m_TimeOffset = 7;
m_Guys[1].m_Marker.m_Index = 1;
m_Guys[2].m_Marker.m_Index = 2;
m_Guys[3].m_Marker.m_Index = 3;
m_Guys[4].m_Marker.m_Index = 4;
m_Guys[5].m_Marker.m_Index = 5;
m_Guys[6].m_Marker.m_Index = 6;
m_Guys[7].m_Marker.m_Index = 7;
m_Guys[1].m_Marker.gotoAndStop("A");
m_Guys[2].m_Marker.gotoAndStop("S");
m_Guys[3].m_Marker.gotoAndStop("D");
m_Guys[4].m_Marker.gotoAndStop("F");
m_Guys[5].m_Marker.gotoAndStop("G");
m_Guys[6].m_Marker.gotoAndStop("H");
m_Guys[7].m_Marker.gotoAndStop(1);
m_Guys[1].m_Sound = new Guy1Sound();
m_Guys[2].m_Sound = new Guy2Sound();
m_Guys[3].m_Sound = new Guy3Sound();
m_Guys[4].m_Sound = new Guy4Sound();
m_Guys[5].m_Sound = new Guy5Sound();
m_Guys[6].m_Sound = new Guy6Sound();
m_Guys[7].m_Sound = new Guy7Sound();
m_Metronome = new Metronome();
m_Metronome.x = 47;
m_Metronome.y = 376;
m_Metronome.scaleX = 0.7;
m_Metronome.scaleY = 0.7;
Main.stageMc.addChild(m_Metronome);
m_ClickSound = new ClickSound();
m_ClickSound2 = new ClickSound2();
m_Level = new Level(_arg1, _arg2);
m_Speed = _arg2;
m_NumGuys = _arg1;
m_TimeLine = 0;
m_MetTimeLine = 0;
m_State = "countdown";
m_Arrow = new arrow();
m_Arrow.x = 37;
m_Arrow.y = 130;
m_Level.GetLevelMc().addChildAt(m_Arrow, 0);
m_Effects = new Sprite();
m_Level.GetLevelMc().addChildAt(m_Effects, 0);
m_Score = new Score();
m_Level.GetLevelMc().addChildAt(m_Score, 0);
_local3 = new ButtonMenu();
_local3.x = 601.5;
_local3.y = 20.5;
m_Level.GetLevelMc().addChildAt(_local3, 0);
}
private function UpdateMetronome(){
var _local1:*;
var _local2:SoundChannel;
var _local3:Number;
_local1 = (Math.abs((((m_MetTimeLine - (m_Speed / 2)) / m_Speed) * 70)) % 140);
if (_local1 > 70){
_local1 = (140 - _local1);
};
m_Metronome.m_Stick.rotation = (_local1 - 35);
if (((((m_MetTimeLine % (m_Speed / 2)) == 0)) && ((m_MetTimeLine >= m_Speed)))){
_local3 = 0.5;
if ((m_MetTimeLine % m_Speed) == 0){
_local2 = m_ClickSound2.play(10);
_local3 = 1;
} else {
_local2 = m_ClickSound.play(10);
};
_local2.soundTransform = new SoundTransform(_local3);
};
m_Metronome.m_Flash.alpha = Math.pow((1 - Math.abs((m_Metronome.m_Stick.rotation / 35))), 4);
}
private function UpdateMarkers():Boolean{
var _local1:Boolean;
var _local2:int;
_local1 = false;
_local2 = 1;
while (_local2 <= m_NumGuys) {
_local1 = ((m_Guys[_local2].UpdateMarker(m_TimeLine, (m_Speed / 3))) || (_local1));
_local2++;
};
if (m_TimeLine == int((m_Speed * 4.75))){
m_TimeLine = (m_TimeLine - (m_Speed * 4));
return (false);
};
return (true);
}
private function UpdateGuys():Boolean{
var _local1:Boolean;
var _local2:int;
_local1 = false;
_local2 = 1;
while (_local2 <= m_NumGuys) {
_local1 = ((m_Guys[_local2].Update(m_TimeLine)) || (_local1));
_local2++;
};
if (m_TimeLine == int((m_Speed * 4.5))){
m_TimeLine = (m_TimeLine - (m_Speed * 4));
return (false);
};
return (true);
}
private function PreUpdateGuys(){
var _local1:int;
_local1 = 1;
while (_local1 < m_Guys.length) {
m_Guys[_local1].PreUpdate();
_local1++;
};
UpdateEffects();
}
public function UpdateEffects(){
var _local1:int;
var _local2:*;
_local1 = 0;
while (_local1 < m_Effects.numChildren) {
_local2 = m_Effects.getChildAt(_local1);
_local2.scaleX = (_local2.scaleX + 0.04);
_local2.scaleY = (_local2.scaleY + 0.04);
_local2.y = (_local2.y + 2);
_local2.alpha = (_local2.alpha - 0.11);
if (_local2.alpha < 0.01){
m_Effects.removeChildAt(_local1);
_local1--;
};
_local1++;
};
}
private function DoCountDown(){
var _local1:MovieClip;
if (m_MetTimeLine == m_Speed){
_local1 = new countdown4();
_local1.x = 320;
_local1.y = 240;
m_Level.GetLevelMc().addChild(_local1);
} else {
if (m_MetTimeLine == (m_Speed * 2)){
_local1 = new countdown3();
_local1.x = 320;
_local1.y = 240;
m_Level.GetLevelMc().addChild(_local1);
} else {
if (m_MetTimeLine == (m_Speed * 3)){
_local1 = new countdown2();
_local1.x = 320;
_local1.y = 240;
m_Level.GetLevelMc().addChild(_local1);
} else {
if (m_MetTimeLine == (m_Speed * 4)){
_local1 = new countdown1();
_local1.x = 320;
_local1.y = 240;
m_Level.GetLevelMc().addChild(_local1);
};
};
};
};
}
public function Update(){
var _local1:MovieClip;
var _local2:MovieClip;
PreUpdateGuys();
if ((((m_Level.PatternsPlayed == 10)) && ((m_Speed == 20)))){
_local1 = new speedupMc();
_local1.x = 320;
_local1.y = 240;
m_Level.GetLevelMc().addChild(_local1);
m_Speed = 16;
m_Level.m_Speed = 16;
m_Level.InitLevel(m_NumGuys);
} else {
if ((((m_Level.PatternsPlayed == 20)) && ((m_Speed == 16)))){
_local2 = new speedupMc();
_local2.x = 320;
_local2.y = 240;
m_Level.GetLevelMc().addChild(_local2);
m_Speed = 14;
m_Level.m_Speed = 14;
m_Level.InitLevel(m_NumGuys);
} else {
if (m_Level.PatternsPlayed == 30){
Main.SetMode("summary");
return;
};
};
};
m_Arrow.y = 130;
switch (m_State){
case "countdown":
if (m_TimeLine == (m_Speed * 4)){
m_State = "playback";
m_TimeLine = 0;
};
DoCountDown();
UpdateMetronome();
m_TimeLine++;
m_MetTimeLine++;
break;
case "playback":
if (!UpdateGuys()){
m_State = "input";
m_Arrow.y = 254;
};
UpdateMetronome();
m_TimeLine++;
m_MetTimeLine++;
break;
case "input":
m_Arrow.y = 254;
if (!UpdateMarkers()){
m_State = "playback";
m_Level.InitLevel(m_NumGuys);
};
UpdateMetronome();
m_TimeLine++;
m_MetTimeLine++;
break;
default:
break;
};
m_Score.UpdateText();
m_Score.UpdateBonus();
}
public function AddEffect(_arg1:int, _arg2:Number, _arg3:Number){
var _local4:MovieClip;
switch (_arg1){
case 1:
_local4 = new Guy1();
break;
case 2:
_local4 = new Guy2();
break;
case 3:
_local4 = new Guy3();
break;
case 4:
_local4 = new Guy4();
break;
case 5:
_local4 = new Guy5();
break;
case 6:
_local4 = new Guy6();
break;
default:
_local4 = new Guy7();
};
_local4.x = _arg2;
_local4.y = _arg3;
m_Effects.addChild(_local4);
}
}
}//package General
Section 20
//Input (General.Input)
package General {
import flash.display.*;
import flash.events.*;
public class Input {
public static var lastKey:int = 0;
private static var keyArr:Array;
public static var mouseReleased:Boolean = false;
public static var ascii:Array;
public static var mouseX:Number = 0;
public static var mouseY:Number = 0;
private static var bufferSize:int;
public static var mouse:Sprite = new Sprite();
public static var mouseDown:Boolean = false;
private static var keyState:Array;
public static var timeSinceLastKey = 0;
private static var keyBuffer:Array;
public function Input(){
var _local1:int;
var _local2:int;
super();
ascii = new Array(222);
FillAscii();
keyState = new Array(222);
keyArr = new Array();
_local1 = 0;
while (_local1 < 222) {
keyState[_local1] = new int(0);
if (ascii[_local1] != undefined){
keyArr.push(_local1);
};
_local1++;
};
bufferSize = 5;
keyBuffer = new Array(bufferSize);
_local2 = 0;
while (_local2 < bufferSize) {
keyBuffer[_local2] = new Array(0, 0);
_local2++;
};
Main.stageMc.stage.addEventListener(KeyboardEvent.KEY_DOWN, KeyPress, false, 0, true);
Main.stageMc.stage.addEventListener(KeyboardEvent.KEY_UP, KeyRelease, false, 0, true);
Main.stageMc.stage.addEventListener(MouseEvent.MOUSE_DOWN, MousePress, false, 0, true);
Main.stageMc.stage.addEventListener(MouseEvent.CLICK, MouseRelease, false, 0, true);
Main.stageMc.stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove, false, 0, true);
mouse.graphics.lineStyle(1, 0, 100);
mouse.graphics.moveTo(0, 0);
mouse.graphics.lineTo(0, 1);
}
public function MouseRelease(_arg1:MouseEvent){
mouseDown = false;
mouseReleased = true;
}
public function KeyPress(_arg1:KeyboardEvent){
keyState[_arg1.keyCode] = Math.max(keyState[_arg1.keyCode], 1);
lastKey = _arg1.keyCode;
}
private function FillAscii(){
ascii[65] = "A";
ascii[66] = "B";
ascii[67] = "C";
ascii[68] = "D";
ascii[69] = "E";
ascii[70] = "F";
ascii[71] = "G";
ascii[72] = "H";
ascii[73] = "I";
ascii[74] = "J";
ascii[75] = "K";
ascii[76] = "L";
ascii[77] = "M";
ascii[78] = "N";
ascii[79] = "O";
ascii[80] = "P";
ascii[81] = "Q";
ascii[82] = "R";
ascii[83] = "S";
ascii[84] = "T";
ascii[85] = "U";
ascii[86] = "V";
ascii[87] = "W";
ascii[88] = "X";
ascii[89] = "Y";
ascii[90] = "Z";
ascii[48] = "0";
ascii[49] = "1";
ascii[50] = "2";
ascii[51] = "3";
ascii[52] = "4";
ascii[53] = "5";
ascii[54] = "6";
ascii[55] = "7";
ascii[56] = "8";
ascii[57] = "9";
ascii[32] = "Spacebar";
ascii[17] = "Ctrl";
ascii[16] = "Shift";
ascii[192] = "~";
ascii[38] = "up";
ascii[40] = "down";
ascii[37] = "left";
ascii[39] = "right";
ascii[96] = "Numpad 0";
ascii[97] = "Numpad 1";
ascii[98] = "Numpad 2";
ascii[99] = "Numpad 3";
ascii[100] = "Numpad 4";
ascii[101] = "Numpad 5";
ascii[102] = "Numpad 6";
ascii[103] = "Numpad 7";
ascii[104] = "Numpad 8";
ascii[105] = "Numpad 9";
ascii[111] = "Numpad /";
ascii[106] = "Numpad *";
ascii[109] = "Numpad -";
ascii[107] = "Numpad +";
ascii[110] = "Numpad .";
ascii[45] = "Insert";
ascii[46] = "Delete";
ascii[33] = "Page Up";
ascii[34] = "Page Down";
ascii[35] = "End";
ascii[36] = "Home";
ascii[112] = "F1";
ascii[113] = "F2";
ascii[114] = "F3";
ascii[115] = "F4";
ascii[116] = "F5";
ascii[117] = "F6";
ascii[118] = "F7";
ascii[119] = "F8";
ascii[188] = ",";
ascii[190] = ".";
ascii[186] = ";";
ascii[222] = "'";
ascii[219] = "[";
ascii[221] = "]";
ascii[189] = "-";
ascii[187] = "+";
ascii[220] = "\\";
ascii[191] = "/";
ascii[9] = "TAB";
ascii[8] = "Backspace";
}
public function MouseMove(_arg1:MouseEvent){
mouseX = (_arg1.stageX - Main.stageMc.x);
mouseY = (_arg1.stageY - Main.stageMc.y);
mouse.x = mouseX;
mouse.y = mouseY;
}
public function KeyRelease(_arg1:KeyboardEvent){
var _local2:int;
keyState[_arg1.keyCode] = -1;
_local2 = (bufferSize - 1);
while (_local2 > 0) {
keyBuffer[_local2] = keyBuffer[(_local2 - 1)];
_local2--;
};
keyBuffer[0] = [_arg1.keyCode, 0];
}
public function MousePress(_arg1:MouseEvent){
mouseDown = true;
}
public static function IsKeyReleased(_arg1:int):Boolean{
return ((keyState[_arg1] == -1));
}
public static function IsKeyInBuffer(_arg1:int, _arg2:int, _arg3:int){
return ((((keyBuffer[_arg2][0] == _arg1)) && ((keyBuffer[_arg2][1] <= _arg3))));
}
public static function GetKeyHold(_arg1:int):int{
return (Math.max(0, keyState[_arg1]));
}
public static function IsKeyPressed(_arg1:int):Boolean{
timeSinceLastKey = 0;
return ((keyState[_arg1] == 1));
}
public static function Update(){
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < keyArr.length) {
if (keyState[keyArr[_local1]] != 0){
var _local3 = keyState;
var _local4 = keyArr[_local1];
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local1++;
};
_local2 = 0;
while (_local2 < bufferSize) {
_local3 = keyBuffer[_local2];
_local4 = 1;
_local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
_local2++;
};
mouseReleased = false;
}
public static function IsKeyDown(_arg1:int):Boolean{
return ((keyState[_arg1] > 0));
}
public static function GetKeyString(_arg1:uint):String{
return (ascii[_arg1]);
}
}
}//package General
Section 21
//Menu (General.Menu)
package General {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import Guys.*;
import flash.net.*;
public class Menu extends MovieClip {
public var btn_Newgrounds:SimpleButton;
public var m_CreditsAni:MovieClip;
public var m_Armorgames:MovieClip;
private var m_State:String;// = "intro"
public var btn_HighScores:SimpleButton;
public var m_Instructions:MovieClip;
public var btn_Normal:SimpleButton;
private var m_TempTimer:int;// = 0
var m_menuslide:Sound;
var m_menuclick:Sound;
public var btn_Lvl2:SimpleButton;
public var btn_Lvl3:SimpleButton;
public var btn_Lvl1:SimpleButton;
public var btn_Free:SimpleButton;
public var m_Credits:MovieClip;
public var btn_Dustin:SimpleButton;
public var btn_Armorgames:SimpleButton;
public var btn_Instructions:SimpleButton;
public var m_Lvl1:MovieClip;
public var m_Lvl2:MovieClip;
public var m_Lvl3:MovieClip;
var m_Effects:Sprite;
public var m_Normal:MovieClip;
public var m_InstructionMenu:MovieClip;
public var btn_CreditsBack:SimpleButton;
public var m_Free:MovieClip;
public var btn_Play:SimpleButton;
public var m_Newgrounds:MovieClip;
public var m_Dustin:MovieClip;
public var m_HighScores:MovieClip;
public var btn_Credits:SimpleButton;
public var m_CreditsBack:MovieClip;
public var m_Play:MovieClip;
static var m_menuhover:Sound = new menuhover();
public function Menu(){
m_TempTimer = 0;
m_State = "intro";
m_menuclick = new menuclick();
m_menuslide = new menuslide();
super();
addFrameScript(0, frame1);
btn_Dustin.addEventListener(MouseEvent.CLICK, btnDustinCallback, false, 0, true);
btn_Dustin.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Dustin.visible = false;
btn_Play.addEventListener(MouseEvent.CLICK, btnPlayCallback, false, 0, true);
btn_Play.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Play.visible = false;
btn_Normal.addEventListener(MouseEvent.CLICK, btnNormalCallback, false, 0, true);
btn_Normal.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Normal.visible = false;
btn_Free.addEventListener(MouseEvent.CLICK, btnFreeCallback, false, 0, true);
btn_Free.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Free.visible = false;
btn_Instructions.addEventListener(MouseEvent.CLICK, btnInstructionsCallback, false, 0, true);
btn_Instructions.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Instructions.visible = false;
btn_HighScores.addEventListener(MouseEvent.CLICK, btnHighScoresCallback, false, 0, true);
btn_HighScores.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_HighScores.visible = false;
btn_Newgrounds.addEventListener(MouseEvent.CLICK, btnNewgroundsCallback, false, 0, true);
btn_Newgrounds.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Newgrounds.visible = false;
btn_Armorgames.addEventListener(MouseEvent.CLICK, btnArmorgamesCallback, false, 0, true);
btn_Armorgames.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Armorgames.visible = false;
btn_Credits.addEventListener(MouseEvent.CLICK, btnCreditsCallback, false, 0, true);
btn_Credits.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Credits.visible = false;
btn_CreditsBack.addEventListener(MouseEvent.CLICK, btnCreditsBackCallback, false, 0, true);
btn_CreditsBack.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_CreditsBack.visible = false;
m_CreditsBack.visible = false;
btn_Lvl1.addEventListener(MouseEvent.CLICK, btnLvl1Callback, false, 0, true);
btn_Lvl1.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Lvl1.visible = false;
btn_Lvl2.addEventListener(MouseEvent.CLICK, btnLvl2Callback, false, 0, true);
btn_Lvl2.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Lvl2.visible = false;
btn_Lvl3.addEventListener(MouseEvent.CLICK, btnLvl3Callback, false, 0, true);
btn_Lvl3.addEventListener(MouseEvent.MOUSE_OVER, GenericRollover, false, 0, true);
btn_Lvl3.visible = false;
m_Effects = new Sprite();
Main.stageMc.addChildAt(m_Effects, 0);
}
public function btnCreditsBackCallback(_arg1:Event){
m_CreditsAni.gotoAndPlay("end");
m_menuslide.play();
btn_CreditsBack.visible = false;
m_State = "creditsOut";
m_TempTimer = 0;
m_menuclick.play();
}
public function btnNewgroundsCallback(_arg1:Event){
navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank");
m_menuclick.play();
}
public function btnPlayCallback(_arg1:Event){
btn_Dustin.visible = false;
btn_Newgrounds.visible = false;
btn_Armorgames.visible = false;
btn_Credits.visible = false;
btn_Play.visible = false;
btn_Instructions.visible = false;
btn_HighScores.visible = false;
m_Dustin.gotoAndPlay("end");
m_Newgrounds.gotoAndPlay("end");
m_Armorgames.gotoAndPlay("end");
m_Credits.gotoAndPlay("end");
m_Play.gotoAndPlay("end");
m_Instructions.gotoAndPlay("end");
m_HighScores.gotoAndPlay("end");
m_menuslide.play();
m_State = "modeSelectStart";
m_TempTimer = 0;
m_menuclick.play();
}
public function btnLvl1Callback(_arg1:Event){
StartOutro(4);
m_menuclick.play();
}
public function btnDustinCallback(_arg1:Event){
navigateToURL(new URLRequest("http://www.dustfilms.com"), "_blank");
m_menuclick.play();
}
public function btnLvl3Callback(_arg1:Event){
StartOutro(6);
m_menuclick.play();
}
function frame1(){
stop();
}
public function btnArmorgamesCallback(_arg1:Event){
navigateToURL(new URLRequest("http://www.armorgames.com"), "_blank");
m_menuclick.play();
}
private function StartOutro(_arg1:int){
btn_Lvl1.visible = false;
btn_Lvl2.visible = false;
btn_Lvl3.visible = false;
m_Lvl1.gotoAndPlay("end");
m_Lvl2.gotoAndPlay("end");
m_Lvl3.gotoAndPlay("end");
m_menuslide.play();
Main.m_Level = _arg1;
m_TempTimer = 0;
m_State = "levelSelectEnd";
}
public function Update(){
m_TempTimer++;
switch (m_State){
case "intro":
if (m_TempTimer > 45){
m_TempTimer = 0;
m_State = "mainMenuStart";
gotoAndStop("loop");
};
break;
case "mainMenuStart":
if (m_TempTimer == 12){
m_Dustin.play();
m_Newgrounds.play();
m_Armorgames.play();
m_Credits.play();
m_Play.play();
m_Instructions.play();
m_HighScores.play();
m_menuslide.play();
} else {
if (m_TempTimer == 40){
m_TempTimer = 0;
m_State = "mainMenu";
btn_Dustin.visible = true;
btn_Newgrounds.visible = true;
btn_Armorgames.visible = true;
btn_Credits.visible = true;
btn_Play.visible = true;
btn_Instructions.visible = true;
btn_HighScores.visible = true;
};
};
break;
case "modeSelectStart":
if (m_TempTimer == 25){
m_Normal.play();
m_Free.play();
m_menuslide.play();
} else {
if (m_TempTimer == 50){
btn_Normal.visible = true;
btn_Free.visible = true;
};
};
break;
case "levelSelectStart":
if (m_TempTimer == 25){
m_Lvl1.play();
m_Lvl2.play();
m_Lvl3.play();
m_menuslide.play();
} else {
if (m_TempTimer == 50){
btn_Lvl1.visible = true;
btn_Lvl2.visible = true;
btn_Lvl3.visible = true;
};
};
break;
case "levelSelectEnd":
if (m_TempTimer > 20){
m_TempTimer = 0;
m_State = "outro";
gotoAndStop("end");
};
break;
case "instructionsStart":
if (m_TempTimer > 18){
m_TempTimer = 0;
m_State = "instructions";
m_InstructionMenu.gotoAndPlay(2);
};
break;
case "instructions":
if (m_InstructionMenu.currentFrame == 1){
gotoAndStop("start");
m_TempTimer = 0;
m_State = "intro";
m_Dustin.gotoAndPlay(1);
m_Newgrounds.gotoAndPlay(1);
m_Armorgames.gotoAndPlay(1);
m_Credits.gotoAndPlay(1);
m_Play.gotoAndPlay(1);
m_Instructions.gotoAndPlay(1);
m_HighScores.gotoAndPlay(1);
m_InstructionMenu.stop();
};
break;
case "creditsStart":
if (m_TempTimer == 18){
m_CreditsAni.gotoAndPlay(2);
m_menuslide.play();
m_CreditsBack.visible = true;
};
break;
case "creditsOut":
if (m_TempTimer > 30){
m_TempTimer = 30;
m_State = "intro";
m_Dustin.gotoAndPlay(1);
m_Newgrounds.gotoAndPlay(1);
m_Armorgames.gotoAndPlay(1);
m_Credits.gotoAndPlay(1);
m_Play.gotoAndPlay(1);
m_Instructions.gotoAndPlay(1);
m_HighScores.gotoAndPlay(1);
m_InstructionMenu.stop();
m_CreditsBack.visible = false;
};
break;
case "outro":
if (m_TempTimer > 18){
m_TempTimer = 0;
Main.SetMode("game");
};
break;
};
UpdateEffects();
}
public function btnCreditsCallback(_arg1:Event){
btn_Dustin.visible = false;
btn_Newgrounds.visible = false;
btn_Armorgames.visible = false;
btn_Credits.visible = false;
btn_Play.visible = false;
btn_Instructions.visible = false;
btn_HighScores.visible = false;
btn_CreditsBack.visible = true;
m_Dustin.gotoAndPlay("end");
m_Newgrounds.gotoAndPlay("end");
m_Armorgames.gotoAndPlay("end");
m_Credits.gotoAndPlay("end");
m_Play.gotoAndPlay("end");
m_Instructions.gotoAndPlay("end");
m_HighScores.gotoAndPlay("end");
m_menuslide.play();
m_State = "creditsStart";
m_TempTimer = 0;
m_menuclick.play();
}
public function btnLvl2Callback(_arg1:Event){
StartOutro(5);
m_menuclick.play();
}
public function btnHighScoresCallback(_arg1:Event){
navigateToURL(new URLRequest("http://armorbot.com/mytable/?id=1444"), "_blank");
m_menuclick.play();
}
public function btnFreeCallback(_arg1:Event){
btn_Normal.visible = false;
btn_Free.visible = false;
m_Normal.gotoAndPlay("end");
m_Free.gotoAndPlay("end");
m_State = "levelSelectStart";
m_menuslide.play();
Main.continuous = false;
m_TempTimer = 0;
m_menuclick.play();
}
public function AddEffect(_arg1:int, _arg2:Number, _arg3:Number){
var _local4:MovieClip;
switch (_arg1){
case 1:
_local4 = new Guy1();
break;
case 2:
_local4 = new Guy2();
break;
case 3:
_local4 = new Guy3();
break;
case 4:
_local4 = new Guy4();
break;
case 5:
_local4 = new Guy5();
break;
case 6:
_local4 = new Guy6();
break;
default:
_local4 = new Guy7();
};
_local4.x = _arg2;
_local4.y = _arg3;
m_Effects.addChild(_local4);
}
public function btnInstructionsCallback(_arg1:Event){
btn_Dustin.visible = false;
btn_Newgrounds.visible = false;
btn_Armorgames.visible = false;
btn_Credits.visible = false;
btn_Play.visible = false;
btn_Instructions.visible = false;
btn_HighScores.visible = false;
m_Dustin.gotoAndPlay("end");
m_Newgrounds.gotoAndPlay("end");
m_Armorgames.gotoAndPlay("end");
m_Credits.gotoAndPlay("end");
m_Play.gotoAndPlay("end");
m_Instructions.gotoAndPlay("end");
m_HighScores.gotoAndPlay("end");
m_State = "instructionsStart";
m_menuslide.play();
gotoAndStop("end");
m_TempTimer = 0;
m_menuclick.play();
}
public function btnNormalCallback(_arg1:Event){
btn_Normal.visible = false;
btn_Free.visible = false;
m_Normal.gotoAndPlay("end");
m_Free.gotoAndPlay("end");
m_menuslide.play();
Main.m_Level = 4;
m_TempTimer = 0;
m_State = "levelSelectEnd";
Main.continuous = true;
m_TempTimer = 0;
m_menuclick.play();
}
public function UpdateEffects(){
var _local1:int;
var _local2:*;
_local1 = 0;
while (_local1 < m_Effects.numChildren) {
_local2 = m_Effects.getChildAt(_local1);
_local2.scaleX = (_local2.scaleX + 0.04);
_local2.scaleY = (_local2.scaleY + 0.04);
_local2.y = (_local2.y + 2);
_local2.alpha = (_local2.alpha - 0.11);
if (_local2.alpha < 0.01){
m_Effects.removeChildAt(_local1);
_local1--;
};
_local1++;
};
}
public static function GenericRollover(_arg1:Event){
m_menuhover.play();
}
}
}//package General
Section 22
//NumberString (General.NumberString)
package General {
import flash.display.*;
public class NumberString extends MovieClip {
var m_CharArr:Array;
public var m10:NumberMc;
public var m3:NumberMc;
public var m6:NumberMc;
public var m7:NumberMc;
public var m8:NumberMc;
public var m4:NumberMc;
public var m5:NumberMc;
public var m9:NumberMc;
public var m1:NumberMc;
public var m2:NumberMc;
public function NumberString(){
m_CharArr = [m1, m2, m3, m4, m5, m6, m7, m8, m9, m10];
}
public function SetNumber(_arg1:uint){
var _local2:String;
var _local3:int;
var _local4:String;
_local2 = _arg1.toString();
_local3 = 0;
while (_local3 < m_CharArr.length) {
_local4 = _local2.charAt(_local3);
if (_local4 != ""){
m_CharArr[_local3].gotoAndStop(("n" + _local4));
m_CharArr[_local3].visible = true;
} else {
m_CharArr[_local3].visible = false;
};
_local3++;
};
}
}
}//package General
Section 23
//Score (General.Score)
package General {
import flash.display.*;
public class Score extends MovieClip {
public const m_BonusTime:int = 150;
public var m_Misses:int;
public var m_BonusActive:Boolean;// = false
public var bonus:BonusMeter;
public var m_Score:int;
public var m_CharArr:Array;
public var m_BonusPos:int;// = 0
public var m_ScoreMul:int;// = 1
public var activeBorder:MovieClip;
public var m_Hits:int;
public var m_BonusCDown:int;// = 1
public function Score(){
var _local1:int;
var _local2:NumberMc;
m_BonusPos = 0;
m_BonusCDown = 1;
m_BonusActive = false;
m_ScoreMul = 1;
super();
m_CharArr = new Array();
_local1 = 0;
while (_local1 < 10) {
_local2 = new NumberMc();
m_CharArr[_local1] = _local2;
_local2.y = 30;
_local2.x = (96 + (_local1 * 10));
_local2.visible = false;
addChild(_local2);
_local1++;
};
m_Score = 0;
UpdateText();
bonus.activeMc.visible = false;
activeBorder.visible = false;
}
public function TakeScore(){
m_Score--;
m_Misses++;
if (!m_BonusActive){
m_BonusPos = (m_BonusPos - 3);
};
}
public function AddScore(){
m_Score = (m_Score + m_ScoreMul);
m_Hits++;
if (!m_BonusActive){
m_BonusPos++;
};
}
public function UpdateText(){
var _local1:String;
var _local2:int;
var _local3:String;
m_Score = Math.max(0, m_Score);
_local1 = m_Score.toString();
_local2 = 0;
while (_local2 < m_CharArr.length) {
_local3 = _local1.charAt(_local2);
if (_local3 != ""){
m_CharArr[_local2].gotoAndStop(("n" + _local3));
m_CharArr[_local2].visible = true;
} else {
m_CharArr[_local2].visible = false;
};
_local2++;
};
}
public function UpdateBonus(){
m_BonusPos = Math.max(0, m_BonusPos);
m_BonusPos = Math.min(10, m_BonusPos);
bonus.activeMc.visible = false;
activeBorder.visible = false;
if ((((m_BonusPos == 10)) && (Input.IsKeyPressed(32)))){
m_BonusActive = true;
m_BonusPos = 0;
m_BonusCDown = m_BonusTime;
};
if (m_BonusActive){
bonus.activeMc.visible = true;
activeBorder.visible = true;
m_ScoreMul = 3;
if (Main.m_Game.m_State == "input"){
m_BonusCDown--;
};
if (bonus.currentFrame != (int(((m_BonusCDown * 9) / m_BonusTime)) + 1)){
bonus.gotoAndStop((int(((m_BonusCDown * 9) / m_BonusTime)) + 1));
};
if (m_BonusCDown <= 0){
m_BonusActive = false;
m_ScoreMul = 1;
};
} else {
if (bonus.currentFrame != (m_BonusPos + 1)){
bonus.gotoAndStop((m_BonusPos + 1));
};
};
}
}
}//package General
Section 24
//ScoreSummary (General.ScoreSummary)
package General {
import flash.display.*;
import flash.events.*;
public class ScoreSummary extends MovieClip {
public var m_GotoMenu:ButtonMenu;
var GameEnd:Boolean;// = false
public var m_GotoMenuSm:ButtonMenu;
public var m_Next:SimpleButton;
public var m_Summary:MovieClip;
public var m_Goto2:MovieClip;
public var m_Goto3:MovieClip;
public var m_Win:MovieClip;
public function ScoreSummary(_arg1:Score){
var _local2:int;
GameEnd = false;
super();
m_Next.addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
m_Summary.scoreString.SetNumber(_arg1.m_Score);
m_Summary.hitsString.SetNumber(_arg1.m_Hits);
m_Summary.missesString.SetNumber(_arg1.m_Misses);
_local2 = int((((_arg1.m_Hits * 100) / ((_arg1.m_Hits * 100) + (_arg1.m_Misses * 100))) * 100));
if (_local2 > 9){
m_Summary.p.x = (m_Summary.p.x + 18);
};
if (_local2 > 99){
m_Summary.p.x = (m_Summary.p.x + 18);
};
m_Summary.accuracyString.SetNumber(_local2);
GameEnd = (((Main.m_Level == 6)) && (Main.continuous));
m_Win.visible = GameEnd;
if (GameEnd){
m_Win.gotoAndPlay(2);
} else {
m_Win.stop();
};
m_Summary.visible = !(GameEnd);
m_Next.visible = ((Main.continuous) && (!(GameEnd)));
m_GotoMenu.visible = !(Main.continuous);
m_GotoMenuSm.visible = ((Main.continuous) && (!(GameEnd)));
m_Goto2.visible = (((((Main.m_Level == 4)) && (Main.continuous))) && (!(GameEnd)));
m_Goto3.visible = (((((Main.m_Level == 5)) && (Main.continuous))) && (!(GameEnd)));
}
public function OnPress(_arg1:MouseEvent){
Main.m_Level++;
if (Main.m_Level < 7){
Main.SetMode("game");
};
}
public function Update(){
}
}
}//package General
Section 25
//Guy (Guys.Guy)
package Guys {
import flash.display.*;
import General.*;
import flash.media.*;
import flash.geom.*;
public class Guy extends MovieClip {
public var m_End:int;
public var m_Marker:GuyMarker;
public var m_Sequence:Array;
public var m_Sound:Sound;
public var wrong:MovieClip;
public var m_TimeOffset:int;
static var sndIncorrect:incorrect = new incorrect();
public function Guy(){
m_Marker = new GuyMarker();
m_Sequence = new Array();
scaleX = 0.5;
scaleY = 0.5;
stop();
}
private function FadeToBlack(){
var _local1:int;
var _local2:int;
var _local3:int;
_local1 = 25;
_local2 = transform.colorTransform.redOffset;
_local3 = Math.max(0, (_local2 - _local1));
if ((((transform.colorTransform.redOffset > 0)) && ((transform.colorTransform.greenOffset > 0)))){
transform.colorTransform = new ColorTransform(1, 1, 1, 1, _local3, _local3, _local3, 0);
} else {
if (transform.colorTransform.redOffset > 0){
transform.colorTransform = new ColorTransform(1, 1, 1, 1, _local3, 0, 0, 0);
};
};
}
public function PlaySound(_arg1:Number=1){
var _local2:SoundChannel;
_local2 = m_Sound.play();
_local2.soundTransform = new SoundTransform(_arg1);
}
public function AppendMove(_arg1:int){
m_Sequence.push(_arg1);
m_End = _arg1;
}
public function PreUpdate(){
FadeToBlack();
if (m_Marker.mc != null){
m_Marker.mc.gotoAndStop("up");
};
}
public function UpdateMarker(_arg1:int, _arg2:int):Boolean{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((!((currentFrame == 1))) && (!((currentFrame == totalFrames))))){
gotoAndStop((currentFrame + 1));
};
if (((!((m_Marker.mc == null))) && (Input.IsKeyDown(m_Marker.GetKeyCode())))){
m_Marker.mc.gotoAndStop("down");
} else {
if (m_Marker.mc != null){
m_Marker.mc.gotoAndStop("up");
};
};
_local3 = false;
_local4 = 0;
while (_local4 < m_Sequence.length) {
_local5 = (m_Sequence[_local4] - _arg1);
if (((!((m_Sequence[_local4] == 0))) && (Input.IsKeyPressed(m_Marker.GetKeyCode())))){
if ((((_local5 > -(_arg2))) && ((_local5 <= _arg2)))){
_local3 = true;
if (Math.abs(_local5) < 2){
PlaySound();
} else {
if (Math.abs(_local5) < _arg2){
PlaySound();
} else {
PlaySound();
};
};
Main.m_Game.m_Score.AddScore();
m_Sequence[_local4] = 0;
Main.m_Game.AddEffect(m_Marker.m_Index, x, y);
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0);
break;
};
} else {
if (((!((m_Sequence[_local4] == 0))) && ((_local5 <= (-(_arg2) * 0.7))))){
Main.m_Game.m_Score.m_Misses++;
wrong.gotoAndPlay(2);
m_Sequence[_local4] = 0;
};
};
_local4++;
};
if (((!(_local3)) && (Input.IsKeyPressed(m_Marker.GetKeyCode())))){
wrong.gotoAndPlay(2);
PlaySound(0.4);
PlayIncorrect();
Main.m_Game.m_Score.TakeScore();
};
if ((((m_Sequence.length == 0)) || ((_arg1 > (m_End + (_arg2 * 0.7)))))){
return (false);
};
return (true);
}
public function ResetSeq(){
m_Sequence = new Array();
}
function PlayIncorrect(){
var _local1:SoundChannel;
_local1 = sndIncorrect.play();
_local1.soundTransform = new SoundTransform(0.5);
}
public function Update(_arg1:int):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:int;
wrong.gotoAndStop(1);
_local2 = false;
_local3 = 0;
while (_local3 < m_Sequence.length) {
if ((((m_Sequence[_local3] >= _arg1)) && (((m_Sequence[_local3] - _arg1) < m_TimeOffset)))){
_local4 = (m_TimeOffset - (m_Sequence[_local3] - _arg1));
if ((((currentFrame < m_TimeOffset)) || ((Math.abs((_local4 - m_TimeOffset)) < Math.abs((currentFrame - m_TimeOffset)))))){
gotoAndPlay(_local4);
_local2 = true;
};
break;
};
_local3++;
};
if (currentFrame == totalFrames){
stop();
} else {
if (((!(_local2)) && (!((currentFrame == 1))))){
gotoAndStop((currentFrame + 1));
};
};
if (currentFrame == m_TimeOffset){
PlaySound();
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0);
};
if ((((m_Sequence.length == 0)) || ((_arg1 > m_Sequence[(m_Sequence.length - 1)])))){
return (false);
};
return (true);
}
}
}//package Guys
Section 26
//Guy1 (Guys.Guy1)
package Guys {
public dynamic class Guy1 extends Guy {
}
}//package Guys
Section 27
//Guy2 (Guys.Guy2)
package Guys {
public dynamic class Guy2 extends Guy {
}
}//package Guys
Section 28
//Guy3 (Guys.Guy3)
package Guys {
public dynamic class Guy3 extends Guy {
}
}//package Guys
Section 29
//Guy4 (Guys.Guy4)
package Guys {
public dynamic class Guy4 extends Guy {
}
}//package Guys
Section 30
//Guy5 (Guys.Guy5)
package Guys {
public dynamic class Guy5 extends Guy {
}
}//package Guys
Section 31
//Guy6 (Guys.Guy6)
package Guys {
public dynamic class Guy6 extends Guy {
}
}//package Guys
Section 32
//Guy7 (Guys.Guy7)
package Guys {
public dynamic class Guy7 extends Guy {
}
}//package Guys
Section 33
//GuyMarker (Guys.GuyMarker)
package Guys {
import flash.display.*;
public class GuyMarker extends MovieClip {
public var m_Index:int;
public var mc:MovieClip;
private static var KeyArr:Array;
public function GuyMarker(){
KeyArr = [0, 65, 83, 68, 70, 71, 72, 74, 75, 76];
}
public function GetKeyCode(){
return (KeyArr[m_Index]);
}
}
}//package Guys
Section 34
//Level (Levels.Level)
package Levels {
import flash.display.*;
import General.*;
public class Level {
var PatternArr1;
var PatternArr3;
var m_LevelMc:Sprite;
var m_Mode:String;
var GuyArr:Array;
var PatternArr2;
var m_Sequence:Array;
public var m_Speed:int;
public var PatternsPlayed:int;// = 0
public function Level(_arg1:int, _arg2:int){
var _local3:int;
var _local4:MovieClip;
var _local5:MovieClip;
GuyArr = [1, 2, 3, 4, 5, 6, 7];
PatternsPlayed = 0;
PatternArr1 = ["s-a-fff-", "s-a-fda-", "aaffssd-", "aadds-s-", "aaf-aad-", "fds-dsa-", "asd-sdf-", "aa-dd---", "aa-ddff-", "aa-dsfs-", "a-d-f-f-", "d-d-aaa-", "a-f-f-s-", "a-d-dff-", "dda-dda-", "ffffd-d-", "aaaas-s-", "ssssf-f-", "dddda-a-", "dffdffd-", "dffdffa-", "d-a-dda-", "d-s-ffa-", "d-a-sff-", "ffa-ffd-", "f-d-fsa-", "fffas-s-", "fff-daa-", "ssa-ssaa", "ssa-fff-", "s-d-sfd-", "s-d-ffa-", "dffdffd-", "ddf-ssa-", "s-a-dda-", "s-aas-ff", "d-ffs-aa", "sss-aaa-", "fff-ddd-"];
PatternArr2 = ["g-g-dfa-", "g-ggs-s-", "ssddg-g-", "ssddggg-", "asdfsdfg", "gfdsfdsa", "fffagffa", "f-a-ggga", "g-d-ggd-", "g-d-ggaa", "ssa-ggd-", "dggdgga-", "s-d-ggd-", "ggg-aaa-", "gafsddd-", "aag-aagg", "ddddgag-", "ss-sg-g-", "sss-gfg-", "g-a-gga-", "ggaag-a-", "g-d-gdd-", "ggddg-g-", "aaaaag--", "gd----dd", "s--g--s-", "s--g-gd", "f---gga-", "f---g-dd", "s-d--gs-", "s-d--ggg", "agagddd-", "ffffdgd-", "sd-dggs-", "sd-dagg-", "aassdfg-", "gdfsa-a-", "gdfsdaa-", "adsfdgg-", "asdfg-g-"];
PatternArr3 = ["s-d-shd-", "shdhffs-", "hhaagsg-", "ah-hfff-", "ah-hs-s-", "g-s-hhs-", "gga-hsh-", "asd-hgf-", "ahsgdff-", "gdhga-a-", "ds-shhh-", "f--h--h-", "f--ahha-", "d-d-ffh-", "f-a--shh", "s--f-hhh", "hhaas-s-", "hhaaggf-", "d-d-sgh-", "ah-sgdf-", "as-dfgh-", "sg-dfhh-", "aa---hh-", "s-s---gh", "h-a-g-d-", "h-a-ggdd", "dssaggh-", "aggdhhs-", "a--h--h-", "s--g--g-", "a-h-fsg-", "s-h-ffa-", "a------h", "ah-ah-f-", "ah-ahhaa", "f-f-f-fh", "a-a-aahs", "f-ffh-sa", "-s-shhaa", "-fffh-h-"];
super();
m_LevelMc = new Sprite();
Main.stageMc.addChild(m_LevelMc);
m_Speed = _arg2;
InitLevel(_arg1);
_local3 = 0;
while (_local3 < _arg1) {
_local5 = Game.m_Guys[GuyArr[_local3]];
_local5.y = 180;
_local5.x = ((((_local3 * 90) + 320) - ((Number(_arg1) / 2) * 90)) + 45);
_local5.stop();
m_LevelMc.addChild(_local5);
m_LevelMc.addChild(_local5.m_Marker);
_local5.m_Marker.x = _local5.x;
_local5.m_Marker.y = _local5.y;
_local3++;
};
_local4 = new borderMc();
_local4.x = 17.8;
_local4.y = 201.8;
m_LevelMc.addChild(_local4);
}
public function GetLevelMc():Sprite{
return (m_LevelMc);
}
public function Update(){
}
public function InitLevel(_arg1){
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:String;
var _local7:int;
_local2 = 1;
while (_local2 <= 7) {
Game.m_Guys[_local2].ResetSeq();
_local2++;
};
PatternsPlayed++;
_local3 = int((Math.random() * PatternArr1.length));
_local4 = PatternArr1;
if (_arg1 == 5){
_local4 = PatternArr2;
} else {
if (_arg1 == 6){
_local4 = PatternArr3;
};
};
_local5 = 0;
while (_local5 < _local4[_local3].length) {
_local6 = _local4[_local3].charAt(_local5);
_local7 = 0;
switch (_local6){
case "a":
case "A":
_local7 = 1;
break;
case "s":
case "S":
_local7 = 2;
break;
case "d":
case "D":
_local7 = 3;
break;
case "f":
case "F":
_local7 = 4;
break;
case "g":
case "G":
_local7 = 5;
break;
case "h":
case "H":
_local7 = 6;
break;
case "j":
case "J":
_local7 = 7;
break;
};
if (_local7 != 0){
Game.m_Guys[_local7].AppendMove(((m_Speed * (_local5 / 2)) + m_Speed));
};
_local5++;
};
}
}
}//package Levels
Section 35
//asdf_2 (Play_fla.asdf_2)
package Play_fla {
import flash.display.*;
public dynamic class asdf_2 extends MovieClip {
public function asdf_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Play_fla
Section 36
//bannerAGanimation_69 (Play_fla.bannerAGanimation_69)
package Play_fla {
import flash.display.*;
public dynamic class bannerAGanimation_69 extends MovieClip {
public function bannerAGanimation_69(){
addFrameScript(0, frame1, 38, frame39, 63, frame64);
}
function frame64(){
stop();
}
function frame1(){
stop();
}
function frame39(){
stop();
}
}
}//package Play_fla
Section 37
//bannerNGanimation_67 (Play_fla.bannerNGanimation_67)
package Play_fla {
import flash.display.*;
public dynamic class bannerNGanimation_67 extends MovieClip {
public function bannerNGanimation_67(){
addFrameScript(0, frame1, 38, frame39, 64, frame65);
}
function frame65(){
stop();
}
function frame1(){
stop();
}
function frame39(){
stop();
}
}
}//package Play_fla
Section 38
//bonussample_87 (Play_fla.bonussample_87)
package Play_fla {
import flash.display.*;
public dynamic class bonussample_87 extends MovieClip {
public function bonussample_87(){
addFrameScript(119, frame120);
}
function frame120(){
stop();
}
}
}//package Play_fla
Section 39
//creditsanimation_94 (Play_fla.creditsanimation_94)
package Play_fla {
import flash.display.*;
public dynamic class creditsanimation_94 extends MovieClip {
public function creditsanimation_94(){
addFrameScript(0, frame1, 34, frame35, 70, frame71);
}
function frame71(){
stop();
}
function frame1(){
stop();
}
function frame35(){
stop();
}
}
}//package Play_fla
Section 40
//endinganimation_135 (Play_fla.endinganimation_135)
package Play_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import General.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class endinganimation_135 extends MovieClip {
public var m_Summary3:MovieClip;
public var m_Summary2:MovieClip;
public var tPTotal:int;
public var tP3:int;
public var sndChStart:SoundChannel;
public var tP2:int;
public var m_InputBox:TextField;
public var tP1:int;
public var sndAppStart:Sound;
public var submitText:MovieClip;
public var sndChLoop:SoundChannel;
public var m_GotoMenuSm:ButtonMenu;
public var m_Next:ButtonNext;
public var sndAppLoop:Sound;
public var m_InputBoxOuter:MovieClip;
public var buttonSubmit:SimpleButton;
public var m_Summary1:MovieClip;
public var m_SummaryTotal:MovieClip;
public function endinganimation_135(){
addFrameScript(0, frame1, 69, frame70, 94, frame95, 96, frame97, 98, frame99, 100, frame101, 101, frame102, 102, frame103, 103, frame104, 104, frame105, 105, frame106, 106, frame107, 107, frame108, 108, frame109, 109, frame110, 110, frame111, 111, frame112, 112, frame113, 113, frame114, 114, frame115, 115, frame116, 116, frame117, 117, frame118, 118, frame119, 119, frame120, 120, frame121, 121, frame122, 122, frame123);
}
public function getScore(_arg1:String){
var _local2:String;
var _local3:int;
_local2 = "";
_local3 = 20;
while (_local3 < 26) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) + 9)));
_local3++;
};
return (_local2);
}
function frame70(){
sndAppStart = new applaudstart();
sndChStart = sndAppStart.play();
}
public function OnSubmit(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
navigateToURL(new URLRequest("http://armorbot.com/mytable/?id=1444"), "_blank");
buttonSubmit.visible = false;
submitText.alpha = 0.4;
_local2 = new URLVariables();
_local2.z = m_InputBox.text;
_local2.x = testClass.testFunction(((Main.StatArr[0].m_Score + Main.StatArr[1].m_Score) + Main.StatArr[2].m_Score));
_local2.c = 1444;
_local2.v = "AHVNDY";
_local3 = new URLRequest("http://armorbot.com/s_b");
_local3.method = "POST";
_local3.data = _local2;
sendToURL(_local3);
Main.SetMode("menu");
}
function frame95(){
sndAppLoop = new applaudloop();
sndChLoop = sndAppLoop.play(0, 100000);
sndChStart.stop();
stop();
m_Next.addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
}
function frame97(){
stop();
m_Next.addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
}
function frame102(){
sndChLoop.soundTransform = new SoundTransform(0.95);
}
function frame105(){
sndChLoop.soundTransform = new SoundTransform(0.8);
}
function frame106(){
sndChLoop.soundTransform = new SoundTransform(0.75);
}
function frame103(){
sndChLoop.soundTransform = new SoundTransform(0.9);
}
function frame108(){
sndChLoop.soundTransform = new SoundTransform(0.65);
}
function frame1(){
stop();
sndAppStart = new applaudstart();
sndChStart = new SoundChannel();
sndAppLoop = new applaudloop();
sndChLoop = new SoundChannel();
}
public function OnPress(_arg1:MouseEvent){
play();
}
function frame117(){
sndChLoop.soundTransform = new SoundTransform(0.25);
}
function frame115(){
sndChLoop.soundTransform = new SoundTransform(0.35);
}
function frame107(){
sndChLoop.soundTransform = new SoundTransform(0.7);
}
function frame109(){
sndChLoop.soundTransform = new SoundTransform(0.6);
}
function frame112(){
sndChLoop.soundTransform = new SoundTransform(0.5);
}
function frame114(){
sndChLoop.soundTransform = new SoundTransform(0.4);
}
function frame99(){
stop();
m_Next.addEventListener(MouseEvent.CLICK, OnPress, false, 0, true);
}
function frame120(){
sndChLoop.soundTransform = new SoundTransform(0.1);
}
function frame118(){
sndChLoop.soundTransform = new SoundTransform(0.2);
}
function frame110(){
sndChLoop.soundTransform = new SoundTransform(0.55);
}
function frame101(){
sndChLoop.soundTransform = new SoundTransform(1);
}
function frame121(){
sndChLoop.soundTransform = new SoundTransform(0.05);
}
function frame111(){
sndChLoop.soundTransform = new SoundTransform(0.55);
}
function frame116(){
sndChLoop.soundTransform = new SoundTransform(0.3);
}
function frame119(){
sndChLoop.soundTransform = new SoundTransform(0.15);
}
function frame113(){
sndChLoop.soundTransform = new SoundTransform(0.45);
}
function frame122(){
sndChLoop.stop();
}
function frame123(){
stop();
m_Summary1.scoreString.SetNumber(Main.StatArr[0].m_Score);
m_Summary1.hitsString.SetNumber(Main.StatArr[0].m_Hits);
m_Summary1.missesString.SetNumber(Main.StatArr[0].m_Misses);
tP1 = int((((Main.StatArr[0].m_Hits * 100) / ((Main.StatArr[0].m_Hits * 100) + (Main.StatArr[0].m_Misses * 100))) * 100));
if (tP1 > 9){
m_Summary1.p.x = (m_Summary1.p.x + 18);
};
if (tP1 > 99){
m_Summary1.p.x = (m_Summary1.p.x + 18);
};
m_Summary1.accuracyString.SetNumber(tP1);
m_Summary2.scoreString.SetNumber(Main.StatArr[1].m_Score);
m_Summary2.hitsString.SetNumber(Main.StatArr[1].m_Hits);
m_Summary2.missesString.SetNumber(Main.StatArr[1].m_Misses);
tP2 = int((((Main.StatArr[1].m_Hits * 100) / ((Main.StatArr[1].m_Hits * 100) + (Main.StatArr[1].m_Misses * 100))) * 100));
if (tP2 > 9){
m_Summary2.p.x = (m_Summary2.p.x + 18);
};
if (tP2 > 99){
m_Summary2.p.x = (m_Summary2.p.x + 18);
};
m_Summary2.accuracyString.SetNumber(tP2);
m_Summary3.scoreString.SetNumber(Main.StatArr[2].m_Score);
m_Summary3.hitsString.SetNumber(Main.StatArr[2].m_Hits);
m_Summary3.missesString.SetNumber(Main.StatArr[2].m_Misses);
tP3 = int((((Main.StatArr[2].m_Hits * 100) / ((Main.StatArr[2].m_Hits * 100) + (Main.StatArr[2].m_Misses * 100))) * 100));
if (tP3 > 9){
m_Summary3.p.x = (m_Summary3.p.x + 18);
};
if (tP3 > 99){
m_Summary3.p.x = (m_Summary3.p.x + 18);
};
m_Summary3.accuracyString.SetNumber(tP3);
m_SummaryTotal.scoreString.SetNumber(((Main.StatArr[0].m_Score + Main.StatArr[1].m_Score) + Main.StatArr[2].m_Score));
m_SummaryTotal.hitsString.SetNumber(((Main.StatArr[0].m_Hits + Main.StatArr[1].m_Hits) + Main.StatArr[2].m_Hits));
m_SummaryTotal.missesString.SetNumber(((Main.StatArr[0].m_Misses + Main.StatArr[1].m_Misses) + Main.StatArr[2].m_Misses));
tPTotal = int((((tP1 + tP2) + tP3) / 3));
if (tPTotal > 9){
m_SummaryTotal.p.x = (m_SummaryTotal.p.x + 18);
};
if (tPTotal > 99){
m_SummaryTotal.p.x = (m_SummaryTotal.p.x + 18);
};
m_SummaryTotal.accuracyString.SetNumber(tPTotal);
buttonSubmit.addEventListener(MouseEvent.CLICK, OnSubmit, false, 0, true);
}
function frame104(){
sndChLoop.soundTransform = new SoundTransform(0.85);
}
}
}//package Play_fla
Section 41
//incorrectsymbol_111 (Play_fla.incorrectsymbol_111)
package Play_fla {
import flash.display.*;
public dynamic class incorrectsymbol_111 extends MovieClip {
public function incorrectsymbol_111(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package Play_fla
Section 42
//instructionsfull_71 (Play_fla.instructionsfull_71)
package Play_fla {
import flash.display.*;
public dynamic class instructionsfull_71 extends MovieClip {
public function instructionsfull_71(){
addFrameScript(0, frame1, 21, frame22, 111, frame112, 125, frame126, 134, frame135, 154, frame155, 174, frame175, 194, frame195, 215, frame216, 223, frame224, 232, frame233, 237, frame238, 244, frame245, 251, frame252, 258, frame259, 266, frame267, 276, frame277);
}
function frame155(){
Main.m_Menu.AddEffect(4, 457, 167);
}
function frame277(){
stop();
}
function frame1(){
stop();
}
function frame22(){
stop();
}
function frame224(){
stop();
}
function frame216(){
stop();
}
function frame175(){
Main.m_Menu.AddEffect(2, 290, 170);
}
function frame195(){
Main.m_Menu.AddEffect(3, 374, 169);
}
function frame238(){
stop();
}
function frame112(){
stop();
}
function frame245(){
stop();
}
function frame233(){
stop();
}
function frame126(){
stop();
}
function frame252(){
stop();
}
function frame259(){
stop();
}
function frame135(){
Main.m_Menu.AddEffect(1, 198, 169);
}
function frame267(){
stop();
}
}
}//package Play_fla
Section 43
//loadED_222 (Play_fla.loadED_222)
package Play_fla {
import flash.display.*;
public dynamic class loadED_222 extends MovieClip {
public function loadED_222(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package Play_fla
Section 44
//menuafreeplay_66 (Play_fla.menuafreeplay_66)
package Play_fla {
import flash.display.*;
public dynamic class menuafreeplay_66 extends MovieClip {
public function menuafreeplay_66(){
addFrameScript(0, frame1, 24, frame25, 61, frame62);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame62(){
stop();
}
}
}//package Play_fla
Section 45
//menucredits_93 (Play_fla.menucredits_93)
package Play_fla {
import flash.display.*;
public dynamic class menucredits_93 extends MovieClip {
public function menucredits_93(){
addFrameScript(0, frame1, 25, frame26, 51, frame52);
}
function frame1(){
stop();
}
function frame26(){
stop();
}
function frame52(){
stop();
}
}
}//package Play_fla
Section 46
//menuhighscore_61 (Play_fla.menuhighscore_61)
package Play_fla {
import flash.display.*;
public dynamic class menuhighscore_61 extends MovieClip {
public function menuhighscore_61(){
addFrameScript(0, frame1, 25, frame26, 62, frame63);
}
function frame1(){
stop();
}
function frame26(){
stop();
}
function frame63(){
stop();
}
}
}//package Play_fla
Section 47
//menuinstructions_62 (Play_fla.menuinstructions_62)
package Play_fla {
import flash.display.*;
public dynamic class menuinstructions_62 extends MovieClip {
public function menuinstructions_62(){
addFrameScript(0, frame1, 27, frame28, 61, frame62);
}
function frame1(){
stop();
}
function frame28(){
stop();
}
function frame62(){
stop();
}
}
}//package Play_fla
Section 48
//menulevel1_56 (Play_fla.menulevel1_56)
package Play_fla {
import flash.display.*;
public dynamic class menulevel1_56 extends MovieClip {
public function menulevel1_56(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
stop();
}
function frame29(){
stop();
}
}
}//package Play_fla
Section 49
//menulevel2_55 (Play_fla.menulevel2_55)
package Play_fla {
import flash.display.*;
public dynamic class menulevel2_55 extends MovieClip {
public function menulevel2_55(){
addFrameScript(0, frame1, 27, frame28);
}
function frame1(){
stop();
}
function frame28(){
stop();
}
}
}//package Play_fla
Section 50
//menulevel3_53 (Play_fla.menulevel3_53)
package Play_fla {
import flash.display.*;
public dynamic class menulevel3_53 extends MovieClip {
public function menulevel3_53(){
addFrameScript(0, frame1, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
}
}//package Play_fla
Section 51
//menunormalmode_65 (Play_fla.menunormalmode_65)
package Play_fla {
import flash.display.*;
public dynamic class menunormalmode_65 extends MovieClip {
public function menunormalmode_65(){
addFrameScript(0, frame1, 28, frame29, 60, frame61);
}
function frame1(){
stop();
}
function frame29(){
stop();
}
function frame61(){
stop();
}
}
}//package Play_fla
Section 52
//menuplay_63 (Play_fla.menuplay_63)
package Play_fla {
import flash.display.*;
public dynamic class menuplay_63 extends MovieClip {
public function menuplay_63(){
addFrameScript(0, frame1, 20, frame21, 50, frame51);
}
function frame1(){
stop();
}
function frame21(){
stop();
}
function frame51(){
stop();
}
}
}//package Play_fla
Section 53
//ng_Drummer_152 (Play_fla.ng_Drummer_152)
package Play_fla {
import flash.display.*;
public dynamic class ng_Drummer_152 extends MovieClip {
public function ng_Drummer_152(){
addFrameScript(140, frame141);
}
function frame141(){
gotoAndPlay("bb");
}
}
}//package Play_fla
Section 54
//ng_preloader_218 (Play_fla.ng_preloader_218)
package Play_fla {
import flash.display.*;
public dynamic class ng_preloader_218 extends MovieClip {
public function ng_preloader_218(){
addFrameScript(129, frame130, 143, frame144);
}
function frame144(){
stop();
}
function frame130(){
stop();
}
}
}//package Play_fla
Section 55
//sndClapMc_76 (Play_fla.sndClapMc_76)
package Play_fla {
import flash.display.*;
public dynamic class sndClapMc_76 extends MovieClip {
public var tSound:Guy1Sound;
public function sndClapMc_76(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
tSound = new Guy1Sound();
tSound.play();
}
}
}//package Play_fla
Section 56
//sndDrum2Mc_79 (Play_fla.sndDrum2Mc_79)
package Play_fla {
import flash.display.*;
public dynamic class sndDrum2Mc_79 extends MovieClip {
public var tSound:Guy3Sound;
public function sndDrum2Mc_79(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
tSound = new Guy3Sound();
tSound.play();
}
}
}//package Play_fla
Section 57
//sndJumpMc_78 (Play_fla.sndJumpMc_78)
package Play_fla {
import flash.display.*;
public dynamic class sndJumpMc_78 extends MovieClip {
public var tSound:Guy2Sound;
public function sndJumpMc_78(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
tSound = new Guy2Sound();
tSound.play();
}
}
}//package Play_fla
Section 58
//sndPunchMc_77 (Play_fla.sndPunchMc_77)
package Play_fla {
import flash.display.*;
public dynamic class sndPunchMc_77 extends MovieClip {
public var tSound:Guy4Sound;
public function sndPunchMc_77(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
stop();
}
function frame1(){
tSound = new Guy4Sound();
tSound.play();
}
}
}//package Play_fla
Section 59
//SummaryText_132 (Play_fla.SummaryText_132)
package Play_fla {
import flash.display.*;
import General.*;
public dynamic class SummaryText_132 extends MovieClip {
public var scoreString:NumberString;
public var missesString:NumberString;
public var accuracyString:NumberString;
public var p:MovieClip;
public var hitsString:NumberString;
}
}//package Play_fla
Section 60
//Symbol1_3 (Play_fla.Symbol1_3)
package Play_fla {
import flash.display.*;
public dynamic class Symbol1_3 extends MovieClip {
public function Symbol1_3(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Play_fla
Section 61
//titleanimationend_99 (Play_fla.titleanimationend_99)
package Play_fla {
import flash.display.*;
public dynamic class titleanimationend_99 extends MovieClip {
public function titleanimationend_99(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package Play_fla
Section 62
//titleanimationstart_97 (Play_fla.titleanimationstart_97)
package Play_fla {
import flash.display.*;
public dynamic class titleanimationstart_97 extends MovieClip {
public var m_menuplaythegame:menuplaythegame;
public function titleanimationstart_97(){
addFrameScript(14, frame15);
}
function frame15(){
m_menuplaythegame = new menuplaythegame();
m_menuplaythegame.play();
}
}
}//package Play_fla
Section 63
//www_59 (Play_fla.www_59)
package Play_fla {
import flash.display.*;
public dynamic class www_59 extends MovieClip {
public function www_59(){
addFrameScript(0, frame1, 39, frame40, 75, frame76);
}
function frame76(){
stop();
}
function frame1(){
stop();
}
function frame40(){
stop();
}
}
}//package Play_fla
Section 64
//applaudloop (applaudloop)
package {
import flash.media.*;
public dynamic class applaudloop extends Sound {
}
}//package
Section 65
//applaudstart (applaudstart)
package {
import flash.media.*;
public dynamic class applaudstart extends Sound {
}
}//package
Section 66
//arrow (arrow)
package {
import flash.display.*;
public dynamic class arrow extends MovieClip {
}
}//package
Section 67
//BonusMeter (BonusMeter)
package {
import flash.display.*;
public dynamic class BonusMeter extends MovieClip {
public var activeMc:MovieClip;
}
}//package
Section 68
//borderMc (borderMc)
package {
import flash.display.*;
public dynamic class borderMc extends MovieClip {
public function borderMc(){
addFrameScript(35, frame36);
}
function frame36(){
gotoAndPlay("loop");
}
}
}//package
Section 69
//ClickSound (ClickSound)
package {
import flash.media.*;
public dynamic class ClickSound extends Sound {
}
}//package
Section 70
//ClickSound2 (ClickSound2)
package {
import flash.media.*;
public dynamic class ClickSound2 extends Sound {
}
}//package
Section 71
//countdown1 (countdown1)
package {
import flash.display.*;
public dynamic class countdown1 extends MovieClip {
public function countdown1(){
addFrameScript(9, frame10);
}
function frame10(){
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 72
//countdown2 (countdown2)
package {
import flash.display.*;
public dynamic class countdown2 extends MovieClip {
public function countdown2(){
addFrameScript(9, frame10);
}
function frame10(){
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 73
//countdown3 (countdown3)
package {
import flash.display.*;
public dynamic class countdown3 extends MovieClip {
public function countdown3(){
addFrameScript(9, frame10);
}
function frame10(){
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 74
//countdown4 (countdown4)
package {
import flash.display.*;
public dynamic class countdown4 extends MovieClip {
public function countdown4(){
addFrameScript(9, frame10);
}
function frame10(){
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 75
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 76
//Guy1Sound (Guy1Sound)
package {
import flash.media.*;
public dynamic class Guy1Sound extends Sound {
}
}//package
Section 77
//Guy2Sound (Guy2Sound)
package {
import flash.media.*;
public dynamic class Guy2Sound extends Sound {
}
}//package
Section 78
//Guy3Sound (Guy3Sound)
package {
import flash.media.*;
public dynamic class Guy3Sound extends Sound {
}
}//package
Section 79
//Guy4Sound (Guy4Sound)
package {
import flash.media.*;
public dynamic class Guy4Sound extends Sound {
}
}//package
Section 80
//Guy5Sound (Guy5Sound)
package {
import flash.media.*;
public dynamic class Guy5Sound extends Sound {
}
}//package
Section 81
//Guy6Sound (Guy6Sound)
package {
import flash.media.*;
public dynamic class Guy6Sound extends Sound {
}
}//package
Section 82
//Guy7Sound (Guy7Sound)
package {
import flash.media.*;
public dynamic class Guy7Sound extends Sound {
}
}//package
Section 83
//incorrect (incorrect)
package {
import flash.media.*;
public dynamic class incorrect extends Sound {
}
}//package
Section 84
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import General.*;
import flash.net.*;
public class Main extends MovieClip {
private var m_Input:Input;
private var m_FocusManager:FocusManager;
public var silenceStream:MovieClip;
public static var m_Game:Game;
public static var m_Loader:NGAGLoader;
public static var StatArr:Array = new Array();
public static var continuous:Boolean = false;
public static var m_Menu:Menu;
public static var m_Level:int = 4;
public static var m_Summary:ScoreSummary;
public static var m_Speed:int = 20;
public static var stageMc:MovieClip;
public static var m_State:String;
public function Main(){
addFrameScript(0, frame1, 2, frame3);
m_State = "loader";
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
stageMc = this;
m_Input = new Input();
m_Loader = new NGAGLoader();
m_Loader.x = 48.2;
m_Loader.y = 21.9;
m_Loader.btnNG.addEventListener(MouseEvent.CLICK, btnNewgroundsCallback, false, 0, true);
m_Loader.btnAG.addEventListener(MouseEvent.CLICK, btnArmorgamesCallback, false, 0, true);
addChild(m_Loader);
m_FocusManager = new FocusManager(this);
silenceStream.stop();
}
public function btnNewgroundsCallback(_arg1:Event){
navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank");
}
function UpdateLoader(){
var _local1:Number;
_local1 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
if (_local1 < 1){
m_Loader.bar.gotoAndStop(int((_local1 * 100)));
} else {
if (m_Loader.bar.currentFrame < 101){
m_Loader.bar.gotoAndPlay(102);
};
};
if (m_Loader.bar.currentFrame > 143){
stage.quality = "medium";
SetMode("menu");
gotoAndPlay(2);
};
}
function frame3(){
stop();
}
function frame1(){
stop();
}
public function btnArmorgamesCallback(_arg1:Event){
navigateToURL(new URLRequest("http://www.armorgames.com"), "_blank");
}
public function update(_arg1:Event){
if (m_State == "game"){
m_FocusManager.setFocus(stageMc.stage);
};
switch (m_State){
case "loader":
UpdateLoader();
break;
case "menu":
if (m_Menu == null){
m_Menu = new Menu();
stageMc.addChild(m_Menu);
};
m_Menu.Update();
break;
case "game":
if (m_Game == null){
m_Game = new Game(m_Level, m_Speed);
};
m_Game.Update();
break;
case "summary":
m_Summary.Update();
break;
default:
m_State = "menu";
break;
};
Input.Update();
}
public static function SetMode(_arg1:String){
var _local2:MovieClip;
_local2 = stageMc.silenceStream;
while (stageMc.numChildren > 0) {
stageMc.removeChildAt(0);
};
stageMc.addChild(_local2);
_local2.stop();
m_Summary = null;
if (_arg1 == "summary"){
if (continuous){
if (m_Game.m_NumGuys == 4){
StatArr[0] = m_Game.m_Score;
} else {
if (m_Game.m_NumGuys == 5){
StatArr[1] = m_Game.m_Score;
} else {
if (m_Game.m_NumGuys == 6){
StatArr[2] = m_Game.m_Score;
};
};
};
};
m_Summary = new ScoreSummary(m_Game.m_Score);
stageMc.addChild(m_Summary);
};
m_Menu = null;
m_Game = null;
m_State = _arg1;
}
}
}//package
Section 85
//menuclick (menuclick)
package {
import flash.media.*;
public dynamic class menuclick extends Sound {
}
}//package
Section 86
//menuhover (menuhover)
package {
import flash.media.*;
public dynamic class menuhover extends Sound {
}
}//package
Section 87
//menuplaythegame (menuplaythegame)
package {
import flash.media.*;
public dynamic class menuplaythegame extends Sound {
}
}//package
Section 88
//menuslide (menuslide)
package {
import flash.media.*;
public dynamic class menuslide extends Sound {
}
}//package
Section 89
//Metronome (Metronome)
package {
import flash.display.*;
public dynamic class Metronome extends MovieClip {
public var m_Stick:MovieClip;
public var m_Flash:MovieClip;
}
}//package
Section 90
//NGAGLoader (NGAGLoader)
package {
import flash.display.*;
public dynamic class NGAGLoader extends MovieClip {
public var bar:MovieClip;
public var btnNG:SimpleButton;
public var btnAG:SimpleButton;
}
}//package
Section 91
//NumberMc (NumberMc)
package {
import flash.display.*;
public dynamic class NumberMc extends MovieClip {
}
}//package
Section 92
//Score (Score)
package {
import General.*;
public dynamic class Score extends Score {
}
}//package
Section 93
//speedupMc (speedupMc)
package {
import flash.display.*;
public dynamic class speedupMc extends MovieClip {
public function speedupMc(){
addFrameScript(20, frame21);
}
function frame21(){
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 94
//testClass (testClass)
package {
import flash.utils.*;
import flash.net.*;
public class testClass {
private static function rand(_arg1:int):int{
return (int((Math.random() * _arg1)));
}
public static function decodeStr8bytes(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_arg1 = (("PIE" + _arg1) + "PIE");
_arg1 = fr(_arg1, "%", "D", undefined);
_arg1 = fr(_arg1, "$", "D", undefined);
_arg1 = fr(_arg1, "#", "D", undefined);
_arg1 = fr(_arg1, "@", "D", undefined);
_arg1 = fr(_arg1, "PIED", "", undefined);
_arg1 = fr(_arg1, "DPIE", "", undefined);
_local2 = _arg1.split("D");
_local3 = "";
_local4 = 0;
_local5 = _local2.length;
while (_local4 < _local5) {
_local3 = (_local3 + String(String.fromCharCode(_local2[_local4])));
_local4++;
};
return (_local3);
}
public static function decodeNum(_arg1){
var _local2:*;
var _local3:*;
_local2 = ["aZ", "Zy", "Zx", "zH", "jY", "uH", "Ah", "Xh", "hO", "Ub", "Bu", "Cb", "Qc", "Pc", "Pe", "Ei", "Ie", "Ef", "Fk", "kG", "Kg", "Jl", "Lm", "Mn", "No", "Np", "Qp", "Rs", "St", "Sw"];
_arg1 = String(_arg1);
_arg1 = _arg1.split("Dd");
_arg1 = _arg1[0];
_arg1 = fr(_arg1, _local2[0], "9", undefined);
_arg1 = fr(_arg1, _local2[1], "9", undefined);
_arg1 = fr(_arg1, _local2[2], "9", undefined);
_arg1 = fr(_arg1, _local2[3], "8", undefined);
_arg1 = fr(_arg1, _local2[4], "8", undefined);
_arg1 = fr(_arg1, _local2[5], "8", undefined);
_arg1 = fr(_arg1, _local2[6], "7", undefined);
_arg1 = fr(_arg1, _local2[7], "7", undefined);
_arg1 = fr(_arg1, _local2[8], "7", undefined);
_arg1 = fr(_arg1, _local2[9], "6", undefined);
_arg1 = fr(_arg1, _local2[10], "6", undefined);
_arg1 = fr(_arg1, _local2[11], "6", undefined);
_arg1 = fr(_arg1, _local2[12], "5", undefined);
_arg1 = fr(_arg1, _local2[13], "5", undefined);
_arg1 = fr(_arg1, _local2[14], "5", undefined);
_arg1 = fr(_arg1, _local2[15], "4", undefined);
_arg1 = fr(_arg1, _local2[16], "4", undefined);
_arg1 = fr(_arg1, _local2[17], "4", undefined);
_arg1 = fr(_arg1, _local2[18], "3", undefined);
_arg1 = fr(_arg1, _local2[19], "3", undefined);
_arg1 = fr(_arg1, _local2[20], "3", undefined);
_arg1 = fr(_arg1, _local2[21], "2", undefined);
_arg1 = fr(_arg1, _local2[22], "2", undefined);
_arg1 = fr(_arg1, _local2[23], "2", undefined);
_arg1 = fr(_arg1, _local2[24], "1", undefined);
_arg1 = fr(_arg1, _local2[25], "1", undefined);
_arg1 = fr(_arg1, _local2[26], "1", undefined);
_arg1 = fr(_arg1, _local2[27], "0", undefined);
_arg1 = fr(_arg1, _local2[28], "0", undefined);
_arg1 = fr(_arg1, _local2[29], "0", undefined);
_local3 = Number(_arg1);
return (_local3);
}
public static function testFunction(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
_local2 = getTimer();
_local3 = ["aZ", "Zy", "Zx"];
_local4 = ["zH", "jY", "uH"];
_local5 = ["Ah", "Xh", "hO"];
_local6 = ["Ub", "Bu", "Cb"];
_local7 = ["Qc", "Pc", "Pe"];
_local8 = ["Ei", "Ie", "Ef"];
_local9 = ["Fk", "kG", "Kg"];
_local10 = ["Jl", "Lm", "Mn"];
_local11 = ["No", "Np", "Qp"];
_local12 = ["Rs", "St", "Sw"];
_local13 = rand(3);
_arg1 = String(_arg1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "9", _local3[rand(3)], 1);
_arg1 = fr(_arg1, "8", _local4[rand(3)], 1);
_arg1 = fr(_arg1, "8", _local4[rand(3)], 1);
_arg1 = fr(_arg1, "8", _local4[rand(3)], 1);
_arg1 = fr(_arg1, "8", _local4[rand(3)], 1);
_arg1 = fr(_arg1, "8", _local4[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "7", _local5[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
_arg1 = fr(_arg1, "6", _local6[rand(3)], 1);
if (_local13 == 1){
_arg1 = fr(_arg1, "5", _local7[0], undefined);
} else {
_arg1 = fr(_arg1, "5", _local7[rand(3)], undefined);
};
_arg1 = fr(_arg1, "4", _local8[rand(3)], undefined);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "3", _local9[rand(3)], 1);
_arg1 = fr(_arg1, "2", _local10[rand(3)], undefined);
_arg1 = fr(_arg1, "1", _local11[rand(3)], undefined);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_arg1 = fr(_arg1, "0", _local12[rand(3)], 1);
_local14 = (getTimer() - _local2);
_arg1 = ((_arg1 + "Dd") + _local14);
return (_arg1);
}
private static function fr(_arg1, _arg2, _arg3, _arg4){
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = _arg1;
if (typeof(_arg2) !== "string"){
if (_arg3 === undefined){
_arg3 = [""];
} else {
if (typeof(_arg3) === "string"){
_arg3 = [_arg3];
};
};
} else {
_arg2 = [_arg2];
_arg3 = [_arg3];
};
_local8 = _arg2.length;
_local9 = 0;
_local10 = 0;
while (_local9 < _local8) {
while ((_local7 = _local5.indexOf(_arg2[_local9])) !== -1) {
if (((!((_arg4 === undefined))) && ((_local10 >= _arg4)))){
break;
};
_local6 = new Array(_local5.substring(0, _local7), _local5.substr(_local7, _arg2[_local9].length), _local5.substr((_local7 + _arg2[_local9].length)));
_local6[1] = ((_arg3[_local9])===undefined) ? "" : _arg3[_local9];
_local5 = ((_local6[0] + _local6[1]) + _local6[2]);
_local10++;
};
_local9++;
_local10 = 0;
};
return (_local5);
}
public static function encodeStr8bytes(_arg1){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = 0;
_local3 = _arg1.length;
_local4 = "%";
_local5 = ["%", "$", "#", "@"];
while (_local2 < _local3) {
_local4 = (_local4 + (_arg1.charCodeAt(_local2) + _local5[rand(_local5.length)]));
_local2++;
};
return (_local4);
}
}
}//package
Section 95
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 96
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package