STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228131
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/58153210?noj=FRM58153210-15DC" width="1" height="1"></div>

Villa Village.swf

This is the info page for
Flash #25716

(Click the ID number above for more basic data on this flash file.)


Text
<p align="left"></p>

<p align="left"></p>

Villa Village

congratulations!!!

you won the game!!!

game over

you borrowed too much money from the bank
next time be careful not to exceed -100000$

Credits

this game was programmed by murat coroz
(c) 2007 Murat Coroz. All rights reserved.
contact me at mcoroz at gmail.com
MUSIC: chemical - by rimelA

<p align="center"><font face="Synchro LET" size="14" color="#000000" letterSpacing="0.000000" kerning="1"><a href="http://go.to/rimela">http://go.to/rimela</a></font></p>

InstructionS

try to build a village of luxury villas. you earn money by renting the
villas. increase luxury and keep the rental fees low to attract more
people to your villas. a high rental fee will be more profitable, but your
villa will be less likely to be rented. A low rental fee on the other hand
will be less profitable, but your villa will be more likely to be rented.
you will have to make a compromise between those two things. the
luxury/rental fee percentage is an indication of how likely it is for your
house to get rented by someone. also you have to pay periodical
service costs even if your villa is empty. rental fee minus service costs is your
profit. upgrading a house is a cheap way to increase luxury, but you
need to collect a lot of money for it. you can have negative money up
to -100000$, but you will pay interest over the money. exceeding -100000$ means
game over. you win the game if you have 5 stars and the maximum number of 12 houses
all with max upgrades. youR game will be autosaved and can be reset at any time.

ActionScript [AS3]

