Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 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 fl.core.*;
import flash.events.*;
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 fl.core.*;
import flash.events.*;
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 fl.core.*;
import flash.events.*;
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
//instruct2_29 (Kaichoustandalone_fla.instruct2_29)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class instruct2_29 extends MovieClip {
public var num0:MovieClip;
public var num1:MovieClip;
public var juicebar:MovieClip;
}
}//package Kaichoustandalone_fla
Section 16
//instructions_25 (Kaichoustandalone_fla.instructions_25)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class instructions_25 extends MovieClip {
public function instructions_25(){
addFrameScript(0, frame1, 14, frame15, 29, frame30, 44, frame45);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame30(){
stop();
}
function frame45(){
gotoAndStop(1);
}
}
}//package Kaichoustandalone_fla
Section 17
//intro_69 (Kaichoustandalone_fla.intro_69)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class intro_69 extends MovieClip {
public var varsound:vs;
public function intro_69(){
addFrameScript(0, frame1);
}
function frame1(){
varsound = new vs();
varsound.play();
}
}
}//package Kaichoustandalone_fla
Section 18
//loader_1 (Kaichoustandalone_fla.loader_1)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class loader_1 extends MovieClip {
public function loader_1(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 19
//MainTimeline (Kaichoustandalone_fla.MainTimeline)
package Kaichoustandalone_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var lastKillTime:Number;
public var txts:Array;
public var game:MovieClip;
public var loader:Loader;
public var maxRad:int;
public var currents:Array;
public var nfive:note5;
public var scores:hiscores;
public var bestCombo:int;
public var bar:BitmapData;
public var blackdata:BitmapData;
public var pressed:btnpress;
public var btime:int;
public var ship:player;
public var prep:int;
public var speed:int;
public var hurtsound:hurt;
public var dspeed:Number;
public var nseven:note7;
public var charging:Boolean;
public var t:int;
public var pauseMenu:pausemen;
public var screenRec:Rectangle;
public var deathanim:death;
public var div:int;
public var nfour:note4;
public var atan2:Function;
public var score:int;
public var combos:Array;
public var trans:blip;
public var particles:Array;
public var savedata;
public var mainMenu:menu;
public var particlesHolder:Sprite;
public var bulletsHolder:Sprite;
public var kills:int;
public var sin:Function;
public var neight:note8;
public var circlesNum;
public var creds:credits;
public var loadermc:MovieClip;
public var hit2:hitbeat2;
public var fps:FPS;
public var pspawn:playerspawn;
public var deathSound:deathtune;
public var fademe:fade;
public var stageW:int;
public var ballsHolder:Sprite;
public var barBitmap:Bitmap;
public var stageH:int;
public var sqrt:Function;
public var deathTimer;
public var helpS:help;
public var ntwo:note2;
public var gui:GUI;
public var count:int;
public var flower1:flowerSelector;
public var flower2:flowerSelector;
public var none:note1;
public var timer:int;
public var soundOn:Boolean;
public var titleS:titleScreen;
public var maxBalls:int;
public var frameState:String;
public var juice:int;
public var sureBox:surebox;
public var flowers:Array;
public var dropCount:int;
public var linesHolder:Sprite;
public var combo:int;
public var txtsHolder:Sprite;
public var currentCombo:Shape;
public var hit:hitbeat;
public var timer1:int;
public var lastScore:int;
public var mySpectrum:ByteArray;
public var juiceCount:int;
public var cos:Function;
public var menuNum:int;
public var circles:Object;
public var logo:MovieClip;
public var nsix:note6;
public var bestMulti:int;
public var downKeys;
public var bullets:Array;
public var gamePaused:Boolean;
public var logo1:MovieClip;
public var flowerHolder:Sprite;
public var gameOver:Gameover;
public var nthree:note3;
public var PI:Number;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 17, frame18, 18, frame19, 19, frame20);
}
public function MouseUp(_arg1:MouseEvent):void{
if ((((frameState == "game")) && (!(gamePaused)))){
charging = false;
newBullet(ship.x, ship.y, ship.powerlevel.currentFrame);
ship.powerlevel.gotoAndStop(1);
};
}
public function MouseMove(_arg1:MouseEvent):void{
if (frameState == "menu"){
if (flower1.currentFrame >= 50){
if ((((((((stage.mouseX > 220)) && ((stage.mouseX < 420)))) && ((stage.mouseY > 100)))) && ((stage.mouseY < 350)))){
if (stage.mouseY > 335){
mainMenu.gotoAndStop(55);
flower1.gotoAndStop(55);
flower2.gotoAndStop(55);
if (menuNum != 6){
trans.play();
};
menuNum = 6;
} else {
if (stage.mouseY > 285){
mainMenu.gotoAndStop(54);
flower1.gotoAndStop(54);
flower2.gotoAndStop(54);
if (menuNum != 5){
trans.play();
};
menuNum = 5;
} else {
if (stage.mouseY > 240){
mainMenu.gotoAndStop(53);
flower1.gotoAndStop(53);
flower2.gotoAndStop(53);
if (menuNum != 4){
trans.play();
};
menuNum = 4;
} else {
if (stage.mouseY > 190){
mainMenu.gotoAndStop(52);
flower1.gotoAndStop(52);
flower2.gotoAndStop(52);
if (menuNum != 3){
trans.play();
};
menuNum = 3;
} else {
if (stage.mouseY > 150){
mainMenu.gotoAndStop(51);
flower1.gotoAndStop(51);
flower2.gotoAndStop(51);
if (menuNum != 2){
trans.play();
};
menuNum = 2;
} else {
mainMenu.gotoAndStop(50);
flower1.gotoAndStop(50);
flower2.gotoAndStop(50);
if (menuNum != 1){
trans.play();
};
menuNum = 1;
};
};
};
};
};
};
};
};
}
public function menuPress(_arg1:MouseEvent):void{
pressed.play();
_arg1.target.removeEventListener(MouseEvent.CLICK, menuPress);
removeChild(game);
game = new MovieClip();
addChild(game);
game.addChild(titleS);
game.addChild(flower1);
game.addChild(flower2);
game.addChild(mainMenu);
frameState = "menu";
menuNum = 1;
mainMenu.gotoAndPlay(25);
flower1.gotoAndPlay(15);
flower2.gotoAndPlay(15);
game.addChild(fademe);
fademe.gotoAndPlay(1);
stage.addEventListener(Event.ENTER_FRAME, checkMenuFrame);
}
public function newFlower(_arg1:int, _arg2:int):flower{
var _local3:flower;
_local3 = new flower();
_local3.s = ((Math.random() * 50) + 30);
_local3.x = _arg1;
_local3.y = _arg2;
_local3.width = 1;
_local3.height = 1;
_local3.t = 60;
flowerHolder.addChild(_local3);
(_local3.gotoAndStop(Math.floor((Math.random() * 9))) + 1);
flowers.push(_local3);
return (_local3);
}
public function newMultiTxt(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:multitxt;
if (_arg3 > bestMulti){
bestMulti = _arg3;
};
_local4 = new multitxt();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.mult.gotoAndStop((Math.floor((Math.random() * 4)) + 1));
_local4.mtxt.text = String(_arg3);
txts.push(_local4);
txtsHolder.addChild(_local4);
}
public function onComplete(_arg1:Event):void{
play();
}
public function addHiScore(_arg1:int):void{
var _local2:int;
_local2 = 1;
while (_local2 < 11) {
if ((((savedata.data[("name" + _local2)] == undefined)) || ((_arg1 > savedata.data[("score" + _local2)])))){
trace(("yea! score should be at " + _local2));
if (savedata.data[("name" + _local2)] != undefined){
shuffleDown((_local2 + 1));
};
scores[("name" + _local2)].gotoAndStop(2);
scores[("score" + _local2)].text = String(_arg1);
prep = _local2;
break;
};
_local2++;
};
}
public function newParticle(_arg1:int, _arg2:int, _arg3:int):void{
var i:int;
var p:particle;
var ang:Number;
var s:*;
var x = _arg1;
var y = _arg2;
var num = _arg3;
i = 0;
while (i < num) {
p = new particle();
p.x = x;
p.y = y;
p.width = ((Math.random() * 20) + 10);
p.height = p.width;
p.rotation = (Math.random() * 360);
p.t = ((Math.random() * 30) + 10);
p.gotoAndStop(Math.floor(((Math.random() * 5) + 1)));
ang = ((Math.random() * 360) * (Math.PI / 180));
s = ((Math.random() * 5) + 1);
p.xv = (Math.cos(ang) * s);
p.yv = (Math.sin(ang) * s);
p.dead = false;
particlesHolder.addChild(p);
p.handle = function (){
this.x = (this.x + this.xv);
this.y = (this.y + this.yv);
this.t--;
if (this.t <= 0){
this.dead = true;
};
};
particles.push(p);
i = (i + 1);
};
}
function frame18(){
stop();
timer = 0;
this.addEventListener(Event.ENTER_FRAME, updatelogo);
logo.addEventListener(MouseEvent.CLICK, getLink);
stage.showDefaultContextMenu = false;
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = (_arg1.target.bytesLoaded / _arg1.target.bytesTotal);
loadermc.gotoAndStop((Math.floor((_local2 * 10)) + 1));
}
public function quit():void{
stage.frameRate = 30;
gamePaused = false;
removeChild(game);
stage.removeEventListener(Event.ENTER_FRAME, update);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyup);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, MouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
}
public function checkExit(_arg1:MouseEvent):void{
pressed.play();
game.addChild(sureBox);
sureBox.nobtn.addEventListener(MouseEvent.CLICK, backToPause);
sureBox.yesbtn.addEventListener(MouseEvent.CLICK, resetMe);
}
public function toggleSound(_arg1:MouseEvent):void{
if (SoundMixer.soundTransform.volume == 1){
SoundMixer.soundTransform = new SoundTransform(0, 0);
pauseMenu.soundbtn.gotoAndStop(4);
} else {
SoundMixer.soundTransform = new SoundTransform(1, 0);
pauseMenu.soundbtn.gotoAndStop(2);
};
}
public function getLink(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.armorgames.com");
navigateToURL(_local2, "_blank");
}
public function checkSporeCollision(_arg1:spore):Boolean{
var _local2:Object;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
for (_local2 in circles) {
_local3 = (circles[_local2].tempx - _arg1.x);
_local4 = (circles[_local2].tempy - _arg1.y);
_local5 = ((_local3 * _local3) + (_local4 * _local4));
if (_local5 <= ((_arg1.r + circles[_local2].r) * (_arg1.r + circles[_local2].r))){
_local6 = (Math.floor((Math.random() * 2)) + 1);
if (_local6 == 1){
hit.play();
} else {
if (_local6 == 2){
hit2.play();
};
};
collisionReaction(_arg1, circles[_local2], _local3, _local4, sqrt(_local5));
circles[_local2].r0 = (circles[_local2].r0 - _arg1.r);
if (circles[_local2].r > circles[_local2].r0){
circles[_local2].r = circles[_local2].r0;
};
if (circles[_local2].r <= 15){
circles[_local2].dead = true;
circlesNum--;
_local7 = newFlower(circles[_local2].x, circles[_local2].y);
kills++;
_arg1.kills++;
if (_arg1.kills > 1){
newMultiTxt(_arg1.x, _arg1.y, _arg1.kills);
score = (score + (4000 * (_arg1.kills - 1)));
updateScore();
};
onKill(circles[_local2].x, circles[_local2].y, ((circles[_local2].lr * circles[_local2].lr) / 3), _local7);
} else {
circles[_local2].lr = circles[_local2].r;
circles[_local2].s.graphics.clear();
circles[_local2].s.graphics.beginBitmapFill(blackdata);
circles[_local2].s.graphics.drawCircle(0, 0, circles[_local2].r);
circles[_local2].s.graphics.endFill();
};
return (true);
};
};
return (false);
}
function frame3(){
loadermc.gotoAndPlay(2);
}
function frame20(){
stop();
stage.frameRate = 45;
game = new MovieClip();
addChild(game);
kills = 0;
gamePaused = false;
soundOn = true;
sqrt = Math.sqrt;
PI = Math.PI;
atan2 = Math.atan2;
sin = Math.sin;
cos = Math.cos;
circlesNum = 0;
deathTimer = 0;
downKeys = {};
count = 0;
speed = 6;
dspeed = (sqrt(((speed * speed) + (speed * speed))) / 2);
lastKillTime = 0;
combo = 0;
combos = new Array();
currents = new Array();
score = 0;
juice = 100;
juiceCount = 15;
dropCount = 0;
maxBalls = 3;
maxRad = 5;
lastScore = 0;
div = 10;
charging = false;
fps = new FPS(10);
gui = new GUI();
stageW = 640;
stageH = 480;
frameState = "title";
screenRec = new Rectangle(0, 0, stageW, stageH);
menuNum = 1;
none = new note1();
ntwo = new note2();
nthree = new note3();
nfour = new note4();
nfive = new note5();
nsix = new note6();
nseven = new note7();
neight = new note8();
hurtsound = new hurt();
deathSound = new deathtune();
pressed = new btnpress();
hit = new hitbeat();
hit2 = new hitbeat2();
trans = new blip();
mySpectrum = new ByteArray();
bar = new BitmapData(stageW, stageH, false);
barBitmap = new Bitmap(bar);
blackdata = new BitmapData(60, 60, false, 0);
titleS = new titleScreen();
pauseMenu = new pausemen();
sureBox = new surebox();
helpS = new help();
gameOver = new Gameover();
scores = new hiscores();
creds = new credits();
flower1 = new flowerSelector();
flower2 = new flowerSelector();
mainMenu = new menu();
mainMenu.x = 382;
mainMenu.y = 246;
flower1.x = 0xFF;
flower1.y = 123;
flower2.x = 386;
flower2.y = 123;
flower2.scaleX = -1;
fademe = new fade();
pspawn = new playerspawn();
deathanim = new death();
ship = new player();
t = 0;
btime = 2;
prep = 0;
savedata = SharedObject.getLocal("kaichou1");
game.addChild(titleS);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keydown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyup);
stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
stage.showDefaultContextMenu = false;
}
function frame19(){
stop();
timer1 = 0;
this.addEventListener(Event.ENTER_FRAME, updatelogo1);
logo1.addEventListener(MouseEvent.CLICK, getLink1);
stage.showDefaultContextMenu = false;
}
function frame1(){
loader = new Loader();
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
stage.showDefaultContextMenu = false;
}
public function checkCollisions(_arg1):void{
var _local2:Object;
var _local3:*;
var _local4:*;
var _local5:*;
for (_local2 in circles) {
if (circles[_local2] != _arg1){
_local3 = (circles[_local2].tempx - _arg1.tempx);
_local4 = (circles[_local2].tempy - _arg1.tempy);
_local5 = ((_local3 * _local3) + (_local4 * _local4));
if (_local5 <= ((_arg1.r + circles[_local2].r) * (_arg1.r + circles[_local2].r))){
collisionReaction(_arg1, circles[_local2], _local3, _local4, sqrt(_local5));
};
};
};
}
public function updatelogo1(_arg1:Event):void{
timer1++;
if (timer1 > 215){
this.removeEventListener(Event.ENTER_FRAME, updatelogo1);
logo1.removeEventListener(MouseEvent.CLICK, getLink1);
nextFrame();
};
}
public function newBullet(_arg1:int, _arg2:int, _arg3:int):void{
var b:spore;
var xd:int;
var yd:int;
var ang:Number;
var x = _arg1;
var y = _arg2;
var p = _arg3;
b = new spore();
b.x = x;
b.y = y;
b.width = (10 + (p / 2));
b.height = (10 + (p / 2));
b.r = (b.width / 2);
b.kills = 0;
xd = (stage.mouseX - x);
yd = (stage.mouseY - y);
ang = atan2(yd, xd);
b.rotation = (ang * (180 / PI));
b.xv = (cos(ang) * 15);
b.yv = (sin(ang) * 15);
b.dead = false;
bulletsHolder.addChild(b);
b.handle = function (){
this.x = (this.x + this.xv);
this.y = (this.y + this.yv);
if ((((this.x < 0)) || ((this.x > stageW)))){
this.xv = (this.xv * -1);
this.r = (this.r - 5);
this.width = (this.r * 2);
this.height = this.width;
newParticle(this.x, this.y, 6);
};
if ((((this.y < 0)) || ((this.y > stageH)))){
this.yv = (this.yv * -1);
this.r = (this.r - 5);
this.width = (this.r * 2);
this.height = this.width;
newParticle(this.x, this.y, 6);
};
if (this.r < 5){
this.dead = true;
};
};
bullets.push(b);
}
public function update(_arg1:Event):void{
var _local2:Object;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Object;
var _local9:Boolean;
if (deathTimer > 0){
deathTimer--;
if (deathTimer == 0){
endGame();
};
};
if (!gamePaused){
if ((((downKeys.key37 == true)) || ((downKeys.key65 == true)))){
if (ship.x > (ship.width / 2)){
if ((((downKeys.key38 == true)) || ((downKeys.key87 == true)))){
if (ship.y > (ship.height / 2)){
ship.y = (ship.y - dspeed);
ship.x = (ship.x - dspeed);
} else {
ship.x = (ship.x - speed);
ship.y = (ship.height / 2);
};
} else {
if ((((downKeys.key40 == true)) || ((downKeys.key83 == true)))){
if (ship.y < (stageH - (ship.height / 2))){
ship.y = (ship.y + dspeed);
ship.x = (ship.x - speed);
} else {
ship.y = (stageH - (ship.height / 2));
ship.x = (ship.x - speed);
};
} else {
ship.x = (ship.x - speed);
};
};
} else {
ship.x = (ship.width / 2);
};
} else {
if ((((downKeys.key39 == true)) || ((downKeys.key68 == true)))){
if (ship.x < (stageW - (ship.width / 2))){
if ((((downKeys.key38 == true)) || ((downKeys.key87 == true)))){
if (ship.y > (ship.height / 2)){
ship.y = (ship.y - dspeed);
ship.x = (ship.x + dspeed);
} else {
ship.y = (ship.height / 2);
ship.x = (ship.x + speed);
};
} else {
if ((((downKeys.key40 == true)) || ((downKeys.key83 == true)))){
if (ship.y < (stageH - (ship.height / 2))){
ship.y = (ship.y + dspeed);
ship.x = (ship.x + speed);
} else {
ship.y = (stageH - (ship.height / 2));
ship.x = (ship.x + speed);
};
} else {
ship.x = (ship.x + speed);
};
};
} else {
ship.x = (stageW - (ship.width / 2));
};
} else {
if ((((downKeys.key38 == true)) || ((downKeys.key87 == true)))){
if (ship.y > (ship.height / 2)){
ship.y = (ship.y - speed);
} else {
ship.y = (ship.height / 2);
};
} else {
if ((((downKeys.key40 == true)) || ((downKeys.key83 == true)))){
if (ship.y < (stageH - (ship.height / 2))){
ship.y = (ship.y + speed);
} else {
ship.y = (stageH - (ship.height / 2));
};
};
};
};
};
for (_local2 in circles) {
_local8 = circles[_local2];
if (_local8.dead == true){
ballsHolder.removeChild(_local8.s);
delete circles[_local2];
} else {
if (checkPlayerHit(_local8) == true){
juice = (juice - 30);
_local8.dead = true;
circlesNum--;
newBall();
emitBlack(_local8.x, _local8.y, (_local8.r / 3));
};
if (_local8.r < _local8.r0){
_local8.r = (_local8.r + 2);
_local8.s.graphics.beginBitmapFill(blackdata);
_local8.s.graphics.drawCircle(0, 0, _local8.r);
_local8.s.graphics.endFill();
};
_local8.tempx = (_local8.tempx + _local8.xv);
_local8.tempy = (_local8.tempy + _local8.yv);
checkCollisions(_local8);
checkBounds(_local8);
_local8.x = _local8.tempx;
_local8.y = _local8.tempy;
_local8.s.x = _local8.tempx;
_local8.s.y = _local8.tempy;
};
};
_local3 = 0;
while (_local3 < bullets.length) {
if (bullets[_local3].dead != true){
bullets[_local3].handle();
if (bullets[_local3].dead == true){
bulletsHolder.removeChild(bullets[_local3]);
bullets.splice(_local3, 1);
} else {
_local9 = checkSporeCollision(bullets[_local3]);
if (_local9 == true){
newParticle(bullets[_local3].x, bullets[_local3].y, (bullets[_local3].width / 2));
bullets[_local3].r = (bullets[_local3].r - 5);
bullets[_local3].width = (bullets[_local3].r * 2);
bullets[_local3].height = bullets[_local3].width;
if (bullets[_local3].r < 5){
bullets[_local3].dead = true;
bulletsHolder.removeChild(bullets[_local3]);
bullets.splice(_local3, 1);
};
};
};
};
_local3++;
};
_local4 = 0;
while (_local4 < particles.length) {
particles[_local4].handle();
if (particles[_local4].dead == true){
particlesHolder.removeChild(particles[_local4]);
particles.splice(_local4, 1);
};
_local4++;
};
_local5 = 0;
while (_local5 < flowers.length) {
if (flowers[_local5].width < flowers[_local5].s){
flowers[_local5].width = (flowers[_local5].width + 2);
flowers[_local5].height = (flowers[_local5].height + 2);
} else {
flowers[_local5].t--;
if (flowers[_local5].t < 0){
flowers[_local5].alpha = (flowers[_local5].alpha - 0.001);
if (flowers[_local5].alpha <= 0){
flowerHolder.removeChild(flowers[_local5]);
flowers.splice(_local5, 1);
};
};
};
_local5++;
};
_local6 = 0;
while (_local6 < combos.length) {
if (combos[_local6] == currentCombo){
combos[_local6].alpha = currents[(currents.length - 1)].alpha;
if (combos[_local6].alpha <= 0){
linesHolder.removeChild(combos[_local6]);
combos.splice(_local6, 1);
};
} else {
combos[_local6].alpha = (combos[_local6].alpha - 0.001);
if (combos[_local6].alpha <= 0){
linesHolder.removeChild(combos[_local6]);
combos.splice(_local6, 1);
};
};
_local6++;
};
_local7 = 0;
while (_local7 < txts.length) {
txts[_local7].alpha = (txts[_local7].alpha - 0.02);
if (txts[_local7].alpha <= 0){
txtsHolder.removeChild(txts[_local7]);
txts.splice(_local7, 1);
};
_local7++;
};
t++;
if (t == 2){
t = 0;
showWave();
};
if ((getTimer() - lastKillTime) > 1000){
combo = 0;
};
if (maxBalls > circlesNum){
newBall();
};
dropCount++;
if (dropCount >= juiceCount){
dropCount = 0;
juice--;
gui.juicebar.width = (1.15 * juice);
if (juice <= 0){
deathTimer = 40;
deathSound.play();
gamePaused = true;
game.addChild(deathanim);
deathanim.x = ship.x;
deathanim.y = ship.y;
deathanim.gotoAndPlay(1);
};
};
};
fps.calculate();
}
public function checkPlayerHit(_arg1):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg1.dead == true){
return (false);
};
_local2 = (_arg1.x - ship.x);
_local3 = (_arg1.y - ship.y);
_local4 = ((_local2 * _local2) + (_local3 * _local3));
_local5 = ((_arg1.r + (ship.width / 2)) * (_arg1.r + (ship.width / 2)));
if (_local4 < _local5){
return (true);
};
return (false);
}
public function MouseDown(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLRequest;
if (frameState == "title"){
titleS.mc.play();
frameState = "menu";
game.addChild(flower1);
game.addChild(flower2);
game.addChild(mainMenu);
flower1.gotoAndPlay(2);
flower2.gotoAndPlay(2);
mainMenu.gotoAndPlay(2);
stage.addEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (frameState == "menu"){
if ((((flower1.currentFrame >= 50)) && ((stage.mouseY > 100)))){
pressed.play();
if (menuNum == 1){
game.removeChild(titleS);
initGame();
frameState = "game";
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 2){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(helpS);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "help";
helpS.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
helpS.nxtbtn.addEventListener(MouseEvent.CLICK, helpnextPress);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 3){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(scores);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "score";
scores.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
loadData();
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 4){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(creds);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "credits";
creds.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 5){
_local2 = new URLRequest("http://www.armorgames.com");
navigateToURL(_local2, "_blank");
} else {
if (menuNum == 6){
_local3 = new URLRequest("http://www.armorblog.com");
navigateToURL(_local3, "_blank");
};
};
};
};
};
};
};
} else {
if ((((frameState == "game")) && (!(gamePaused)))){
charging = true;
ship.powerlevel.play();
};
};
};
}
public function onMusicComplete(_arg1:Event):void{
trace("complete");
this.play();
}
public function helpnextPress(_arg1:MouseEvent):void{
pressed.play();
}
public function quitGame(_arg1:MouseEvent):void{
pressed.play();
quit();
}
public function submitPress(_arg1:MouseEvent):void{
pressed.play();
removeChild(game);
game = new MovieClip();
addChild(game);
game.addChild(scores);
scores.menubtn.gotoAndStop(3);
scores.menubtn.addEventListener(MouseEvent.CLICK, submenuPress);
frameState = "scores";
game.addChild(fademe);
fademe.gotoAndPlay(1);
loadData();
addHiScore(score);
}
public function checkMenuFrame(_arg1:Event):void{
if (flower1.currentFrame == 49){
if ((((((((stage.mouseX > 220)) && ((stage.mouseX < 420)))) && ((stage.mouseY > 100)))) && ((stage.mouseY < 400)))){
if (stage.mouseY > 335){
mainMenu.gotoAndStop(55);
flower1.gotoAndStop(55);
flower2.gotoAndStop(55);
menuNum = 6;
} else {
if (stage.mouseY > 285){
mainMenu.gotoAndStop(54);
flower1.gotoAndStop(54);
flower2.gotoAndStop(54);
menuNum = 5;
} else {
if (stage.mouseY > 240){
mainMenu.gotoAndStop(53);
flower1.gotoAndStop(53);
flower2.gotoAndStop(53);
menuNum = 4;
} else {
if (stage.mouseY > 190){
mainMenu.gotoAndStop(52);
flower1.gotoAndStop(52);
flower2.gotoAndStop(52);
menuNum = 3;
} else {
if (stage.mouseY > 150){
mainMenu.gotoAndStop(51);
flower1.gotoAndStop(51);
flower2.gotoAndStop(51);
menuNum = 2;
} else {
mainMenu.gotoAndStop(50);
flower1.gotoAndStop(50);
flower2.gotoAndStop(50);
menuNum = 1;
};
};
};
};
};
};
};
}
public function shuffleDown(_arg1:int):void{
var _local2:int;
_local2 = 10;
while (_local2 >= _arg1) {
if (savedata.data[("name" + (_local2 - 1))] != undefined){
scores[("name" + _local2)].nametxt.text = savedata.data[("name" + (_local2 - 1))];
scores[("score" + _local2)].text = String(savedata.data[("score" + (_local2 - 1))]);
savedata.data[("score" + _local2)] = savedata.data[("score" + (_local2 - 1))];
savedata.data[("name" + _local2)] = savedata.data[("name" + (_local2 - 1))];
};
_local2--;
};
}
public function initGame():void{
var _local1:int;
gamePaused = false;
circles = {};
circlesNum = 0;
bullets = new Array();
particles = new Array();
flowers = new Array();
txts = new Array();
downKeys = {};
flowerHolder = new Sprite();
ballsHolder = new Sprite();
linesHolder = new Sprite();
particlesHolder = new Sprite();
bulletsHolder = new Sprite();
txtsHolder = new Sprite();
game.addChild(barBitmap);
game.addChild(linesHolder);
game.addChild(flowerHolder);
game.addChild(particlesHolder);
game.addChild(ballsHolder);
game.addChild(txtsHolder);
game.addChild(bulletsHolder);
maxBalls = 3;
maxRad = 5;
kills = 0;
lastScore = 0;
div = 10;
lastKillTime = 0;
combo = 0;
combos = new Array();
currents = new Array();
juice = 100;
juiceCount = 15;
dropCount = 0;
bestCombo = 0;
bestMulti = 0;
_local1 = 0;
while (_local1 < maxBalls) {
newBall();
_local1++;
};
game.addChild(ship);
ship.x = ((stageW / 2) + (ship.width / 2));
ship.y = ((stageH / 2) + (ship.width / 2));
game.addChild(pspawn);
pspawn.x = ship.x;
pspawn.y = ship.y;
pspawn.gotoAndPlay(1);
score = 0;
juice = 100;
juiceCount = 15;
dropCount = 0;
combo = 0;
game.addChild(gui);
gui.y = 435;
gui.juicebar.width = 115;
updateScore();
stage.addEventListener(Event.ENTER_FRAME, update);
}
public function resetMe(_arg1:MouseEvent):void{
pressed.play();
reset();
}
public function updateScore():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:int;
trace(kills);
trace((kills / div));
if (Math.floor((kills / div)) > lastScore){
if (maxRad < 50){
maxRad = (maxRad + 3);
};
if (juiceCount > 6){
juiceCount--;
};
maxBalls++;
lastScore = Math.floor((kills / div));
div = (div * 1.02);
};
_local1 = String(score);
_local2 = _local1.length;
_local3 = (6 - _local2);
_local4 = 0;
while (_local4 < _local3) {
gui[("num" + _local4)].gotoAndStop(1);
_local4++;
};
_local5 = _local3;
while (_local5 < 6) {
gui[("num" + _local5)].gotoAndStop((Number(_local1.charAt((_local5 - _local3))) + 1));
_local5++;
};
}
public function keyup(_arg1:KeyboardEvent):void{
downKeys[("key" + _arg1.keyCode)] = false;
}
public function backToPause(_arg1:MouseEvent):void{
pressed.play();
game.removeChild(sureBox);
}
public function endGame(){
this.addChild(gameOver);
this.addChild(fademe);
circles = {};
bullets = new Array();
particles = new Array();
flowers = new Array();
txts = new Array();
fademe.gotoAndPlay(1);
gameOver.scoretxt.text = String(score);
gameOver.combotxt.text = ("x " + String(bestCombo));
gameOver.multitxt.text = ("x " + String(bestMulti));
gameOver.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
gameOver.submitbtn.addEventListener(MouseEvent.CLICK, submitPress);
game.removeChild(gui);
game.removeChild(ship);
game.removeChild(barBitmap);
game.removeChild(linesHolder);
game.removeChild(flowerHolder);
game.removeChild(particlesHolder);
game.removeChild(ballsHolder);
game.removeChild(txtsHolder);
game.removeChild(bulletsHolder);
stage.removeEventListener(Event.ENTER_FRAME, update);
}
public function reset():void{
gui.mess.gotoAndStop(1);
gamePaused = false;
circles = {};
bullets = new Array();
particles = new Array();
flowers = new Array();
txts = new Array();
removeChild(game);
game = new MovieClip();
addChild(game);
stage.removeEventListener(Event.ENTER_FRAME, update);
game.addChild(titleS);
titleS.mc.gotoAndStop(1);
frameState = "title";
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
}
public function collisionReaction(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
_local6 = Math.atan2(_arg4, _arg3);
_local7 = Math.cos(_local6);
_local8 = Math.sin(_local6);
_local9 = ((_local7 * _arg1.xv) + (_local8 * _arg1.yv));
_local10 = ((_local7 * _arg1.yv) - (_local8 * _arg1.xv));
_local11 = ((_local7 * _arg2.xv) + (_local8 * _arg2.yv));
_local12 = ((_local7 * _arg2.yv) - (_local8 * _arg2.xv));
_local13 = ((_local9 * _arg1.r) + (_local11 * _arg2.r));
_local14 = (_local9 - _local11);
_local9 = ((_local13 - (_arg2.r * _local14)) / (_arg1.r + _arg2.r));
_local11 = (_local14 + _local9);
_arg1.xv = ((_local7 * _local9) - (_local8 * _local10));
_arg1.yv = ((_local7 * _local10) + (_local8 * _local9));
_arg2.xv = ((_local7 * _local11) - (_local8 * _local12));
_arg2.yv = ((_local7 * _local12) + (_local8 * _local11));
_local15 = (((_arg1.r + _arg2.r) - _arg5) / 2);
_local16 = (_local7 * _local15);
_local17 = (_local8 * _local15);
_arg1.tempx = (_arg1.tempx - _local16);
_arg1.tempy = (_arg1.tempy - _local17);
_arg2.tempx = (_arg2.tempx + _local16);
_arg2.tempy = (_arg2.tempy + _local17);
}
public function keydown(_arg1:KeyboardEvent):void{
var _local2:URLRequest;
var _local3:URLRequest;
if (frameState == "title"){
titleS.mc.play();
frameState = "menu";
game.addChild(flower1);
game.addChild(flower2);
game.addChild(mainMenu);
flower1.gotoAndPlay(2);
flower2.gotoAndPlay(2);
mainMenu.gotoAndPlay(2);
stage.addEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (frameState == "menu"){
if ((((_arg1.keyCode == 32)) || ((_arg1.keyCode == 13)))){
pressed.play();
if (menuNum == 1){
game.removeChild(titleS);
initGame();
frameState = "game";
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 2){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(helpS);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "help";
helpS.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
helpS.nxtbtn.addEventListener(MouseEvent.CLICK, helpnextPress);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 3){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(scores);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "score";
scores.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
loadData();
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 4){
game.removeChild(titleS);
game.removeChild(flower1);
game.removeChild(flower2);
game.removeChild(mainMenu);
game.addChild(creds);
game.addChild(fademe);
fademe.gotoAndPlay(1);
frameState = "credits";
creds.menubtn.addEventListener(MouseEvent.CLICK, menuPress);
stage.removeEventListener(Event.ENTER_FRAME, checkMenuFrame);
} else {
if (menuNum == 5){
_local2 = new URLRequest("http://www.armorgames.com");
navigateToURL(_local2, "_blank");
} else {
if (menuNum == 6){
_local3 = new URLRequest("http://www.armorblog.com");
navigateToURL(_local3, "_blank");
};
};
};
};
};
};
} else {
if ((((_arg1.keyCode == 40)) || ((_arg1.keyCode == 83)))){
if ((((flower1.currentFrame > 49)) && ((flower1.currentFrame < 55)))){
trans.play();
menuNum++;
flower1.nextFrame();
flower2.nextFrame();
mainMenu.nextFrame();
};
if (menuNum > 6){
flower1.gotoAndStop(50);
flower2.gotoAndStop(50);
mainMenu.gotoAndStop(50);
menuNum = 1;
};
} else {
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
if ((((flower1.currentFrame > 50)) && ((flower1.currentFrame < 56)))){
trans.play();
menuNum--;
flower1.prevFrame();
flower2.prevFrame();
mainMenu.prevFrame();
};
trace(menuNum);
if (menuNum < 1){
flower1.gotoAndStop(55);
flower2.gotoAndStop(55);
mainMenu.gotoAndStop(55);
menuNum = 6;
};
};
};
};
} else {
if (frameState == "game"){
if (_arg1.keyCode == 32){
if ((((gui.mess.currentFrame == 1)) && ((pauseMenu.currentFrame == 1)))){
game.addChild(pauseMenu);
gamePaused = true;
gui.mess.gotoAndStop(2);
pauseMenu.soundbtn.addEventListener(MouseEvent.CLICK, toggleSound);
pauseMenu.quitbtn.addEventListener(MouseEvent.CLICK, checkQuit);
pauseMenu.exitbtn.addEventListener(MouseEvent.CLICK, checkExit);
pauseMenu.resumebtn.addEventListener(MouseEvent.CLICK, resumeGame);
if (SoundMixer.soundTransform.volume == 1){
pauseMenu.soundbtn.gotoAndStop(1);
} else {
pauseMenu.soundbtn.gotoAndStop(3);
};
} else {
game.removeChild(pauseMenu);
gamePaused = false;
gui.mess.gotoAndStop(1);
};
};
downKeys[("key" + _arg1.keyCode)] = true;
};
};
};
}
public function checkQuit(_arg1:MouseEvent):void{
pressed.play();
game.addChild(sureBox);
sureBox.nobtn.addEventListener(MouseEvent.CLICK, backToPause);
sureBox.yesbtn.addEventListener(MouseEvent.CLICK, resetMe);
}
public function loadData():void{
var _local1:int;
_local1 = 1;
while (_local1 < 11) {
if (savedata.data[("name" + _local1)] == undefined){
} else {
scores[("name" + _local1)].nametxt.text = savedata.data[("name" + _local1)];
scores[("score" + _local1)].text = savedata.data[("score" + _local1)];
};
_local1++;
};
}
public function getLink1(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.varstudios.com");
navigateToURL(_local2, "_blank");
}
public function showWave():void{
var _local1:int;
var _local2:Rectangle;
var _local3:*;
SoundMixer.computeSpectrum(mySpectrum);
bar.fillRect(screenRec, 0xFFFFFF);
_local1 = 0;
while (_local1 < 510) {
_local3 = mySpectrum.readFloat();
if (_local3 > 0){
_local2 = new Rectangle(((_local1 / 10) * (stageW / 51)), (stageH / 2), 10, (_local3 * 200));
} else {
_local2 = new Rectangle(((_local1 / 10) * (stageW / 51)), ((stageH / 2) + (_local3 * 200)), 10, (_local3 * -200));
};
bar.fillRect(_local2, 0xCCCCCC);
_local1 = (_local1 + 10);
};
}
public function newComboTxt(_arg1:int, _arg2:int, _arg3:int):void{
var _local4:combotxt;
if (_arg3 > bestCombo){
bestCombo = _arg3;
};
_local4 = new combotxt();
_local4.x = _arg1;
_local4.y = _arg2;
_local4.com.gotoAndStop((Math.floor((Math.random() * 4)) + 1));
_local4.ctxt.text = String(_arg3);
txts.push(_local4);
txtsHolder.addChild(_local4);
}
public function newBall():void{
var _local1:int;
var _local2:*;
var _local3:*;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Shape;
var _local9:*;
circlesNum++;
_local1 = ((Math.random() * maxRad) + 15);
_local2 = (((Math.random() * ((stageW - (_local1 * 2)) - 10)) + _local1) + 5);
_local3 = (((Math.random() * ((stageH - (_local1 * 2)) - 10)) + _local1) + 5);
_local4 = ((Math.random() * 2) * Math.PI);
_local5 = (Math.random() * 3);
_local6 = (Math.cos(_local4) * _local5);
_local7 = (Math.sin(_local4) * _local5);
_local8 = new Shape();
_local8.x = _local2;
_local8.y = _local3;
_local9 = (circles[("circle" + count)] = {s:_local8, r0:_local1, r:1, lr:_local1, x:_local2, y:_local3, tempx:_local2, tempy:_local3, ang:_local4, speed:_local5, xv:_local6, yv:_local7});
count++;
if (checkPlayerHit({x:_local9.x, y:_local9.y, r:(_local9.r + 40)}) == true){
trace("ok");
_local9.dead = true;
circlesNum--;
} else {
_local8.graphics.beginBitmapFill(blackdata);
_local8.graphics.drawCircle(0, 0, 1);
_local8.graphics.endFill();
};
ballsHolder.addChild(_local8);
}
public function checkBounds(_arg1):void{
if ((_arg1.tempx + _arg1.r) >= stageW){
if (_arg1.xv > 0){
_arg1.xv = (_arg1.xv * -1);
};
} else {
if ((_arg1.tempx - _arg1.r) <= 0){
if (_arg1.xv < 0){
_arg1.xv = (_arg1.xv * -1);
};
};
};
if ((_arg1.tempy + _arg1.r) >= stageH){
if (_arg1.yv > 0){
_arg1.yv = (_arg1.yv * -1);
};
} else {
if ((_arg1.tempy - _arg1.r) <= 0){
if (_arg1.yv < 0){
_arg1.yv = (_arg1.yv * -1);
};
};
};
}
public function resumeGame(_arg1:MouseEvent):void{
pressed.play();
game.removeChild(pauseMenu);
gamePaused = false;
gui.mess.gotoAndStop(1);
}
public function submenuPress(_arg1:MouseEvent):void{
pressed.play();
_arg1.target.gotoAndStop(1);
if (prep > 0){
savedata.data[("name" + prep)] = scores[("name" + prep)].nametxt.text;
savedata.data[("score" + prep)] = String(score);
savedata.flush();
scores[("name" + prep)].gotoAndStop(1);
prep = 0;
};
_arg1.target.removeEventListener(MouseEvent.CLICK, submenuPress);
removeChild(game);
game = new MovieClip();
addChild(game);
game.addChild(titleS);
game.addChild(flower1);
game.addChild(flower2);
game.addChild(mainMenu);
frameState = "menu";
menuNum = 1;
mainMenu.gotoAndPlay(25);
flower1.gotoAndPlay(15);
flower2.gotoAndPlay(15);
game.addChild(fademe);
fademe.gotoAndPlay(1);
stage.addEventListener(Event.ENTER_FRAME, checkMenuFrame);
}
public function emitBlack(_arg1:int, _arg2:int, _arg3:int):void{
var i:int;
var p:particle;
var ang:Number;
var s:*;
var x = _arg1;
var y = _arg2;
var num = _arg3;
hurtsound.play();
i = 0;
while (i < num) {
p = new particle();
p.x = x;
p.y = y;
p.width = ((Math.random() * 20) + 10);
p.height = p.width;
p.rotation = (Math.random() * 360);
p.t = ((Math.random() * 30) + 10);
p.gotoAndStop(6);
ang = ((Math.random() * 360) * (Math.PI / 180));
s = ((Math.random() * 5) + 1);
p.xv = (Math.cos(ang) * s);
p.yv = (Math.sin(ang) * s);
p.dead = false;
particlesHolder.addChild(p);
p.handle = function (){
this.x = (this.x + this.xv);
this.y = (this.y + this.yv);
this.t--;
if (this.t <= 0){
this.dead = true;
};
};
particles.push(p);
i = (i + 1);
};
}
public function updatelogo(_arg1:Event):void{
timer++;
if (timer > 125){
this.removeEventListener(Event.ENTER_FRAME, updatelogo);
logo.removeEventListener(MouseEvent.CLICK, getLink);
nextFrame();
};
}
public function onKill(_arg1:int, _arg2:int, _arg3:int, _arg4:flower):void{
var _local5:int;
var _local6:int;
_local5 = (Math.floor((Math.random() * 8)) + 1);
if (_local5 == 1){
none.play();
} else {
if (_local5 == 2){
ntwo.play();
} else {
if (_local5 == 3){
nthree.play();
} else {
if (_local5 == 4){
nfour.play();
} else {
if (_local5 == 5){
nfive.play();
} else {
if (_local5 == 6){
nsix.play();
} else {
if (_local5 == 7){
nseven.play();
} else {
neight.play();
};
};
};
};
};
};
};
juice = (juice + (_arg3 / 20));
if (juice > 100){
juice = 100;
};
if (((((getTimer() - lastKillTime) <= 1000)) || ((combo == 0)))){
if (combo == 0){
currentCombo = new Shape();
currents = new Array();
linesHolder.addChild(currentCombo);
currentCombo.graphics.lineStyle(4, 1231670, 1);
currentCombo.graphics.moveTo(_arg1, _arg2);
combos.push(currentCombo);
} else {
if (combo > 0){
newComboTxt(_arg1, _arg2, (combo + 1));
currentCombo.alpha = 1;
_local6 = 0;
while (_local6 < currents.length) {
currents[_local6].alpha = 1;
currents[_local6].t = (_arg4.t + ((_arg4.s - _arg4.width) / 2));
_local6++;
};
currentCombo.graphics.lineTo(_arg1, _arg2);
};
};
combo++;
score = (score + (_arg3 * combo));
currents.push(_arg4);
updateScore();
} else {
if (combo > 0){
combo = 0;
};
};
lastKillTime = getTimer();
}
}
}//package Kaichoustandalone_fla
Section 20
//menubutton_7 (Kaichoustandalone_fla.menubutton_7)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class menubutton_7 extends MovieClip {
public function menubutton_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 21
//nobtn_59 (Kaichoustandalone_fla.nobtn_59)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class nobtn_59 extends MovieClip {
public function nobtn_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 22
//num_20 (Kaichoustandalone_fla.num_20)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class num_20 extends MovieClip {
public function num_20(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 23
//nxtbutton_24 (Kaichoustandalone_fla.nxtbutton_24)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class nxtbutton_24 extends MovieClip {
public function nxtbutton_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 24
//pausemessage_22 (Kaichoustandalone_fla.pausemessage_22)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class pausemessage_22 extends MovieClip {
public function pausemessage_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 25
//powerfill_32 (Kaichoustandalone_fla.powerfill_32)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class powerfill_32 extends MovieClip {
public function powerfill_32(){
addFrameScript(0, frame1, 89, frame90);
}
function frame90(){
stop();
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 26
//quitgame_50 (Kaichoustandalone_fla.quitgame_50)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class quitgame_50 extends MovieClip {
public function quitgame_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 27
//quitmenubtn_47 (Kaichoustandalone_fla.quitmenubtn_47)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class quitmenubtn_47 extends MovieClip {
public function quitmenubtn_47(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 28
//resumebtn_49 (Kaichoustandalone_fla.resumebtn_49)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class resumebtn_49 extends MovieClip {
public function resumebtn_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 29
//scorename_39 (Kaichoustandalone_fla.scorename_39)
package Kaichoustandalone_fla {
import flash.display.*;
import flash.text.*;
public dynamic class scorename_39 extends MovieClip {
public var nametxt:TextField;
public function scorename_39(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 30
//soundbtn_48 (Kaichoustandalone_fla.soundbtn_48)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class soundbtn_48 extends MovieClip {
public function soundbtn_48(){
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 31
//SUBMITBTN_17 (Kaichoustandalone_fla.SUBMITBTN_17)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class SUBMITBTN_17 extends MovieClip {
public function SUBMITBTN_17(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 32
//titleGraphics_61 (Kaichoustandalone_fla.titleGraphics_61)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class titleGraphics_61 extends MovieClip {
public function titleGraphics_61(){
addFrameScript(0, frame1, 47, frame48);
}
function frame1(){
stop();
}
function frame48(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 33
//vslink_8 (Kaichoustandalone_fla.vslink_8)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class vslink_8 extends MovieClip {
public function vslink_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 34
//xczcxzc_66 (Kaichoustandalone_fla.xczcxzc_66)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class xczcxzc_66 extends MovieClip {
public var s1:sword1;
public var s5:sword5;
public var s6:sword6;
public var s7:sword7;
public var ag:agtune;
public var s2:sword2;
public var s4:sword4;
public var s3:sword3;
public function xczcxzc_66(){
addFrameScript(0, frame1, 5, frame6, 15, frame16, 20, frame21, 35, frame36, 45, frame46, 55, frame56, 105, frame106);
}
function frame6(){
s3.play();
}
function frame16(){
s6.play();
}
function frame1(){
s1 = new sword1();
s2 = new sword2();
s3 = new sword3();
s4 = new sword4();
s5 = new sword5();
s6 = new sword6();
s7 = new sword7();
ag = new agtune();
s5.play();
ag.play();
}
function frame106(){
s5.play();
}
function frame21(){
s3.play();
}
function frame36(){
s7.play();
}
function frame46(){
s2.play();
}
function frame56(){
s4.play();
}
}
}//package Kaichoustandalone_fla
Section 35
//yesbtn_58 (Kaichoustandalone_fla.yesbtn_58)
package Kaichoustandalone_fla {
import flash.display.*;
public dynamic class yesbtn_58 extends MovieClip {
public function yesbtn_58(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Kaichoustandalone_fla
Section 36
//agtune (agtune)
package {
import flash.media.*;
public dynamic class agtune extends Sound {
}
}//package
Section 37
//bgbeat (bgbeat)
package {
import flash.media.*;
public dynamic class bgbeat extends Sound {
}
}//package
Section 38
//bgMusic (bgMusic)
package {
import flash.media.*;
public dynamic class bgMusic extends Sound {
}
}//package
Section 39
//black (black)
package {
import flash.display.*;
public dynamic class black extends BitmapData {
public function black(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 40
//blip (blip)
package {
import flash.media.*;
public dynamic class blip extends Sound {
}
}//package
Section 41
//btnpress (btnpress)
package {
import flash.media.*;
public dynamic class btnpress extends Sound {
}
}//package
Section 42
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
}
}//package
Section 43
//combotxt (combotxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class combotxt extends MovieClip {
public var ctxt:TextField;
public var com:MovieClip;
}
}//package
Section 44
//credits (credits)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class credits extends MovieClip {
public var vslink:MovieClip;
public var menubtn:MovieClip;
public function credits(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
menubtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
menubtn.addEventListener(MouseEvent.MOUSE_OUT, out);
vslink.addEventListener(MouseEvent.CLICK, vsPress);
vslink.addEventListener(MouseEvent.MOUSE_OVER, roll);
vslink.addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function roll(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
public function vsPress(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.varstudios.com");
navigateToURL(_local2, "_blank");
}
}
}//package
Section 45
//cursormc (cursormc)
package {
import flash.display.*;
public dynamic class cursormc extends MovieClip {
}
}//package
Section 46
//death (death)
package {
import flash.display.*;
public dynamic class death extends MovieClip {
public function death(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package
Section 47
//deathtune (deathtune)
package {
import flash.media.*;
public dynamic class deathtune extends Sound {
}
}//package
Section 48
//decor (decor)
package {
import flash.display.*;
public dynamic class decor extends MovieClip {
}
}//package
Section 49
//fade (fade)
package {
import flash.display.*;
public dynamic class fade extends MovieClip {
public function fade(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package
Section 50
//flower (flower)
package {
import flash.display.*;
public dynamic class flower extends MovieClip {
public function flower(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 51
//flowerSelector (flowerSelector)
package {
import flash.display.*;
public dynamic class flowerSelector extends MovieClip {
public function flowerSelector(){
addFrameScript(0, frame1, 49, frame50, 50, frame51, 51, frame52, 52, frame53, 53, frame54, 54, frame55, 65, frame66);
}
function frame1(){
stop();
}
function frame51(){
stop();
}
function frame52(){
stop();
}
function frame54(){
stop();
}
function frame55(){
stop();
}
function frame50(){
stop();
}
function frame53(){
stop();
}
function frame66(){
stop();
}
}
}//package
Section 52
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 53
//FPS (FPS)
package {
import flash.text.*;
import flash.utils.*;
public class FPS extends TextField {
private var startTime:Number;
private var numFrames:int;
private var interval:int;
public function FPS(_arg1:int){
background = true;
autoSize = "left";
selectable = false;
startTime = getTimer();
numFrames = 0;
interval = _arg1;
}
public function calculate():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:String;
if (++numFrames == interval){
_local1 = getTimer();
_local2 = ((_local1 - startTime) / 1000);
_local3 = (numFrames / _local2);
_local4 = _local3.toFixed(2);
text = ("fps: " + _local4);
startTime = _local1;
numFrames = 0;
};
}
}
}//package
Section 54
//Gameover (Gameover)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Gameover extends MovieClip {
public var combotxt:TextField;
public var submitbtn:MovieClip;
public var multitxt:TextField;
public var menubtn:MovieClip;
public var scoretxt:TextField;
public function Gameover(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
menubtn.addEventListener(MouseEvent.ROLL_OVER, roll);
menubtn.addEventListener(MouseEvent.ROLL_OUT, out);
submitbtn.addEventListener(MouseEvent.ROLL_OVER, roll);
submitbtn.addEventListener(MouseEvent.ROLL_OUT, out);
}
public function roll(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
}
}//package
Section 55
//GENERATE (GENERATE)
package {
import flash.display.*;
public dynamic class GENERATE extends MovieClip {
}
}//package
Section 56
//GUI (GUI)
package {
import flash.display.*;
public dynamic class GUI extends MovieClip {
public var num0:MovieClip;
public var num1:MovieClip;
public var num3:MovieClip;
public var num4:MovieClip;
public var num5:MovieClip;
public var num2:MovieClip;
public var juicebar:MovieClip;
public var mess:MovieClip;
}
}//package
Section 57
//help (help)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class help extends MovieClip {
public var nxtbtn:MovieClip;
public var instruct:MovieClip;
public var menubtn:MovieClip;
public function help(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
nxtbtn.addEventListener(MouseEvent.CLICK, nxtPress);
nxtbtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
nxtbtn.addEventListener(MouseEvent.MOUSE_OUT, out);
menubtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
menubtn.addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function roll(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
public function nxtPress(_arg1:MouseEvent):void{
instruct.play();
}
}
}//package
Section 58
//hiscores (hiscores)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class hiscores extends MovieClip {
public var score1:TextField;
public var score5:TextField;
public var name1:MovieClip;
public var name3:MovieClip;
public var name4:MovieClip;
public var name6:MovieClip;
public var name8:MovieClip;
public var name2:MovieClip;
public var name5:MovieClip;
public var name7:MovieClip;
public var score10:TextField;
public var score6:TextField;
public var name9:MovieClip;
public var menubtn:MovieClip;
public var score2:TextField;
public var score3:TextField;
public var score7:TextField;
public var score8:TextField;
public var score4:TextField;
public var score9:TextField;
public var name10:MovieClip;
public function hiscores(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
if (_arg1.target.currentFrame == 2){
_arg1.target.gotoAndStop(1);
} else {
if (_arg1.target.currentFrame == 4){
_arg1.target.gotoAndStop(3);
};
};
}
function frame1(){
menubtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
menubtn.addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function roll(_arg1:MouseEvent):void{
if (_arg1.target.currentFrame == 1){
_arg1.target.gotoAndStop(2);
} else {
if (_arg1.target.currentFrame == 3){
_arg1.target.gotoAndStop(4);
};
};
}
}
}//package
Section 59
//hitbeat (hitbeat)
package {
import flash.media.*;
public dynamic class hitbeat extends Sound {
}
}//package
Section 60
//hitbeat2 (hitbeat2)
package {
import flash.media.*;
public dynamic class hitbeat2 extends Sound {
}
}//package
Section 61
//hurt (hurt)
package {
import flash.media.*;
public dynamic class hurt extends Sound {
}
}//package
Section 62
//menu (menu)
package {
import flash.display.*;
public dynamic class menu extends MovieClip {
public function menu(){
addFrameScript(0, frame1, 49, frame50, 50, frame51, 51, frame52, 52, frame53, 53, frame54, 54, frame55, 85, frame86);
}
function frame86(){
stop();
}
function frame1(){
stop();
}
function frame51(){
stop();
}
function frame52(){
stop();
}
function frame54(){
stop();
}
function frame55(){
stop();
}
function frame50(){
stop();
}
function frame53(){
stop();
}
}
}//package
Section 63
//multitxt (multitxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class multitxt extends MovieClip {
public var mtxt:TextField;
public var mult:MovieClip;
}
}//package
Section 64
//note1 (note1)
package {
import flash.media.*;
public dynamic class note1 extends Sound {
}
}//package
Section 65
//note2 (note2)
package {
import flash.media.*;
public dynamic class note2 extends Sound {
}
}//package
Section 66
//note3 (note3)
package {
import flash.media.*;
public dynamic class note3 extends Sound {
}
}//package
Section 67
//note4 (note4)
package {
import flash.media.*;
public dynamic class note4 extends Sound {
}
}//package
Section 68
//note5 (note5)
package {
import flash.media.*;
public dynamic class note5 extends Sound {
}
}//package
Section 69
//note6 (note6)
package {
import flash.media.*;
public dynamic class note6 extends Sound {
}
}//package
Section 70
//note7 (note7)
package {
import flash.media.*;
public dynamic class note7 extends Sound {
}
}//package
Section 71
//note8 (note8)
package {
import flash.media.*;
public dynamic class note8 extends Sound {
}
}//package
Section 72
//particle (particle)
package {
import flash.display.*;
public dynamic class particle extends MovieClip {
}
}//package
Section 73
//pausemen (pausemen)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class pausemen extends MovieClip {
public var resumebtn:MovieClip;
public var quitbtn:MovieClip;
public var exitbtn:MovieClip;
public var soundbtn:MovieClip;
public function pausemen(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
stop();
quitbtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
quitbtn.addEventListener(MouseEvent.MOUSE_OUT, out);
soundbtn.addEventListener(MouseEvent.MOUSE_OVER, roll2);
soundbtn.addEventListener(MouseEvent.MOUSE_OUT, out2);
exitbtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
exitbtn.addEventListener(MouseEvent.MOUSE_OUT, out);
resumebtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
resumebtn.addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function roll2(_arg1:MouseEvent):void{
if (_arg1.target.currentFrame == 1){
_arg1.target.gotoAndStop(2);
} else {
if (_arg1.target.currentFrame == 3){
_arg1.target.gotoAndStop(4);
};
};
}
public function roll(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
public function out2(_arg1:MouseEvent):void{
if (_arg1.target.currentFrame == 2){
_arg1.target.gotoAndStop(1);
} else {
if (_arg1.target.currentFrame == 4){
_arg1.target.gotoAndStop(3);
};
};
}
}
}//package
Section 74
//player (player)
package {
import flash.display.*;
public dynamic class player extends MovieClip {
public var powerlevel:MovieClip;
public function player(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 75
//playerspawn (playerspawn)
package {
import flash.display.*;
public dynamic class playerspawn extends MovieClip {
public function playerspawn(){
addFrameScript(0, frame1, 42, frame43);
}
function frame1(){
stop();
}
function frame43(){
stop();
}
}
}//package
Section 76
//spore (spore)
package {
import flash.display.*;
public dynamic class spore extends MovieClip {
}
}//package
Section 77
//surebox (surebox)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.geom.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.net.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class surebox extends MovieClip {
public var yesbtn:MovieClip;
public var nobtn:MovieClip;
public function surebox(){
addFrameScript(0, frame1);
}
public function out(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(1);
}
function frame1(){
yesbtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
yesbtn.addEventListener(MouseEvent.MOUSE_OUT, out);
nobtn.addEventListener(MouseEvent.MOUSE_OVER, roll);
nobtn.addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function roll(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
}
}
}//package
Section 78
//sword1 (sword1)
package {
import flash.media.*;
public dynamic class sword1 extends Sound {
}
}//package
Section 79
//sword2 (sword2)
package {
import flash.media.*;
public dynamic class sword2 extends Sound {
}
}//package
Section 80
//sword3 (sword3)
package {
import flash.media.*;
public dynamic class sword3 extends Sound {
}
}//package
Section 81
//sword4 (sword4)
package {
import flash.media.*;
public dynamic class sword4 extends Sound {
}
}//package
Section 82
//sword5 (sword5)
package {
import flash.media.*;
public dynamic class sword5 extends Sound {
}
}//package
Section 83
//sword6 (sword6)
package {
import flash.media.*;
public dynamic class sword6 extends Sound {
}
}//package
Section 84
//sword7 (sword7)
package {
import flash.media.*;
public dynamic class sword7 extends Sound {
}
}//package
Section 85
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 86
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 87
//titleScreen (titleScreen)
package {
import flash.display.*;
public dynamic class titleScreen extends MovieClip {
public var mc:MovieClip;
public function titleScreen(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 88
//vs (vs)
package {
import flash.media.*;
public dynamic class vs extends Sound {
}
}//package