Section 1
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var pressTimer:Timer;
protected var _autoRepeat:Boolean;// = false
protected var _selected:Boolean;// = false
protected var background:DisplayObject;
private var unlockedMouseState:String;
protected var mouseState:String;
private var _mouseStateLocked: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(){
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
override public function get enabled():Boolean{
return (super.enabled);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
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 drawLayout():void{
background.width = width;
background.height = height;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
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();
};
};
};
}
protected function drawBackground():void{
var _local1:String = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
var _local2:DisplayObject = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public function get selected():Boolean{
return (_selected);
}
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 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 selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
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 setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
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 _emphasized:Boolean;// = false
protected var emphasizedBorder:DisplayObject;
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
var _local1:Object = 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 function get emphasized():Boolean{
return (_emphasized);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
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 static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 3
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 4
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _toggle:Boolean;// = false
public var textField:TextField;
protected var mode:String;// = "center"
protected var _labelPlacement:String;// = "right"
protected var oldMouseState:String;
protected var _label:String;// = "Label"
protected var icon:DisplayObject;
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;
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();
}
override protected function drawLayout():void{
var _local7:Number;
var _local8:Number;
var _local1:Number = Number(getStyleValue("textPadding"));
var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
var _local3:Number = (textField.textWidth + 4);
var _local4:Number = (textField.textHeight + 4);
var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1);
var _local6:Number = ((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();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
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));
};
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function get toggle():Boolean{
return (_toggle);
}
protected function setEmbedFont(){
var _local1:Object = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function drawIcon():void{
var _local1:DisplayObject = icon;
var _local2:String = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
var _local3:Object = 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);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
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);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
protected function drawTextFormat():void{
var _local1:Object = UIComponent.getStyleDefinition();
var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public function get label():String{
return (_label);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 5
//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 6
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.utils.*;
import fl.events.*;
import flash.text.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _x:Number;
protected var _enabled:Boolean;// = true
protected var callLaterMethods:Dictionary;
private var _mouseFocusEnabled:Boolean;// = true
private var tempText:TextField;
private var _focusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var invalidateFlag:Boolean;// = false
protected var _oldIMEMode:String;// = null
protected var _inspector:Boolean;// = false
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var invalidHash:Object;
protected var sharedStyles:Object;
protected var uiFocusRect:DisplayObject;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var _width:Number;
protected var instanceStyles:Object;
public var version:String;// = "3.0.0.16"
protected var isFocused:Boolean;// = false
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(){
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 getStyle(_arg1:String):Object{
return (instanceStyles[_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"));
}
private function callLaterDispatcher(_arg1:Event):void{
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;
var _local2:Dictionary = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
protected function validate():void{
invalidHash = {};
}
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);
}
override public function get height():Number{
return (_height);
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
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{
}
override public function get scaleY():Number{
return ((height / startHeight));
}
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;
};
};
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function configUI():void{
isLivePreview = checkLivePreview();
var _local1:Number = rotation;
rotation = 0;
var _local2:Number = super.width;
var _local3:Number = 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 setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
override public function get scaleX():Number{
return ((width / startWidth));
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
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 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);
}
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 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);
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
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);
};
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
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 skin = _arg1;
var classDef:Object;
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 initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject = 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);
}
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);
};
}
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();
}
override public function set visible(_arg1:Boolean):void{
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
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 y(_arg1:Number):void{
move(_x, _arg1);
}
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);
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local5:Object;
var _local6:String;
var _local2:Object = {};
var _local3:uint = _args.length;
var _local4:uint;
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 7
//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 8
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.display.*;
import flash.events.*;
import fl.controls.*;
import fl.core.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
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 _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
var _local5:int = focusableCandidates.length;
var _local6:int = _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);
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
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));
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject = (_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);
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
if (!hasFocusableObjects()){
return;
};
var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_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 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);
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local3:TextField;
var _local4:SimpleButton;
var _local2:DisplayObjectContainer = 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);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button = (_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 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 = focusableCandidates.length;
var _local3:int;
_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 _local4:InteractiveObject;
var _local3:DisplayObject = 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 _local5:int;
var _local6:String;
var _local7:String;
var _local3 = "";
var _local4 = "";
var _local8 = "0000";
var _local9:DisplayObject = DisplayObject(_arg1);
var _local10:DisplayObject = 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 = 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 _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var _local2:DisplayObject = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
var _local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
var _local4:int = getIndexOfFocusedObject(_local2);
var _local5:Boolean;
var _local6:int = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (_arg1.isDefaultPrevented()){
return;
};
var _local2:InteractiveObject = 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 = _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 _local3:Button;
var _local2:InteractiveObject = 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{
calculateCandidates = true;
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
var _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 get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
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;
}
}
}//package fl.managers
Section 9
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
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 findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function hideFocus():void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function setFocus(_arg1:InteractiveObject):void;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 10
//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 11
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function get selected():Boolean;
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
}
}//package fl.managers
Section 12
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var classToInstancesDict:Dictionary;
private var globalStyles:Object;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToDefaultStylesDict: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 = getClassDef(_arg1);
var _local4:Object = 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 = getClassDef(_arg1);
var _local5:Object = 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 _local5:String;
var _local2:StyleManager = getInstance();
var _local3:Class = getClassDef(_arg1);
var _local4:Object = _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 = getClassDef(_arg1);
var _local4:Object = 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 _local4:Object;
var _local5:UIComponent;
var _local3:Dictionary = 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 _local3:Object;
var _local2:Dictionary = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
var inst:StyleManager = getInstance();
var classDef:Class = 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;
if (inst.classToStylesDict[classDef] == null){
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 = getClassDef(_arg1);
var _local4:StyleManager = getInstance();
var _local5:Object = _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 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 13
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("3.0 as3");
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
var sendHostProgress:Boolean;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 14
//Util (myUtil.Util)
package myUtil {
import flash.display.*;
import flash.geom.*;
import fl.managers.*;
import ZombieKiller.*;
import flash.system.*;
public class Util {
public static function addObject(_arg1:Number, _arg2:String, _arg3:Array, _arg4:MovieClip, _arg5:Object):void{
var _local6:int = _arg3.length;
var _local7:int = _local6;
while (_local7 < (_local6 + _arg1)) {
_arg3[_local7] = MovieClip(Util.getResource((_arg2 + "MC")));
_arg5.addChild(_arg3[_local7]);
_local7++;
};
}
public static function setStageFocus(_arg1:Object):void{
var _local2:* = _arg1;
var _local3:* = new FocusManager(_local2);
if (_local3 == null){
_local3 = new FocusManager(_local2);
_local3.setFocus(_local2);
} else {
_local3.setFocus(_local2);
};
}
public static function getResource(_arg1:String):Sprite{
var _local2:ApplicationDomain = ApplicationDomain.currentDomain;
var _local3:MovieClip;
var _local4:Class = (_local2.getDefinition(_arg1) as Class);
if (_local4 != null){
_local3 = new (_local4);
};
return (_local3);
}
public static function getRotation_fixedPoint(_arg1:Number, _arg2:Number, _arg3:MovieClip):Number{
var _local4:Number = _arg3.mouseX;
var _local5:Number = _arg3.mouseY;
var _local6:Number = ((Math.atan2((_local5 - _arg2), (_local4 - _arg1)) * 180) / Math.PI);
return (_local6);
}
public static function getSpeedY(_arg1:Number, _arg2:Number, _arg3:MovieClip, _arg4:Number):Number{
var _local5:Number = _arg3.mouseX;
var _local6:Number = _arg3.mouseY;
var _local7:Number = Math.atan2((_local6 - _arg2), (_local5 - _arg1));
var _local8:* = (_arg4 * Math.sin(_local7));
return (_local8);
}
public static function getDistanceToPoint(_arg1:Point, _arg2:MovieClip):Number{
var _local3:Number = Math.sqrt((Math.pow((_arg1.x - _arg2.x), 2) + Math.pow((_arg1.y - _arg2.y), 2)));
return (_local3);
}
public static function getDistance(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Number = Math.sqrt((Math.pow((_arg1.x - _arg2.x), 2) + Math.pow((_arg1.y - _arg2.y), 2)));
return (_local3);
}
public static function getSpeedX(_arg1:Number, _arg2:Number, _arg3:MovieClip, _arg4:Number):Number{
var _local5:Number = _arg3.mouseX;
var _local6:Number = _arg3.mouseY;
var _local7:Number = Math.atan2((_local6 - _arg2), (_local5 - _arg1));
var _local8:* = (_arg4 * Math.cos(_local7));
return (_local8);
}
public static function doFigure(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:MovieClip){
var _local5:Number = 0;
var _local6:* = new Object();
_local6.x = (_arg1.x + _arg2);
_local6.y = _arg1.y;
if (_arg2 < 0){
if (_arg4.hitTestPoint((_arg1.x + _arg2), _arg1.y, true)){
_local5 = -3.14159265358979;
while (_local5 < -1.5707963267949) {
_local6.x = ((Math.cos(_local5) * -(_arg3)) + _arg1.x);
_local6.y = ((Math.sin(_local5) * -(_arg3)) + _arg1.y);
if (_arg4.hitTestPoint(_local6.x, _local6.y, true) == false){
_local5 = 0;
};
_local5 = (_local5 + 0.0628318530717959);
};
};
} else {
if (_arg2 > 0){
if (_arg4.hitTestPoint((_arg1.x + _arg2), _arg1.y, true)){
_local5 = 0;
while (_local5 > -1.5707963267949) {
_local6.x = ((Math.cos(_local5) * _arg3) + _arg1.x);
_local6.y = ((Math.sin(_local5) * _arg3) + _arg1.y);
if (_arg4.hitTestPoint(_local6.x, _local6.y, true) == false){
_local5 = -1.5707963267949;
};
_local5 = (_local5 - 0.10471975511966);
};
};
};
};
if ((_arg1.y - _local6.y) < (Math.abs(_arg3) * 0.96)){
if ((((((((_arg4.hitTestPoint((_arg1.x + 40), (_arg1.y - 20), true) == false)) && ((_arg2 > 0)))) || ((((_arg4.hitTestPoint((_arg1.x - 40), (_arg1.y - 20), true) == false)) && ((_arg2 < 0)))))) && (!((_arg1.currentLabel == "pndHit"))))){
_arg1.x = _local6.x;
};
_arg1.y = _local6.y;
};
}
public static function getRandomColor():ColorTransform{
var _local1:Number = ((Math.random() * 0x0200) - 0xFF);
var _local2:Number = ((Math.random() * 0x0200) - 0xFF);
var _local3:Number = ((Math.random() * 0x0200) - 0xFF);
return (new ColorTransform(1, 1, 1, 1, _local1, _local2, _local3, 0));
}
public static function initLayers(_arg1:MovieClip):void{
var _local3:*;
var _local4:MovieClip;
var _local2:Array = ["background", "scene", "tool", "enemy", "weapon", "charactor", "alert"];
for (_local3 in _local2) {
_local4 = new MovieClip();
_local4.name = _local2[_local3];
_arg1.addChild(_local4);
Cache.Layers[_local2[_local3]] = _local4;
};
}
public static function getRotation(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Number = _arg2.mouseX;
var _local4:Number = _arg2.mouseY;
var _local5:Number = ((Math.atan2((_local4 - _arg1.y), (_local3 - _arg1.x)) * 180) / Math.PI);
return (_local5);
}
public static function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
public static function getLocaledPoint(_arg1:MovieClip, _arg2:MovieClip):Point{
var _local3:* = new Point(_arg1.x, _arg1.y);
_local3 = _arg1.parent.localToGlobal(_local3);
_local3 = _arg2.globalToLocal(_local3);
return (_local3);
}
public static function getDistanceToMouse(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Number = _arg2.mouseX;
var _local4:Number = _arg2.mouseY;
var _local5:Number = Math.sqrt((Math.pow((_arg1.x - _local3), 2) + Math.pow((_arg1.y - _local4), 2)));
return (_local5);
}
}
}//package myUtil
Section 15
//Timeline_109 (ZombieAvengerCS3_fla.Timeline_109)
package ZombieAvengerCS3_fla {
import flash.display.*;
public dynamic class Timeline_109 extends MovieClip {
public function Timeline_109(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
this.stop();
}
}
}//package ZombieAvengerCS3_fla
Section 16
//Timeline_29 (ZombieAvengerCS3_fla.Timeline_29)
package ZombieAvengerCS3_fla {
import flash.display.*;
public dynamic class Timeline_29 extends MovieClip {
public function Timeline_29(){
addFrameScript(80, frame81);
}
function frame81(){
this.stop();
}
}
}//package ZombieAvengerCS3_fla
Section 17
//Timeline_83 (ZombieAvengerCS3_fla.Timeline_83)
package ZombieAvengerCS3_fla {
import flash.display.*;
public dynamic class Timeline_83 extends MovieClip {
public var gun:MovieClip;
public function Timeline_83(){
addFrameScript(0, frame1, 4, frame5, 7, frame8, 10, frame11);
}
function frame1(){
this.stop();
}
function frame5(){
this.gotoAndStop(1);
}
function frame8(){
this.gotoAndStop(1);
}
function frame11(){
this.gotoAndStop(1);
}
}
}//package ZombieAvengerCS3_fla
Section 18
//Timeline_84 (ZombieAvengerCS3_fla.Timeline_84)
package ZombieAvengerCS3_fla {
import flash.display.*;
public dynamic class Timeline_84 extends MovieClip {
public var sensor:MovieClip;
public function Timeline_84(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
function frame3(){
this.stop();
}
}
}//package ZombieAvengerCS3_fla
Section 19
//BackGround (ZombieKiller.BackGround)
package ZombieKiller {
import flash.display.*;
import myUtil.*;
public class BackGround extends MovieClip {
var ss:String;
var s:String;// = ""
public function BackGround(){
while (Cache.Layers["background"].numChildren > 0) {
Cache.Layers["background"].removeChildAt(0);
};
Cache.backGroundArr.splice(0, Cache.backGroundArr.length);
if (Cache.level == 1){
addBackGround("background1_", 7);
} else {
if (Cache.level == 2){
addBackGround("background2_", 7);
} else {
if (Cache.level == 3){
addBackGround("background3_", 8);
};
};
};
}
public function addBackGround(_arg1:String, _arg2:Number):void{
this.s = _arg1;
var _local3:int;
while (_local3 < _arg2) {
ss = String(_local3);
s = s.concat(ss);
Cache.backGroundArr[_local3] = Util.getResource(s);
Cache.backGroundArr[0].x = 0;
if (_local3 > 0){
Cache.backGroundArr[_local3].x = ((Cache.backGroundArr[(_local3 - 1)].x + Cache.backGroundArr[(_local3 - 1)].width) - 1);
};
Cache.backGroundArr[_local3].cacheAsBitmap = true;
Cache.Layers["background"].addChild(Cache.backGroundArr[_local3]);
this.s = _arg1;
_local3++;
};
}
}
}//package ZombieKiller
Section 20
//Boss1 (ZombieKiller.Boss1)
package ZombieKiller {
public class Boss1 extends Enemy {
public function Boss1(){
this.x = (Cache.totalWidth - 1500);
this.y = 300;
this.scaleX = (scaleY = 0.6);
enemyHealth = 1000;
easingSpeed = 0.5;
canJump = true;
jumpSpeed = 60;
Cache.boss = this;
this.cacheAsBitmap = true;
}
}
}//package ZombieKiller
Section 21
//Boss2 (ZombieKiller.Boss2)
package ZombieKiller {
import flash.display.*;
import flash.geom.*;
public class Boss2 extends Enemy {
public var boss2fire:MovieClip;
public function Boss2(){
this.x = (Cache.totalWidth - 1500);
this.y = 300;
this.scaleX = (scaleY = 0.6);
enemyHealth = 1000;
easingSpeed = 0.3;
canJump = true;
jumpSpeed = 60;
Cache.boss = this;
}
override public function attack():void{
if (Math.abs((this.x - Cache.hero.x)) <= 80){
if (((!((this.currentLabel == "attack"))) && (!((this.currentLabel == "attack1"))))){
this.gotoAndPlay("attack1");
};
};
if ((((Math.abs((this.x - Cache.hero.x)) <= 800)) && ((Math.abs((this.x - Cache.hero.x)) > 80)))){
if (((!((this.currentLabel == "attack"))) && (!((this.currentLabel == "attack1"))))){
this.gotoAndPlay("attack");
};
};
if (((!((this.boss2fire == null))) && (this.boss2fire.hitTestObject(Cache.hero)))){
Cache.heroHealth = (Cache.heroHealth - 0.1);
Cache.hero.transform.colorTransform = new ColorTransform(3, 3, 3, 1);
};
}
}
}//package ZombieKiller
Section 22
//Box (ZombieKiller.Box)
package ZombieKiller {
import flash.display.*;
import flash.events.*;
import myUtil.*;
public class Box extends MovieClip {
public function Box(){
this.y = -100;
this.addEventListener(Event.ENTER_FRAME, boxMove);
}
public function boxMove(_arg1:Event):void{
if (this.parent == null){
return;
};
this.y = (this.y + 6);
if (Cache.scene.hitTestPoint(this.x, this.y, true)){
removeBox();
};
if (Cache.hero.hitTestObject(this)){
if ((this is Box1MC)){
Cache.heroHealth = (Cache.heroHealth + 2);
removeBox();
} else {
if ((((this is Box2MC)) && (!((Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1)) == null))))){
MovieClip(Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1))).m2Num.text = (Number(MovieClip(Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1))).m2Num.text) + 10);
removeBox();
} else {
if ((((this is Box3MC)) && (!((Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1)) == null))))){
MovieClip(Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1))).m3Num.text = (Number(MovieClip(Cache.main.parent.getChildAt((Cache.main.parent.numChildren - 1))).m3Num.text) + 5);
removeBox();
};
};
};
};
}
public function removeBox():void{
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, boxMove);
};
if (this.parent != null){
this.parent.removeChild(this);
};
Cache.boxArr.splice(Cache.boxArr.indexOf(this), 1);
}
public static function addBox(_arg1, _arg2){
var _local3:int = Cache.boxArr.length;
var _local4:int = _local3;
while (_local4 < (_local3 + _arg1)) {
Cache.boxArr[_local4] = MovieClip(Util.getResource((_arg2 + "MC")));
if (Util.randRange(0, 2) == 1){
Cache.boxArr[_local4].x = Util.randRange((Cache.hero.x - 300), Cache.hero.x);
} else {
Cache.boxArr[_local4].x = Util.randRange(Cache.hero.x, (Cache.hero.x + 300));
};
Cache.Layers["scene"].addChild(Cache.boxArr[_local4]);
_local4++;
};
}
}
}//package ZombieKiller
Section 23
//Cache (ZombieKiller.Cache)
package ZombieKiller {
import flash.display.*;
public class Cache {
public static var soundSwit:Boolean = false;
public static var enemyArr:Array = [];
public static var scene:MovieClip = null;
public static var level:Number = 1;
public static var boxArr:Array = [];
public static var scene3_Length:Number = 8;
public static var scene1_Length:Number = 7;
public static var totalKilled:Number = 0;
public static var Layers:Array = [];
public static var pauseSwit:Boolean = false;
public static var boss:MovieClip = null;
public static var totalWidth:Number = 0;
public static var backGroundArr:Array = [];
public static var sceneArr:Array = [];
public static var heroHealth:int = 100;
public static var totalTime:Number = 0;
public static var main:Main = null;
public static var hero:Hero = null;
public static var scene2_Length:Number = 7;
public static function reset():void{
Cache.totalKilled = 0;
Cache.totalTime = 0;
Cache.heroHealth = 35;
Cache.enemyArr.splice(0, Cache.enemyArr.length);
if (Cache.main.tool != null){
MovieClip(Cache.main.tool).weapon.gotoAndStop("m1");
MovieClip(Cache.main.tool).m2Num.text = "10";
MovieClip(Cache.main.tool).m3Num.text = "5";
MovieClip(Cache.main.tool).killedTxt.text = "0";
};
}
}
}//package ZombieKiller
Section 24
//Enemy (ZombieKiller.Enemy)
package ZombieKiller {
import flash.display.*;
import flash.geom.*;
import myUtil.*;
public class Enemy extends MovieClip {
var enemyHealth:int;// = 10
var easingSpeed:Number;// = 0
var initSpeed:Number;// = 10
var canJump:Boolean;// = false
var enemySpeed:Number;// = 0
var grav:Number;// = 0.5
var maxEnemySpeed:Number;// = 15
var noWay:Number;// = 0
var enemyName:String;// = ""
var jumping:Boolean;// = false
var jump:Boolean;// = false
var jumpSpeed:Number;// = 0
public function Enemy(){
if (Util.randRange(0, 1) == 0){
this.x = Util.randRange((Cache.hero.x + 350), (Cache.hero.x + 500));
} else {
this.x = Util.randRange((Cache.hero.x - 500), (Cache.hero.x - 350));
};
this.y = 400;
this.scaleX = (scaleY = 0.5);
this.gotoAndPlay("standBy");
this.cacheAsBitmap = true;
}
public function run():void{
enemyMove();
if (this.currentLabel == "dead"){
removeEnemy();
};
if (((((((((!((this.currentLabel == "death"))) && (!((this.currentLabel == "dead"))))) && (!((Cache.hero.currentLabel == "death"))))) && (!((this.currentLabel == "jump"))))) && (!((this.currentLabel == "fall"))))){
attack();
};
}
public function attack():void{
if (this.hitTestObject(Cache.hero)){
if (this.currentLabel != "attack"){
this.gotoAndPlay("attack");
Cache.heroHealth = (Cache.heroHealth - 1);
Cache.hero.transform.colorTransform = new ColorTransform(3, 3, 3, 1);
};
};
}
public function enemyMove():void{
if (((((!((this.currentLabel == "death"))) && (!((this.currentLabel == "dead"))))) && (!((Cache.hero.currentLabel == "death"))))){
if (this.hitTestObject(Cache.hero)){
enemySpeed = 0;
} else {
if (this.hitTestObject(Cache.hero) == false){
if (this.x < Cache.hero.x){
enemySpeed = (initSpeed * easingSpeed);
} else {
if (this.x > Cache.hero.x){
enemySpeed = (-(initSpeed) * easingSpeed);
};
};
};
};
} else {
enemySpeed = 0;
};
if (enemySpeed > 0){
this.scaleX = Math.abs(this.scaleX);
if ((Cache.scene.hitTestPoint((this.x + 20), (this.y - 20), true) == false)){
this.x = (this.x + enemySpeed);
};
} else {
if (enemySpeed < 0){
this.scaleX = -(Math.abs(this.scaleX));
if (Cache.scene.hitTestPoint((this.x - 20), (this.y - 20), true) == false){
this.x = (this.x + enemySpeed);
};
};
};
var _local1:Number = 0;
while ((((Cache.scene.hitTestPoint(this.x, (this.y + 2), true) == false)) && ((_local1 < 18)))) {
this.y = (this.y + 1);
_local1++;
};
while (Cache.scene.hitTestPoint(this.x, this.y, true)) {
this.y = (this.y - 3);
};
if (((canJump) && (!((((((this.currentLabel == "death")) || ((this.currentLabel == "dead")))) || ((Cache.hero.currentLabel == "death"))))))){
jumpAction();
};
if (((!((Math.abs(enemySpeed) == 0))) && (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)))){
if ((((this.currentLabel == "standBy")) || ((this.currentLabel == "fall")))){
if (this.currentLabel != "move"){
this.gotoAndPlay("move");
};
};
};
if ((((Math.abs(enemySpeed) == 0)) && (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)))){
if ((((this.currentLabel == "move")) || ((this.currentLabel == "fall")))){
if (this.currentLabel != "standBy"){
this.gotoAndPlay("standBy");
};
};
};
enemySpeed = 0;
}
public function jumpAction():void{
if (((Cache.scene.hitTestPoint((this.x + 20), (this.y - 20), true)) || (Cache.scene.hitTestPoint((this.x - 20), (this.y - 20), true)))){
jumpSpeed = 50;
if (((!((this.currentLabel == "jump"))) && (!((this.currentLabel == "fall"))))){
this.gotoAndPlay("jump");
};
};
if ((((jumpSpeed > 0)) && ((Cache.scene.hitTestPoint(this.x, (this.y - 80), true) == false)))){
this.y = (this.y - jumpSpeed);
} else {
jumpSpeed = 0;
};
jumpSpeed = (jumpSpeed - (jumpSpeed / 10));
if (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)){
jumpSpeed = 0;
};
}
public function removeEnemy():void{
if (this.parent != null){
this.parent.removeChild(this);
};
Cache.enemyArr.splice(Cache.enemyArr.indexOf(this), 1);
}
}
}//package ZombieKiller
Section 25
//EnemyGroup (ZombieKiller.EnemyGroup)
package ZombieKiller {
import flash.display.*;
import myUtil.*;
public class EnemyGroup {
public static function addEnemy(_arg1:int, _arg2:String){
var _local3:int;
while (_local3 < _arg1) {
Cache.enemyArr.push(MovieClip(Util.getResource((_arg2 + "MC"))));
Cache.Layers["enemy"].addChild(Cache.enemyArr[(Cache.enemyArr.length - 1)]);
_local3++;
};
}
}
}//package ZombieKiller
Section 26
//GameOver (ZombieKiller.GameOver)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class GameOver extends MovieClip {
public var totalScoreTxt:TextField;
public var timeTxt:TextField;
public var btnMoreGames:SimpleButton;
public var btnNextGames:SimpleButton;
public var killedTxt:TextField;
public var btnBackToMenu:SimpleButton;
public function GameOver(){
btnBackToMenu.addEventListener(MouseEvent.CLICK, playAgainProcess);
btnMoreGames.addEventListener(MouseEvent.CLICK, moreGamesProcess);
btnNextGames.addEventListener(MouseEvent.CLICK, nextGamesProcess);
killedTxt.text = String(Cache.totalKilled);
timeTxt.text = String(Cache.totalTime);
totalScoreTxt.text = String(Math.round(((Cache.totalKilled / Cache.totalTime) * 100)));
}
function nextGamesProcess(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.onlineaddicted.com"), "_blank");
}
function playAgainProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
Cache.main.restart();
}
function moreGamesProcess(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.gamebusted.com");
navigateToURL(_local2, "_blank");
}
}
}//package ZombieKiller
Section 27
//GreenGhost (ZombieKiller.GreenGhost)
package ZombieKiller {
public class GreenGhost extends Enemy {
public function GreenGhost(){
enemyHealth = 50;
easingSpeed = 0.5;
canJump = true;
jumpSpeed = 60;
}
}
}//package ZombieKiller
Section 28
//Hero (ZombieKiller.Hero)
package ZombieKiller {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import myUtil.*;
import flash.media.*;
import flash.ui.*;
public class Hero extends MovieClip {
public var gun:MovieClip;
var canMove:Boolean;// = false
var isShot:Boolean;// = false
var moveRight:Boolean;// = false
var charSpeed:Number;// = 0
var weapon1:MovieClip;// = null
var weapon3:MovieClip;// = null
var shotSound1:Sound;
var weapon2:MovieClip;// = null
var canJump:Boolean;// = false
var shotSound2:Sound;
var canShot:Boolean;// = false
var moveLeft:Boolean;// = false
var jumpSpeed:Number;// = 0
public function Hero(){
this.scaleX = (scaleY = 0.5);
this.gotoAndPlay("standBy");
this.x = 480;
this.y = 430;
this.cacheAsBitmap = true;
Cache.hero = this;
Cache.main.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
Cache.main.stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
Cache.main.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
Cache.main.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
Cache.main.stage.addEventListener(FocusEvent.FOCUS_OUT, handleFocus);
shotSound1 = new ShotSound1();
shotSound2 = new ShotSound2();
}
public function removeHeroListener():void{
this.charSpeed = 0;
this.canJump = false;
this.canShot = false;
if (Cache.main.stage.hasEventListener(KeyboardEvent.KEY_DOWN)){
Cache.main.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
};
if (Cache.main.stage.hasEventListener(KeyboardEvent.KEY_UP)){
Cache.main.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
};
if (Cache.main.stage.hasEventListener(MouseEvent.MOUSE_DOWN)){
Cache.main.stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
};
if (Cache.main.stage.hasEventListener(MouseEvent.MOUSE_UP)){
Cache.main.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
};
}
public function charMove():void{
if (this.currentLabel != "death"){
if (((!((this.gun == null))) && (!((this.gun.gun == null))))){
this.gun.rotation = ((Math.atan2(((this.mouseY + 110) - this.gun.gun.y), (this.mouseX - this.gun.gun.x)) * 180) / Math.PI);
};
};
this.transform.colorTransform = new ColorTransform(0.6, 0.6, 0.8, 1);
if ((((this.parent.mouseX > this.x)) && (!((this.currentLabel == "death"))))){
this.scaleX = Math.abs(this.scaleX);
};
if ((((this.parent.mouseX <= this.x)) && (!((this.currentLabel == "death"))))){
this.scaleX = -(Math.abs(this.scaleX));
};
if (((canJump) && (((Cache.scene.hitTestPoint(this.x, (this.y + 3), true)) || (Cache.scene.hitTestPoint(this.x, this.y, true)))))){
if (this.currentLabel != "jump"){
this.gotoAndPlay("jump");
};
jumpSpeed = 60;
};
if ((((jumpSpeed > 0)) && ((Cache.scene.hitTestPoint(this.x, (this.y - 80), true) == false)))){
this.y = (this.y - jumpSpeed);
} else {
jumpSpeed = 0;
};
jumpSpeed = (jumpSpeed - (jumpSpeed / 10));
if (moveLeft){
charSpeed = -10;
};
if (moveRight){
charSpeed = 10;
};
if (charSpeed > 0){
if (Cache.scene.hitTestPoint((this.x + 10), (this.y - 10), true) == false){
this.x = (this.x + charSpeed);
};
} else {
if (charSpeed < 0){
if (Cache.scene.hitTestPoint((this.x - 10), (this.y - 10), true) == false){
this.x = (this.x + charSpeed);
};
};
};
var _local1:Number = 0;
while ((((Cache.scene.hitTestPoint(this.x, (this.y + 2), true) == false)) && ((_local1 < 18)))) {
this.y = (this.y + 1.4);
_local1++;
};
while (Cache.scene.hitTestPoint(this.x, this.y, true)) {
this.y = (this.y - 1);
};
if (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)){
jumpSpeed = 0;
};
if (((!((Math.abs(charSpeed) == 0))) && (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)))){
if ((((((((this.currentLabel == "standBy")) || ((this.currentLabel == "fall")))) || ((this.currentLabel == "backwardmove")))) || ((this.currentLabel == "move")))){
if ((((((charSpeed > 0)) && ((this.scaleX > 0)))) || ((((charSpeed < 0)) && ((this.scaleX < 0)))))){
if (this.currentLabel != "move"){
this.gotoAndPlay("move");
};
};
if ((((((charSpeed > 0)) && ((this.scaleX < 0)))) || ((((charSpeed < 0)) && ((this.scaleX > 0)))))){
if (this.currentLabel != "backwardmove"){
this.gotoAndPlay("backwardmove");
};
};
};
};
if ((((Math.abs(charSpeed) == 0)) && (Cache.scene.hitTestPoint(this.x, (this.y + 5), true)))){
if ((((((this.currentLabel == "move")) || ((this.currentLabel == "backwardmove")))) || ((this.currentLabel == "fall")))){
if (this.currentLabel != "standBy"){
this.gotoAndPlay("standBy");
};
};
};
}
function attack():void{
if (this.scaleX > 0){
if (Cache.scene.hitTestPoint((this.x - 20), (this.y - 20), true) == false){
this.x = (this.x - 2);
};
} else {
if (this.scaleX < 0){
if (Cache.scene.hitTestPoint((this.x + 20), (this.y - 20), true) == false){
this.x = (this.x + 2);
};
};
};
if (Cache.main.tool.weapon.currentLabel == "m1"){
weapon1 = MovieClip(Util.getResource("m1"));
Cache.Layers["weapon"].addChild(weapon1);
if (this.gun.currentLabel != "shot1"){
this.gun.gotoAndPlay("shot1");
};
shotSound1.play();
} else {
if (Cache.main.tool.weapon.currentLabel == "m2"){
if (Cache.main.tool.m2Num.text > 0){
weapon2 = MovieClip(Util.getResource("m2"));
Cache.Layers["weapon"].addChild(weapon2);
Cache.main.tool.m2Num.text = (Number(Cache.main.tool.m2Num.text) - 1);
if (this.gun.currentLabel != "shot2"){
this.gun.gotoAndPlay("shot2");
};
shotSound2.play();
};
} else {
if (Cache.main.tool.weapon.currentLabel == "m3"){
if (Cache.main.tool.m3Num.text > 0){
weapon3 = MovieClip(Util.getResource("m3"));
Cache.Layers["weapon"].addChild(weapon3);
Cache.main.tool.m3Num.text = (Number(Cache.main.tool.m3Num.text) - 1);
if (this.gun.currentLabel != "shot3"){
this.gun.gotoAndPlay("shot3");
};
};
};
};
};
}
public function handleFocus(_arg1:FocusEvent):void{
this.canJump = false;
this.canShot = false;
Util.setStageFocus(Cache.main.stage);
}
public function run():void{
charMove();
if (((canShot) && (!(isShot)))){
isShot = true;
if (((!((this.gun == null))) && (!((this.gun.gun == null))))){
attack();
};
};
}
public function keyUp(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
moveRight = false;
charSpeed = 0;
} else {
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
moveLeft = false;
charSpeed = 0;
} else {
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
canJump = false;
};
};
};
}
public function mouseUp(_arg1:MouseEvent):void{
this.canShot = false;
isShot = false;
}
public function keyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
moveRight = true;
} else {
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
moveLeft = true;
} else {
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
canJump = true;
} else {
if (_arg1.keyCode == 49){
Cache.main.tool.weapon.gotoAndStop("m1");
this.gun.gun.gotoAndStop(1);
} else {
if (_arg1.keyCode == 50){
Cache.main.tool.weapon.gotoAndStop("m2");
this.gun.gun.gotoAndStop(2);
} else {
if (_arg1.keyCode == 51){
Cache.main.tool.weapon.gotoAndStop("m3");
this.gun.gun.gotoAndStop(3);
} else {
if (_arg1.keyCode == 81){
if (Cache.main.tool.weapon.currentLabel == "m1"){
Cache.main.tool.weapon.gotoAndStop("m2");
this.gun.gun.gotoAndStop(2);
} else {
if (Cache.main.tool.weapon.currentLabel == "m2"){
Cache.main.tool.weapon.gotoAndStop("m3");
this.gun.gun.gotoAndStop(3);
} else {
if (Cache.main.tool.weapon.currentLabel == "m3"){
Cache.main.tool.weapon.gotoAndStop("m1");
this.gun.gun.gotoAndStop(1);
};
};
};
};
};
};
};
};
};
};
}
public function mouseDown(_arg1:MouseEvent):void{
this.canShot = true;
}
}
}//package ZombieKiller
Section 29
//Instruction (ZombieKiller.Instruction)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import myUtil.*;
public class Instruction extends MovieClip {
public var btnStartGame:SimpleButton;
public var btnBackToMenu:SimpleButton;
public function Instruction(){
btnStartGame.addEventListener(MouseEvent.CLICK, startGameProcess);
btnBackToMenu.addEventListener(MouseEvent.CLICK, backToMenuProcess);
}
function startGameProcess(_arg1:MouseEvent):void{
Cache.main.startGame();
}
function backToMenuProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
var _local2:MovieClip = MovieClip(Util.getResource("StartGameMC"));
Cache.Layers["background"].addChild(_local2);
}
}
}//package ZombieKiller
Section 30
//Knife (ZombieKiller.Knife)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
import myUtil.*;
public class Knife extends MovieClip {
private var vx:Number;// = 0
private var vy:Number;// = 0
private var ox:Number;// = 0
public var knifePoint:Point;
private var count:Number;// = 0
private var speedX:Number;// = 0
private var speedY:Number;// = 0
private var hitSound:Sound;
public function Knife(){
this.gotoAndStop(1);
this.scaleX = (scaleY = 0.6);
this.addEventListener(Event.ENTER_FRAME, knifeMove);
hitSound = new knifeHitSound();
}
public function removeKnife():void{
if (((!((this.parent == null))) && (!((this.parent.numChildren == 0))))){
this.parent.removeChild(this);
};
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, knifeMove);
};
}
public function knifeMove(_arg1:Event):void{
count++;
if (count == 1){
ox = this.x;
this.rotation = ((Math.atan2(((Cache.hero.y - 50) - this.y), (Cache.hero.x - this.x)) * 180) / Math.PI);
speedX = ((Cache.hero.x - this.x) * 0.1);
speedY = (((Cache.hero.y - 50) - this.y) * 0.1);
};
if (Cache.scene.hitTestPoint(this.x, this.y, true)){
vx = 0;
vy = 0;
if (Util.randRange(0, 50) == 16){
removeKnife();
};
} else {
if (Math.abs((ox - this.x)) > 300){
vx = 0;
vy = 0;
removeKnife();
} else {
vx = speedX;
vy = speedY;
};
};
this.x = (this.x + vx);
this.y = (this.y + vy);
if (Cache.hero.hitTestPoint(this.x, this.y, true)){
hitSound.play();
Cache.heroHealth = (Cache.heroHealth - 1);
Cache.hero.transform.colorTransform = new ColorTransform(3, 3, 3, 1);
removeKnife();
};
}
}
}//package ZombieKiller
Section 31
//LevelFinished (ZombieKiller.LevelFinished)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class LevelFinished extends MovieClip {
public var btnNextGame:SimpleButton;
public var timeTxt:TextField;
public var totalScoreTxt:TextField;
public var levelTxt:TextField;
public var btnMoreGames:SimpleButton;
public var killedTxt:TextField;
public var btnNextLevel:SimpleButton;
public function LevelFinished(){
btnNextLevel.addEventListener(MouseEvent.CLICK, nextLevelProcess);
btnNextGame.addEventListener(MouseEvent.CLICK, nextGameProcess);
btnMoreGames.addEventListener(MouseEvent.CLICK, moreGamesProcess);
killedTxt.text = String(Cache.totalKilled);
timeTxt.text = String(Cache.totalTime);
totalScoreTxt.text = String(Math.round(((Cache.totalKilled / Cache.totalTime) * 100)));
levelTxt.text = String(Cache.level);
}
function nextGameProcess(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.onlineaddicted.com"), "_blank");
}
function moreGamesProcess(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.gamebusted.com");
navigateToURL(_local2, "_blank");
}
function nextLevelProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
Cache.main.nextLevel();
}
}
}//package ZombieKiller
Section 32
//Main (ZombieKiller.Main)
package ZombieKiller {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import myUtil.*;
import flash.media.*;
import flash.net.*;
import flash.ui.*;
public dynamic class Main extends MovieClip {
var healthTotal:int;// = 35
var bgSound:Sound;
var gbLogo_mc:GBLogoRotating;
var initRate:Number;// = 0
var startPage:MovieClip;
var bossAdded:Boolean;// = false
var cursor:MovieClip;
var bgsoundChen:SoundChannel;
public var gb:GB;
var tool:MovieClip;
var backGroundSoundChannel:SoundChannel;
var addBoss:Boolean;// = false
var timeCounter:Number;// = 0
var hero:MovieClip;
public function Main(){
addFrameScript(0, frame1, 1, frame2, 9, frame10);
}
public function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if (Cache.hero.parent == null){
return;
};
if (Cache.scene == null){
return;
};
toolDisplay();
Cache.hero.run();
generateBox();
generateEnemy();
levelCheck();
if (Cache.enemyArr != null){
_local2 = 0;
while (_local2 < Cache.enemyArr.length) {
if (Cache.enemyArr[_local2] != null){
Cache.enemyArr[_local2].run();
};
if (((((!((Cache.enemyArr[_local2] == null))) && (!((((Cache.enemyArr[_local2] is Boss1)) || ((Cache.enemyArr[_local2] is Boss2))))))) && ((((Math.abs((Cache.hero.x - Cache.enemyArr[_local2].x)) > 900)) || ((Math.abs((Cache.hero.y - Cache.enemyArr[_local2].y)) > 900)))))){
Cache.enemyArr[_local2].removeEnemy();
};
_local2++;
};
};
this.x = (300 - Cache.hero.x);
}
private function removeLayers():void{
while (Cache.Layers["background"].numChildren > 0) {
Cache.Layers["background"].removeChildAt(0);
};
while (Cache.Layers["scene"].numChildren > 0) {
Cache.Layers["scene"].removeChildAt(0);
};
while (Cache.Layers["weapon"].numChildren > 0) {
Cache.Layers["weapon"].removeChildAt(0);
};
while (Cache.Layers["enemy"].numChildren > 0) {
Cache.Layers["enemy"].removeChildAt(0);
};
while (Cache.Layers["charactor"].numChildren > 0) {
Cache.Layers["charactor"].removeChildAt(0);
};
}
function frame10(){
stop();
startIt();
}
function toolDisplay():void{
if (this.tool == null){
return;
};
timeCounter++;
Cache.totalTime = Math.round((timeCounter / initRate));
if (tool != null){
tool.timeTxt.text = Cache.totalTime;
};
tool.healthBar.bar.scaleX = (Cache.heroHealth / healthTotal);
if (tool.healthBar.bar.scaleX >= 1){
tool.healthBar.bar.scaleX = 1;
} else {
if (tool.healthBar.bar.scaleX <= 0){
tool.healthBar.bar.scaleX = 0;
};
};
}
function generateEnemy():void{
if (Math.abs(Cache.hero.x) >= (Cache.totalWidth - 2000)){
addBoss = true;
};
if (((addBoss) && (!(bossAdded)))){
if ((((Cache.level == 1)) && ((Cache.totalKilled >= 50)))){
EnemyGroup.addEnemy(1, "Boss1");
trace(Cache.boss);
bossAdded = true;
} else {
if ((((Cache.level == 2)) && ((Cache.totalKilled >= 80)))){
EnemyGroup.addEnemy(1, "Boss2");
trace(Cache.boss);
bossAdded = true;
} else {
if ((((Cache.level == 3)) && ((Cache.totalKilled >= 120)))){
EnemyGroup.addEnemy(1, "Boss3");
trace(Cache.boss);
bossAdded = true;
};
};
};
};
if (Cache.enemyArr.length < 2){
if ((((((Cache.level == 1)) && ((Cache.totalKilled <= 50)))) && ((Math.abs(Cache.hero.x) <= (Cache.totalWidth - 1000))))){
EnemyGroup.addEnemy(2, "Zombie");
if (Math.abs(Cache.hero.x) >= (Cache.totalWidth / 2)){
EnemyGroup.addEnemy(3, "Skeleton");
} else {
EnemyGroup.addEnemy(3, "Zombie");
};
} else {
if ((((((Cache.level == 2)) && ((Cache.totalKilled <= 80)))) && ((Math.abs(Cache.hero.x) <= (Cache.totalWidth - 1000))))){
if (Util.randRange(0, 1) == 0){
EnemyGroup.addEnemy(2, "Witch");
EnemyGroup.addEnemy(3, "Skeleton");
EnemyGroup.addEnemy(1, "GreenGhost");
} else {
if (Util.randRange(0, 1) == 1){
EnemyGroup.addEnemy(2, "Skeleton");
EnemyGroup.addEnemy(3, "Witch");
};
};
} else {
if ((((((Cache.level == 3)) && ((Cache.totalKilled <= 120)))) && ((Math.abs(Cache.hero.x) <= (Cache.totalWidth - 1000))))){
if (Util.randRange(0, 1) == 0){
EnemyGroup.addEnemy(2, "Witch");
EnemyGroup.addEnemy(1, "Skeleton");
EnemyGroup.addEnemy(2, "GreenGhost");
} else {
if (Util.randRange(0, 1) == 1){
EnemyGroup.addEnemy(1, "Witch");
EnemyGroup.addEnemy(2, "Skeleton");
EnemyGroup.addEnemy(2, "GreenGhost");
};
};
};
};
};
};
}
public function levelFinished():void{
removeLayers();
bgsoundChen.stop();
var _local1:MovieClip = MovieClip(Util.getResource("LevelFinishedMC"));
Cache.Layers["alert"].addChild(_local1);
_local1.x = -(this.x);
_local1.y = -(this.y);
tool.visible = false;
Cache.reset();
Cache.level++;
}
public function win():void{
removeLayers();
Cache.enemyArr.splice(0, Cache.enemyArr.length);
var _local1:MovieClip = MovieClip(Util.getResource("WinMC"));
Cache.Layers["alert"].addChild(_local1);
tool.visible = false;
_local1.x = -(this.x);
_local1.y = -(this.y);
Cache.reset();
addBoss = false;
bossAdded = false;
this.x = (this.y = 0);
}
function levelCheck():void{
if (Cache.heroHealth <= 0){
Cache.hero.removeHeroListener();
if (Cache.hero.currentLabel != "death"){
Cache.hero.gotoAndPlay("death");
};
};
if (((!((Cache.boss == null))) && ((Cache.boss.currentLabel == "dead")))){
Cache.boss.removeEnemy();
Cache.boss = null;
if ((((Cache.level == 1)) || ((Cache.level == 2)))){
levelFinished();
} else {
if (Cache.level == 3){
win();
};
};
};
}
public function restart():void{
removeLayers();
if (tool.parent != null){
tool.parent.removeChild(tool);
};
Cache.enemyArr.splice(0, Cache.enemyArr.length);
addBoss = false;
bossAdded = false;
Cache.level = 1;
Cache.Layers["alert"].addChild(startPage);
startPage.x = -(this.x);
startPage.y = -(this.y);
}
function frame1(){
stop();
MochiAd.showPreGameAd({clip:root, id:"381f92dc7beaf029", res:"670x480"});
}
public function startIt(){
var gotoURL:Function;
gotoURL = function (_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.gamebusted.com/"), "_blank");
};
Util.initLayers(this);
bgSound = new BackgroundSound1();
startPage = MovieClip(Util.getResource("StartGameMC"));
Cache.Layers["background"].addChild(startPage);
Cache.main = this;
initRate = this.stage.frameRate;
gbLogo_mc = new GBLogoRotating();
gbLogo_mc.buttonMode = true;
gbLogo_mc.addEventListener(MouseEvent.CLICK, gotoURL);
gbLogo_mc.x = 100;
gbLogo_mc.y = 440;
gbLogo_mc.name = "gbLogo_mc";
this.addChild(gbLogo_mc);
}
public function gameOver():void{
removeLayers();
if (Cache.hero.parent != null){
Cache.hero.parent.removeChild(Cache.hero);
};
Cache.enemyArr.splice(0, Cache.enemyArr.length);
var _local1:MovieClip = MovieClip(Util.getResource("GameOverMC"));
Cache.Layers["alert"].addChild(_local1);
tool.visible = false;
_local1.x = -(this.x);
_local1.y = -(this.y);
}
function generateBox():void{
if (Util.randRange(0, 30) == 10){
if (Util.randRange(0, 40) == 1){
Box.addBox(1, "Box1");
} else {
if (Util.randRange(0, 40) == 8){
Box.addBox(1, "Box2");
} else {
if (Util.randRange(0, 40) == 12){
Box.addBox(1, "Box3");
};
};
};
};
}
public function startGame(){
while (Cache.Layers["background"].numChildren > 0) {
Cache.Layers["background"].removeChildAt(0);
};
tool = MovieClip(Util.getResource("ToolsMC"));
tool.visible = true;
this.parent.addChild(tool);
this.parent.setChildIndex(tool, (this.parent.numChildren - 1));
this.parent.addChildAt(gbLogo_mc, (this.parent.numChildren - 1));
Cache.reset();
timeCounter = 0;
var _local1:* = new BackGround();
var _local2:* = new Scene();
Cache.scene = Cache.Layers["scene"];
Cache.scene.cacheAsBitmap = true;
Cache.Layers["background"].cacheAsBitmap = true;
hero = MovieClip(Util.getResource("HeroMC"));
Cache.Layers["charactor"].addChild(hero);
addBoss = false;
bossAdded = false;
Cache.reset();
Util.setStageFocus(Cache.main.stage);
bgsoundChen = bgSound.play(0, 1000);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function frame2(){
stop();
}
public function nextLevel():void{
removeLayers();
Cache.reset();
timeCounter = 0;
tool.visible = true;
addBoss = false;
bossAdded = false;
var _local1:* = new BackGround();
var _local2:* = new Scene();
Cache.scene = Cache.Layers["scene"];
var _local3:MovieClip = MovieClip(Util.getResource("HeroMC"));
Cache.Layers["charactor"].addChild(_local3);
Util.setStageFocus(Cache.main.stage);
if (Cache.level == 2){
bgSound = new BackgroundSound2();
};
if (Cache.level == 3){
bgSound = new BackgroundSound3();
};
bgsoundChen = bgSound.play(0, 1000);
}
}
}//package ZombieKiller
Section 33
//Scene (ZombieKiller.Scene)
package ZombieKiller {
import flash.display.*;
import myUtil.*;
public class Scene extends MovieClip {
var ss:String;
var s:String;// = ""
public function Scene(){
Cache.totalWidth = 0;
while (Cache.Layers["scene"].numChildren > 0) {
Cache.Layers["scene"].removeChildAt(0);
};
Cache.sceneArr.splice(0, Cache.sceneArr.length);
if (Cache.level == 1){
addScene("scene1_", Cache.scene1_Length);
} else {
if (Cache.level == 2){
addScene("scene2_", Cache.scene2_Length);
} else {
if (Cache.level == 3){
addScene("scene3_", Cache.scene3_Length);
};
};
};
}
public function addScene(_arg1:String, _arg2:Number):void{
this.s = _arg1;
var _local3:int;
while (_local3 < _arg2) {
ss = String(_local3);
s = s.concat(ss);
Cache.sceneArr[_local3] = Util.getResource(s);
Cache.sceneArr[0].x = 0;
if (_local3 > 0){
Cache.sceneArr[_local3].x = ((Cache.sceneArr[(_local3 - 1)].x + Cache.sceneArr[(_local3 - 1)].width) - 1);
};
Cache.totalWidth = (Cache.totalWidth + Cache.sceneArr[_local3].width);
Cache.sceneArr[_local3].cacheAsBitmap = true;
Cache.Layers["scene"].addChildAt(Cache.sceneArr[_local3], _local3);
this.s = _arg1;
_local3++;
};
}
}
}//package ZombieKiller
Section 34
//Skeleton (ZombieKiller.Skeleton)
package ZombieKiller {
public class Skeleton extends Enemy {
public function Skeleton(){
enemyHealth = 50;
easingSpeed = 0.6;
canJump = false;
jumpSpeed = 60;
}
}
}//package ZombieKiller
Section 35
//StartGame (ZombieKiller.StartGame)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import myUtil.*;
public class StartGame extends MovieClip {
public var btnInstructions:SimpleButton;
public var btnMoreGames:SimpleButton;
public var btnStartGame:SimpleButton;
public var btnAddictingGame:SimpleButton;
public function StartGame(){
btnStartGame.addEventListener(MouseEvent.CLICK, startGameProcess);
btnAddictingGame.addEventListener(MouseEvent.CLICK, addictingGameProcess);
btnMoreGames.addEventListener(MouseEvent.CLICK, moreGameProcess);
btnInstructions.addEventListener(MouseEvent.CLICK, instructionsProcess);
}
function moreGameProcess(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.gamebusted.com");
navigateToURL(_local2, "_blank");
}
function instructionsProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
var _local2:MovieClip = MovieClip(Util.getResource("InstructionMC"));
Cache.Layers["background"].addChild(_local2);
}
function addictingGameProcess(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.onlineaddicted.com"), "_blank");
}
function startGameProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
Cache.main.startGame();
}
}
}//package ZombieKiller
Section 36
//Tools (ZombieKiller.Tools)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Tools extends MovieClip {
public var m3Num:TextField;
public var m2Num:TextField;
public var timeTxt:TextField;
public var killedTxt:TextField;
public var healthBar:MovieClip;
public var btnPause:SimpleButton;
public var weapon:MovieClip;
var on:Boolean;
public function Tools(){
btnPause.addEventListener(MouseEvent.CLICK, pauseProcess);
on = true;
Cache.pauseSwit = on;
}
public function pauseProcess(_arg1:MouseEvent):void{
if (this.parent != null){
if (on){
if (this.currentLabel != "pauseOn"){
this.gotoAndStop("pauseOn");
};
Cache.main.stage.frameRate = 0;
on = false;
Cache.pauseSwit = this.on;
} else {
if (this.currentLabel != "pauseOff"){
this.gotoAndStop("pauseOff");
};
Cache.main.stage.frameRate = Cache.main.initRate;
on = true;
Cache.pauseSwit = this.on;
};
};
}
}
}//package ZombieKiller
Section 37
//Weapon (ZombieKiller.Weapon)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import myUtil.*;
public class Weapon extends MovieClip {
private var vx:Number;// = 0
private var vy:Number;// = 0
private var g:Number;// = 0.8
private var dist:Number;// = 0
private var speedX:Number;// = 0
private var speedY:Number;// = 0
private var angle:Number;// = 0
private var initSpeed:Number;// = 0
private var myPoint:Point;
public function Weapon(){
this.gotoAndStop(1);
this.scaleX = (scaleY = 0.7);
this.cacheAsBitmap = true;
myPoint = Util.getLocaledPoint(Cache.hero.gun.gun.sensor, Cache.Layers["weapon"]);
this.x = myPoint.x;
this.y = myPoint.y;
this.addEventListener(Event.ENTER_FRAME, weaponMove);
this.rotation = Util.getRotation(this, Cache.Layers["weapon"]);
angle = ((this.rotation * Math.PI) / 180);
dist = Util.getDistanceToMouse(this, Cache.Layers["weapon"]);
if ((this is m1)){
initSpeed = 15;
} else {
if ((((this is m2)) || ((this is m3)))){
initSpeed = (dist / 10);
};
};
speedX = Util.getSpeedX(Cache.hero.x, this.y, Cache.Layers["weapon"], initSpeed);
speedY = Util.getSpeedY(Cache.hero.x, this.y, Cache.Layers["weapon"], initSpeed);
}
public function weaponMove(_arg1:Event):void{
if (this.parent == null){
return;
};
if ((((this is m1)) && ((Util.getDistanceToPoint(myPoint, this) > 800)))){
this.removeWeaponListener();
this.parent.removeChild(this);
};
if (this.currentFrame == this.totalFrames){
if ((this is m3)){
this.removeWeaponListener();
this.parent.removeChild(this);
} else {
this.parent.removeChild(this);
};
};
if (Cache.hero.scaleX > 0){
this.rotation = (this.rotation + 2);
} else {
this.rotation = (this.rotation - 2);
};
if (Cache.scene.hitTestPoint(this.x, this.y, true) == false){
if ((this is m1)){
if ((((Math.abs((speedX * 2)) < 10)) || ((Math.abs((speedY * 2)) < 2)))){
vx = (speedX * 2);
vy = (speedY * 2);
} else {
vx = (speedX * 1.5);
vy = (speedY * 1.5);
};
} else {
vx = speedX;
speedY = (speedY + g);
vy = speedY;
};
this.x = (this.x + vx);
this.y = (this.y + vy);
};
if (Cache.scene.hitTestPoint(this.x, this.y, true)){
this.rotation = 0;
if (this.currentLabel != "explode"){
this.gotoAndPlay("explode");
if (!(this is m3)){
removeWeaponListener();
};
};
};
killEnemy();
if ((((this is m3)) && ((this.currentFrame == this.totalFrames)))){
removeWeaponListener();
};
}
private function killEnemy():void{
var _local1:Number = 0;
while (_local1 < Cache.enemyArr.length) {
if (((((!((this is m3))) && (!((Cache.enemyArr[_local1] == null))))) && (Cache.enemyArr[_local1].hitTestPoint(this.x, this.y, true)))){
enemyBeShot(Cache.enemyArr[_local1]);
if (this.currentLabel != "explode"){
this.rotation = 0;
this.gotoAndPlay("explode");
if ((this is m1)){
Cache.enemyArr[_local1].enemyHealth = (Cache.enemyArr[_local1].enemyHealth - 5);
} else {
if ((this is m2)){
Cache.enemyArr[_local1].enemyHealth = (Cache.enemyArr[_local1].enemyHealth - 8);
};
};
removeWeaponListener();
};
enemyDie(Cache.enemyArr[_local1]);
};
if ((((((this is m3)) && (!((Cache.enemyArr[_local1] == null))))) && (Cache.enemyArr[_local1].hitTestObject(this)))){
enemyBeShot(Cache.enemyArr[_local1]);
Cache.enemyArr[_local1].enemyHealth = (Cache.enemyArr[_local1].enemyHealth - 2);
enemyDie(Cache.enemyArr[_local1]);
};
_local1++;
};
}
public function removeWeaponListener():void{
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, weaponMove);
};
if ((this is m1)){
Cache.hero.weapon1 = null;
} else {
if ((this is m2)){
Cache.hero.weapon2 = null;
} else {
if ((this is m3)){
Cache.hero.weapon3 = null;
};
};
};
}
public function enemyDie(_arg1:MovieClip):void{
if (((!((_arg1.currentLabel == "death"))) && (!((_arg1.currentLabel == "dead"))))){
if ((((((((_arg1 is Boss2)) || ((_arg1 is Boss2)))) && (!((_arg1.currentLabel == "attack"))))) && (!((_arg1.currentLabel == "hurt"))))){
_arg1.gotoAndPlay("hurt");
};
if (_arg1.enemyHealth <= 0){
_arg1.gotoAndPlay("death");
Cache.heroHealth = (Cache.heroHealth + 1);
Cache.totalKilled = (Cache.totalKilled + 1);
if (Cache.main.tool != null){
Cache.main.tool.killedTxt.text = String(Cache.totalKilled);
};
};
};
}
public function enemyBeShot(_arg1:MovieClip):void{
if (((((!((((_arg1 is Boss1)) || ((_arg1 is Boss2))))) && (!((_arg1.currentLabel == "death"))))) && (!((_arg1.currentLabel == "dead"))))){
if ((((_arg1.x > this.x)) && ((Cache.scene.hitTestPoint((_arg1.x + 50), (_arg1.y - 20), true) == false)))){
_arg1.x = (_arg1.x + 10);
} else {
if ((((_arg1.x < this.x)) && ((Cache.scene.hitTestPoint((_arg1.x - 50), (_arg1.y - 20), true) == false)))){
_arg1.x = (_arg1.x - 10);
};
};
};
}
}
}//package ZombieKiller
Section 38
//Win (ZombieKiller.Win)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class Win extends MovieClip {
public var totalScoreTxt:TextField;
public var timeTxt:TextField;
public var btnMoreGames:SimpleButton;
public var btnMainMenu:SimpleButton;
public var killedTxt:TextField;
public function Win(){
btnMoreGames.addEventListener(MouseEvent.CLICK, moreGamesProcess);
btnMainMenu.addEventListener(MouseEvent.CLICK, mainMenuProcess);
killedTxt.text = String(Cache.totalKilled);
timeTxt.text = String(Cache.totalTime);
totalScoreTxt.text = String((Math.round((Cache.totalKilled / Cache.totalTime)) * 100));
}
function moreGamesProcess(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://freeonlinegames.com");
navigateToURL(_local2, "_blank");
}
function mainMenuProcess(_arg1:MouseEvent):void{
this.parent.removeChild(this);
Cache.main.restart();
}
}
}//package ZombieKiller
Section 39
//Witch (ZombieKiller.Witch)
package ZombieKiller {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import myUtil.*;
public class Witch extends Enemy {
var UsingKnife:Boolean;// = true
var myPoint:Point;
var knife:MovieClip;
public var knifeP:knifePoint;
var canUseKnife:Boolean;// = false
public function Witch(){
canJump = true;
enemyHealth = 30;
easingSpeed = 0.3;
jumpSpeed = 0;
}
override public function attack():void{
if (Math.abs((this.x - Cache.hero.x)) < 700){
if ((((Util.randRange(0, 100) == 19)) || (this.hitTestObject(Cache.hero)))){
if (this.currentLabel != "attack"){
this.gotoAndPlay("attack");
};
};
};
if ((((this.currentLabel == "attack")) && (!((this.knifeP == null))))){
knife = MovieClip(Util.getResource("KnifeMC"));
myPoint = Util.getLocaledPoint(this.knifeP, Cache.Layers["scene"]);
knife.x = myPoint.x;
knife.y = myPoint.y;
Cache.Layers["alert"].addChild(knife);
};
}
}
}//package ZombieKiller
Section 40
//Zombie (ZombieKiller.Zombie)
package ZombieKiller {
public class Zombie extends Enemy {
public function Zombie(){
enemyHealth = 20;
canJump = false;
easingSpeed = 0.4;
jumpSpeed = 0;
}
}
}//package ZombieKiller
Section 41
//background1_0 (background1_0)
package {
import flash.display.*;
public dynamic class background1_0 extends MovieClip {
}
}//package
Section 42
//background1_1 (background1_1)
package {
import flash.display.*;
public dynamic class background1_1 extends MovieClip {
}
}//package
Section 43
//background1_2 (background1_2)
package {
import flash.display.*;
public dynamic class background1_2 extends MovieClip {
}
}//package
Section 44
//background1_3 (background1_3)
package {
import flash.display.*;
public dynamic class background1_3 extends MovieClip {
}
}//package
Section 45
//background1_4 (background1_4)
package {
import flash.display.*;
public dynamic class background1_4 extends MovieClip {
}
}//package
Section 46
//background1_5 (background1_5)
package {
import flash.display.*;
public dynamic class background1_5 extends MovieClip {
}
}//package
Section 47
//background1_6 (background1_6)
package {
import flash.display.*;
public dynamic class background1_6 extends MovieClip {
}
}//package
Section 48
//background2_0 (background2_0)
package {
import flash.display.*;
public dynamic class background2_0 extends MovieClip {
}
}//package
Section 49
//background2_1 (background2_1)
package {
import flash.display.*;
public dynamic class background2_1 extends MovieClip {
}
}//package
Section 50
//background2_2 (background2_2)
package {
import flash.display.*;
public dynamic class background2_2 extends MovieClip {
}
}//package
Section 51
//background2_3 (background2_3)
package {
import flash.display.*;
public dynamic class background2_3 extends MovieClip {
}
}//package
Section 52
//background2_4 (background2_4)
package {
import flash.display.*;
public dynamic class background2_4 extends MovieClip {
}
}//package
Section 53
//background2_5 (background2_5)
package {
import flash.display.*;
public dynamic class background2_5 extends MovieClip {
}
}//package
Section 54
//background2_6 (background2_6)
package {
import flash.display.*;
public dynamic class background2_6 extends MovieClip {
}
}//package
Section 55
//background3_0 (background3_0)
package {
import flash.display.*;
public dynamic class background3_0 extends MovieClip {
}
}//package
Section 56
//background3_1 (background3_1)
package {
import flash.display.*;
public dynamic class background3_1 extends MovieClip {
}
}//package
Section 57
//background3_2 (background3_2)
package {
import flash.display.*;
public dynamic class background3_2 extends MovieClip {
}
}//package
Section 58
//background3_3 (background3_3)
package {
import flash.display.*;
public dynamic class background3_3 extends MovieClip {
}
}//package
Section 59
//background3_4 (background3_4)
package {
import flash.display.*;
public dynamic class background3_4 extends MovieClip {
}
}//package
Section 60
//background3_5 (background3_5)
package {
import flash.display.*;
public dynamic class background3_5 extends MovieClip {
}
}//package
Section 61
//background3_6 (background3_6)
package {
import flash.display.*;
public dynamic class background3_6 extends MovieClip {
}
}//package
Section 62
//background3_7 (background3_7)
package {
import flash.display.*;
public dynamic class background3_7 extends MovieClip {
}
}//package
Section 63
//BackgroundSound1 (BackgroundSound1)
package {
import flash.media.*;
public dynamic class BackgroundSound1 extends Sound {
}
}//package
Section 64
//BackgroundSound2 (BackgroundSound2)
package {
import flash.media.*;
public dynamic class BackgroundSound2 extends Sound {
}
}//package
Section 65
//BackgroundSound3 (BackgroundSound3)
package {
import flash.media.*;
public dynamic class BackgroundSound3 extends Sound {
}
}//package
Section 66
//Boss1MC (Boss1MC)
package {
import ZombieKiller.*;
public dynamic class Boss1MC extends Boss1 {
public function Boss1MC(){
addFrameScript(0, frame1, 8, frame9, 29, frame30, 53, frame54, 75, frame76, 108, frame109);
}
function frame9(){
gotoAndPlay("move");
}
function frame1(){
gotoAndPlay("standBy");
}
function frame30(){
gotoAndPlay("standBy");
}
function frame54(){
gotoAndPlay("standBy");
}
function frame76(){
gotoAndPlay("standBy");
}
function frame109(){
this.stop();
}
}
}//package
Section 67
//Boss2MC (Boss2MC)
package {
import ZombieKiller.*;
public dynamic class Boss2MC extends Boss2 {
public function Boss2MC(){
addFrameScript(32, frame33, 65, frame66, 78, frame79, 128, frame129, 146, frame147, 164, frame165, 214, frame215);
}
function frame165(){
this.stop();
}
function frame33(){
gotoAndPlay("standBy");
}
function frame147(){
gotoAndPlay("standBy");
}
function frame215(){
gotoAndPlay("standBy");
}
function frame129(){
gotoAndPlay("standBy");
}
function frame66(){
gotoAndPlay("standBy");
}
function frame79(){
this.gotoAndPlay("standBy");
}
}
}//package
Section 68
//Boss3MC (Boss3MC)
package {
import ZombieKiller.*;
public dynamic class Boss3MC extends Boss1 {
public function Boss3MC(){
addFrameScript(24, frame25, 60, frame61, 91, frame92, 113, frame114, 154, frame155);
}
function frame25(){
gotoAndPlay("standBy");
}
function frame155(){
this.stop();
}
function frame92(){
gotoAndPlay("standBy");
}
function frame114(){
gotoAndPlay("standBy");
}
function frame61(){
gotoAndPlay("move");
}
}
}//package
Section 69
//Box1MC (Box1MC)
package {
import ZombieKiller.*;
public dynamic class Box1MC extends Box {
}
}//package
Section 70
//Box2MC (Box2MC)
package {
import ZombieKiller.*;
public dynamic class Box2MC extends Box {
}
}//package
Section 71
//Box3MC (Box3MC)
package {
import ZombieKiller.*;
public dynamic class Box3MC extends Box {
}
}//package
Section 72
//dude (dude)
package {
import flash.display.*;
public dynamic class dude extends MovieClip {
public function dude(){
addFrameScript(9, frame10);
}
function frame10(){
gotoAndPlay(5);
}
}
}//package
Section 73
//GameOverMC (GameOverMC)
package {
import ZombieKiller.*;
public dynamic class GameOverMC extends GameOver {
}
}//package
Section 74
//GB (GB)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class GB extends MovieClip {
public var playBtn_mc:PlayBtn;
public var AS:dude;
public var bar:MovieClip;
public var btn1:SimpleButton;
public var btn2:SimpleButton;
public function GB(){
addFrameScript(0, frame1, 2, frame3, 3, frame4, 119, frame120, 121, frame122);
}
function frame120(){
MovieClip(root).gotoAndStop(10);
}
function frame4(){
btn1.addEventListener(MouseEvent.CLICK, gotoURL);
}
function frame3(){
stop();
playBtn_mc.buttonMode = true;
playBtn_mc.addEventListener(MouseEvent.ROLL_OVER, over);
playBtn_mc.addEventListener(MouseEvent.ROLL_OUT, out);
playBtn_mc.addEventListener(MouseEvent.CLICK, rel);
}
function frame1(){
stop();
if (root.loaderInfo.bytesLoaded == root.loaderInfo.bytesTotal){
this.gotoAndStop(3);
};
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, doIt);
btn2.addEventListener(MouseEvent.CLICK, gotoURL2);
}
public function out(_arg1:MouseEvent){
_arg1.target.gotoAndStop("up");
}
public function over(_arg1:MouseEvent){
_arg1.target.gotoAndStop("over");
}
public function rel(_arg1:MouseEvent){
_arg1.target.gotoAndStop("rel");
this.play();
}
public function gotoURL(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.onlineaddicted.com/"), "_blank");
}
function frame122(){
stop();
}
public function doIt(_arg1:ProgressEvent){
var _local2:Number = (Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100)) / 100);
if (_local2 < 1){
bar.scaleX = _local2;
} else {
this.gotoAndStop(3);
};
}
public function gotoURL2(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.gamebusted.com/"), "_blank");
}
}
}//package
Section 75
//GB_PLAY (GB_PLAY)
package {
import flash.display.*;
public dynamic class GB_PLAY extends SimpleButton {
}
}//package
Section 76
//GBLogoRotating (GBLogoRotating)
package {
import flash.display.*;
public dynamic class GBLogoRotating extends MovieClip {
public function GBLogoRotating(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 77
//GreenGhostMC (GreenGhostMC)
package {
import ZombieKiller.*;
public dynamic class GreenGhostMC extends GreenGhost {
public function GreenGhostMC(){
addFrameScript(0, frame1, 30, frame31, 51, frame52, 75, frame76, 120, frame121);
}
function frame121(){
this.stop();
}
function frame1(){
this.stop();
}
function frame52(){
this.gotoAndPlay("standBy");
}
function frame31(){
this.gotoAndPlay("move");
}
function frame76(){
this.gotoAndPlay("standBy");
}
}
}//package
Section 78
//HeroMC (HeroMC)
package {
import ZombieKiller.*;
public dynamic class HeroMC extends Hero {
public function HeroMC(){
addFrameScript(16, frame17, 34, frame35, 110, frame111, 128, frame129, 203, frame204);
}
function frame17(){
this.gotoAndPlay("standBy");
}
function frame111(){
this.gotoAndPlay("standBy");
}
function frame204(){
this.stop();
Cache.main.gameOver();
}
function frame129(){
this.gotoAndPlay("backwardmove");
}
function frame35(){
this.gotoAndPlay("move");
}
}
}//package
Section 79
//InstructionMC (InstructionMC)
package {
import ZombieKiller.*;
public dynamic class InstructionMC extends Instruction {
}
}//package
Section 80
//knifeHitSound (knifeHitSound)
package {
import flash.media.*;
public dynamic class knifeHitSound extends Sound {
}
}//package
Section 81
//KnifeMC (KnifeMC)
package {
import ZombieKiller.*;
public dynamic class KnifeMC extends Knife {
}
}//package
Section 82
//knifePoint (knifePoint)
package {
import flash.display.*;
public dynamic class knifePoint extends MovieClip {
}
}//package
Section 83
//LevelFinishedMC (LevelFinishedMC)
package {
import ZombieKiller.*;
public dynamic class LevelFinishedMC extends LevelFinished {
}
}//package
Section 84
//m1 (m1)
package {
import ZombieKiller.*;
public dynamic class m1 extends Weapon {
public function m1(){
addFrameScript(0, frame1, 6, frame7);
}
function frame7(){
this.stop();
}
function frame1(){
this.stop();
}
}
}//package
Section 85
//m2 (m2)
package {
import ZombieKiller.*;
public dynamic class m2 extends Weapon {
public function m2(){
addFrameScript(0, frame1, 33, frame34);
}
function frame1(){
this.stop();
}
function frame34(){
this.stop();
}
}
}//package
Section 86
//m3 (m3)
package {
import ZombieKiller.*;
public dynamic class m3 extends Weapon {
public function m3(){
addFrameScript(0, frame1, 24, frame25);
}
function frame25(){
this.stop();
}
function frame1(){
this.stop();
}
}
}//package
Section 87
//PauseMC (PauseMC)
package {
import ZombieKiller.*;
public dynamic class PauseMC extends Tools {
public function PauseMC(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
this.stop();
}
function frame2(){
this.stop();
}
}
}//package
Section 88
//PlayBtn (PlayBtn)
package {
import flash.display.*;
public dynamic class PlayBtn extends MovieClip {
public var fx:Symbol55555;
public function PlayBtn(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
fx.play();
}
}
}//package
Section 89
//scene1_0 (scene1_0)
package {
import flash.display.*;
public dynamic class scene1_0 extends MovieClip {
}
}//package
Section 90
//scene1_1 (scene1_1)
package {
import flash.display.*;
public dynamic class scene1_1 extends MovieClip {
}
}//package
Section 91
//scene1_2 (scene1_2)
package {
import flash.display.*;
public dynamic class scene1_2 extends MovieClip {
}
}//package
Section 92
//scene1_3 (scene1_3)
package {
import flash.display.*;
public dynamic class scene1_3 extends MovieClip {
}
}//package
Section 93
//scene1_4 (scene1_4)
package {
import flash.display.*;
public dynamic class scene1_4 extends MovieClip {
}
}//package
Section 94
//scene1_5 (scene1_5)
package {
import flash.display.*;
public dynamic class scene1_5 extends MovieClip {
}
}//package
Section 95
//scene1_6 (scene1_6)
package {
import flash.display.*;
public dynamic class scene1_6 extends MovieClip {
}
}//package
Section 96
//scene2_0 (scene2_0)
package {
import flash.display.*;
public dynamic class scene2_0 extends MovieClip {
}
}//package
Section 97
//scene2_1 (scene2_1)
package {
import flash.display.*;
public dynamic class scene2_1 extends MovieClip {
}
}//package
Section 98
//scene2_2 (scene2_2)
package {
import flash.display.*;
public dynamic class scene2_2 extends MovieClip {
}
}//package
Section 99
//scene2_3 (scene2_3)
package {
import flash.display.*;
public dynamic class scene2_3 extends MovieClip {
}
}//package
Section 100
//scene2_4 (scene2_4)
package {
import flash.display.*;
public dynamic class scene2_4 extends MovieClip {
}
}//package
Section 101
//scene2_5 (scene2_5)
package {
import flash.display.*;
public dynamic class scene2_5 extends MovieClip {
}
}//package
Section 102
//scene2_6 (scene2_6)
package {
import flash.display.*;
public dynamic class scene2_6 extends MovieClip {
}
}//package
Section 103
//scene3_0 (scene3_0)
package {
import flash.display.*;
public dynamic class scene3_0 extends MovieClip {
}
}//package
Section 104
//scene3_1 (scene3_1)
package {
import flash.display.*;
public dynamic class scene3_1 extends MovieClip {
}
}//package
Section 105
//scene3_2 (scene3_2)
package {
import flash.display.*;
public dynamic class scene3_2 extends MovieClip {
}
}//package
Section 106
//scene3_3 (scene3_3)
package {
import flash.display.*;
public dynamic class scene3_3 extends MovieClip {
}
}//package
Section 107
//scene3_4 (scene3_4)
package {
import flash.display.*;
public dynamic class scene3_4 extends MovieClip {
}
}//package
Section 108
//scene3_5 (scene3_5)
package {
import flash.display.*;
public dynamic class scene3_5 extends MovieClip {
}
}//package
Section 109
//scene3_6 (scene3_6)
package {
import flash.display.*;
public dynamic class scene3_6 extends MovieClip {
}
}//package
Section 110
//scene3_7 (scene3_7)
package {
import flash.display.*;
public dynamic class scene3_7 extends MovieClip {
}
}//package
Section 111
//ShotSound1 (ShotSound1)
package {
import flash.media.*;
public dynamic class ShotSound1 extends Sound {
}
}//package
Section 112
//ShotSound2 (ShotSound2)
package {
import flash.media.*;
public dynamic class ShotSound2 extends Sound {
}
}//package
Section 113
//SkeletonMC (SkeletonMC)
package {
import ZombieKiller.*;
public dynamic class SkeletonMC extends Skeleton {
public function SkeletonMC(){
addFrameScript(0, frame1, 27, frame28, 52, frame53, 98, frame99);
}
function frame53(){
this.gotoAndPlay("standBy");
}
function frame28(){
this.gotoAndPlay("move");
}
function frame1(){
this.stop();
}
function frame99(){
this.stop();
}
}
}//package
Section 114
//StartGameMC (StartGameMC)
package {
import ZombieKiller.*;
public dynamic class StartGameMC extends StartGame {
}
}//package
Section 115
//Symbol55555 (Symbol55555)
package {
import flash.display.*;
public dynamic class Symbol55555 extends MovieClip {
public function Symbol55555(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 116
//ToolsMC (ToolsMC)
package {
import ZombieKiller.*;
public dynamic class ToolsMC extends Tools {
}
}//package
Section 117
//WinMC (WinMC)
package {
import ZombieKiller.*;
public dynamic class WinMC extends Win {
}
}//package
Section 118
//WitchMC (WitchMC)
package {
import ZombieKiller.*;
public dynamic class WitchMC extends Witch {
public function WitchMC(){
addFrameScript(0, frame1, 16, frame17, 32, frame33, 56, frame57, 100, frame101);
}
function frame1(){
this.stop();
}
function frame101(){
this.stop();
}
function frame17(){
this.gotoAndPlay("move");
}
function frame33(){
this.gotoAndPlay("standBy");
}
function frame57(){
this.gotoAndPlay("standBy");
}
}
}//package
Section 119
//ZombieMC (ZombieMC)
package {
import ZombieKiller.*;
public dynamic class ZombieMC extends Zombie {
public function ZombieMC(){
addFrameScript(0, frame1, 16, frame17, 40, frame41, 99, frame100);
}
function frame41(){
this.gotoAndPlay("standBy");
}
function frame17(){
this.gotoAndPlay("move");
}
function frame1(){
this.stop();
}
function frame100(){
this.stop();
}
}
}//package