Section 1
//BaseButton (fl.controls.BaseButton) package fl.controls { import flash.display.*; import fl.core.*; import flash.events.*; import flash.utils.*; import fl.events.*; public class BaseButton extends UIComponent { protected var _selected:Boolean;// = false private var unlockedMouseState:String; protected var pressTimer:Timer; protected var mouseState:String; protected var background:DisplayObject; private var _mouseStateLocked:Boolean;// = false protected var _autoRepeat:Boolean;// = false private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35}; public function BaseButton(){ _selected = false; _autoRepeat = false; _mouseStateLocked = false; super(); buttonMode = true; mouseChildren = false; useHandCursor = false; setupMouseEvents(); setMouseState("up"); pressTimer = new Timer(1, 0); pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true); } protected function endPress():void{ pressTimer.reset(); } public function set mouseStateLocked(_arg1:Boolean):void{ _mouseStateLocked = _arg1; if (_arg1 == false){ setMouseState(unlockedMouseState); } else { unlockedMouseState = mouseState; }; } public function get autoRepeat():Boolean{ return (_autoRepeat); } public function set autoRepeat(_arg1:Boolean):void{ _autoRepeat = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseEnabled = _arg1; } public function get selected():Boolean{ return (_selected); } protected function mouseEventHandler(_arg1:MouseEvent):void{ if (_arg1.type == MouseEvent.MOUSE_DOWN){ setMouseState("down"); startPress(); } else { if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){ setMouseState("over"); endPress(); } else { if (_arg1.type == MouseEvent.ROLL_OUT){ setMouseState("up"); endPress(); }; }; }; } public function setMouseState(_arg1:String):void{ if (_mouseStateLocked){ unlockedMouseState = _arg1; return; }; if (mouseState == _arg1){ return; }; mouseState = _arg1; invalidate(InvalidationType.STATE); } protected function startPress():void{ if (_autoRepeat){ pressTimer.delay = Number(getStyleValue("repeatDelay")); pressTimer.start(); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } protected function buttonDown(_arg1:TimerEvent):void{ if (!_autoRepeat){ endPress(); return; }; if (pressTimer.currentCount == 1){ pressTimer.delay = Number(getStyleValue("repeatInterval")); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } public function set selected(_arg1:Boolean):void{ if (_selected == _arg1){ return; }; _selected = _arg1; invalidate(InvalidationType.STATE); } override public function get enabled():Boolean{ return (super.enabled); } override protected function draw():void{ if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } protected function setupMouseEvents():void{ addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true); } protected function drawLayout():void{ background.width = width; background.height = height; } protected function drawBackground():void{ var _local1:String; var _local2:DisplayObject; _local1 = (enabled) ? mouseState : "disabled"; if (selected){ _local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); }; _local1 = (_local1 + "Skin"); _local2 = background; background = getDisplayObjectInstance(getStyleValue(_local1)); addChildAt(background, 0); if (((!((_local2 == null))) && (!((_local2 == background))))){ removeChild(_local2); }; } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 2
//Button (fl.controls.Button) package fl.controls { import flash.display.*; import fl.core.*; import fl.managers.*; public class Button extends LabelButton implements IFocusManagerComponent { protected var emphasizedBorder:DisplayObject; protected var _emphasized:Boolean;// = false private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2}; public static var createAccessibilityImplementation:Function; public function Button(){ _emphasized = false; super(); } override public function drawFocus(_arg1:Boolean):void{ var _local2:Number; var _local3:*; super.drawFocus(_arg1); if (_arg1){ _local2 = Number(getStyleValue("emphasizedPadding")); if ((((_local2 < 0)) || (!(_emphasized)))){ _local2 = 0; }; _local3 = getStyleValue("focusRectPadding"); _local3 = ((_local3)==null) ? 2 : _local3; _local3 = (_local3 + _local2); uiFocusRect.x = -(_local3); uiFocusRect.y = -(_local3); uiFocusRect.width = (width + (_local3 * 2)); uiFocusRect.height = (height + (_local3 * 2)); }; } public function set emphasized(_arg1:Boolean):void{ _emphasized = _arg1; invalidate(InvalidationType.STYLES); } override protected function draw():void{ if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ drawEmphasized(); }; super.draw(); if (emphasizedBorder != null){ setChildIndex(emphasizedBorder, (numChildren - 1)); }; } public function get emphasized():Boolean{ return (_emphasized); } override protected function initializeAccessibility():void{ if (Button.createAccessibilityImplementation != null){ Button.createAccessibilityImplementation(this); }; } protected function drawEmphasized():void{ var _local1:Object; var _local2:Number; if (emphasizedBorder != null){ removeChild(emphasizedBorder); }; emphasizedBorder = null; if (!_emphasized){ return; }; _local1 = getStyleValue("emphasizedSkin"); if (_local1 != null){ emphasizedBorder = getDisplayObjectInstance(_local1); }; if (emphasizedBorder != null){ addChildAt(emphasizedBorder, 0); _local2 = Number(getStyleValue("emphasizedPadding")); emphasizedBorder.x = (emphasizedBorder.y = -(_local2)); emphasizedBorder.width = (width + (_local2 * 2)); emphasizedBorder.height = (height + (_local2 * 2)); }; } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); } } }//package fl.controls
Section 3
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement) package fl.controls { public class ButtonLabelPlacement { public static const TOP:String = "top"; public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const RIGHT:String = "right"; } }//package fl.controls
Section 4
//LabelButton (fl.controls.LabelButton) package fl.controls { import flash.display.*; import fl.core.*; import flash.events.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.ui.*; public class LabelButton extends BaseButton implements IFocusManagerComponent { protected var _labelPlacement:String;// = "right" protected var _toggle:Boolean;// = false protected var icon:DisplayObject; protected var oldMouseState:String; protected var mode:String;// = "center" public var textField:TextField; protected var _label:String;// = "Label" private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false}; public static var createAccessibilityImplementation:Function; public function LabelButton(){ _labelPlacement = ButtonLabelPlacement.RIGHT; _toggle = false; _label = "Label"; mode = "center"; super(); } protected function toggleSelected(_arg1:MouseEvent):void{ selected = !(selected); dispatchEvent(new Event(Event.CHANGE, true)); } public function get labelPlacement():String{ return (_labelPlacement); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ if (oldMouseState == null){ oldMouseState = mouseState; }; setMouseState("down"); startPress(); }; } protected function setEmbedFont(){ var _local1:Object; _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } override protected function keyUpHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ setMouseState(oldMouseState); oldMouseState = null; endPress(); dispatchEvent(new MouseEvent(MouseEvent.CLICK)); }; } override public function get selected():Boolean{ return ((_toggle) ? _selected : false); } public function set labelPlacement(_arg1:String):void{ _labelPlacement = _arg1; invalidate(InvalidationType.SIZE); } public function set toggle(_arg1:Boolean):void{ if (((!(_arg1)) && (super.selected))){ selected = false; }; _toggle = _arg1; if (_toggle){ addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true); } else { removeEventListener(MouseEvent.CLICK, toggleSelected); }; invalidate(InvalidationType.STATE); } public function get label():String{ return (_label); } override public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_toggle){ invalidate(InvalidationType.STATE); }; } override protected function draw():void{ if (textField.text != _label){ label = _label; }; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); drawIcon(); drawTextFormat(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } public function get toggle():Boolean{ return (_toggle); } override protected function configUI():void{ super.configUI(); textField = new TextField(); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; addChild(textField); } override protected function drawLayout():void{ var _local1:Number; var _local2:String; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local1 = Number(getStyleValue("textPadding")); _local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; textField.height = (textField.textHeight + 4); _local3 = (textField.textWidth + 4); _local4 = (textField.textHeight + 4); _local5 = ((icon)==null) ? 0 : (icon.width + _local1); _local6 = ((icon)==null) ? 0 : (icon.height + _local1); textField.visible = (label.length > 0); if (icon != null){ icon.x = Math.round(((width - icon.width) / 2)); icon.y = Math.round(((height - icon.height) / 2)); }; if (textField.visible == false){ textField.width = 0; textField.height = 0; } else { if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){ _local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1)))); if ((height - 2) > _local4){ _local8 = _local4; } else { _local8 = (height - 2); }; _local3 = _local7; textField.width = _local3; _local4 = _local8; textField.height = _local4; textField.x = Math.round(((width - _local3) / 2)); textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0)); if (icon != null){ icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1)); }; } else { _local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1)))); _local3 = _local7; textField.width = _local3; textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0)); textField.y = Math.round(((height - textField.height) / 2)); if (icon != null){ icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1)); }; }; }; super.drawLayout(); } override protected function initializeAccessibility():void{ if (LabelButton.createAccessibilityImplementation != null){ LabelButton.createAccessibilityImplementation(this); }; } protected function drawIcon():void{ var _local1:DisplayObject; var _local2:String; var _local3:Object; _local1 = icon; _local2 = (enabled) ? mouseState : "disabled"; if (selected){ _local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); }; _local2 = (_local2 + "Icon"); _local3 = getStyleValue(_local2); if (_local3 == null){ _local3 = getStyleValue("icon"); }; if (_local3 != null){ icon = getDisplayObjectInstance(_local3); }; if (icon != null){ addChildAt(icon, 1); }; if (((!((_local1 == null))) && (!((_local1 == icon))))){ removeChild(_local1); }; } public function set label(_arg1:String):void{ _label = _arg1; if (textField.text != _label){ textField.text = _label; dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE)); }; invalidate(InvalidationType.SIZE); invalidate(InvalidationType.STYLES); } protected function drawTextFormat():void{ var _local1:Object; var _local2:TextFormat; var _local3:TextFormat; _local1 = UIComponent.getStyleDefinition(); _local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); _local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); } } }//package fl.controls
Section 5
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 6
//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 7
//UIComponent (fl.core.UIComponent) package fl.core { import flash.display.*; import flash.events.*; import fl.managers.*; import flash.utils.*; import fl.events.*; import flash.text.*; import flash.system.*; public class UIComponent extends Sprite { protected var _enabled:Boolean;// = true private var _mouseFocusEnabled:Boolean;// = true protected var startHeight:Number; protected var _height:Number; protected var _oldIMEMode:String;// = null protected var startWidth:Number; public var focusTarget:IFocusManagerComponent; protected var errorCaught:Boolean;// = false protected var uiFocusRect:DisplayObject; protected var _width:Number; public var version:String;// = "3.0.0.15" protected var isFocused:Boolean;// = false protected var callLaterMethods:Dictionary; private var _focusEnabled:Boolean;// = true private var tempText:TextField; protected var invalidateFlag:Boolean;// = false protected var _inspector:Boolean;// = false protected var sharedStyles:Object; protected var invalidHash:Object; protected var isLivePreview:Boolean;// = false protected var _imeMode:String;// = null protected var instanceStyles:Object; protected var _x:Number; protected var _y:Number; public static var inCallLaterPhase:Boolean = false; private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)}; public static var createAccessibilityImplementation:Function; private static var focusManagers:Dictionary = new Dictionary(false); public function UIComponent(){ version = "3.0.0.15"; isLivePreview = false; invalidateFlag = false; _enabled = true; isFocused = false; _focusEnabled = true; _mouseFocusEnabled = true; _imeMode = null; _oldIMEMode = null; errorCaught = false; _inspector = false; super(); instanceStyles = {}; sharedStyles = {}; invalidHash = {}; callLaterMethods = new Dictionary(); StyleManager.registerInstance(this); configUI(); invalidate(InvalidationType.ALL); tabEnabled = (this is IFocusManagerComponent); focusRect = false; if (tabEnabled){ addEventListener(FocusEvent.FOCUS_IN, focusInHandler); addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); }; initializeFocusManager(); addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true); } public function drawFocus(_arg1:Boolean):void{ var _local2:Number; isFocused = _arg1; if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){ removeChild(uiFocusRect); uiFocusRect = null; }; if (_arg1){ uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite); if (uiFocusRect == null){ return; }; _local2 = Number(getStyleValue("focusRectPadding")); uiFocusRect.x = -(_local2); uiFocusRect.y = -(_local2); uiFocusRect.width = (width + (_local2 * 2)); uiFocusRect.height = (height + (_local2 * 2)); addChildAt(uiFocusRect, 0); }; } private function callLaterDispatcher(_arg1:Event):void{ var _local2:Dictionary; var _local3:Object; if (_arg1.type == Event.ADDED_TO_STAGE){ removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); return; }; _arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); return; }; inCallLaterPhase = true; _local2 = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } private function addedHandler(_arg1:Event):void{ removeEventListener("addedToStage", addedHandler); initializeFocusManager(); } protected function getStyleValue(_arg1:String):Object{ return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); } protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((_arg1 == this)); } override public function get scaleX():Number{ return ((width / startWidth)); } override public function get scaleY():Number{ return ((height / startHeight)); } override public function set height(_arg1:Number):void{ if (_height == _arg1){ return; }; setSize(width, _arg1); } protected function keyDownHandler(_arg1:KeyboardEvent):void{ } protected function focusInHandler(_arg1:FocusEvent):void{ var _local2:IFocusManager; if (isOurFocus((_arg1.target as DisplayObject))){ _local2 = focusManager; if (((_local2) && (_local2.showFocusIndicator))){ drawFocus(true); isFocused = true; }; }; } public function setStyle(_arg1:String, _arg2:Object):void{ if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; instanceStyles[_arg1] = _arg2; invalidate(InvalidationType.STYLES); } override public function get visible():Boolean{ return (super.visible); } public function get componentInspectorSetting():Boolean{ return (_inspector); } override public function get x():Number{ return ((isNaN(_x)) ? super.x : _x); } override public function get y():Number{ return ((isNaN(_y)) ? super.y : _y); } protected function setIMEMode(_arg1:Boolean){ var enabled = _arg1; if (_imeMode != null){ if (enabled){ IME.enabled = true; _oldIMEMode = IME.conversionMode; try { if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _imeMode; }; errorCaught = false; } catch(e:Error) { errorCaught = true; throw (new Error(("IME mode not supported: " + _imeMode))); }; } else { if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _oldIMEMode; }; IME.enabled = false; }; }; } public function set enabled(_arg1:Boolean):void{ if (_arg1 == _enabled){ return; }; _enabled = _arg1; invalidate(InvalidationType.STATE); } public function setSharedStyle(_arg1:String, _arg2:Object):void{ if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; sharedStyles[_arg1] = _arg2; if (instanceStyles[_arg1] == null){ invalidate(InvalidationType.STYLES); }; } protected function keyUpHandler(_arg1:KeyboardEvent):void{ } public function set focusEnabled(_arg1:Boolean):void{ _focusEnabled = _arg1; } override public function set scaleX(_arg1:Number):void{ setSize((startWidth * _arg1), height); } public function get mouseFocusEnabled():Boolean{ return (_mouseFocusEnabled); } override public function set scaleY(_arg1:Number):void{ setSize(width, (startHeight * _arg1)); } protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{ var classDef:Object; var skin = _arg1; classDef = null; if ((skin is Class)){ return ((new (skin) as DisplayObject)); }; if ((skin is DisplayObject)){ (skin as DisplayObject).x = 0; (skin as DisplayObject).y = 0; return ((skin as DisplayObject)); }; try { classDef = getDefinitionByName(skin.toString()); } catch(e:Error) { try { classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object); } catch(e:Error) { }; }; if (classDef == null){ return (null); }; return ((new (classDef) as DisplayObject)); } protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{ var _local3:String; for (_local3 in _arg2) { _arg1.setStyle(_local3, getStyleValue(_arg2[_local3])); }; } protected function beforeComponentParameters():void{ } protected function callLater(_arg1:Function):void{ if (inCallLaterPhase){ return; }; callLaterMethods[_arg1] = true; if (stage != null){ stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); } else { addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); }; } protected function createFocusManager():void{ if (focusManagers[stage] == null){ focusManagers[stage] = new FocusManager(stage); }; } override public function set visible(_arg1:Boolean):void{ var _local2:String; if (super.visible == _arg1){ return; }; super.visible = _arg1; _local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; dispatchEvent(new ComponentEvent(_local2, true)); } protected function hookAccessibility(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, hookAccessibility); initializeAccessibility(); } public function set componentInspectorSetting(_arg1:Boolean):void{ _inspector = _arg1; if (_inspector){ beforeComponentParameters(); } else { afterComponentParameters(); }; } override public function set x(_arg1:Number):void{ move(_arg1, _y); } public function drawNow():void{ draw(); } override public function set y(_arg1:Number):void{ move(_x, _arg1); } protected function checkLivePreview():Boolean{ var className:String; if (parent == null){ return (false); }; try { className = getQualifiedClassName(parent); } catch(e:Error) { }; return ((className == "fl.livepreview::LivePreviewParent")); } protected function focusOutHandler(_arg1:FocusEvent):void{ if (isOurFocus((_arg1.target as DisplayObject))){ drawFocus(false); isFocused = false; }; } public function set mouseFocusEnabled(_arg1:Boolean):void{ _mouseFocusEnabled = _arg1; } public function getFocus():InteractiveObject{ if (stage){ return (stage.focus); }; return (null); } protected function validate():void{ invalidHash = {}; } override public function get height():Number{ return (_height); } public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ invalidHash[_arg1] = true; if (_arg2){ this.callLater(draw); }; } public function get enabled():Boolean{ return (_enabled); } protected function getScaleX():Number{ return (super.scaleX); } protected function getScaleY():Number{ return (super.scaleY); } public function get focusEnabled():Boolean{ return (_focusEnabled); } protected function afterComponentParameters():void{ } protected function draw():void{ if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } protected function configUI():void{ var _local1:Number; var _local2:Number; var _local3:Number; isLivePreview = checkLivePreview(); _local1 = rotation; rotation = 0; _local2 = super.width; _local3 = super.height; var _local4 = 1; super.scaleY = _local4; super.scaleX = _local4; setSize(_local2, _local3); move(super.x, super.y); rotation = _local1; startWidth = _local2; startHeight = _local3; if (numChildren > 0){ removeChildAt(0); }; } protected function setScaleX(_arg1:Number):void{ super.scaleX = _arg1; } protected function setScaleY(_arg1:Number):void{ super.scaleY = _arg1; } private function initializeFocusManager():void{ if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); } else { createFocusManager(); }; } public function set focusManager(_arg1:IFocusManager):void{ UIComponent.focusManagers[this] = _arg1; } public function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } protected function isInvalid(_arg1:String, ... _args):Boolean{ if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){ return (true); }; while (_args.length > 0) { if (invalidHash[_args.pop()]){ return (true); }; }; return (false); } public function setSize(_arg1:Number, _arg2:Number):void{ _width = _arg1; _height = _arg2; invalidate(InvalidationType.SIZE); dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); } override public function set width(_arg1:Number):void{ if (_width == _arg1){ return; }; setSize(_arg1, height); } public function setFocus():void{ if (stage){ stage.focus = this; }; } protected function initializeAccessibility():void{ if (UIComponent.createAccessibilityImplementation != null){ UIComponent.createAccessibilityImplementation(this); }; } public function get focusManager():IFocusManager{ var _local1:DisplayObject; _local1 = this; while (_local1) { if (UIComponent.focusManagers[_local1] != null){ return (IFocusManager(UIComponent.focusManagers[_local1])); }; _local1 = _local1.parent; }; return (null); } override public function get width():Number{ return (_width); } public function move(_arg1:Number, _arg2:Number):void{ _x = _arg1; _y = _arg2; super.x = Math.round(_arg1); super.y = Math.round(_arg2); dispatchEvent(new ComponentEvent(ComponentEvent.MOVE)); } public function validateNow():void{ invalidate(InvalidationType.ALL, false); draw(); } public function getStyle(_arg1:String):Object{ return (instanceStyles[_arg1]); } public static function getStyleDefinition():Object{ return (defaultStyles); } public static function mergeStyles(... _args):Object{ var _local2:Object; var _local3:uint; var _local4:uint; var _local5:Object; var _local6:String; _local2 = {}; _local3 = _args.length; _local4 = 0; while (_local4 < _local3) { _local5 = _args[_local4]; for (_local6 in _local5) { if (_local2[_local6] != null){ } else { _local2[_local6] = _args[_local4][_local6]; }; }; _local4++; }; return (_local2); } } }//package fl.core
Section 8
//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 9
//FocusManager (fl.managers.FocusManager) package fl.managers { import fl.controls.*; import flash.display.*; import fl.core.*; import flash.events.*; import flash.utils.*; import flash.text.*; import flash.ui.*; public class FocusManager implements IFocusManager { private var focusableObjects:Dictionary; private var _showFocusIndicator:Boolean;// = true private var defButton:Button; private var focusableCandidates:Array; private var _form:DisplayObjectContainer; private var _defaultButtonEnabled:Boolean;// = true private var activated:Boolean;// = false private var _defaultButton:Button; private var calculateCandidates:Boolean;// = true private var lastFocus:InteractiveObject; private var lastAction:String; public function FocusManager(_arg1:DisplayObjectContainer){ activated = false; calculateCandidates = true; _showFocusIndicator = true; _defaultButtonEnabled = true; super(); focusableObjects = new Dictionary(true); if (_arg1 != null){ _form = _arg1; addFocusables(DisplayObject(_arg1)); _arg1.addEventListener(Event.ADDED, addedHandler); _arg1.addEventListener(Event.REMOVED, removedHandler); activate(); }; } public function get showFocusIndicator():Boolean{ return (_showFocusIndicator); } private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{ var _local5:int; var _local6:int; var _local7:DisplayObject; var _local8:IFocusManagerGroup; var _local9:int; var _local10:DisplayObject; var _local11:IFocusManagerGroup; _local5 = focusableCandidates.length; _local6 = _arg1; while (true) { if (_arg2){ _arg1--; } else { _arg1++; }; if (_arg3){ if (((_arg2) && ((_arg1 < 0)))){ break; }; if (((!(_arg2)) && ((_arg1 == _local5)))){ break; }; } else { _arg1 = ((_arg1 + _local5) % _local5); if (_local6 == _arg1){ break; }; }; if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){ _local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1])); if ((_local7 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local7); _local9 = 0; while (_local9 < focusableCandidates.length) { _local10 = focusableCandidates[_local9]; if ((_local10 is IFocusManagerGroup)){ _local11 = IFocusManagerGroup(_local10); if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){ _arg1 = _local9; break; }; }; _local9++; }; }; return (_arg1); }; }; return (_arg1); } public function set form(_arg1:DisplayObjectContainer):void{ _form = _arg1; } private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{ var focusable:IFocusManagerComponent; var io:InteractiveObject; var doc:DisplayObjectContainer; var i:int; var child:DisplayObject; var o = _arg1; var skipTopLevel = _arg2; if (!skipTopLevel){ if ((o is IFocusManagerComponent)){ focusable = IFocusManagerComponent(o); if (focusable.focusEnabled){ if (((focusable.tabEnabled) && (isTabVisible(o)))){ focusableObjects[o] = true; calculateCandidates = true; }; o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; } else { if ((o is InteractiveObject)){ io = (o as InteractiveObject); if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){ focusableObjects[io] = true; calculateCandidates = true; }; io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; }; }; if ((o is DisplayObjectContainer)){ doc = DisplayObjectContainer(o); o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){ i = 0; while (i < doc.numChildren) { try { child = doc.getChildAt(i); if (child != null){ addFocusables(doc.getChildAt(i)); }; } catch(error:SecurityError) { }; i = (i + 1); }; }; }; } private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{ return (_arg1.getChildIndex(_arg2)); } private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ if ((_arg1.relatedObject is TextField)){ return; }; _arg1.preventDefault(); } private function focusOutHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject; _local2 = (_arg1.target as InteractiveObject); } private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{ var _local3:IFocusManagerGroup; if (!isEnabledAndVisible(_arg1)){ return (false); }; if ((_arg1 is IFocusManagerGroup)){ _local3 = IFocusManagerGroup(_arg1); if (_arg2 == _local3.groupName){ return (false); }; }; return (true); } public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ var _local2:InteractiveObject; _local2 = _arg1; while (_arg1) { if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ return (_arg1); }; _arg1 = _arg1.parent; }; return (_local2); } private function sortFocusableObjectsTabIndex():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){ focusableCandidates.push(_local2); }; }; focusableCandidates.sort(sortByTabIndex); } private function removeFocusables(_arg1:DisplayObject):void{ var _local2:Object; var _local3:DisplayObject; if ((_arg1 is DisplayObjectContainer)){ _arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); _arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); for (_local2 in focusableObjects) { _local3 = DisplayObject(_local2); if (DisplayObjectContainer(_arg1).contains(_local3)){ if (_local3 == lastFocus){ lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local2]; calculateCandidates = true; }; }; }; } private function addedHandler(_arg1:Event):void{ var _local2:DisplayObject; _local2 = DisplayObject(_arg1.target); if (_local2.stage){ addFocusables(DisplayObject(_arg1.target)); }; } private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{ while (_arg1 != InteractiveObject(form)) { if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){ return (_arg1); }; _arg1 = _arg1.parent; if (_arg1 == null){ break; }; }; return (null); } private function tabChildrenChangeHandler(_arg1:Event):void{ var _local2:DisplayObjectContainer; if (_arg1.target != _arg1.currentTarget){ return; }; calculateCandidates = true; _local2 = DisplayObjectContainer(_arg1.target); if (_local2.tabChildren){ addFocusables(_local2, true); } else { removeFocusables(_local2); }; } public function sendDefaultButtonEvent():void{ defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } public function getFocus():InteractiveObject{ var _local1:InteractiveObject; _local1 = form.stage.focus; return (findFocusManagerComponent(_local1)); } private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer; var _local3:TextField; var _local4:SimpleButton; _local2 = DisplayObject(form).parent; while (_arg1 != _local2) { if ((_arg1 is UIComponent)){ if (!UIComponent(_arg1).enabled){ return (false); }; } else { if ((_arg1 is TextField)){ _local3 = TextField(_arg1); if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){ return (false); }; } else { if ((_arg1 is SimpleButton)){ _local4 = SimpleButton(_arg1); if (!_local4.enabled){ return (false); }; }; }; }; if (!_arg1.visible){ return (false); }; _arg1 = _arg1.parent; }; return (true); } public function set defaultButton(_arg1:Button):void{ var _local2:Button; _local2 = (_arg1) ? Button(_arg1) : null; if (_local2 != _defaultButton){ if (_defaultButton){ _defaultButton.emphasized = false; }; if (defButton){ defButton.emphasized = false; }; _defaultButton = _local2; defButton = _local2; if (_local2){ _local2.emphasized = true; }; }; } private function deactivateHandler(_arg1:Event):void{ var _local2:InteractiveObject; _local2 = InteractiveObject(_arg1.target); } public function setFocus(_arg1:InteractiveObject):void{ if ((_arg1 is IFocusManagerComponent)){ IFocusManagerComponent(_arg1).setFocus(); } else { form.stage.focus = _arg1; }; } private function setFocusToNextObject(_arg1:FocusEvent):void{ var _local2:InteractiveObject; if (!hasFocusableObjects()){ return; }; _local2 = getNextFocusManagerComponent(_arg1.shiftKey); if (_local2){ setFocus(_local2); }; } private function hasFocusableObjects():Boolean{ var _local1:Object; for (_local1 in focusableObjects) { return (true); }; return (false); } private function tabIndexChangeHandler(_arg1:Event):void{ calculateCandidates = true; } private function sortFocusableObjects():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){ sortFocusableObjectsTabIndex(); return; }; focusableCandidates.push(_local2); }; focusableCandidates.sort(sortByDepth); } private function keyFocusChangeHandler(_arg1:FocusEvent):void{ showFocusIndicator = true; if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){ setFocusToNextObject(_arg1); _arg1.preventDefault(); }; } private function getIndexOfFocusedObject(_arg1:DisplayObject):int{ var _local2:int; var _local3:int; _local2 = focusableCandidates.length; _local3 = 0; _local3 = 0; while (_local3 < _local2) { if (focusableCandidates[_local3] == _arg1){ return (_local3); }; _local3++; }; return (-1); } public function hideFocus():void{ } private function removedHandler(_arg1:Event):void{ var _local2:int; var _local3:DisplayObject; var _local4:InteractiveObject; _local3 = DisplayObject(_arg1.target); if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){ if (_local3 == lastFocus){ IFocusManagerComponent(lastFocus).drawFocus(false); lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local3]; calculateCandidates = true; } else { if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){ _local4 = (_local3 as InteractiveObject); if (_local4){ if (_local4 == lastFocus){ lastFocus = null; }; delete focusableObjects[_local4]; calculateCandidates = true; }; _local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); }; }; removeFocusables(_local3); } private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{ var _local3:String; var _local4:String; var _local5:int; var _local6:String; var _local7:String; var _local8:String; var _local9:DisplayObject; var _local10:DisplayObject; _local3 = ""; _local4 = ""; _local8 = "0000"; _local9 = DisplayObject(_arg1); _local10 = DisplayObject(_arg2); while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) { _local5 = getChildIndex(_local9.parent, _local9); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local3 = (_local7 + _local3); _local9 = _local9.parent; }; while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) { _local5 = getChildIndex(_local10.parent, _local10); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local4 = (_local7 + _local4); _local10 = _local10.parent; }; return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0); } public function get defaultButton():Button{ return (_defaultButton); } private function activateHandler(_arg1:Event):void{ var _local2:InteractiveObject; _local2 = InteractiveObject(_arg1.target); if (lastFocus){ if ((lastFocus is IFocusManagerComponent)){ IFocusManagerComponent(lastFocus).setFocus(); } else { form.stage.focus = lastFocus; }; }; lastAction = "ACTIVATE"; } public function showFocus():void{ } public function set defaultButtonEnabled(_arg1:Boolean):void{ _defaultButtonEnabled = _arg1; } public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{ var _local2:DisplayObject; var _local3:String; var _local4:int; var _local5:Boolean; var _local6:int; var _local7:int; var _local8:IFocusManagerGroup; if (!hasFocusableObjects()){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; _local2 = form.stage.focus; _local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); _local3 = ""; if ((_local2 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local2); _local3 = _local8.groupName; }; _local4 = getIndexOfFocusedObject(_local2); _local5 = false; _local6 = _local4; if (_local4 == -1){ if (_arg1){ _local4 = focusableCandidates.length; }; _local5 = true; }; _local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3); return (findFocusManagerComponent(focusableCandidates[_local7])); } private function mouseDownHandler(_arg1:MouseEvent):void{ var _local2:InteractiveObject; if (_arg1.isDefaultPrevented()){ return; }; _local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target)); if (!_local2){ return; }; showFocusIndicator = false; if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){ setFocus(_local2); }; lastAction = "MOUSEDOWN"; } private function isTabVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer; _local2 = _arg1.parent; while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) { if (!_local2.tabChildren){ return (false); }; _local2 = _local2.parent; }; return (true); } public function get nextTabIndex():int{ return (0); } private function keyDownHandler(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.TAB){ lastAction = "KEY"; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; }; if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){ sendDefaultButtonEvent(); }; } private function focusInHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject; var _local3:Button; _local2 = InteractiveObject(_arg1.target); if (form.contains(_local2)){ lastFocus = findFocusManagerComponent(InteractiveObject(_local2)); if ((lastFocus is Button)){ _local3 = Button(lastFocus); if (defButton){ defButton.emphasized = false; defButton = _local3; _local3.emphasized = true; }; } else { if (((defButton) && (!((defButton == _defaultButton))))){ defButton.emphasized = false; defButton = _defaultButton; _defaultButton.emphasized = true; }; }; }; } private function tabEnabledChangeHandler(_arg1:Event):void{ var _local2:InteractiveObject; var _local3:Boolean; calculateCandidates = true; _local2 = InteractiveObject(_arg1.target); _local3 = (focusableObjects[_local2] == true); if (_local2.tabEnabled){ if (((!(_local3)) && (isTabVisible(_local2)))){ if (!(_local2 is IFocusManagerComponent)){ _local2.focusRect = false; }; focusableObjects[_local2] = true; }; } else { if (_local3){ delete focusableObjects[_local2]; }; }; } public function set showFocusIndicator(_arg1:Boolean):void{ _showFocusIndicator = _arg1; } public function get form():DisplayObjectContainer{ return (_form); } private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{ return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2)); } public function activate():void{ if (activated){ return; }; form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true); form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true); form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true); form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = true; if (lastFocus){ setFocus(lastFocus); }; } public function deactivate():void{ form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.removeEventListener(Event.ACTIVATE, activateHandler); form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler); form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = false; } public function get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } } }//package fl.managers
Section 10
//IFocusManager (fl.managers.IFocusManager) package fl.managers { import fl.controls.*; import flash.display.*; public interface IFocusManager { function getFocus():InteractiveObject; function deactivate():void; function set defaultButton(_arg1:Button):void; function set showFocusIndicator(_arg1:Boolean):void; function get defaultButtonEnabled():Boolean; function get nextTabIndex():int; function get defaultButton():Button; function get showFocusIndicator():Boolean; function setFocus(_arg1:InteractiveObject):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(_arg1:Boolean):void; function hideFocus():void; function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; } }//package fl.managers
Section 11
//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 12
//IFocusManagerGroup (fl.managers.IFocusManagerGroup) package fl.managers { public interface IFocusManagerGroup { function set groupName(_arg1:String):void; function set selected(_arg1:Boolean):void; function get groupName():String; function get selected():Boolean; } }//package fl.managers
Section 13
//StyleManager (fl.managers.StyleManager) package fl.managers { import fl.core.*; import flash.utils.*; import flash.text.*; public class StyleManager { private var globalStyles:Object; private var classToDefaultStylesDict:Dictionary; private var styleToClassesHash:Object; private var classToStylesDict:Dictionary; private var classToInstancesDict:Dictionary; private static var _instance:StyleManager; public function StyleManager(){ styleToClassesHash = {}; classToInstancesDict = new Dictionary(true); classToStylesDict = new Dictionary(true); classToDefaultStylesDict = new Dictionary(true); globalStyles = UIComponent.getStyleDefinition(); } public static function clearComponentStyle(_arg1:Object, _arg2:String):void{ var _local3:Class; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = getInstance().classToStylesDict[_local3]; if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){ delete _local4[_arg2]; invalidateComponentStyle(_local3, _arg2); }; } private static function getClassDef(_arg1:Object):Class{ var component = _arg1; if ((component is Class)){ return ((component as Class)); }; try { return ((getDefinitionByName(getQualifiedClassName(component)) as Class)); } catch(e:Error) { if ((component is UIComponent)){ try { return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class)); } catch(e:Error) { }; }; }; return (null); } public static function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Class; var _local5:Object; _local4 = getClassDef(_arg1); _local5 = getInstance().classToStylesDict[_local4]; if (_local5 == null){ _local5 = (getInstance().classToStylesDict[_local4] = {}); }; if (_local5 == _arg3){ return; }; _local5[_arg2] = _arg3; invalidateComponentStyle(_local4, _arg2); } private static function setSharedStyles(_arg1:UIComponent):void{ var _local2:StyleManager; var _local3:Class; var _local4:Object; var _local5:String; _local2 = getInstance(); _local3 = getClassDef(_arg1); _local4 = _local2.classToDefaultStylesDict[_local3]; for (_local5 in _local4) { _arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5)); }; } public static function getComponentStyle(_arg1:Object, _arg2:String):Object{ var _local3:Class; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = getInstance().classToStylesDict[_local3]; return (((_local4)==null) ? null : _local4[_arg2]); } private static function getInstance(){ if (_instance == null){ _instance = new (StyleManager); }; return (_instance); } private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{ var _local3:Dictionary; var _local4:Object; var _local5:UIComponent; _local3 = getInstance().classToInstancesDict[_arg1]; if (_local3 == null){ return; }; for (_local4 in _local3) { _local5 = (_local4 as UIComponent); if (_local5 == null){ } else { _local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2)); }; }; } private static function invalidateStyle(_arg1:String):void{ var _local2:Dictionary; var _local3:Object; _local2 = getInstance().styleToClassesHash[_arg1]; if (_local2 == null){ return; }; for (_local3 in _local2) { invalidateComponentStyle(Class(_local3), _arg1); }; } public static function registerInstance(_arg1:UIComponent):void{ var inst:StyleManager; var classDef:Class; var target:Class; var defaultStyles:Object; var styleToClasses:Object; var n:String; var instance = _arg1; inst = getInstance(); classDef = getClassDef(instance); if (classDef == null){ return; }; if (inst.classToInstancesDict[classDef] == null){ inst.classToInstancesDict[classDef] = new Dictionary(true); target = classDef; while (defaultStyles == null) { if (target["getStyleDefinition"] != null){ defaultStyles = target["getStyleDefinition"](); break; }; try { target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class); } catch(err:Error) { try { target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class); } catch(e:Error) { defaultStyles = UIComponent.getStyleDefinition(); break; }; }; }; styleToClasses = inst.styleToClassesHash; for (n in defaultStyles) { if (styleToClasses[n] == null){ styleToClasses[n] = new Dictionary(true); }; styleToClasses[n][classDef] = true; }; inst.classToDefaultStylesDict[classDef] = defaultStyles; inst.classToStylesDict[classDef] = {}; }; inst.classToInstancesDict[classDef][instance] = true; setSharedStyles(instance); } public static function getStyle(_arg1:String):Object{ return (getInstance().globalStyles[_arg1]); } private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{ var _local3:Class; var _local4:StyleManager; var _local5:Object; _local3 = getClassDef(_arg1); _local4 = getInstance(); _local5 = _local4.classToStylesDict[_local3][_arg2]; if (_local5 != null){ return (_local5); }; _local5 = _local4.globalStyles[_arg2]; if (_local5 != null){ return (_local5); }; return (_local4.classToDefaultStylesDict[_local3][_arg2]); } public static function setStyle(_arg1:String, _arg2:Object):void{ var _local3:Object; _local3 = getInstance().globalStyles; if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; _local3[_arg1] = _arg2; invalidateStyle(_arg1); } } }//package fl.managers
Section 14
//AGLoader (AGLoader) package { import flash.display.*; public dynamic class AGLoader extends MovieClip { } }//package
Section 15
//AGLogo (AGLogo) package { import flash.display.*; public dynamic class AGLogo extends MovieClip { public function AGLogo(){ addFrameScript(80, frame81); } function frame81(){ stop(); parent.addChild(new MainGame()); parent.removeChild(this); } } }//package
Section 16
//Build (Build) package { import flash.media.*; public dynamic class Build extends Sound { } }//package
Section 17
//Button_disabledSkin (Button_disabledSkin) package { import flash.display.*; public dynamic class Button_disabledSkin extends MovieClip { } }//package
Section 18
//Button_downSkin (Button_downSkin) package { import flash.display.*; public dynamic class Button_downSkin extends MovieClip { } }//package
Section 19
//Button_emphasizedSkin (Button_emphasizedSkin) package { import flash.display.*; public dynamic class Button_emphasizedSkin extends MovieClip { } }//package
Section 20
//Button_overSkin (Button_overSkin) package { import flash.display.*; public dynamic class Button_overSkin extends MovieClip { } }//package
Section 21
//Button_selectedDisabledSkin (Button_selectedDisabledSkin) package { import flash.display.*; public dynamic class Button_selectedDisabledSkin extends MovieClip { } }//package
Section 22
//Button_selectedDownSkin (Button_selectedDownSkin) package { import flash.display.*; public dynamic class Button_selectedDownSkin extends MovieClip { } }//package
Section 23
//Button_selectedOverSkin (Button_selectedOverSkin) package { import flash.display.*; public dynamic class Button_selectedOverSkin extends MovieClip { } }//package
Section 24
//Button_selectedUpSkin (Button_selectedUpSkin) package { import flash.display.*; public dynamic class Button_selectedUpSkin extends MovieClip { } }//package
Section 25
//Button_upSkin (Button_upSkin) package { import flash.display.*; public dynamic class Button_upSkin extends MovieClip { } }//package
Section 26
//CreditsGame (CreditsGame) package { import fl.controls.*; import flash.display.*; import flash.events.*; public dynamic class CreditsGame extends MovieClip { public var back:Button; public function CreditsGame(){ addFrameScript(0, frame1); __setProp_back_CreditsGame_Layer1_1(); } function frame1(){ back.addEventListener(MouseEvent.CLICK, backe); } public function backe(_arg1:MouseEvent):void{ parent.addChild(new StartGame()); parent.removeChild(this); } function __setProp_back_CreditsGame_Layer1_1(){ try { back["componentInspectorSetting"] = true; } catch(e:Error) { }; back.emphasized = false; back.enabled = true; back.label = "BACK"; back.labelPlacement = "right"; back.selected = false; back.toggle = false; back.visible = true; try { back["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 27
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 28
//Game (Game) package { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.text.*; import flash.net.*; public class Game extends MovieClip { public var numrented:int;// = 0 public var gs:GameStats; public var timer:Timer; public var i:int; public var so:SharedObject; public var h10:HB0; public var h11:HB0; public var info:TextField; public var h1:HB0; public var h2:HB0; public var h4:HB0; public var h5:HB0; public var h6:HB0; public var h7:HB0; public var h8:HB0; public var h9:HB0; public var h3:HB0; public var h0:HB0; public function Game():void{ gs = new GameStats(); numrented = 0; so = SharedObject.getLocal("villa_village_save_game1"); super(); addFrameScript(0, frame1); if (so.size == 0){ so.data.money = gs.money; so.data.score = gs.score; so.data.house = gs.house; so.data.addlux = gs.addlux; so.data.addservice = gs.addservice; so.data.addrent = gs.addrent; so.data.rented = gs.rented; } else { gs.money = so.data.money; gs.score = so.data.score; gs.house = so.data.house; gs.addlux = so.data.addlux; gs.addservice = so.data.addservice; gs.addrent = so.data.addrent; gs.rented = so.data.rented; }; } public function reset():void{ gs = new GameStats(); so.data.money = gs.money; so.data.score = gs.score; so.data.house = gs.house; so.data.addlux = gs.addlux; so.data.addservice = gs.addservice; so.data.addrent = gs.addrent; so.data.rented = gs.rented; } function frame1(){ i = 0; while (i < 12) { this[("h" + String(i))].init(this); i++; }; i = 0; while (i < 12) { this[("h" + String(i))].changeType(gs.house[i]); i++; }; timer = new Timer(1000, 99999999); timer.addEventListener(TimerEvent.TIMER, update); timer.start(); } public function update(_arg1:TimerEvent):void{ var _local2:Number; var _local3:Number; var _local4:int; var _local5:int; var _local6:Number; var _local7:Number; _local2 = 0; _local3 = 0; _local4 = 1; _local5 = 0; while (_local5 < 12) { if (gs.house[_local5] > 0){ _local6 = Math.random(); _local7 = ((gs.luxrat * (gs.lux[gs.house[_local5]] + gs.addlux[_local5])) / (gs.rent[gs.house[_local5]] + gs.addrent[_local5])); _local3 = (_local3 + (gs.price[gs.house[_local5]] + (gs.addlux[_local5] * gs.luxval))); if (gs.rented[_local5] != 0){ gs.money = (gs.money + (gs.rent[gs.house[_local5]] + gs.addrent[_local5])); _local2 = (_local2 + 1); if (_local6 < (1 - _local7)){ gs.rented[_local5] = 0; _local2--; }; } else { if (_local6 < _local7){ gs.rented[_local5] = 1; _local2 = (_local2 + 1); }; }; gs.money = (gs.money - (gs.service[gs.house[_local5]] + gs.addservice[_local5])); }; if (gs.house[_local5] != 12){ _local4 = 0; }; _local5++; }; numrented = _local2; if (gs.money < 0){ gs.money = (gs.money + (0.005 * gs.money)); }; gs.score = Math.max(0, (((gs.money / 500) + (_local3 / 100)) - 160)); if ((((gs.score > 100000)) && ((_local4 == 1)))){ timer.stop(); reset(); parent.parent.addChild(new GameWin()); parent.parent.removeChild(parent); }; if (gs.money < -100000){ timer.stop(); reset(); parent.parent.addChild(new GameOver()); parent.parent.removeChild(parent); }; so.data.money = gs.money; so.data.score = gs.score; so.data.house = gs.house; so.data.addlux = gs.addlux; so.data.addservice = gs.addservice; so.data.addrent = gs.addrent; so.data.rented = gs.rented; } } }//package
Section 29
//GameOver (GameOver) package { import fl.controls.*; import flash.display.*; import flash.events.*; public dynamic class GameOver extends MovieClip { public var back:Button; public function GameOver(){ addFrameScript(0, frame1); __setProp_back_GameOver_Layer1_1(); } function __setProp_back_GameOver_Layer1_1(){ try { back["componentInspectorSetting"] = true; } catch(e:Error) { }; back.emphasized = false; back.enabled = true; back.label = "PLAY AGAIN"; back.labelPlacement = "right"; back.selected = false; back.toggle = false; back.visible = true; try { back["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ back.addEventListener(MouseEvent.CLICK, backe); } public function backe(_arg1:MouseEvent):void{ parent.addChild(new StartGame()); parent.removeChild(this); } } }//package
Section 30
//GameStats (GameStats) package { public class GameStats { public var money:Number;// = 80000 public var rentinc:Number;// = 500 public var servinc:Number;// = 200 public var price:Array; public var score:Number;// = 0 public var luxval:Number;// = 86 public var addlux:Array; public var addrent:Array; public var serv:Number;// = 250 public var rented:Array; public var house:Array; public var luxlim:Number;// = 0.2 public var lux:Array; public var luxinc:Number;// = 0.2 public var re:Number;// = 150 public var addservice:Array; public var service:Array; public var servmon:Number;// = 20000 public var rent:Array; public var l:Number;// = 1.05 public var luxrat:Number;// = 0.2 public var luxmon:Number;// = 8000 public function GameStats(){ money = 80000; score = 0; price = [0, 60000, 90000, 120000, 180000, 220000, 290000, 340000, 410000, 610000, 780000, 890000, 1000000]; serv = 250; re = 150; l = 1.05; service = [0, (price[1] / serv), (price[2] / serv), (price[3] / serv), (price[4] / serv), (price[5] / serv), (price[6] / serv), (price[7] / serv), (price[8] / serv), (price[9] / serv), (price[10] / serv), (price[11] / serv), (price[12] / serv)]; lux = [0, ((l * price[1]) / luxval), ((l * price[2]) / luxval), ((l * price[3]) / luxval), ((l * price[4]) / luxval), ((l * price[5]) / luxval), ((l * price[6]) / luxval), ((l * price[7]) / luxval), ((l * price[8]) / luxval), ((l * price[9]) / luxval), ((l * price[10]) / luxval), ((l * price[11]) / luxval), ((l * price[12]) / luxval)]; rent = [0, (price[1] / re), (price[2] / re), (price[3] / re), (price[4] / re), (price[5] / re), (price[6] / re), (price[7] / re), (price[8] / re), (price[9] / re), (price[10] / re), (price[11] / re), (price[12] / re)]; house = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; addlux = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; addservice = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; addrent = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; rented = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; luxinc = (1 / 5); luxmon = 8000; servinc = 200; servmon = 20000; rentinc = 500; luxval = 86; luxlim = 0.2; luxrat = 0.2; super(); } } }//package
Section 31
//GameView (GameView) package { import flash.display.*; import flash.events.*; import flash.text.*; public dynamic class GameView extends MovieClip { public var m_x:Number; public var m_y:Number; public var info2:TextField; public var stars:MovieClip; public var info:TextField; public var game:Game; public function GameView(){ addFrameScript(0, frame1); } function frame1(){ this.addEventListener(MouseEvent.MOUSE_MOVE, mouse); this.addEventListener(Event.ENTER_FRAME, frame); stage.scaleMode = StageScaleMode.EXACT_FIT; m_x = 275; m_y = 200; game.info = info; } public function frame(_arg1:Event):void{ gotoAndPlay(2); if ((((m_x > 500)) && (!(((game.x + (0.5 * game.width)) < -220))))){ game.x = (game.x - (((m_x - 500) / 50) * 15)); }; if ((((m_x < 50)) && (!(((game.x - (0.5 * game.width)) > -1030))))){ game.x = (game.x + (((50 - m_x) / 50) * 15)); }; if ((((m_y > 350)) && (((game.y + (0.5 * game.height)) > 460)))){ game.y = (game.y - (((m_y - 350) / 50) * 15)); }; if ((((m_y < 50)) && (((game.y - (0.5 * game.height)) < -110)))){ game.y = (game.y + (((50 - m_y) / 50) * 15)); }; info2.text = (((((("Money " + String(int(game.gs.money))) + "$\n") + "Score ") + String(int(game.gs.score))) + "\nRented houses ") + game.numrented); if (game.gs.score < 1000){ stars.gotoAndStop(1); } else { if (game.gs.score < 5000){ stars.gotoAndStop(2); } else { if (game.gs.score < 20000){ stars.gotoAndStop(3); } else { if (game.gs.score < 60000){ stars.gotoAndStop(4); } else { if (game.gs.score < 100000){ stars.gotoAndStop(5); } else { stars.gotoAndStop(6); }; }; }; }; }; } public function mouse(_arg1:MouseEvent):void{ m_x = _arg1.stageX; m_y = _arg1.stageY; } } }//package
Section 32
//GameWin (GameWin) package { import fl.controls.*; import flash.display.*; import flash.events.*; public dynamic class GameWin extends MovieClip { public var back:Button; public function GameWin(){ addFrameScript(0, frame1); __setProp_back_GameWin_Layer1_1(); } function frame1(){ back.addEventListener(MouseEvent.CLICK, backe); } public function backe(_arg1:MouseEvent):void{ parent.addChild(new StartGame()); parent.removeChild(this); } function __setProp_back_GameWin_Layer1_1(){ try { back["componentInspectorSetting"] = true; } catch(e:Error) { }; back.emphasized = false; back.enabled = true; back.label = "PLAY AGAIN"; back.labelPlacement = "right"; back.selected = false; back.toggle = false; back.visible = true; try { back["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 33
//HB0 (HB0) package { public dynamic class HB0 extends House { } }//package
Section 34
//HB1 (HB1) package { public dynamic class HB1 extends House { } }//package
Section 35
//HB10 (HB10) package { public dynamic class HB10 extends House { } }//package
Section 36
//HB11 (HB11) package { public dynamic class HB11 extends House { } }//package
Section 37
//HB12 (HB12) package { public dynamic class HB12 extends House { } }//package
Section 38
//HB2 (HB2) package { public dynamic class HB2 extends House { } }//package
Section 39
//HB3 (HB3) package { public dynamic class HB3 extends House { } }//package
Section 40
//HB4 (HB4) package { public dynamic class HB4 extends House { } }//package
Section 41
//HB5 (HB5) package { public dynamic class HB5 extends House { } }//package
Section 42
//HB6 (HB6) package { public dynamic class HB6 extends House { } }//package
Section 43
//HB7 (HB7) package { public dynamic class HB7 extends House { } }//package
Section 44
//HB8 (HB8) package { public dynamic class HB8 extends House { } }//package
Section 45
//HB9 (HB9) package { public dynamic class HB9 extends House { } }//package
Section 46
//Highlight (Highlight) package { import flash.display.*; public dynamic class Highlight extends MovieClip { } }//package
Section 47
//House (House) package { import flash.display.*; import flash.events.*; import flash.ui.*; public class House extends MovieClip { private var hl:Highlight; private var csd:ContextMenuItem; private var cl:ContextMenuItem; public var num:int; public var type:int; private var crd:ContextMenuItem; private var game:Game; public function House():void{ hl = new Highlight(); super(); this.addEventListener(MouseEvent.ROLL_OVER, mouse_over); this.addEventListener(MouseEvent.ROLL_OUT, mouse_out); num = int(name.slice(1, 4)); if ((this is HB0)){ type = 0; }; if ((this is HB1)){ type = 1; }; if ((this is HB2)){ type = 2; }; if ((this is HB3)){ type = 3; }; if ((this is HB4)){ type = 4; }; if ((this is HB5)){ type = 5; }; if ((this is HB6)){ type = 6; }; if ((this is HB7)){ type = 7; }; if ((this is HB8)){ type = 8; }; if ((this is HB9)){ type = 9; }; if ((this is HB10)){ type = 10; }; if ((this is HB11)){ type = 11; }; if ((this is HB12)){ type = 12; }; } public function init(_arg1:Game):void{ var _local2:ContextMenuItem; var _local3:ContextMenuItem; var _local4:ContextMenuItem; var _local5:ContextMenuItem; var _local6:ContextMenuItem; var _local7:ContextMenuItem; game = _arg1; this.contextMenu = new ContextMenu(); this.contextMenu.hideBuiltInItems(); if (type > 0){ _local2 = new ContextMenuItem((("Upgrade house(-" + String(int(game.gs.price[(type + 1)]))) + "$ money)")); _local3 = new ContextMenuItem((((("Increase luxury(+" + String(int((game.gs.luxinc * game.gs.lux[type])))) + " luxury;-") + String(int((game.gs.luxmon + ((game.gs.addlux[num] * game.gs.luxval) * game.gs.luxlim))))) + "$ money)")); _local4 = new ContextMenuItem((((("Decrease service costs(-" + String(int(game.gs.servinc))) + "$ service costs;-") + String(int(game.gs.servmon))) + "$ money)")); _local5 = new ContextMenuItem((("Increase rental fee(+" + String(int(game.gs.rentinc))) + "$ rental fee)")); _local6 = new ContextMenuItem((("Decrease rental fee(-" + String(int(game.gs.rentinc))) + "$ rental fee)")); _local7 = new ContextMenuItem("Sell house for current value"); crd = _local6; csd = _local4; cl = _local3; if (((game.gs.service[type] + game.gs.addservice[num]) - game.gs.servinc) < 0){ _local4.enabled = false; } else { _local4.enabled = true; }; if (((game.gs.rent[type] + game.gs.addrent[num]) - game.gs.rentinc) < 0){ _local6.enabled = false; } else { _local6.enabled = true; }; _local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, lux); _local4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, serv); _local5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, renti); _local6.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, rentd); _local7.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, sell); this.contextMenu.customItems.push(_local3); this.contextMenu.customItems.push(_local4); this.contextMenu.customItems.push(_local5); this.contextMenu.customItems.push(_local6); this.contextMenu.customItems.push(_local7); } else { _local2 = new ContextMenuItem((("Build a house(-" + String(game.gs.price[(type + 1)])) + "$)")); }; if (type != 12){ _local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menu_build); this.contextMenu.customItems.push(_local2); }; } public function lux(_arg1:ContextMenuEvent):void{ new Build().play(); game.gs.addlux[num] = (game.gs.addlux[num] + (game.gs.luxinc * game.gs.lux[type])); game.gs.money = (game.gs.money - (game.gs.luxmon + ((game.gs.addlux[num] * game.gs.luxval) * game.gs.luxlim))); cl.caption = (((("Increase luxury(+" + String(int((game.gs.luxinc * game.gs.lux[type])))) + " luxury;-") + String(int((game.gs.luxmon + ((game.gs.addlux[num] * game.gs.luxval) * game.gs.luxlim))))) + "$ money)"); info_update(); } public function changeType(_arg1:int):void{ var _local2:House; if (_arg1 == 0){ _local2 = new HB0(); } else { if (_arg1 == 1){ _local2 = new HB1(); } else { if (_arg1 == 2){ _local2 = new HB2(); } else { if (_arg1 == 3){ _local2 = new HB3(); } else { if (_arg1 == 4){ _local2 = new HB4(); } else { if (_arg1 == 5){ _local2 = new HB5(); } else { if (_arg1 == 6){ _local2 = new HB6(); } else { if (_arg1 == 7){ _local2 = new HB7(); } else { if (_arg1 == 8){ _local2 = new HB8(); } else { if (_arg1 == 9){ _local2 = new HB9(); } else { if (_arg1 == 10){ _local2 = new HB10(); } else { if (_arg1 == 11){ _local2 = new HB11(); } else { if (_arg1 == 12){ _local2 = new HB12(); }; }; }; }; }; }; }; }; }; }; }; }; }; _local2.name = this.name; _local2.num = num; _local2.x = this.x; _local2.y = this.y; _local2.init(game); parent.addChild(_local2); parent.removeChild(this); } public function serv(_arg1:ContextMenuEvent):void{ game.gs.addservice[num] = (game.gs.addservice[num] - game.gs.servinc); game.gs.money = (game.gs.money - game.gs.servmon); if (((game.gs.service[type] + game.gs.addservice[num]) - game.gs.servinc) < 0){ _arg1.target.enabled = false; } else { _arg1.target.enabled = true; }; info_update(); } public function mouse_over(_arg1:MouseEvent):void{ this.addChild(hl); info_update(); } public function renti(_arg1:ContextMenuEvent):void{ game.gs.addrent[num] = (game.gs.addrent[num] + game.gs.rentinc); if (((game.gs.rent[type] + game.gs.addrent[num]) - game.gs.rentinc) < 0){ crd.enabled = false; } else { crd.enabled = true; }; info_update(); } public function rentd(_arg1:ContextMenuEvent):void{ game.gs.addrent[num] = (game.gs.addrent[num] - game.gs.rentinc); if (((game.gs.rent[type] + game.gs.addrent[num]) - game.gs.rentinc) < 0){ _arg1.target.enabled = false; } else { _arg1.target.enabled = true; }; info_update(); } public function sell(_arg1:ContextMenuEvent):void{ game.gs.money = (game.gs.money + (game.gs.price[type] + (game.gs.addlux[num] * 100))); game.gs.house[num] = 0; game.gs.addlux[num] = 0; game.gs.addservice[num] = 0; game.gs.addrent[num] = 0; game.gs.rented[num] = 0; changeType(0); info_update(); } public function menu_build(_arg1:ContextMenuEvent):void{ new Build().play(); if (type > 0){ if (((game.gs.service[type] + game.gs.addservice[num]) - game.gs.servinc) < 0){ csd.enabled = false; } else { csd.enabled = true; }; }; game.gs.money = (game.gs.money - game.gs.price[(type + 1)]); game.gs.house[num] = (type + 1); changeType((type + 1)); } public function info_update():void{ var _local1:int; if (type == 0){ game.info.text = "Right click to build a house"; } else { _local1 = (((game.gs.luxrat * (game.gs.lux[game.gs.house[num]] + game.gs.addlux[num])) / (game.gs.rent[game.gs.house[num]] + game.gs.addrent[num])) * 100); game.info.text = (((((((((("Value " + String(int((game.gs.price[type] + (game.gs.addlux[num] * game.gs.luxval))))) + "$\nLuxury ") + String(int((game.gs.lux[type] + game.gs.addlux[num])))) + "\nPeriodical service costs ") + String(int((game.gs.service[type] + game.gs.addservice[num])))) + "$\nRental fee ") + String(int((game.gs.rent[type] + game.gs.addrent[num])))) + "$ luxury/fee ") + _local1) + "%"); }; } public function mouse_out(_arg1:MouseEvent):void{ var e = _arg1; try { this.removeChild(hl); } catch(e:ArgumentError) { }; game.info.text = ""; } } }//package
Section 48
//InsGame (InsGame) package { import fl.controls.*; import flash.display.*; import flash.events.*; public dynamic class InsGame extends MovieClip { public var back:Button; public function InsGame(){ addFrameScript(0, frame1); __setProp_back_InsGame_Layer1_1(); } function frame1(){ back.addEventListener(MouseEvent.CLICK, backe); } public function backe(_arg1:MouseEvent):void{ parent.addChild(new StartGame()); parent.removeChild(this); } function __setProp_back_InsGame_Layer1_1(){ try { back["componentInspectorSetting"] = true; } catch(e:Error) { }; back.emphasized = false; back.enabled = true; back.label = "BACK"; back.labelPlacement = "right"; back.selected = false; back.toggle = false; back.visible = true; try { back["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package
Section 49
//MainGame (MainGame) package { import flash.display.*; public dynamic class MainGame extends MovieClip { public var m:Music; public function MainGame(){ addFrameScript(0, frame1); } function frame1(){ m = new Music(); m.play(0, 99999999); } } }//package
Section 50
//Music (Music) package { import flash.media.*; public dynamic class Music extends Sound { } }//package
Section 51
//Root (Root) package { import flash.display.*; import flash.events.*; import flash.net.*; public class Root extends MovieClip { public var ag:AGLoader; public static var _root:MovieClip; public function Root():void{ _root = this; ag = new AGLoader(); ag.x = 329.5; ag.y = 195.5; ag.addEventListener(MouseEvent.CLICK, nav); addChild(ag); loaderInfo.addEventListener(Event.INIT, ag_init); loaderInfo.addEventListener(ProgressEvent.PROGRESS, ag_prog); loaderInfo.addEventListener(Event.COMPLETE, ag_comp); stage.scaleMode = StageScaleMode.EXACT_FIT; } public function nav(_arg1:Event){ navigateToURL(new URLRequest("http://armorgames.com")); } public function ag_init(_arg1:Event){ var _local2:int; var _local3:int; var _local4:int; _local2 = _arg1.target.bytesLoaded; _local3 = _arg1.target.bytesTotal; _local4 = ((_local2 / _local3) * 100); ag.gotoAndStop(0); } public function ag_comp(_arg1:Event){ var _local2:AGLogo; _root.removeChild(ag); _local2 = new AGLogo(); _local2.x = 241.8; _local2.y = 176.2; _local2.addEventListener(MouseEvent.CLICK, nav); _root.addChild(_local2); } public function ag_prog(_arg1:ProgressEvent){ var _local2:int; var _local3:int; var _local4:int; _local2 = _arg1.target.bytesLoaded; _local3 = _arg1.target.bytesTotal; _local4 = ((_local2 / _local3) * 100); ag.gotoAndStop(_local4); } } }//package
Section 52
//StartGame (StartGame) package { import fl.controls.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.media.*; import flash.text.*; import flash.net.*; import flash.ui.*; import flash.system.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.printing.*; import flash.xml.*; public dynamic class StartGame extends MovieClip { public var start:Button; public var reset:Button; public var playmore:Button; public var credits:Button; public var ins:Button; public function StartGame(){ addFrameScript(0, frame1); __setProp_reset_StartGame_Layer1_1(); __setProp_ins_StartGame_Layer1_1(); __setProp_credits_StartGame_Layer1_1(); __setProp_playmore_StartGame_Layer1_1(); __setProp_start_StartGame_Layer1_1(); } public function inse(_arg1:MouseEvent):void{ parent.addChild(new InsGame()); parent.removeChild(this); } public function starte(_arg1:MouseEvent):void{ parent.addChild(new GameView()); parent.removeChild(this); } function __setProp_start_StartGame_Layer1_1(){ try { start["componentInspectorSetting"] = true; } catch(e:Error) { }; start.emphasized = false; start.enabled = true; start.label = "START"; start.labelPlacement = "right"; start.selected = false; start.toggle = false; start.visible = true; try { start["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp_reset_StartGame_Layer1_1(){ try { reset["componentInspectorSetting"] = true; } catch(e:Error) { }; reset.emphasized = false; reset.enabled = true; reset.label = "RESET GAME"; reset.labelPlacement = "right"; reset.selected = false; reset.toggle = false; reset.visible = true; try { reset["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame1(){ start.addEventListener(MouseEvent.CLICK, starte); ins.addEventListener(MouseEvent.CLICK, inse); credits.addEventListener(MouseEvent.CLICK, crede); reset.addEventListener(MouseEvent.CLICK, rese); playmore.addEventListener(MouseEvent.CLICK, playe); } function __setProp_playmore_StartGame_Layer1_1(){ try { playmore["componentInspectorSetting"] = true; } catch(e:Error) { }; playmore.emphasized = false; playmore.enabled = true; playmore.label = "PLAY MORE GAMES"; playmore.labelPlacement = "right"; playmore.selected = false; playmore.toggle = false; playmore.visible = true; try { playmore["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function playe(_arg1:MouseEvent):void{ navigateToURL(new URLRequest("http://armorgames.com")); } function __setProp_credits_StartGame_Layer1_1(){ try { credits["componentInspectorSetting"] = true; } catch(e:Error) { }; credits.emphasized = false; credits.enabled = true; credits.label = "CREDITS"; credits.labelPlacement = "right"; credits.selected = false; credits.toggle = false; credits.visible = true; try { credits["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function rese(_arg1:MouseEvent):void{ var _local2:GameStats; var _local3:SharedObject; _local2 = new GameStats(); _local3 = SharedObject.getLocal("villa_village_save_game1"); _local3.data.money = _local2.money; _local3.data.score = _local2.score; _local3.data.house = _local2.house; _local3.data.addlux = _local2.addlux; _local3.data.addservice = _local2.addservice; _local3.data.addrent = _local2.addrent; _local3.data.rented = _local2.rented; } function __setProp_ins_StartGame_Layer1_1(){ try { ins["componentInspectorSetting"] = true; } catch(e:Error) { }; ins.emphasized = false; ins.enabled = true; ins.label = "INSTRUCTIONS"; ins.labelPlacement = "right"; ins.selected = false; ins.toggle = false; ins.visible = true; try { ins["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function crede(_arg1:MouseEvent):void{ parent.addChild(new CreditsGame()); parent.removeChild(this); } } }//package

Library Items

Symbol 1 Sound {Music}
Symbol 2 Sound {Build}
Symbol 3 GraphicUsed by:17
Symbol 4 GraphicUsed by:8
Symbol 5 GraphicUsed by:6
Symbol 6 MovieClipUses:5Used by:8
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClipUses:4 6 7Used by:17 27
Symbol 9 GraphicUsed by:10 27
Symbol 10 ButtonUses:9Used by:17
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClipUses:11Used by:17
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClipUses:13Used by:17
Symbol 15 GraphicUsed by:16
Symbol 16 MovieClipUses:15Used by:17
Symbol 17 MovieClip {AGLogo}Uses:3 8 10 12 14 16 SS1
Symbol 18 GraphicUsed by:27
Symbol 19 GraphicUsed by:27
Symbol 20 ShapeTweeningUsed by:27
Symbol 21 GraphicUsed by:22
Symbol 22 MovieClipUses:21Used by:27
Symbol 23 GraphicUsed by:24
Symbol 24 MovieClipUses:23Used by:27
Symbol 25 GraphicUsed by:26
Symbol 26 MovieClipUses:25Used by:27
Symbol 27 MovieClip {AGLoader}Uses:18 8 19 20 22 24 26 9
Symbol 28 GraphicUsed by:29
Symbol 29 MovieClip {Highlight}Uses:28
Symbol 30 GraphicUsed by:34
Symbol 31 GraphicUsed by:34
Symbol 32 GraphicUsed by:34
Symbol 33 GraphicUsed by:34
Symbol 34 MovieClipUses:30 31 32 33Used by:39
Symbol 35 GraphicUsed by:38 53 56 59 62 65 68 71 74 77 80 83 86
Symbol 36 BitmapUsed by:37
Symbol 37 GraphicUses:36Used by:38
Symbol 38 MovieClip {HB0}Uses:35 37Used by:39
Symbol 39 MovieClip {Game}Uses:34 38Used by:50
Symbol 40 FontUsed by:41 42 88 113 114 116 117 119 120 121 123 124
Symbol 41 EditableTextUses:40Used by:50
Symbol 42 EditableTextUses:40Used by:50
Symbol 43 GraphicUsed by:49
Symbol 44 GraphicUsed by:49
Symbol 45 GraphicUsed by:49
Symbol 46 GraphicUsed by:49
Symbol 47 GraphicUsed by:49
Symbol 48 GraphicUsed by:49
Symbol 49 MovieClipUses:43 44 45 46 47 48Used by:50
Symbol 50 MovieClip {GameView}Uses:39 41 42 49
Symbol 51 BitmapUsed by:52 87
Symbol 52 GraphicUses:51Used by:53
Symbol 53 MovieClip {HB9}Uses:35 52
Symbol 54 BitmapUsed by:55
Symbol 55 GraphicUses:54Used by:56
Symbol 56 MovieClip {HB6}Uses:35 55
Symbol 57 BitmapUsed by:58 87
Symbol 58 GraphicUses:57Used by:59
Symbol 59 MovieClip {HB5}Uses:35 58
Symbol 60 BitmapUsed by:61
Symbol 61 GraphicUses:60Used by:62
Symbol 62 MovieClip {HB7}Uses:35 61
Symbol 63 BitmapUsed by:64
Symbol 64 GraphicUses:63Used by:65
Symbol 65 MovieClip {HB12}Uses:35 64
Symbol 66 BitmapUsed by:67
Symbol 67 GraphicUses:66Used by:68
Symbol 68 MovieClip {HB3}Uses:35 67
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:71
Symbol 71 MovieClip {HB11}Uses:35 70
Symbol 72 BitmapUsed by:73 87
Symbol 73 GraphicUses:72Used by:74
Symbol 74 MovieClip {HB1}Uses:35 73
Symbol 75 BitmapUsed by:76
Symbol 76 GraphicUses:75Used by:77
Symbol 77 MovieClip {HB8}Uses:35 76
Symbol 78 BitmapUsed by:79
Symbol 79 GraphicUses:78Used by:80
Symbol 80 MovieClip {HB10}Uses:35 79
Symbol 81 BitmapUsed by:82
Symbol 82 GraphicUses:81Used by:83
Symbol 83 MovieClip {HB2}Uses:35 82
Symbol 84 BitmapUsed by:85
Symbol 85 GraphicUses:84Used by:86
Symbol 86 MovieClip {HB4}Uses:35 85
Symbol 87 GraphicUses:51 57 72Used by:115 118 122 125 126
Symbol 88 TextUses:40Used by:115 118 122 125 126
Symbol 89 GraphicUsed by:90
Symbol 90 MovieClipUses:89Used by:112
Symbol 91 MovieClip {fl.core.ComponentShim}Used by:112
Symbol 92 GraphicUsed by:93
Symbol 93 MovieClip {Button_disabledSkin}Uses:92Used by:112
Symbol 94 GraphicUsed by:95
Symbol 95 MovieClip {Button_downSkin}Uses:94Used by:112
Symbol 96 GraphicUsed by:97
Symbol 97 MovieClip {Button_emphasizedSkin}Uses:96Used by:112
Symbol 98 GraphicUsed by:99
Symbol 99 MovieClip {Button_overSkin}Uses:98Used by:112
Symbol 100 GraphicUsed by:101
Symbol 101 MovieClip {Button_selectedDisabledSkin}Uses:100Used by:112
Symbol 102 GraphicUsed by:103
Symbol 103 MovieClip {Button_selectedDownSkin}Uses:102Used by:112
Symbol 104 GraphicUsed by:105
Symbol 105 MovieClip {Button_selectedOverSkin}Uses:104Used by:112
Symbol 106 GraphicUsed by:107
Symbol 107 MovieClip {Button_selectedUpSkin}Uses:106Used by:112
Symbol 108 GraphicUsed by:109
Symbol 109 MovieClip {Button_upSkin}Uses:108Used by:112
Symbol 110 GraphicUsed by:111
Symbol 111 MovieClip {focusRectSkin}Uses:110Used by:112
Symbol 112 MovieClip {fl.controls.Button}Uses:90 91 93 95 97 99 101 103 105 107 109 111Used by:115 118 122 125 126
Symbol 113 TextUses:40Used by:115
Symbol 114 TextUses:40Used by:115
Symbol 115 MovieClip {GameWin}Uses:87 88 112 113 114
Symbol 116 TextUses:40Used by:118
Symbol 117 TextUses:40Used by:118
Symbol 118 MovieClip {GameOver}Uses:87 88 112 116 117
Symbol 119 TextUses:40Used by:122
Symbol 120 TextUses:40Used by:122
Symbol 121 EditableTextUses:40Used by:122
Symbol 122 MovieClip {CreditsGame}Uses:87 88 112 119 120 121
Symbol 123 TextUses:40Used by:125
Symbol 124 TextUses:40Used by:125
Symbol 125 MovieClip {InsGame}Uses:87 88 112 123 124
Symbol 126 MovieClip {StartGame}Uses:87 88 112Used by:127
Symbol 127 MovieClip {MainGame}Uses:126
Streaming Sound 1Used by:Symbol 17 MovieClip {AGLogo}

Instance Names

"h3"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h7"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h6"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h5"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h4"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h11"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h10"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h9"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h8"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h2"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h1"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"h0"Symbol 39 MovieClip {Game} Frame 1Symbol 38 MovieClip {HB0}
"game"Symbol 50 MovieClip {GameView} Frame 1Symbol 39 MovieClip {Game}
"info"Symbol 50 MovieClip {GameView} Frame 1Symbol 41 EditableText
"info2"Symbol 50 MovieClip {GameView} Frame 1Symbol 42 EditableText
"stars"Symbol 50 MovieClip {GameView} Frame 1Symbol 49 MovieClip
"back"Symbol 115 MovieClip {GameWin} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"back"Symbol 118 MovieClip {GameOver} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"back"Symbol 122 MovieClip {CreditsGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"back"Symbol 125 MovieClip {InsGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"start"Symbol 126 MovieClip {StartGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"ins"Symbol 126 MovieClip {StartGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"credits"Symbol 126 MovieClip {StartGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"reset"Symbol 126 MovieClip {StartGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}
"playmore"Symbol 126 MovieClip {StartGame} Frame 1Symbol 112 MovieClip {fl.controls.Button}

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.




http://swfchan.com/6/25716/info.shtml
Created: 23/5 -2019 09:56:56 Last modified: 23/5 -2019 09:56:56 Server time: 16/05 -2024 00:00:33