Section 1
//AnimatedBitmap (fai.common.AnimatedBitmap)
package fai.common {
import flash.display.*;
import flash.geom.*;
public class AnimatedBitmap extends Bitmap {
private var initial_height:int;// = 0
private var point:Point;// = null
private var rect:Rectangle;// = null
private var initial_width:int;// = 0
public var curbuffer:BitmapData;// = null
public var nframes:uint;// = 0
public var framen:uint;// = 0
public function AnimatedBitmap(_arg1:BitmapData, _arg2:int, _arg3:int):void{
nframes = 0;
curbuffer = null;
framen = 0;
point = null;
rect = null;
initial_width = 0;
initial_height = 0;
initial_width = _arg2;
initial_height = _arg3;
super(new BitmapData(_arg2, _arg3, true, 0), "auto", true);
point = new Point(0, 0);
setBuffer(_arg1);
}
public function setBuffer(_arg1:BitmapData):void{
if (((_arg1) && (!((curbuffer == _arg1))))){
curbuffer = _arg1;
nframes = (curbuffer.width / initial_width);
framen = 0;
draw();
};
}
public function setFrame(_arg1:uint):void{
if (_arg1 == framen){
return;
};
framen = _arg1;
draw();
}
private function draw():void{
var _local1:BitmapData;
_local1 = bitmapData;
rect = new Rectangle((framen * initial_width), 0, initial_width, initial_height);
_local1.copyPixels(curbuffer, rect, point);
bitmapData = _local1;
smoothing = true;
}
}
}//package fai.common
Section 2
//Map (fai.common.Map)
package fai.common {
public class Map {
public var values:Array;
protected var index_:int;// = 0
public var keys:Array;
public function Map(){
keys = new Array();
values = new Array();
index_ = 0;
super();
}
public function add(_arg1:Object, _arg2):void{
index_ = 0;
find(_arg1);
keys.splice(index_, 0, _arg1);
values.splice(index_, 0, _arg2);
}
public function empty():Boolean{
return ((keys.length == 0));
}
public function shift(){
var _local1:*;
_local1 = values.shift();
keys.shift();
return (_local1);
}
public function remove(_arg1:Object):void{
if (find(_arg1)){
keys.splice(index_, 1);
values.splice(index_, 1);
};
}
public function size():int{
return (keys.length);
}
public function pop(){
var _local1:*;
_local1 = values.pop();
keys.pop();
return (_local1);
}
public function get(_arg1:Object){
if (!find(_arg1)){
return (null);
};
return (values[index_]);
}
public function getout(_arg1:Object){
var _local2:*;
if (!find(_arg1)){
return (null);
};
_local2 = values[index_];
values.splice(index_, 1);
keys.splice(index_, 1);
return (_local2);
}
public function find(_arg1:Object):Boolean{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = (keys.length - 1);
while (_local2 <= _local3) {
index_ = ((_local2 + _local3) >> 1);
if (_arg1 < keys[index_]){
_local3 = (index_ - 1);
} else {
if (_arg1 > keys[index_]){
_local2 = (index_ + 1);
} else {
return (true);
};
};
};
index_ = _local2;
return (false);
}
public function clear():void{
keys.length = 0;
values.length = 0;
index_ = 0;
}
}
}//package fai.common
Section 3
//Position (fai.common.Position)
package fai.common {
public final class Position {
public var x:int;// = 0
public var y:int;// = 0
public function Position(_arg1:int=0, _arg2:int=0):void{
x = 0;
y = 0;
super();
set(_arg1, _arg2);
}
public function copy(_arg1:Position):void{
x = _arg1.x;
y = _arg1.y;
}
public function set(_arg1:int, _arg2:int):void{
x = _arg1;
y = _arg2;
}
public function isequal(_arg1:Position):Boolean{
return ((((x == _arg1.x)) && ((y == _arg1.y))));
}
public function isSameXY(_arg1:int, _arg2:int):Boolean{
return ((((x == _arg1)) && ((y == _arg2))));
}
}
}//package fai.common
Section 4
//Utils (fai.common.Utils)
package fai.common {
import fai.logic.*;
import flash.text.*;
public class Utils {
public static function fitToClip(_arg1, _arg2):void{
var _local3:Number;
_local3 = 0;
if (_arg1.platform.width > _arg1.platform.height){
if (_arg1.platform.width > _arg2.platform.width){
_arg1.scaleX = (_arg1.scaleY = (_arg2.platform.width / _arg1.platform.width));
};
if (_arg1.platform.height > _arg2.platform.height){
_local3 = _arg1.scaleX;
_arg1.scaleY = (_arg1.scaleX = (_local3 * (_arg2.platform.height / _arg1.platform.height)));
};
} else {
if (_arg1.platform.height > _arg2.platform.height){
_arg1.scaleY = (_arg1.scaleX = (_arg2.platform.height / _arg1.platform.height));
};
if (_arg1.width > _arg2.width){
_local3 = _arg1.scaleX;
_arg1.scaleX = (_arg1.scaleY = (_local3 * (_arg2.platform.width / _arg1.platform.width)));
};
};
}
public static function distanceCustomer(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.getX() - _arg2.x);
_local4 = (_arg1.getY() - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function setTextColor(_arg1:TextField, _arg2:int):void{
var _local3:TextFormat;
_local3 = new TextFormat();
_local3.color = _arg2;
_arg1.defaultTextFormat = _local3;
}
public static function distance(_arg1, _arg2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function posPlatforms(_arg1, _arg2):void{
var _local3:Number;
var _local4:Number;
if (((!((_arg2.platform.width == _arg1.platform.width))) || (!((_arg2.platform.height == _arg1.platform.height))))){
fitToClip(_arg1, _arg2);
};
_local3 = (_arg2.platform.x - _arg1.platform.x);
_local4 = (_arg2.platform.y - _arg1.platform.y);
_arg1.x = _local3;
_arg1.y = _local4;
}
}
}//package fai.common
Section 5
//BuildingGoal (fai.goals.BuildingGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class BuildingGoal extends Goal {
private var engine:Engine;// = null
private var max:int;// = 0
private var ticks:int;// = 0
private var shop_item:ShopItem;// = null
public function BuildingGoal(_arg1:Engine, _arg2):void{
engine = null;
shop_item = null;
ticks = 0;
max = 0;
super();
engine = _arg1;
shop_item = _arg2;
shop_item.setLevel(Consts.ShopBuilding);
shop_item.gotoAndStop("building_progress");
shop_item.building_bar.visible = true;
shop_item.reset();
max = (ticks = DataProxy.getShopBuildingTicks(_arg2.shopType));
}
public function advance():void{
if (ticks <= 0){
buildShop();
deactivate();
return;
};
if (shop_item.building_bar){
shop_item.building_bar.bar.scaleX = (1 - (ticks / max));
shop_item.building_bar.percents.text = ((" " + int(((1 - (ticks / max)) * 100))) + "%");
};
ticks--;
}
private function buildShop():void{
var _local1:*;
engine.playSound(SoundConsts.build);
shop_item.gotoAndStop("shopping");
shop_item.building_bar.visible = false;
shop_item.setLevel(Consts.ShopLevel1);
if ((((shop_item.shopType == StringConsts.fire_dept)) || ((shop_item.shopType == StringConsts.police)))){
shop_item.shoppable = false;
} else {
shop_item.shoppable = true;
};
_local1 = DataProxy.createShopIcon(shop_item);
shop_item.setShopIcon(_local1);
shop_item.updateState();
shop_item.reset();
engine.playWindow.stats.built++;
if ((((((engine.lastLevel.number == 0)) && ((engine.scenario.currentDay == 0)))) && ((shop_item.shopType == StringConsts.boutique)))){
engine.playWindow.ui.click_next_day_button.visible = true;
};
}
}
}//package fai.goals
Section 6
//BuyerGoal (fai.goals.BuyerGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class BuyerGoal extends Goal {
private var engine:Engine;// = null
private var move_goal:MoveCustomerGoal;// = null
private var extra_using:Boolean;// = false
private var buying_goal:BuyingGoal;// = null
private var check_min_distance:int;// = 55
private var buying:Boolean;// = false
private var extra_goal:ExtraGoal;// = null
private var buyer:Customer;// = null
private var check_pause:int;// = 0
private static const CHECK_PAUSE:int = 5;
public function BuyerGoal(_arg1:Engine, _arg2:Customer):void{
var _local3:RoadPath;
engine = null;
buyer = null;
buying = false;
buying_goal = null;
move_goal = null;
extra_using = false;
extra_goal = null;
check_pause = 0;
check_min_distance = 55;
super();
engine = _arg1;
buyer = _arg2;
_local3 = engine.playWindow.getNextRoad();
engine.playWindow.customersHolder.addChild(buyer.suit);
buyer.parent_dc = engine.playWindow.customersHolder;
engine.customers.add(buyer);
move_goal = new MoveCustomerGoal(engine, _arg2, _local3);
}
private function getNearestShop():ShopItem{
var _local1:int;
var _local2:ShopItem;
var _local3:Position;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
_local2 = engine.shops.getItem(_local1);
if (((((((_local2) && (_local2.shoppable))) && ((((((_local2.currentLevel == Consts.ShopLevel1)) || ((_local2.currentLevel == Consts.ShopLevel2)))) || ((_local2.currentLevel == Consts.ShopLevel3)))))) && ((buyer.money > 0)))){
_local3 = new Position((_local2.x + (_local2.move_beacon.x * _local2.scaleX)), (_local2.y + (_local2.move_beacon.y * _local2.scaleY)));
if (Utils.distanceCustomer(buyer, _local3) <= check_min_distance){
return (_local2);
};
};
_local1++;
};
return (null);
}
public function advance():void{
if (buying){
if (((buying_goal) && (buying_goal.active))){
return;
};
buying = false;
if (buyer.money <= 0){
buyer.velocity = (buyer.velocity * 1.4);
};
move_goal.reset();
} else {
if (extra_using){
if (((extra_goal) && (extra_goal.active))){
return;
};
extra_using = false;
if (buyer.money <= 0){
buyer.velocity = (buyer.velocity * 1.4);
};
move_goal.reset();
} else {
if (check_pause <= 0){
checkShops();
check_pause = CHECK_PAUSE;
if (buying){
return;
};
} else {
check_pause--;
};
if (move_goal.active){
move_goal.advance();
buyer.extraTicks();
} else {
engine.customerPassed(buyer);
deactivate();
};
};
};
}
private function getNearestExtra():ExtraItem{
var _local1:int;
var _local2:ExtraItem;
var _local3:Position;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
if (((!(_local2.isAwaiting)) && (!((_local2.currentState == StringConsts.empty))))){
_local3 = new Position(_local2.x, _local2.y);
if (Utils.distanceCustomer(buyer, _local3) <= check_min_distance){
return (_local2);
};
};
_local1++;
};
return (null);
}
private function checkShops():void{
var _local1:ShopItem;
var _local2:ExtraItem;
_local1 = getNearestShop();
if (((_local1) && (!(buyer.hasBuyings(_local1.shopIdString))))){
if (_local1.shopBar.hasRoom()){
buying = true;
buying_goal = new BuyingGoal(engine, buyer, move_goal, _local1);
engine.goal_system.add(buying_goal);
};
};
if (!buying){
_local2 = getNearestExtra();
if (((((_local2) && (!(buyer.extraUsed(_local2))))) && ((buyer.money > 0)))){
if (_local2.hasRoom()){
extra_using = true;
extra_goal = new ExtraGoal(engine, buyer, move_goal, _local2);
engine.goal_system.add(extra_goal);
};
};
};
}
override public function deactivate():void{
super.deactivate();
if (((buyer) && (engine.playWindow))){
engine.customers.remove(buyer);
buyer.parent_dc.removeChild(buyer.suit);
buyer.parent_dc = null;
if (buyer.money > 0){
engine.not_spent = true;
};
if ((((engine.customers.size() == 0)) && ((engine.not_spent == false)))){
engine.playWindow.showBonus(1000);
};
engine.playWindow.updateResources();
buyer = null;
};
}
}
}//package fai.goals
Section 7
//BuyingGoal (fai.goals.BuyingGoal)
package fai.goals {
import fai.logic.*;
import fai.common.*;
import fai.*;
public class BuyingGoal extends Goal {
private var engine:Engine;// = null
private var odx:Number;// = 0
private var unloading:Boolean;// = false
private var ody:Number;// = 0
private var move_goal:MoveSimpleGoal;// = null
private var step:int;// = 0
private var road_move_goal:MoveCustomerGoal;// = null
private var was_hungry:Boolean;// = false
private var steps:int;// = 30
private var target_pos:Position;// = null
private var finished:Boolean;// = false
private var buyer:Customer;// = null
private var shop:ShopItem;// = null
private var loading:Boolean;// = false
public function BuyingGoal(_arg1:Engine, _arg2:Customer, _arg3:MoveCustomerGoal, _arg4:ShopItem):void{
engine = null;
buyer = null;
shop = null;
target_pos = null;
odx = 0;
ody = 0;
steps = 30;
step = 0;
loading = false;
unloading = false;
finished = false;
was_hungry = false;
road_move_goal = null;
move_goal = null;
super();
engine = _arg1;
buyer = _arg2;
shop = _arg4;
road_move_goal = _arg3;
move_goal = new MoveSimpleGoal(engine, buyer);
target_pos = new Position((shop.x + (shop.move_beacon.x * shop.scaleX)), (shop.y + (shop.move_beacon.y * shop.scaleY)));
move_goal.moveTo(target_pos);
loading = true;
}
public function advance():void{
if (loading){
go();
return;
};
if (unloading){
go();
return;
};
if (!buyer.buying){
if (finished){
if (was_hungry){
buyer.customer_money.gotoAndStop("money_label");
};
deactivate();
} else {
unload();
};
};
}
private function go():void{
if (move_goal.active){
move_goal.advance();
} else {
if (unloading){
finished = true;
};
if (loading){
tryToLoad();
};
loading = false;
unloading = false;
};
}
private function tryToLoad():void{
var _local1:ShopSeat;
if (((shop) && ((((((shop.currentLevel == Consts.ShopLevel1)) || ((shop.currentLevel == Consts.ShopLevel2)))) || ((shop.currentLevel == Consts.ShopLevel3)))))){
_local1 = shop.shopBar.load(buyer);
if (_local1){
buyer.suit.visible = false;
shop.shopBar.update();
return;
};
};
buyer.customer_money.gotoAndStop("hungry_label");
was_hungry = true;
unload();
}
private function unload():void{
target_pos = road_move_goal.anyNextNodePos();
buyer.suit.visible = true;
loading = false;
unloading = true;
shop.shopBar.update();
move_goal = new MoveSimpleGoal(engine, buyer);
move_goal.moveTo(target_pos);
}
}
}//package fai.goals
Section 8
//CoinGoal (fai.goals.CoinGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class CoinGoal extends Goal {
private var engine:Engine;// = null
private var coin:CoinMotion;// = null
private var shop;// = null
public function CoinGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
coin = null;
super();
engine = _arg1;
shop = _arg2;
coin = new CoinMotion();
coin.x = (shop.x + ((Math.random() * shop.width) / 2));
coin.y = shop.y;
if ((((shop is ExtraItem)) && (shop.vice_versa))){
coin.x = (coin.x - 15);
};
engine.playWindow.ui.addChild(coin);
coin.play();
}
override public function deactivate():void{
super.deactivate();
if (((coin) && (engine.playWindow))){
coin.stop();
engine.playWindow.ui.removeChild(coin);
coin = null;
};
}
public function advance():void{
if (coin.finished){
deactivate();
};
}
}
}//package fai.goals
Section 9
//CustomerZIndexGoal (fai.goals.CustomerZIndexGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import flash.geom.*;
import fai.goalsystem.*;
import fai.*;
public class CustomerZIndexGoal extends Goal {
private var engine:Engine;// = null
private var pause:int;// = 0
private static const PAUSE:int = 5;
public function CustomerZIndexGoal(_arg1:Engine):void{
engine = null;
pause = 0;
super();
engine = _arg1;
}
public function advance():void{
if (pause > 0){
pause--;
return;
};
pause = PAUSE;
checkZIndexes();
}
public function checkZIndexes():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Customer;
var _local7:Customer;
var _local8:int;
var _local9:int;
var _local10:Point;
var _local11:Boolean;
var _local12:IsoBeacon;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = engine.customers.size();
_local6 = null;
_local7 = null;
_local8 = 0;
_local9 = 0;
_local1 = 0;
while (_local1 < _local5) {
_local6 = engine.customers.getItem(_local1);
if (!_local6.check_zindex){
} else {
_local10 = new Point(_local6.getX(), _local6.getY());
_local11 = false;
_local4 = 0;
while (_local4 < engine.play_window.iso_beacons.length) {
_local12 = engine.play_window.iso_beacons[_local4];
if (hitTestBeacon(_local12, _local10)){
if (_local6.parent_dc != _local12){
moveToBeaconLayer(_local6, _local12);
};
_local11 = true;
break;
};
_local4++;
};
if (((!(_local11)) && (!((_local6.parent_dc == engine.playWindow.customersHolder))))){
moveTocustomersHolder(_local6);
};
_local2 = (_local1 + 1);
while (_local2 < _local5) {
_local7 = engine.customers.getItem(_local2);
if ((((((_local6 == _local7)) || (!(_local7.check_zindex)))) || (!((_local7.parent_dc == _local6.parent_dc))))){
} else {
if ((((_local7.getX() > (_local6.getX() - Consts.SpriteWidth))) && ((_local7.getX() < (_local6.getX() + Consts.SpriteWidth))))){
_local8 = _local6.parent_dc.getChildIndex(_local6.suit);
_local9 = _local6.parent_dc.getChildIndex(_local7.suit);
if ((((((_local6.getY() > _local7.getY())) && ((_local8 < _local9)))) || ((((_local6.getY() < _local7.getY())) && ((_local8 > _local9)))))){
_local6.parent_dc.swapChildren(_local6.suit, _local7.suit);
};
};
};
_local2++;
};
};
_local1++;
};
}
private function moveToBeaconLayer(_arg1:Customer, _arg2):void{
_arg1.parent_dc.removeChild(_arg1.suit);
if (_arg1.parent_dc != engine.playWindow.customersHolder){
_arg1.suit.x = (_arg1.parent_dc.x + _arg1.suit.x);
_arg1.suit.y = (_arg1.parent_dc.y + _arg1.suit.y);
};
_arg1.suit.x = -((_arg2.x - _arg1.suit.x));
_arg1.suit.y = -((_arg2.y - _arg1.suit.y));
_arg2.addChild(_arg1.suit);
_arg1.parent_dc = _arg2;
}
private function moveTocustomersHolder(_arg1:Customer):void{
_arg1.parent_dc.removeChild(_arg1.suit);
_arg1.suit.x = (_arg1.parent_dc.x + _arg1.suit.x);
_arg1.suit.y = (_arg1.parent_dc.y + _arg1.suit.y);
engine.playWindow.customersHolder.addChild(_arg1.suit);
_arg1.parent_dc = engine.playWindow.customersHolder;
}
private function hitTestBeacon(_arg1, _arg2:Point):Boolean{
return ((((((((_arg2.x > _arg1.x)) && ((_arg2.x < (_arg1.x + _arg1.inner.width))))) && ((_arg2.y > _arg1.y)))) && ((_arg2.y < (_arg1.y + _arg1.inner.height)))));
}
}
}//package fai.goals
Section 10
//ExtraGoal (fai.goals.ExtraGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class ExtraGoal extends Goal {
private var engine:Engine;// = null
private var unloading:Boolean;// = false
private var loading:Boolean;// = false
private var free_seat_pos:int;// = 0
private var extra:ExtraItem;// = null
private var move_goal:MoveSimpleGoal;// = null
private var extra_steps:int;// = 0
private var init_scale:Number;// = 0
private var road_move_goal:MoveCustomerGoal;// = null
private var target_pos:Position;// = null
private var buyer:Customer;// = null
private var counter:int;// = 0
public function ExtraGoal(_arg1:Engine, _arg2:Customer, _arg3:MoveCustomerGoal, _arg4:ExtraItem):void{
engine = null;
buyer = null;
extra = null;
target_pos = null;
loading = false;
unloading = false;
extra_steps = 0;
counter = 0;
free_seat_pos = 0;
road_move_goal = null;
move_goal = null;
init_scale = 0;
super();
engine = _arg1;
buyer = _arg2;
extra = _arg4;
init_scale = buyer.character.scaleX;
free_seat_pos = extra.loadCustomer(_arg2);
if (-1 == free_seat_pos){
deactivate();
return;
};
extra_steps = DataProxy.getExtraCounterSteps(_arg4.currentState);
road_move_goal = _arg3;
move_goal = new MoveSimpleGoal(engine, buyer);
setTargetPos();
loading = true;
}
private function unload():void{
target_pos = road_move_goal.anyNextNodePos();
buyer.suit.visible = true;
loading = false;
unloading = true;
extra.unloadCustomer(buyer);
buyer.character.scaleX = init_scale;
if (!buyer.check_zindex){
engine.playWindow.ui.removeChild(buyer.suit);
engine.playWindow.ui.customers.addChild(buyer.suit);
buyer.check_zindex = true;
};
move_goal = new MoveSimpleGoal(engine, buyer);
move_goal.moveTo(target_pos);
}
public function advance():void{
if (((((!(unloading)) && (extra))) && ((extra.currentState == StringConsts.empty)))){
if ((((counter > 0)) || (loading))){
counter = 0;
loading = false;
move_goal.deactivate();
unload();
};
return;
};
if (counter > 0){
counter--;
if (counter == 0){
if (extra.currentState == StringConsts.news_box){
dropCoins();
engine.payMoney(-(Consts.NewspaperCost));
} else {
if (extra.currentState == StringConsts.ice_cream){
dropCoins();
engine.payMoney(-(Consts.IcecreamCost));
};
};
unload();
};
return;
};
if (loading){
go();
return;
};
if (unloading){
go();
return;
};
}
private function setTargetPos():void{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
switch (extra.currentState){
case StringConsts.bench:
if (extra.vice_versa){
_local1 = (extra.x - 46);
_local2 = (extra.y + 30);
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 - (3 * free_seat_pos)));
} else {
_local1 = (extra.x + 25);
_local2 = (extra.y + 15);
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 + (3 * free_seat_pos)));
};
break;
case StringConsts.music_box:
case StringConsts.news_box:
case StringConsts.ice_cream:
if (extra.vice_versa){
_local1 = (extra.x - 50);
_local2 = (extra.y + 30);
target_pos = new Position((_local1 + (6 * free_seat_pos)), (_local2 - (5 * free_seat_pos)));
} else {
_local1 = (extra.x + 20);
_local2 = extra.y;
target_pos = new Position((_local1 + (5 * free_seat_pos)), (_local2 + (5 * free_seat_pos)));
};
break;
};
move_goal.moveTo(target_pos);
}
private function go():void{
if (move_goal.active){
move_goal.advance();
} else {
if (unloading){
buyer.addExtra(extra);
deactivate();
};
if (loading){
loadAnimation();
counter = extra_steps;
};
loading = false;
unloading = false;
};
}
private function dropCoins():void{
engine.goal_system.add(new CoinGoal(engine, extra));
}
override public function deactivate():void{
extra = null;
super.deactivate();
}
private function loadAnimation():void{
switch (extra.currentState){
case StringConsts.bench:
buyer.character.gotoAndPlay("sitting");
break;
case StringConsts.news_box:
buyer.character.gotoAndPlay("reading");
break;
case StringConsts.music_box:
buyer.character.gotoAndPlay("listening");
break;
case StringConsts.ice_cream:
buyer.character.gotoAndPlay("eating");
break;
};
if (!extra.vice_versa){
buyer.character.scaleX = (-1 * init_scale);
};
}
}
}//package fai.goals
Section 11
//FireGoal (fai.goals.FireGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class FireGoal extends Goal {
private var engine:Engine;// = null
private var rescue_ticks:int;// = 150
private var rescuing:Boolean;// = false
private var rescue_building:ShopItem;// = null
private var fire_ticks:int;// = 300
private var rescure_type:String;
private var shop:ShopItem;// = null
public function FireGoal(_arg1:Engine, _arg2, _arg3:String):void{
engine = null;
shop = null;
fire_ticks = 300;
rescue_ticks = 150;
rescuing = false;
rescue_building = null;
super();
engine = _arg1;
shop = _arg2;
rescure_type = _arg3;
shop.shoppable = false;
if (StringConsts.fire_dept == rescure_type){
shop.fire_icon.visible = true;
shop.fire_icon.play();
} else {
if (StringConsts.police == rescure_type){
shop.thief_icon.visible = true;
shop.thief_icon.play();
shop.thief_icon.internal_animation.play();
};
};
}
public function advance():void{
if (rescuing){
if (rescue_ticks <= 0){
shop.shoppable = true;
if (StringConsts.fire_dept == rescure_type){
shop.health = (shop.health / 2);
};
hideIcons();
rescue_building.getShopSprite().service_icon.visible = false;
rescue_building.busy = false;
shop.updateRepairState();
deactivate();
return;
} else {
if (!rescue_building.getShopSprite().service_icon.visible){
rescue_building.getShopSprite().service_icon.visible = true;
rescue_building.getShopSprite().service_icon.play();
};
};
rescue_ticks--;
} else {
if (fire_ticks <= 0){
if (rescure_type == StringConsts.fire_dept){
shop.doSellLogic();
} else {
engine.payMoney((3000 + (2000 * Math.random())));
shop.shoppable = true;
};
hideIcons();
deactivate();
return;
} else {
checkRescueTeam();
};
fire_ticks--;
};
}
private function hideIcons():void{
if (StringConsts.fire_dept == rescure_type){
shop.fire_icon.visible = false;
shop.fire_icon.stop();
} else {
if (StringConsts.police == rescure_type){
shop.thief_icon.visible = false;
shop.thief_icon.stop();
shop.thief_icon.internal_animation.stop();
};
};
}
override public function deactivate():void{
super.deactivate();
}
private function checkRescueTeam():void{
var _local1:int;
var _local2:ShopItem;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
_local2 = engine.shops.getItem(_local1);
if ((((((_local2.currentLevel == Consts.ShopLevel1)) && ((_local2.shopType == rescure_type)))) && ((false == _local2.busy)))){
_local2.busy = true;
rescue_building = _local2;
rescue_building.getShopSprite().service_icon.visible = true;
rescue_building.getShopSprite().service_icon.play();
rescuing = true;
if (StringConsts.fire_dept == rescure_type){
engine.playSound(SoundConsts.fire);
} else {
engine.playSound(SoundConsts.police);
};
return;
};
_local1++;
};
}
}
}//package fai.goals
Section 12
//Goal (fai.goals.Goal)
package fai.goals {
public class Goal {
public var priority:int;// = 100
public var active:Boolean;// = true
public function Goal(){
active = true;
priority = 100;
super();
}
public function deactivate():void{
active = false;
}
}
}//package fai.goals
Section 13
//MoveCustomerGoal (fai.goals.MoveCustomerGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
public class MoveCustomerGoal extends Goal {
private var engine:Engine;// = null
private var node:RoadPoint;// = null
private var dx:Number;// = 0
private var dy:Number;// = 0
private var road:RoadPath;// = null
private var road_enum:RoadGraph;// = null
private var steps:Number;// = 0
private var buyer:Customer;// = null
private var simple_move:MoveSimpleGoal;// = null
public function MoveCustomerGoal(_arg1:Engine, _arg2:Customer, _arg3:RoadPath):void{
engine = null;
buyer = null;
road = null;
steps = 0;
dx = 0;
dy = 0;
road_enum = null;
node = null;
simple_move = null;
super();
engine = _arg1;
buyer = _arg2;
road = _arg3;
gotoNext();
}
public function advance():void{
if (simple_move){
simple_move.advance();
if (!simple_move.active){
simple_move = null;
gotoNext();
};
};
}
public function reset():void{
simple_move.deactivate();
simple_move = null;
gotoNext();
advance();
}
public function anyNextNodePos():Position{
var _local1:RoadPoint;
_local1 = road_enum.lookAnyNext();
return (new Position((road.x + _local1.x), (road.y + _local1.y)));
}
private function gotoNext():void{
var _local1:RoadPoint;
if (!road_enum){
road_enum = new RoadGraph(road);
_local1 = road_enum.getFirst();
buyer.setX((road.x + _local1.x));
buyer.setY((road.y + _local1.y));
};
node = road_enum.getNext();
if (node){
simple_move = new MoveSimpleGoal(engine, buyer);
simple_move.moveToXY((road.x + node.x), (road.y + node.y));
} else {
deactivate();
};
}
}
}//package fai.goals
Section 14
//MoveSimpleGoal (fai.goals.MoveSimpleGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class MoveSimpleGoal extends Goal {
private var engine:Engine;// = null
private var steps:Number;// = 0
private var target:Position;// = null
private var buyer:Customer;// = null
private var dx:Number;// = 0
private var dy:Number;// = 0
public function MoveSimpleGoal(_arg1:Engine, _arg2:Customer):void{
engine = null;
buyer = null;
steps = 0;
dx = 0;
dy = 0;
target = null;
super();
engine = _arg1;
buyer = _arg2;
}
public function moveToXY(_arg1:int, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:int;
target = new Position(_arg1, _arg2);
_local3 = (target.x - buyer.getX());
_local4 = (target.y - buyer.getY());
steps = (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))) / buyer.velocity);
_local5 = (-1 * ((Math.atan2(_local4, _local3) / Math.PI) * 180));
setIsoPos(_local5);
dx = (_local3 / steps);
dy = (_local4 / steps);
}
public function advance():void{
if (steps < 1){
buyer.setX((buyer.getX() + (dx * steps)));
buyer.setY((buyer.getY() + (dy * steps)));
steps = 0;
} else {
buyer.setX((buyer.getX() + dx));
buyer.setY((buyer.getY() + dy));
steps--;
};
if (steps <= 0){
deactivate();
};
}
private function setIsoPos(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < 90)))){
buyer.character.gotoAndStop("walking_ne");
} else {
if ((((_arg1 >= 90)) && ((_arg1 <= 180)))){
buyer.character.gotoAndStop("walking_nw");
} else {
if ((((_arg1 <= 0)) && ((_arg1 > -90)))){
buyer.character.gotoAndStop("walking_se");
} else {
if ((((_arg1 <= -90)) && ((_arg1 >= -180)))){
buyer.character.gotoAndStop("walking_sw");
};
};
};
};
}
public function moveTo(_arg1:Position):void{
moveToXY(_arg1.x, _arg1.y);
}
}
}//package fai.goals
Section 15
//ParticleGoal (fai.goals.ParticleGoal)
package fai.goals {
import fai.common.*;
public class ParticleGoal extends Goal {
private var odx:Number;// = 0
private var ody:Number;// = 0
private var parent_item;// = null
private var max_steps:Number;// = 0
private var dx:Number;// = 0
private var dy:Number;// = 0
public var velocity:int;// = 10
private var particle;// = null
private var use_alpha:Boolean;// = false
private var steps:Number;// = 0
private var distance:Number;// = 0
private var dest_pos:Position;// = null
public function ParticleGoal(_arg1, _arg2, _arg3:Position, _arg4:Boolean=true, _arg5:int=0):void{
var _local6:Object;
parent_item = null;
dest_pos = null;
dx = 0;
dy = 0;
steps = 0;
velocity = 10;
distance = 0;
odx = 0;
ody = 0;
max_steps = 0;
particle = null;
use_alpha = false;
super();
dest_pos = _arg3;
particle = _arg1;
parent_item = _arg2;
use_alpha = _arg4;
if (_arg5 > 0){
velocity = _arg5;
};
parent_item.addChild(particle);
dx = (dest_pos.x - particle.x);
dy = (dest_pos.y - particle.y);
distance = Math.sqrt(((dx * dx) + (dy * dy)));
steps = (distance / velocity);
_local6 = getNormalOffset(dx, dy, ((Math.random() > 0.5)) ? true : false);
dx = (dx / steps);
dy = (dy / steps);
odx = (((_local6.dx / steps) * Math.random()) / 2);
ody = (((_local6.dy / steps) * Math.random()) / 2);
max_steps = steps;
}
public function advance():void{
var _local1:Number;
if (steps > 0){
_local1 = (((2 * steps) / max_steps) - 1);
if (steps > 1){
particle.x = (particle.x + (dx + (odx * _local1)));
particle.y = (particle.y + (dy + (ody * _local1)));
} else {
particle.x = (particle.x + ((dx + (odx * _local1)) * steps));
particle.y = (particle.y + ((dy + (ody * _local1)) * steps));
};
if (use_alpha){
particle.alpha = (steps / max_steps);
};
steps--;
} else {
deactivate();
};
}
private function getNormalOffset(_arg1:Number, _arg2:Number, _arg3:Boolean):Object{
var _local4:Object;
_local4 = new Object();
if ((((_arg1 <= 0)) && ((_arg2 < 0)))){
if (_arg3){
_local4.dx = _arg2;
_local4.dy = Math.abs(_arg1);
} else {
_local4.dx = Math.abs(_arg2);
_local4.dy = _arg1;
};
} else {
if ((((_arg1 > 0)) && ((_arg2 <= 0)))){
if (_arg3){
_local4.dx = -(Math.abs(_arg2));
_local4.dy = -(Math.abs(_arg1));
} else {
_local4.dx = Math.abs(_arg2);
_local4.dy = Math.abs(_arg1);
};
} else {
if ((((_arg1 >= 0)) && ((_arg2 > 0)))){
if (_arg3){
_local4.dx = Math.abs(_arg2);
_local4.dy = -(Math.abs(_arg1));
} else {
_local4.dx = -(Math.abs(_arg2));
_local4.dy = Math.abs(_arg1);
};
} else {
if ((((_arg1 < 0)) && ((_arg2 >= 0)))){
if (_arg3){
_local4.dx = Math.abs(_arg2);
_local4.dy = Math.abs(_arg1);
} else {
_local4.dx = -(Math.abs(_arg2));
_local4.dy = -(Math.abs(_arg1));
};
};
};
};
};
return (_local4);
}
override public function deactivate():void{
super.deactivate();
parent_item.removeChild(particle);
}
}
}//package fai.goals
Section 16
//SeatsGoal (fai.goals.SeatsGoal)
package fai.goals {
import fai.logic.*;
import fai.*;
public class SeatsGoal extends Goal {
private var engine:Engine;// = null
private var loaded:int;// = 0
private var seats:Array;// = null
private var shop:ShopItem;// = null
public function SeatsGoal(_arg1:Engine, _arg2:Array, _arg3:ShopItem):void{
engine = null;
seats = null;
loaded = 0;
shop = null;
super();
engine = _arg1;
seats = _arg2;
shop = _arg3;
}
public function advance():void{
var _local1:ShopSeat;
var _local2:int;
_local1 = null;
_local2 = 0;
_local2 = 0;
while (_local2 < seats.length) {
_local1 = seats[_local2];
if (_local1.loaded){
_local1.percents = (_local1.percents + _local1.velocity);
if (_local1.percents > 100){
unloadSeat(_local1);
};
};
_local2++;
};
}
public function loadCustomer(_arg1:Customer):ShopSeat{
var _local2:int;
var _local3:ShopSeat;
if (loaded >= seats.length){
return (null);
};
_local2 = 0;
_local2 = 0;
while (_local2 < seats.length) {
_local3 = seats[_local2];
if (_local3.loaded == false){
loadSeat(_local3);
_local3.customer = _arg1;
_local3.velocity = DataProxy.getShopBuyingTicks(shop.shopType);
if ((((shop.shopType == StringConsts.boutique)) && ((shop.currentLevel > 1)))){
_local3.velocity = 0.7;
};
if (_local3.velocity <= 0){
_local3.velocity = 1;
};
_arg1.buying = true;
return (_local3);
};
_local2++;
};
return (null);
}
private function loadSeat(_arg1:ShopSeat):void{
_arg1.loaded = true;
_arg1.percents = 0;
loaded++;
}
override public function deactivate():void{
var _local1:int;
var _local2:ShopSeat;
super.deactivate();
if (loaded > 0){
_local1 = 0;
_local1 = 0;
while (_local1 < seats.length) {
_local2 = seats[_local1];
if (_local2.loaded){
unloadSeat(_local2);
};
_local1++;
};
};
}
private function dropCoins():void{
engine.goal_system.add(new CoinGoal(engine, shop));
}
private function moneyValue(_arg1:ShopSeat):int{
return (((_arg1.customer.money > shop.moneyValue)) ? shop.moneyValue : _arg1.customer.money);
}
public function get loadedCount():int{
return (loaded);
}
private function unloadSeat(_arg1:ShopSeat):void{
var _local2:int;
_arg1.loaded = false;
shop.customerPassed();
_local2 = moneyValue(_arg1);
_arg1.customer.money = (_arg1.customer.money - _local2);
_arg1.customer.updateMoney();
_arg1.customer.addBuying(shop.shopIdString);
_arg1.customer.buying = false;
_arg1.customer = null;
if (engine.playWindow){
engine.score = (engine.score + (_local2 / 5));
engine.payMoney(-(_local2));
engine.playWindow.updateResources();
dropCoins();
};
loaded--;
}
}
}//package fai.goals
Section 17
//UpdateStateGoal (fai.goals.UpdateStateGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class UpdateStateGoal extends Goal {
private var engine:Engine;// = null
private var shop;// = null
private var pause:int;// = 10
public function UpdateStateGoal(_arg1:Engine, _arg2):void{
engine = null;
shop = null;
pause = 10;
super();
engine = _arg1;
shop = _arg2;
if (shop.shopBar){
shop.shopBar.visible = false;
};
}
public function advance():void{
if (pause > 0){
pause--;
} else {
if (shop.shopBar){
shop.shopBar.visible = true;
};
shop.updateState();
deactivate();
};
}
override public function deactivate():void{
super.deactivate();
}
}
}//package fai.goals
Section 18
//UpgradingGoal (fai.goals.UpgradingGoal)
package fai.goals {
import fai.logic.*;
import fai.ui.*;
import fai.common.*;
import fai.goalsystem.*;
import fai.*;
public class UpgradingGoal extends Goal {
private var engine:Engine;// = null
private var max:int;// = 0
private var ticks:int;// = 0
private var save_var_pos:int;// = 0
private var shop_item:ShopItem;// = null
private var current_level:int;// = 0
public function UpgradingGoal(_arg1:Engine, _arg2):void{
engine = null;
shop_item = null;
ticks = 0;
max = 0;
current_level = 0;
save_var_pos = 0;
super();
engine = _arg1;
shop_item = _arg2;
current_level = shop_item.currentLevel;
shop_item.setLevel(Consts.ShopUpgrading);
shop_item.building_bar.visible = true;
max = (ticks = DataProxy.getShopUpgradingTicks(shop_item.shopType, current_level));
}
private function finish():void{
engine.playSound(SoundConsts.build);
shop_item.setLevel((current_level + 1));
shop_item.getShopSprite().play();
shop_item.updateState();
engine.goal_system.add(new UpdateStateGoal(engine, shop_item));
shop_item.reset();
engine.playWindow.stats.built++;
}
public function advance():void{
if (ticks <= 0){
finish();
deactivate();
return;
};
if (shop_item.building_bar){
shop_item.building_bar.bar.scaleX = (1 - (ticks / max));
shop_item.building_bar.percents.text = ((" " + int(((1 - (ticks / max)) * 100))) + "%");
};
ticks--;
}
public function cancel():void{
deactivate();
shop_item.setLevel(current_level);
}
override public function deactivate():void{
super.deactivate();
shop_item.building_bar.visible = false;
shop_item.building_bar.bar.scaleX = 1;
}
}
}//package fai.goals
Section 19
//VParticleEffectGoal (fai.goals.VParticleEffectGoal)
package fai.goals {
import fai.common.*;
import fai.goalsystem.*;
public class VParticleEffectGoal extends Goal {
private var particle_parent;// = null
private var goal_system:GoalSystem;// = null
private var pause:int;// = 0
public function VParticleEffectGoal(_arg1):void{
particle_parent = null;
goal_system = null;
pause = 0;
super();
particle_parent = _arg1;
goal_system = new GoalSystem();
}
public function advance():void{
var _local1:Position;
var _local2:WhiteStar;
var _local3:ParticleGoal;
goal_system.tick();
if (pause > 0){
pause--;
return;
};
_local1 = new Position((20 + ((particle_parent.width / 2) * Math.random())), (0 - (Math.random() * 10)));
_local2 = new WhiteStar();
_local2.x = (20 + ((particle_parent.width / 2) * Math.random()));
_local2.y = (particle_parent.height - 45);
_local3 = new ParticleGoal(_local2, particle_parent, _local1);
goal_system.add(_local3);
}
override public function deactivate():void{
super.deactivate();
goal_system.deactivateAll();
goal_system = null;
particle_parent = null;
}
}
}//package fai.goals
Section 20
//GoalSystem (fai.goalsystem.GoalSystem)
package fai.goalsystem {
import fai.*;
public class GoalSystem {
public var goals:Array;
private var active_count:int;// = 0
private var counter:int;// = 0
public function GoalSystem(){
goals = [];
counter = 0;
active_count = 0;
super();
}
public function add(_arg1):void{
goals.push(_arg1);
}
public function activeCount():int{
return (active_count);
}
public function deactivateAll():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (goals[_local1].active){
goals[_local1].deactivate();
};
_local1++;
};
goals.length = 0;
}
private function cleanGoals():void{
var _local1:int;
_local1 = 0;
while (_local1 < goals.length) {
if (!goals[_local1].active){
delete goals[_local1];
goals.splice(_local1, 1);
} else {
_local1++;
};
};
}
public function tick():void{
var _local1:uint;
_local1 = 0;
active_count = 0;
while (_local1 < goals.length) {
if (goals[_local1].active){
goals[_local1].advance();
active_count++;
};
_local1++;
};
if (!counter){
cleanGoals();
counter = Consts.GOALSCLEANPAUSE;
} else {
counter--;
};
}
}
}//package fai.goalsystem
Section 21
//Buttons (fai.logic.Buttons)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import fai.*;
public class Buttons {
private var engine:Engine;// = null
private var extras:Array;
private var buttons:Array;
public function Buttons(_arg1:Engine):void{
engine = null;
buttons = [];
extras = [];
super();
engine = _arg1;
}
public function size():int{
return (buttons.length);
}
public function update():void{
var _local1:*;
var _local2:int;
var _local3:*;
updateExtras();
_local1 = null;
_local2 = 0;
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
_local1.icon_holder.gotoAndStop((_local1.buttonType + "1"));
_local2++;
};
_local3 = null;
if (engine.shops.awaitBuilding()){
_local3 = getButtonByType(engine.shops.buildingType);
if (_local3){
_local3.gotoAndStop("cancel_action");
_local3.icon_holder.visible = false;
};
};
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
if (_local3 != _local1){
updateButtonState(_local1, _local1.assigned);
};
_local2++;
};
}
private function updateExtras():void{
var _local1:Boolean;
var _local2:int;
var _local3:ExtraItem;
if (!engine.upgrades){
return;
};
_local1 = true;
_local2 = 0;
_local2 = 0;
while (_local2 < engine.extras.size()) {
_local3 = engine.extras.getItem(_local2);
if ((((_local3.currentState == StringConsts.empty)) || (_local3.isAwaiting))){
_local1 = false;
break;
};
_local2++;
};
if (_local1){
engine.ui.extra_buttons.news_box.visible = false;
engine.ui.extra_buttons.music_box.visible = false;
engine.ui.extra_buttons.benches.visible = false;
engine.ui.extra_buttons.ice_cream.visible = false;
} else {
engine.ui.extra_buttons.news_box.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.news_box));
engine.ui.extra_buttons.music_box.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.music_box));
engine.ui.extra_buttons.benches.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.bench));
engine.ui.extra_buttons.ice_cream.visible = (engine.playerMoney >= DataProxy.getExtraBuildCost(StringConsts.ice_cream));
};
engine.extras.update();
}
public function getExtraItem(_arg1:int){
return (extras[_arg1]);
}
public function extraSize():int{
return (extras.length);
}
public function destroy():void{
}
public function addItem(_arg1):void{
switch (_arg1){
case engine.ui.boutique_button:
_arg1.setType(StringConsts.boutique);
break;
case engine.ui.pet_shop_button:
_arg1.setType(StringConsts.pet_shop);
break;
case engine.ui.jewelry_button:
_arg1.setType(StringConsts.jewelry);
break;
case engine.ui.restaurant_button:
_arg1.setType(StringConsts.food);
break;
case engine.ui.toy_store_button:
_arg1.setType(StringConsts.toy_store);
break;
case engine.ui.nclub_button:
_arg1.setType(StringConsts.nclub);
break;
case engine.ui.market_button:
_arg1.setType(StringConsts.super_market);
break;
case engine.ui.computers_button:
_arg1.setType(StringConsts.computers);
break;
case engine.ui.fire_dept_button:
_arg1.setType(StringConsts.fire_dept);
break;
case engine.ui.police_button:
_arg1.setType(StringConsts.police);
break;
case engine.ui.extra_buttons.benches:
case engine.ui.extra_buttons.news_box:
case engine.ui.extra_buttons.music_box:
case engine.ui.extra_buttons.ice_cream:
extras.push(_arg1);
return;
};
_arg1.setEngine(engine);
buttons.push(_arg1);
_arg1.gotoAndStop("enabled");
_arg1.buttonMode = true;
_arg1.icon_holder.visible = true;
_arg1.visible = false;
}
public function hideBuildButtons():void{
var _local1:*;
var _local2:int;
var _local3:Boolean;
_local1 = null;
_local2 = 0;
_local3 = false;
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
_local1.visible = _local3;
_local2++;
};
}
private function updateButtonState(_arg1, _arg2:ShopItem):void{
if (_arg2){
if (_arg2.awaitsBuilding){
_arg1.gotoAndStop("cancel_action");
_arg1.icon_holder.visible = false;
return;
};
if (_arg2.currentLevel == 0){
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
return;
};
switch (_arg2.currentLevel){
case Consts.ShopBuilding:
case Consts.ShopUpgrading:
_arg1.gotoAndStop("cancel_action");
_arg1.icon_holder.visible = false;
break;
case Consts.ShopLevel1:
case Consts.ShopLevel2:
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
break;
case Consts.ShopLevel3:
_arg1.gotoAndStop("done");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
break;
};
} else {
_arg1.gotoAndStop("enabled");
_arg1.icon_holder.visible = true;
updateButtonCost(_arg1);
};
}
private function updateButtonCost(_arg1):void{
var _local2:Boolean;
_local2 = true;
_local2 = (DataProxy.getBuildCost(_arg1.buttonType, 0) <= engine.playerMoney);
if (!_local2){
_arg1.gotoAndStop("disabled");
};
}
public function getItem(_arg1:int){
return (buttons[_arg1]);
}
public function getButtonByType(_arg1:String){
switch (_arg1){
case StringConsts.boutique:
return (engine.ui.boutique_button);
case StringConsts.food:
return (engine.ui.restaurant_button);
case StringConsts.pet_shop:
return (engine.ui.pet_shop_button);
case StringConsts.toy_store:
return (engine.ui.toy_store_button);
case StringConsts.nclub:
return (engine.ui.nclub_button);
case StringConsts.computers:
return (engine.ui.computers_button);
case StringConsts.super_market:
return (engine.ui.market_button);
case StringConsts.jewelry:
return (engine.ui.jewelry_button);
case StringConsts.fire_dept:
return (engine.ui.fire_dept_button);
case StringConsts.police:
return (engine.ui.police_button);
};
return (null);
}
public function getItemByType(_arg1:String){
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < buttons.length) {
if (buttons[_local2].buttonType == _arg1){
return (buttons[_local2]);
};
_local2++;
};
return (null);
}
public function buildButtonPressed():void{
var _local1:*;
var _local2:int;
var _local3:Boolean;
_local1 = null;
_local2 = 0;
_local3 = (buttons[_local2].visible) ? false : true;
_local2 = 0;
while (_local2 < buttons.length) {
_local1 = buttons[_local2];
_local1.visible = _local3;
_local2++;
};
}
}
}//package fai.logic
Section 22
//Customer (fai.logic.Customer)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import fai.common.*;
import fai.*;
public class Customer {
public var money:int;// = 0
private var engine:Engine;// = null
private var initial_money:int;// = 0
public var suit:Sprite;// = null
private var buyings:Array;
private var init_scale:Number;// = 0
public var buying:Boolean;// = false
public var velocity:Number;// = 2
public var customer_money:CustomerMoney;// = null
private var extras:Array;
public var character;// = null
public var check_zindex:Boolean;// = true
public var parent_dc;// = null
public function Customer():void{
engine = null;
money = 0;
initial_money = 0;
suit = null;
velocity = 2;
customer_money = null;
character = null;
buying = false;
buyings = [];
extras = [];
init_scale = 0;
check_zindex = true;
parent_dc = null;
super();
}
public function getY():Number{
if (parent_dc == engine.playWindow.levelBack){
return (suit.y);
};
return ((parent_dc.y + suit.y));
}
public function getX():Number{
if (parent_dc == engine.playWindow.levelBack){
return (suit.x);
};
return ((parent_dc.x + suit.x));
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function init(_arg1:int):void{
initial_money = (money = _arg1);
init_scale = customer_money.bar.bar.scaleX;
}
public function addExtra(_arg1:ExtraItem):void{
extras.push([_arg1.currentState, 0]);
}
public function extraTicks():void{
var _local1:int;
var _local2:int;
_local1 = 0;
while (_local1 < extras.length) {
_local2 = extras[_local1][1];
_local2++;
if (_local2 > Consts.ExtraLiveTime){
extras.splice(_local1, 1);
} else {
extras[_local1][1] = _local2;
_local1++;
};
};
}
public function updateMoney():void{
if (money > 0){
customer_money.gotoAndStop("money_label");
} else {
customer_money.gotoAndStop("happy_face");
customer_money.bar.visible = false;
};
customer_money.bar.bar.scaleX = (init_scale * (money / initial_money));
}
public function hasBuyings(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < buyings.length) {
if (buyings[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function addBuying(_arg1:String):void{
buyings.push(_arg1);
}
public function extraUsed(_arg1:ExtraItem):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < extras.length) {
if (extras[_local2][0] == _arg1.currentState){
return (true);
};
_local2++;
};
return (false);
}
public function setY(_arg1:Number):void{
if (parent_dc == engine.playWindow.levelBack){
suit.y = _arg1;
} else {
suit.y = -((parent_dc.y - _arg1));
};
}
public function setX(_arg1:Number):void{
if (parent_dc == engine.playWindow.levelBack){
suit.x = _arg1;
} else {
suit.x = -((parent_dc.x - _arg1));
};
}
}
}//package fai.logic
Section 23
//Customers (fai.logic.Customers)
package fai.logic {
public class Customers {
private var engine:Engine;// = null
private var people:Array;
public function Customers(_arg1:Engine):void{
engine = null;
people = [];
super();
engine = _arg1;
}
public function size():int{
return (people.length);
}
public function getItem(_arg1:int):Customer{
return (people[_arg1]);
}
public function remove(_arg1:Customer):void{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < people.length) {
if (people[_local2] == _arg1){
delete people[_local2];
people.splice(_local2, 1);
return;
};
_local2++;
};
}
public function add(_arg1:Customer):void{
people.push(_arg1);
}
public function destroy():void{
if (people){
people.length = 0;
people = null;
};
}
}
}//package fai.logic
Section 24
//DataProxy (fai.logic.DataProxy)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import flash.filters.*;
import fai.common.*;
import fai.*;
public class DataProxy {
private var levels:Array;
public function DataProxy():void{
var _local1:Level;
levels = [];
super();
_local1 = new Level(StringConsts.level1);
addLevel(_local1);
_local1 = new Level(StringConsts.level2);
addLevel(_local1);
_local1 = new Level(StringConsts.level3);
addLevel(_local1);
_local1 = new Level(StringConsts.level4);
addLevel(_local1);
_local1 = new Level(StringConsts.level5);
addLevel(_local1);
_local1 = new Level(StringConsts.level6);
addLevel(_local1);
_local1 = new Level(StringConsts.level7);
addLevel(_local1);
_local1 = new Level(StringConsts.level8);
addLevel(_local1);
_local1 = new Level(StringConsts.level9);
addLevel(_local1);
}
public function getLevels():Array{
return (levels);
}
private function addLevel(_arg1:Level):void{
_arg1.number = levels.length;
levels.push(_arg1);
}
public function getLevel(_arg1:int):Level{
return (levels[_arg1]);
}
public static function getExtraBuildCost(_arg1:String):int{
switch (_arg1){
case StringConsts.bench:
return (150);
case StringConsts.news_box:
return (1000);
case StringConsts.music_box:
return (800);
case StringConsts.ice_cream:
return (1500);
};
return (0);
}
public static function getIconLabel(_arg1:ShopItem):String{
switch (_arg1.currentLevel){
case 0:
return ((_arg1.shopType + "1"));
case Consts.ShopLevel1:
return ((_arg1.shopType + "2"));
case Consts.ShopLevel2:
return ((_arg1.shopType + "3"));
case Consts.ShopLevel3:
return ((_arg1.shopType + "3"));
};
return ("");
}
public static function createShopBuilding(_arg1:ShopItem){
var _local2:*;
var _local3:ShopBuilding;
_local2 = createShopIcon(_arg1);
_local3 = new ShopBuilding(_arg1, _local2);
_local3.stop();
return (_local3);
}
public static function getExtraCounterSteps(_arg1:String):int{
switch (_arg1){
case StringConsts.bench:
return (100);
case StringConsts.music_box:
return (200);
case StringConsts.news_box:
return (350);
case StringConsts.ice_cream:
return (250);
};
return (0);
}
public static function getShopUpgradingTicks(_arg1:String, _arg2:int):int{
switch (_arg1){
case StringConsts.boutique:
return (50);
case StringConsts.jewelry:
return (60);
case StringConsts.food:
return (70);
case StringConsts.pet_shop:
return (70);
case StringConsts.toy_store:
return (80);
case StringConsts.computers:
return (90);
case StringConsts.nclub:
return (100);
case StringConsts.super_market:
return (115);
};
return (50);
}
public static function createShopIcon(_arg1:ShopItem){
return (getShopIcon(_arg1.shopType));
}
public static function getShopIcon(_arg1:String){
var _local2:*;
_local2 = null;
switch (_arg1){
case StringConsts.boutique:
_local2 = new BoutiqueShop();
break;
case StringConsts.jewelry:
_local2 = new JewelryShop();
break;
case StringConsts.food:
_local2 = new RestaurantShop();
break;
case StringConsts.pet_shop:
_local2 = new PetShopShop();
break;
case StringConsts.toy_store:
_local2 = new ToyStoreShop();
break;
case StringConsts.computers:
_local2 = new ComputersShop();
break;
case StringConsts.nclub:
_local2 = new NightClubShop();
break;
case StringConsts.super_market:
_local2 = new SuperMarketShop();
break;
case StringConsts.police:
_local2 = new Police();
break;
case StringConsts.fire_dept:
_local2 = new FireDept();
break;
};
return (_local2);
}
public static function getGoodsCost(_arg1:String, _arg2:int):int{
var _local3:int;
var _local4:int;
_local3 = 0;
switch (_arg1){
case StringConsts.boutique:
_local3 = 50;
break;
case StringConsts.pet_shop:
_local3 = 75;
break;
case StringConsts.toy_store:
_local3 = 40;
break;
case StringConsts.jewelry:
_local3 = 170;
break;
case StringConsts.food:
_local3 = 50;
break;
case StringConsts.computers:
_local3 = 120;
break;
case StringConsts.nclub:
_local3 = 150;
break;
case StringConsts.super_market:
_local3 = 180;
break;
};
_local4 = _local3;
if ((((_arg2 == Consts.ShopLevel2)) || ((_arg2 == Consts.ShopLevel3)))){
_local4 = (_local4 + (int((_local3 / 2)) * (_arg2 - 1)));
};
return (_local4);
}
public static function getShopBuyingTicks(_arg1:String):Number{
var _local2:Number;
_local2 = 0;
switch (_arg1){
case StringConsts.boutique:
_local2 = 1;
break;
case StringConsts.pet_shop:
_local2 = 0.8;
break;
case StringConsts.toy_store:
_local2 = 0.6;
break;
case StringConsts.jewelry:
_local2 = 0.25;
break;
case StringConsts.food:
_local2 = 0.2;
break;
case StringConsts.computers:
_local2 = 0.4;
break;
case StringConsts.nclub:
_local2 = 0.3;
break;
case StringConsts.super_market:
_local2 = 0.15;
break;
};
return (_local2);
}
public static function getCustomerInitialMoney(_arg1:int):int{
var _local2:Number;
var _local3:int;
_local2 = ((_arg1 > 5)) ? ((_arg1 - 5) * 0.35) : 1;
_local3 = (30 * _arg1);
if (_local3 > 1178){
_local3 = 1178;
};
return (_local3);
}
public static function getBuyerCount(_arg1:int):int{
var _local2:int;
var _local3:int;
_local2 = ((_arg1 - 1) * 2);
_local3 = (((_arg1 > 5)) ? (_arg1 - 5) : 0 * 2);
return (((20 + ((_local2 > 35)) ? 35 : _local2) + _local3));
}
public static function getCustomer(_arg1:int):Customer{
var _local2:Customer;
var _local3:*;
var _local4:int;
var _local5:Number;
var _local6:BitmapFilter;
var _local7:Array;
var _local8:CustomerMoney;
_local2 = null;
_local3 = null;
_local4 = (Math.random() * 7.1);
_local5 = 0.6;
switch (_local4){
case 0:
_local3 = new Customer1();
break;
case 1:
_local3 = new Customer2();
break;
case 2:
_local3 = new Customer3();
break;
case 3:
_local3 = new Customer4();
break;
case 4:
_local3 = new Customer5();
break;
case 5:
_local3 = new Customer6();
break;
case 6:
_local3 = new Customer7();
break;
};
if (!_local3){
_local3 = new Customer1();
};
_local3.scaleY = (_local3.scaleX = _local5);
_local2 = new Customer();
_local2.suit = new Sprite();
_local2.suit.addChild(_local3);
_local2.character = _local3;
_local2.velocity = 2;
_local6 = getShadowFilter();
_local7 = new Array();
_local7.push(_local6);
_local2.suit.filters = _local7;
_local8 = new CustomerMoney();
_local8.x = -15;
_local8.y = (_local2.character.y - 35);
if ((((_local4 == 2)) || ((_local4 == 3)))){
_local8.y = (_local8.y + 10);
};
_local2.suit.addChild(_local8);
_local2.customer_money = _local8;
_local2.init(getCustomerInitialMoney(_arg1));
_local2.updateMoney();
return (_local2);
}
private static function getShadowFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Number;
_local1 = 0;
_local2 = 45;
_local3 = 1;
_local4 = 1;
_local5 = 1;
_local6 = 1;
_local7 = 0.65;
_local8 = false;
_local9 = false;
_local10 = BitmapFilterQuality.LOW;
return (new DropShadowFilter(_local6, _local2, _local1, _local3, _local4, _local5, _local7, _local10, _local8, _local9));
}
public static function getShopBuildingTicks(_arg1:String):int{
switch (_arg1){
case StringConsts.boutique:
return (50);
case StringConsts.jewelry:
return (90);
case StringConsts.food:
return (90);
case StringConsts.pet_shop:
return (70);
case StringConsts.toy_store:
return (80);
case StringConsts.computers:
return (110);
case StringConsts.nclub:
return (150);
case StringConsts.super_market:
return (250);
case StringConsts.police:
return (250);
case StringConsts.fire_dept:
return (300);
};
return (50);
}
public static function getSeatsCount(_arg1:String, _arg2:int):int{
var _local3:int;
var _local4:int;
_local3 = 0;
switch (_arg1){
case StringConsts.boutique:
_local3 = 4;
break;
case StringConsts.pet_shop:
_local3 = 5;
break;
case StringConsts.toy_store:
_local3 = 6;
break;
case StringConsts.jewelry:
_local3 = 8;
break;
case StringConsts.food:
_local3 = 10;
break;
case StringConsts.computers:
_local3 = 12;
break;
case StringConsts.nclub:
_local3 = 16;
break;
case StringConsts.super_market:
_local3 = 20;
break;
};
_local4 = _local3;
if ((((_arg2 == Consts.ShopLevel2)) || ((_arg2 == Consts.ShopLevel3)))){
_local4 = (_local4 + (int(_local3) * (_arg2 - 1)));
};
return (_local4);
}
public static function getLevelBackground(_arg1:int){
switch (_arg1){
case 0:
return (new LevelBack1());
case 1:
return (new LevelBack2());
case 2:
return (new LevelBack3());
case 3:
return (new LevelBack4());
case 4:
return (new LevelBack5());
case 5:
return (new LevelBack6());
case 6:
return (new LevelBack7());
case 7:
return (new LevelBack8());
case 8:
return (new LevelBack9());
};
return (new LevelBack1());
}
public static function getBuildCost(_arg1:String, _arg2:int):int{
var _local3:int;
var _local4:int;
_local3 = 0;
switch (_arg1){
case StringConsts.boutique:
_local3 = 2500;
break;
case StringConsts.pet_shop:
_local3 = 3000;
break;
case StringConsts.toy_store:
_local3 = 7000;
break;
case StringConsts.jewelry:
_local3 = 15000;
break;
case StringConsts.food:
_local3 = 10000;
break;
case StringConsts.computers:
_local3 = 25000;
break;
case StringConsts.nclub:
_local3 = 35000;
break;
case StringConsts.super_market:
_local3 = 55000;
break;
case StringConsts.fire_dept:
_local3 = 10000;
break;
case StringConsts.police:
_local3 = 5000;
break;
};
_local4 = _local3;
if ((((_arg2 == Consts.ShopLevel2)) || ((_arg2 == Consts.ShopLevel3)))){
_local4 = (_local4 + (_local3 * (_arg2 - 1)));
};
return (_local4);
}
public static function showTooltip(_arg1:Engine, _arg2:ShopButton):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Boolean;
var _local7:String;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = false;
_arg1.playWindow.ui.shop_tooltip.title_txt.text = _arg2.buttonType;
Utils.setTextColor(_arg1.playWindow.ui.shop_tooltip.params_txt, 0xFFFFFF);
_local3 = getBuildCost(_arg2.buttonType, 0);
_local4 = getSeatsCount(_arg2.buttonType, 0);
_local5 = getGoodsCost(_arg2.buttonType, 0);
if (!_local6){
_local7 = (("Build Cost: <b><font color=\"#ffffff\" size=\"14\">" + _local3.toString()) + "$</font></b>");
if (_local4 > 0){
_local7 = (_local7 + (("\n<font color=\"#ffffff\">Capacity:</font> <b><font color=\"#00ff00\" size=\"14\">" + _local4.toString()) + "</font></b>"));
};
if (_local5 > 0){
_local7 = (_local7 + (("\n<font color=\"#FFffff\">Goods Cost:</font> <b><font color=\"#FFCC00\" size=\"14\">" + _local5.toString()) + "$</font></b>"));
};
if (_arg2.buttonType == StringConsts.police){
_local7 = (_local7 + "\n<b>Protects your shops from thiefs.</b>");
} else {
if (_arg2.buttonType == StringConsts.fire_dept){
_local7 = (_local7 + "\n<b>Protects your shops from accidental fires.</b>");
};
};
_arg1.playWindow.ui.shop_tooltip.params_txt.htmlText = _local7;
} else {
_arg1.playWindow.ui.shop_tooltip.params_txt.text = "Maximum upgrade level had reached.";
};
}
public static function showExtraTooltip(_arg1:Engine, _arg2):void{
var _local3:int;
var _local4:String;
var _local5:String;
_local3 = 0;
_local4 = "";
_local5 = "";
switch (_arg2){
case _arg1.playWindow.ui.extra_buttons.benches:
_local5 = "Bench";
_local3 = getExtraBuildCost(StringConsts.bench);
_local4 = "Bench slows down customers.";
break;
case _arg1.playWindow.ui.extra_buttons.news_box:
_local5 = "Newspaper Box";
_local3 = getExtraBuildCost(StringConsts.news_box);
_local4 = "Place where customers can buy newspapers.";
break;
case _arg1.playWindow.ui.extra_buttons.music_box:
_local5 = "Music Box";
_local3 = getExtraBuildCost(StringConsts.music_box);
_local4 = "Music box attracts customers with ads.";
break;
case _arg1.playWindow.ui.extra_buttons.ice_cream:
_local5 = "Ice Cream Stand";
_local3 = getExtraBuildCost(StringConsts.ice_cream);
_local4 = "Build Ice Cream Stand.";
break;
};
_arg1.playWindow.ui.shop_tooltip.title_txt.text = _local5;
_arg1.playWindow.ui.shop_tooltip.params_txt.htmlText = (((("Build Cost: <b><font color=\"#ffffff\" size=\"14\">" + _local3.toString()) + "$</font></b>\n\n<b><font color=\"#E6E6E6\">") + _local4) + "</font></b>");
}
}
}//package fai.logic
Section 25
//Engine (fai.logic.Engine)
package fai.logic {
import flash.media.*;
import flash.events.*;
import fai.ui.*;
import fai.common.*;
import flash.geom.*;
import fai.goals.*;
import fai.goalsystem.*;
import flash.utils.*;
import fai.*;
public class Engine {
public var buttons:Buttons;// = null
public var not_spent:Boolean;// = false
public var scenario:Scenario;// = null
public var score:int;// = 0
public var events:GameEvents;// = null
public var volume:Number;// = 1
private var game_finished:Boolean;// = false
public var fast_mode:Boolean;// = false
private var last_tooltip_button:ShopButton;// = null
private var money_goal:int;// = 0
public var shops:Shops;// = null
public var money:int;// = 0
private var level_life_points:int;// = 0
public var selected_item;// = null
public var paused:Boolean;// = false
private var last_loaded_level:Level;// = null
public var customers:Customers;// = null
private var game_data:DataProxy;// = null
public var play_window:PlayWindow;// = null
public var upgrades:Upgrades;// = null
private var global_stage;// = null
public var extras:Extras;// = null
public var music_channel:SoundChannel;// = null
public var goal_system:GoalSystem;// = null
private var vd_timer:Timer;// = null
private var music_sound:Sound;// = null
public var volumeOff:Boolean;// = false
public function Engine(_arg1):void{
var _local2:int;
var _local3:int;
var _local4:int;
game_data = null;
global_stage = null;
money = 0;
money_goal = 0;
score = 0;
paused = false;
goal_system = null;
events = null;
play_window = null;
last_loaded_level = null;
volume = 1;
volumeOff = false;
shops = null;
buttons = null;
level_life_points = 0;
scenario = null;
upgrades = null;
extras = null;
customers = null;
not_spent = false;
last_tooltip_button = null;
vd_timer = null;
music_sound = null;
music_channel = null;
game_finished = false;
fast_mode = false;
selected_item = null;
super();
global_stage = _arg1;
game_data = new DataProxy();
_local2 = 0;
_local3 = 0;
_local4 = 40;
}
public function playSoundData(_arg1:Sound):void{
var _local2:SoundTransform;
if (volumeOff){
return;
};
_local2 = new SoundTransform();
_local2.volume = volume;
_arg1.play(0, 0, _local2);
}
public function customerPassed(_arg1:Customer):void{
if (_arg1.money > 0){
if (level_life_points > 0){
level_life_points--;
};
playWindow.updateResources();
};
}
public function log(_arg1:String):void{
playWindow.ui.output_message.msg.msg_txt.text = _arg1;
playWindow.ui.output_message.gotoAndPlay("show_animation");
playWindow.ui.output_message.visible = true;
}
public function get lastLevel():Level{
return (last_loaded_level);
}
public function clearAll():void{
if (!play_window){
return;
};
stopMusic();
events.unregister();
events = null;
shops.destroy();
shops = null;
buttons.destroy();
buttons = null;
scenario = null;
upgrades = null;
customers.destroy();
customers = null;
extras.destroy();
extras = null;
play_window.destroy();
GameStage.play_holder.removeChild(play_window.ui);
play_window = null;
last_tooltip_button = null;
goal_system.deactivateAll();
goal_system = null;
game_finished = false;
paused = false;
}
private function defeatHandler(_arg1:TimerEvent):void{
game_finished = true;
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer = null;
predeactivateGoals();
if (!paused){
pause();
};
play_window.stats.final_victory.visible = false;
play_window.stats.defeat();
play_window.stats.start();
play_window.stats.visible = true;
}
public function get gameBoard():GameBoard{
if (!play_window){
return (null);
};
return (play_window.gameBoard);
}
public function victory():void{
if (game_finished){
return;
};
game_finished = true;
vd_timer = new Timer(1000, 1);
vd_timer.addEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer.start();
}
public function get levelLifePoints():int{
return (level_life_points);
}
public function predeactivateGoals():void{
var _local1:int;
var _local2:*;
var _local3:*;
_local1 = 0;
_local1 = 0;
while (_local1 < goal_system.goals.length) {
_local2 = goal_system.goals[_local1];
if ((_local2 is CoinGoal)){
_local2.deactivate();
};
_local1++;
};
_local1 = 0;
while (_local1 < customers.size()) {
_local3 = customers.getItem(_local1);
_local3.character.stop();
_local1++;
};
}
public function get ui(){
return (play_window.ui);
}
public function playLevel(_arg1:Level):void{
if (!_arg1){
return;
};
clearAll();
money = _arg1.initial_money;
money_goal = 0;
score = 0;
level_life_points = 5;
fast_mode = false;
goal_system = new GoalSystem();
events = new GameEvents(this);
shops = new Shops(this);
buttons = new Buttons(this);
extras = new Extras(this);
last_loaded_level = _arg1;
play_window = new PlayWindow(this);
play_window.initialize(_arg1.number);
GameStage.play_holder.addChild(play_window.ui);
scenario = new Scenario(this, _arg1);
upgrades = new Upgrades(this);
customers = new Customers(this);
goal_system.add(new CustomerZIndexGoal(this));
events.register();
play_window.updateAll();
music_sound = new Sound_level_selection();
if ((((_arg1.number == 5)) || ((_arg1.number == 6)))){
music_sound = null;
};
playMusic();
}
public function switchSound(_arg1:Boolean):void{
volumeOff = !(_arg1);
if (volumeOff){
stopMusic();
GameStage.welcomeScreen.levelSelection.stopMusic();
} else {
playMusic();
};
}
public function get gameData():DataProxy{
return (game_data);
}
public function playSound(_arg1:int):void{
switch (_arg1){
case SoundConsts.victory:
playSoundData(new Sound_tada());
break;
case SoundConsts.build:
playSoundData(new Sound_build());
break;
case SoundConsts.click:
playSoundData(new Sound_click3());
break;
case SoundConsts.coins:
playSoundData(new Sound_coins());
break;
case SoundConsts.new_day:
playSoundData(new Sound_new_day());
break;
case SoundConsts.fire:
playSoundData(new Sound_fire());
break;
case SoundConsts.police:
playSoundData(new Sound_police());
break;
case SoundConsts.sell:
playSoundData(new Sound_sell());
break;
case SoundConsts.final_victory:
playSoundData(new Sound_final_victory());
break;
case SoundConsts.alarm:
playSoundData(new Sound_alarm());
break;
case SoundConsts.repair:
playSoundData(new Sound_repair());
break;
};
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function showTooltip(_arg1):void{
if (((!(_arg1)) || ((_arg1 is ShopButton)))){
if (_arg1){
last_tooltip_button = _arg1;
DataProxy.showTooltip(this, _arg1);
} else {
DataProxy.showTooltip(this, last_tooltip_button);
};
} else {
DataProxy.showExtraTooltip(this, _arg1);
};
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((!(volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = volume;
music_channel = music_sound.play(0, 25, _local1);
};
}
public function finalVictory():void{
score = (score + 1900000);
play_window.stats.final_victory.visible = true;
}
private function victoryHandler(_arg1:TimerEvent):void{
var _local2:LevelSelection;
vd_timer.stop();
vd_timer.removeEventListener(TimerEvent.TIMER, victoryHandler);
vd_timer = null;
predeactivateGoals();
game_finished = true;
if (!paused){
pause();
};
_local2 = GameStage.welcomeScreen.levelSelection;
play_window.stats.final_victory.visible = false;
if (lastLevel.number == (gameData.getLevels().length - 1)){
finalVictory();
};
if (_local2.current_level == lastLevel.number){
_local2.current_level++;
};
play_window.stats.victory();
play_window.stats.start();
play_window.stats.visible = true;
}
public function get playerMoney():int{
return (money);
}
public function hideEverythingOpened():void{
buttons.hideBuildButtons();
shops.hideBuildingIcons();
shops.hideMenus();
if (extras.isAwaiting){
extras.cancelSketchyState();
};
ui.extra_buttons.visible = false;
}
public function get playWindow():PlayWindow{
return (play_window);
}
public function get goalMoney():int{
return (money_goal);
}
public function returnMoney(_arg1:int):void{
playWindow.stats.spent = (playWindow.stats.spent - Math.abs(_arg1));
money = (money + _arg1);
playWindow.updateAll();
}
public function pause():void{
if (!paused){
stopMusic();
play_window.ui.pause_mc.visible = true;
play_window.ui.pause_mc.gotoAndPlay("pause");
events.unregister();
setCustomersVisible(false);
} else {
playMusic();
play_window.ui.pause_mc.stop();
play_window.ui.pause_mc.visible = false;
events.register();
setCustomersVisible(true);
};
paused = !(paused);
}
private function setCustomersVisible(_arg1:Boolean):void{
var _local2:int;
var _local3:*;
_local2 = 0;
_local2 = 0;
while (_local2 < customers.size()) {
_local3 = customers.getItem(_local2);
if (!_local3.buying){
_local3.suit.visible = _arg1;
};
_local2++;
};
}
public function payMoney(_arg1:int):void{
if (_arg1 < 0){
playSound(SoundConsts.coins);
money_goal = (money_goal + Math.abs(_arg1));
playWindow.stats.earned = (playWindow.stats.earned + Math.abs(_arg1));
} else {
playWindow.stats.spent = (playWindow.stats.spent + Math.abs(_arg1));
};
money = (money - _arg1);
playWindow.updateAll();
}
public function gameOver():void{
if (game_finished){
return;
};
game_finished = true;
vd_timer = new Timer(1000, 1);
vd_timer.addEventListener(TimerEvent.TIMER, defeatHandler);
vd_timer.start();
}
}
}//package fai.logic
Section 26
//Extras (fai.logic.Extras)
package fai.logic {
import fai.ui.*;
import fai.*;
public class Extras {
private var engine:Engine;// = null
private var await_type:String;
private var extras:Array;
private var awaits:Boolean;// = false
public function Extras(_arg1:Engine):void{
engine = null;
extras = [];
awaits = false;
super();
engine = _arg1;
}
public function size():int{
return (extras.length);
}
public function getItem(_arg1:int){
return (extras[_arg1]);
}
public function setAwaiting(_arg1:Boolean):void{
awaits = _arg1;
}
public function update():void{
if (((awaits) && ((engine.playerMoney < DataProxy.getExtraBuildCost(await_type))))){
cancelSketchyState();
};
}
public function addItem(_arg1):void{
extras.push(_arg1);
_arg1.visible = false;
}
public function extraMusicBox():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.music_box)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.music_box);
}
public function extraNewsBox():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.news_box)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.news_box);
}
public function extraClick(_arg1):void{
if ((_arg1 is ExtraItem)){
if (_arg1.isAwaiting){
if (engine.playerMoney < DataProxy.getExtraBuildCost(_arg1.currentState)){
engine.log(StringConsts.not_enough_money);
return;
};
setAwaiting(false);
engine.payMoney(DataProxy.getExtraBuildCost(_arg1.currentState));
_arg1.setAwaiting(false);
_arg1.setNormalState();
engine.playWindow.stats.built++;
engine.score = (engine.score + DataProxy.getExtraBuildCost(_arg1.currentState));
engine.playWindow.updateAll();
cancelSketchyState();
} else {
engine.playWindow.ui.sell_dialog.x = ((_arg1.x + _arg1.width) - engine.playWindow.ui.sell_dialog.width);
engine.playWindow.ui.sell_dialog.y = ((_arg1.y + (_arg1.height / 2)) - engine.playWindow.ui.sell_dialog.height);
if (engine.playWindow.ui.sell_dialog.x < 0){
engine.playWindow.ui.sell_dialog.x = 0;
};
if (engine.playWindow.ui.sell_dialog.x > (Consts.ScreenWidth - engine.playWindow.ui.sell_dialog.width)){
engine.playWindow.ui.sell_dialog.x = ((Consts.ScreenWidth - engine.playWindow.ui.sell_dialog.width) - 5);
};
if ((engine.playWindow.ui.sell_dialog.y - engine.playWindow.ui.sell_dialog.height) < 0){
engine.playWindow.ui.sell_dialog.y = (engine.playWindow.ui.sell_dialog.height + 5);
};
if ((engine.playWindow.ui.sell_dialog.y + engine.playWindow.ui.sell_dialog.height) > Consts.ScreenHeight){
engine.playWindow.ui.sell_dialog.y = ((Consts.ScreenHeight - engine.playWindow.ui.sell_dialog.height) - 5);
};
engine.playWindow.ui.sell_dialog.visible = true;
engine.playWindow.ui.sell_dialog.money_txt.text = ((DataProxy.getExtraBuildCost(_arg1.currentState) * Consts.SellDownturn).toString() + "$");
engine.playWindow.ui.upgrade_dialog.visible = false;
if (!_arg1.vice_versa){
engine.playWindow.ui.sell_dialog.x = (engine.playWindow.ui.sell_dialog.x + (engine.playWindow.ui.sell_dialog.width / 2));
};
engine.selected_item = _arg1;
};
};
}
public function get isAwaiting():Boolean{
return (awaits);
}
public function cancelSketchyState():void{
var _local1:int;
var _local2:ExtraItem;
awaits = false;
_local1 = 0;
_local1 = 0;
while (_local1 < extras.length) {
_local2 = extras[_local1];
if (_local2.isAwaiting){
_local2.setCurrentState(StringConsts.empty);
_local2.setAwaiting(false);
_local2.visible = false;
};
_local1++;
};
engine.ui.extra_buttons.visible = false;
}
private function showSketchyState(_arg1:String):void{
var _local2:int;
var _local3:Boolean;
var _local4:ExtraItem;
if (((awaits) && ((await_type == _arg1)))){
cancelSketchyState();
return;
};
_local2 = 0;
_local3 = false;
_local2 = 0;
while (_local2 < extras.length) {
_local4 = extras[_local2];
if ((((_local4.currentState == StringConsts.empty)) || (extras[_local2].isAwaiting))){
_local4.setCurrentState(_arg1);
_local4.setAwaiting(true);
_local4.setSketchyState();
_local4.visible = true;
_local3 = true;
};
_local2++;
};
if (_local3){
awaits = true;
await_type = _arg1;
engine.shops.hideBuildingIcons();
};
}
public function extraIceCream():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.ice_cream)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.ice_cream);
}
public function extraBenches():void{
if (engine.playerMoney < DataProxy.getExtraBuildCost(StringConsts.bench)){
engine.log(StringConsts.not_enough_money);
return;
};
showSketchyState(StringConsts.bench);
}
public function destroy():void{
if (extras){
extras.length = 0;
extras = null;
};
}
}
}//package fai.logic
Section 27
//GameBoard (fai.logic.GameBoard)
package fai.logic {
import flash.display.*;
public class GameBoard extends Sprite {
private var engine:Engine;// = null
public function GameBoard(_arg1:Engine):void{
engine = null;
super();
}
}
}//package fai.logic
Section 28
//GameEvents (fai.logic.GameEvents)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import fai.*;
public class GameEvents {
private var engine:Engine;// = null
private var scenario_pause:int;// = 0
public function GameEvents(_arg1:Engine):void{
engine = null;
scenario_pause = 0;
super();
engine = _arg1;
}
private function modeChangeButtonHandler(_arg1:MouseEvent):void{
engine.fast_mode = !(engine.fast_mode);
engine.playWindow.ui.fast_mode_button.visible = !(engine.fast_mode);
engine.playWindow.ui.slow_mode_button.visible = engine.fast_mode;
_arg1.stopPropagation();
}
private function extraButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
switch (_arg1.currentTarget){
case engine.playWindow.ui.extra_buttons.benches:
engine.extras.extraBenches();
break;
case engine.playWindow.ui.extra_buttons.news_box:
engine.extras.extraNewsBox();
break;
case engine.playWindow.ui.extra_buttons.music_box:
engine.extras.extraMusicBox();
break;
case engine.playWindow.ui.extra_buttons.ice_cream:
engine.extras.extraIceCream();
break;
};
_arg1.stopPropagation();
}
private function onKeyDown(_arg1:KeyboardEvent):void{
}
private function shopButtonOutHandler(_arg1:MouseEvent):void{
engine.playWindow.ui.shop_tooltip.visible = false;
}
private function clickShopUpgradeHandler(_arg1:MouseEvent):void{
var _local2:ShopItem;
if (((engine.selected_item) && ((engine.selected_item is ShopItem)))){
engine.playSound(SoundConsts.click);
_local2 = engine.selected_item;
if (_local2.currentLevel < Consts.ShopLevel3){
if (engine.playerMoney < DataProxy.getBuildCost(_local2.shopType, (_local2.currentLevel + 1))){
engine.log(StringConsts.not_enough_money);
} else {
_local2.startUpgrading();
};
};
engine.hideEverythingOpened();
};
_arg1.stopPropagation();
}
private function clickShopHandler(_arg1:MouseEvent):void{
var _local2:*;
if ((_arg1.currentTarget is ShopItem)){
if (engine.shops.awaitBuilding()){
engine.playSound(SoundConsts.click);
_arg1.currentTarget.handleClick();
engine.hideEverythingOpened();
} else {
_local2 = engine.buttons.getButtonByType(_arg1.currentTarget.shopType);
shopPressed(_local2, _arg1.currentTarget);
};
};
_arg1.stopPropagation();
}
private function playWindowMenuHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.pause();
engine.play_window.ui.visible = false;
GameStage.welcomeScreen.showWelcome();
_arg1.stopPropagation();
}
private function playWindowPauseHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.pause();
_arg1.stopPropagation();
}
private function extraBuildButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.ui.extra_buttons.visible = !(engine.ui.extra_buttons.visible);
if (engine.ui.extra_buttons.visible){
engine.hideEverythingOpened();
engine.ui.extra_buttons.visible = true;
};
_arg1.stopPropagation();
}
private function shopPressed(_arg1, _arg2):void{
var _local3:ShopItem;
var _local4:Boolean;
var _local5:String;
engine.playSound(SoundConsts.click);
if ((_arg2 is String)){
if (engine.playerMoney < DataProxy.getBuildCost(_arg2, 0)){
engine.log(StringConsts.not_enough_money);
} else {
engine.shops.showBuildingIcons(_arg2);
};
} else {
if ((_arg2 is ShopItem)){
_local3 = _arg2;
if (((_local3.underBuilding()) || (_local3.underUpgrading()))){
_local4 = _local3.underBuilding();
_local3.cancel();
if (engine.shops.awaitBuilding()){
_local5 = engine.shops.buildingType;
engine.shops.hideBuildingIcons();
engine.shops.showBuildingIcons(_local5);
};
} else {
engine.hideEverythingOpened();
_arg2.showMenu(!(engine.playWindow.ui.upgrade_dialog.visible));
engine.selected_item = _arg2;
if (!_arg2.shoppable){
engine.playWindow.ui.repair_dialog.visible = false;
engine.playWindow.ui.upgrade_dialog.visible = false;
};
};
};
};
}
private function soundOnHandler(_arg1:MouseEvent):void{
engine.switchSound(true);
engine.playWindow.ui.mute_button.visible = true;
engine.playWindow.ui.sound_button.visible = false;
_arg1.stopPropagation();
}
public function tick(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = 1;
if (engine.fast_mode){
_local2 = 4;
};
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
engine.goal_system.tick();
engine.scenario.generate();
if (scenario_pause == 20){
engine.scenario.think();
scenario_pause = 0;
};
scenario_pause++;
_local3++;
};
}
private function nextDayButtonHandler(_arg1:MouseEvent):void{
if (engine.playWindow.next_day_blocked){
return;
};
engine.playWindow.ui.click_next_day_button.visible = false;
engine.playSound(SoundConsts.new_day);
engine.scenario.nextDay();
_arg1.stopPropagation();
}
private function unregisterShops():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
engine.shops.getItem(_local1).removeEventListener(MouseEvent.MOUSE_DOWN, clickShopHandler);
_local1++;
};
}
private function soundMuteHandler(_arg1:MouseEvent):void{
engine.switchSound(false);
engine.playWindow.ui.mute_button.visible = false;
engine.playWindow.ui.sound_button.visible = true;
_arg1.stopPropagation();
}
public function register():void{
var _local1:int;
var _local2:*;
GameStage.main_stage.addEventListener(Event.ENTER_FRAME, tick);
GameStage.main_stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
registerShops();
_local1 = 0;
_local2 = null;
_local1 = 0;
while (_local1 < engine.buttons.size()) {
_local2 = engine.buttons.getItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, shopButtonHandler);
_local2.addEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.addEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local2.buttonMode = true;
_local2.mouseChildren = false;
_local1++;
};
engine.ui.build_button.addEventListener(MouseEvent.MOUSE_DOWN, buildButtonHandler);
engine.ui.extra_button.addEventListener(MouseEvent.MOUSE_DOWN, extraBuildButtonHandler);
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, extraItemHandler);
_local2.buttonMode = true;
_local2.mouseChildren = false;
_local1++;
};
_local1 = 0;
while (_local1 < engine.buttons.extraSize()) {
_local2 = engine.buttons.getExtraItem(_local1);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, extraButtonHandler);
_local2.addEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.addEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.playWindow.ui.upgrade_dialog.upgrade_button.addEventListener(MouseEvent.MOUSE_DOWN, clickShopUpgradeHandler);
engine.playWindow.ui.sell_dialog.sell_button.addEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.repair_dialog.repair_button.addEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.playWindow.ui.addEventListener(MouseEvent.MOUSE_DOWN, clickBackHandler);
engine.playWindow.ui.next_day_button.addEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.menu_button.addEventListener(MouseEvent.MOUSE_DOWN, playWindowMenuHandler);
engine.playWindow.ui.pause_button.addEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.mute_button.addEventListener(MouseEvent.MOUSE_DOWN, soundMuteHandler);
engine.playWindow.ui.sound_button.addEventListener(MouseEvent.MOUSE_DOWN, soundOnHandler);
engine.playWindow.ui.click_next_day_button.addEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.fast_mode_button.addEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
engine.playWindow.ui.slow_mode_button.addEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
}
private function clickShopSellHandler(_arg1:MouseEvent):void{
if ((engine.selected_item is ShopItem)){
engine.selected_item.sell();
engine.playSound(SoundConsts.sell);
} else {
if ((engine.selected_item is ExtraItem)){
engine.selected_item.sell();
engine.playSound(SoundConsts.sell);
};
};
engine.hideEverythingOpened();
_arg1.stopPropagation();
}
private function buildButtonHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.buttons.update();
engine.buttons.buildButtonPressed();
engine.ui.extra_buttons.visible = false;
_arg1.stopPropagation();
}
private function shopButtonOverHandler(_arg1:MouseEvent):void{
engine.showTooltip(_arg1.currentTarget);
engine.playWindow.ui.shop_tooltip.visible = true;
engine.playWindow.ui.shop_tooltip.gotoAndPlay("show_animation");
}
private function shopButtonHandler(_arg1:MouseEvent):void{
if (((engine.shops.awaitBuilding()) && ((_arg1.currentTarget.buttonType == engine.shops.buildingType)))){
engine.shops.hideBuildingIcons();
engine.buttons.buildButtonPressed();
return;
};
shopPressed(_arg1.currentTarget, _arg1.currentTarget.buttonType);
engine.buttons.buildButtonPressed();
_arg1.stopPropagation();
}
private function registerShops():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < engine.shops.size()) {
engine.shops.getItem(_local1).addEventListener(MouseEvent.MOUSE_DOWN, clickShopHandler);
_local1++;
};
}
private function extraItemHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
engine.extras.extraClick(_arg1.currentTarget);
_arg1.stopPropagation();
}
private function clickBackHandler(_arg1:MouseEvent):void{
engine.hideEverythingOpened();
}
public function unregister():void{
var _local1:int;
var _local2:*;
GameStage.main_stage.removeEventListener(Event.ENTER_FRAME, tick);
GameStage.main_stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
unregisterShops();
_local1 = 0;
_local2 = null;
_local1 = 0;
while (_local1 < engine.buttons.size()) {
_local2 = engine.buttons.getItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, shopButtonHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.ui.build_button.removeEventListener(MouseEvent.MOUSE_DOWN, buildButtonHandler);
engine.ui.extra_button.removeEventListener(MouseEvent.MOUSE_DOWN, extraBuildButtonHandler);
engine.playWindow.ui.removeEventListener(MouseEvent.MOUSE_DOWN, clickBackHandler);
_local1 = 0;
while (_local1 < engine.extras.size()) {
_local2 = engine.extras.getItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, extraItemHandler);
_local1++;
};
_local1 = 0;
while (_local1 < engine.buttons.extraSize()) {
_local2 = engine.buttons.getExtraItem(_local1);
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, extraButtonHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, shopButtonOverHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, shopButtonOutHandler);
_local1++;
};
engine.playWindow.ui.upgrade_dialog.upgrade_button.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopUpgradeHandler);
engine.playWindow.ui.sell_dialog.sell_button.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopSellHandler);
engine.playWindow.ui.repair_dialog.repair_button.removeEventListener(MouseEvent.MOUSE_DOWN, clickShopRepairHandler);
engine.playWindow.ui.next_day_button.removeEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.menu_button.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowMenuHandler);
engine.playWindow.ui.pause_button.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, playWindowPauseHandler);
engine.playWindow.ui.mute_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundMuteHandler);
engine.playWindow.ui.sound_button.removeEventListener(MouseEvent.MOUSE_DOWN, soundOnHandler);
engine.playWindow.ui.click_next_day_button.removeEventListener(MouseEvent.MOUSE_DOWN, nextDayButtonHandler);
engine.playWindow.ui.fast_mode_button.removeEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
engine.playWindow.ui.slow_mode_button.removeEventListener(MouseEvent.MOUSE_DOWN, modeChangeButtonHandler);
}
private function clickShopRepairHandler(_arg1:MouseEvent):void{
var _local2:Number;
engine.playSound(SoundConsts.click);
if ((engine.selected_item is ShopItem)){
_local2 = engine.selected_item.getRepairCost();
if (engine.playerMoney < _local2){
engine.log(StringConsts.not_enough_money);
} else {
engine.selected_item.repair();
engine.payMoney(_local2);
engine.playSound(SoundConsts.repair);
};
};
engine.hideEverythingOpened();
_arg1.stopPropagation();
}
}
}//package fai.logic
Section 29
//Level (fai.logic.Level)
package fai.logic {
import fai.*;
public class Level {
public var initial_money:int;// = 0
public var number:int;// = 0
public var days:int;// = 0
public var money_goal:int;// = 0
public var type:String;
public var description:String;
public function Level(_arg1:String):void{
number = 0;
days = 0;
initial_money = 0;
money_goal = 0;
super();
type = _arg1;
initial_money = 7000;
description = "";
switch (type){
case StringConsts.level1:
days = 5;
initial_money = 5050;
money_goal = 7000;
break;
case StringConsts.level2:
days = 8;
money_goal = 25000;
break;
case StringConsts.level3:
days = 10;
money_goal = 45000;
break;
case StringConsts.level4:
days = 12;
money_goal = 85000;
break;
case StringConsts.level5:
days = 14;
money_goal = 120000;
break;
case StringConsts.level6:
days = 16;
money_goal = 150000;
initial_money = 9000;
break;
case StringConsts.level7:
days = 20;
money_goal = 300000;
initial_money = 10000;
break;
case StringConsts.level8:
days = 24;
initial_money = 12000;
money_goal = 550000;
break;
case StringConsts.level9:
days = 29;
initial_money = 12000;
money_goal = 1000000;
break;
};
}
public function copy(_arg1:Level):void{
type = _arg1.type;
description = _arg1.description;
days = _arg1.days;
initial_money = _arg1.initial_money;
money_goal = _arg1.money_goal;
}
}
}//package fai.logic
Section 30
//PlayWindow (fai.logic.PlayWindow)
package fai.logic {
import flash.events.*;
import fai.ui.*;
import flash.display.*;
import fai.*;
public class PlayWindow {
private var engine:Engine;// = null
private var game_ui:PlayWindowUI;// = null
private var level_back;// = null
public var roads:Array;// = null
public var game_board:GameBoard;// = null
public var stats:Statistics;// = null
private var initial_bar_scale:Number;// = 0
public var build_buttons:Array;// = null
private var road_index:int;// = 0
public var iso_beacons:Array;
private var shop_items:Array;// = null
public var next_day_blocked:Boolean;// = false
public function PlayWindow(_arg1:Engine):void{
engine = null;
game_board = null;
game_ui = null;
shop_items = null;
build_buttons = null;
roads = null;
initial_bar_scale = 0;
stats = null;
road_index = 0;
level_back = null;
iso_beacons = [];
next_day_blocked = false;
super();
engine = _arg1;
}
public function show():void{
ui.visible = true;
}
private function unpauseHandler(_arg1:MouseEvent):void{
engine.pause();
}
public function initialize(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:*;
game_ui = new PlayWindowUI();
shop_items = new Array();
roads = new Array();
level_back = DataProxy.getLevelBackground(_arg1);
game_ui.back_holder.addChild(level_back);
_local2 = 0;
_local3 = level_back.numChildren;
_local2 = 0;
while (_local2 < _local3) {
_local4 = level_back.getChildAt(_local2);
if ((_local4 is ShopItem)){
shop_items.push(_local4);
} else {
if ((_local4 is RoadPath)){
_local4.initialize();
_local4.visible = false;
roads.push(_local4);
} else {
if ((_local4 is ExtraItem)){
if (_local4.scaleX < 1){
_local4.vice_versa = true;
};
engine.extras.addItem(_local4);
_local4.setEngine(engine);
} else {
if ((_local4 is IsoBeacon)){
iso_beacons.push(_local4);
_local4.inner.visible = false;
};
};
};
};
_local2++;
};
initializeButtons();
_local2 = 0;
while (_local2 < shop_items.length) {
engine.shops.addItem(shop_items[_local2]);
engine.shops.getItem(_local2).initialize(engine);
_local2++;
};
initial_bar_scale = game_ui.resources.goal_bar.bar.scaleX;
game_ui.shop_tooltip.visible = false;
game_ui.shop_tooltip.stop();
game_ui.output_message.visible = false;
game_ui.bonus_animation.visible = false;
game_ui.pause_mc.stop();
game_ui.pause_mc.buttonMode = true;
game_ui.pause_mc.mouseChildren = false;
game_ui.pause_mc.visible = false;
stats = new Statistics();
stats.setEngine(engine);
stats.visible = false;
game_ui.addChild(stats);
game_ui.pause_mc.addEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
ui.sound_button.visible = false;
game_ui.tutorial_mc.init(engine);
if (engine.lastLevel.number > 4){
game_ui.removeChild(game_ui.tutorial_mc);
game_ui.tutorial_mc.destroy();
game_ui.tutorial_mc = null;
} else {
game_ui.tutorial_mc.stop();
game_ui.tutorial_mc.visible = true;
switch (engine.lastLevel.number){
case 1:
game_ui.tutorial_mc.gotoPage("page3");
break;
case 2:
game_ui.tutorial_mc.page1.gotoAndStop("the_same_type");
break;
case 3:
game_ui.tutorial_mc.page1.gotoAndStop("intersections");
break;
case 4:
game_ui.tutorial_mc.page1.gotoAndStop("fire_police");
break;
};
};
ui.click_next_day_button.visible = false;
ui.slow_mode_button.visible = false;
ui.upgrade_dialog.visible = false;
ui.sell_dialog.visible = false;
ui.repair_dialog.visible = false;
engine.buttons.update();
}
public function get levelBack(){
return (level_back);
}
public function get ui(){
return (game_ui);
}
private function initializeButtons():void{
game_ui.extra_buttons.visible = false;
engine.buttons.addItem(game_ui.boutique_button);
engine.buttons.addItem(game_ui.pet_shop_button);
engine.buttons.addItem(game_ui.computers_button);
engine.buttons.addItem(game_ui.nclub_button);
engine.buttons.addItem(game_ui.jewelry_button);
engine.buttons.addItem(game_ui.restaurant_button);
engine.buttons.addItem(game_ui.market_button);
engine.buttons.addItem(game_ui.toy_store_button);
engine.buttons.addItem(game_ui.fire_dept_button);
engine.buttons.addItem(game_ui.police_button);
engine.buttons.addItem(game_ui.extra_buttons.benches);
engine.buttons.addItem(game_ui.extra_buttons.news_box);
engine.buttons.addItem(game_ui.extra_buttons.music_box);
engine.buttons.addItem(game_ui.extra_buttons.ice_cream);
}
public function get gameBoard():GameBoard{
return (game_board);
}
public function destroy():void{
if (game_ui.tutorial_mc){
game_ui.tutorial_mc.destroy();
game_ui.tutorial_mc = null;
};
game_ui.pause_mc.removeEventListener(MouseEvent.MOUSE_DOWN, unpauseHandler);
}
public function get customersHolder(){
return (ui.customers);
}
public function showBonus(_arg1:int):void{
ui.bonus_animation.visible = true;
ui.bonus_animation.gotoAndPlay("start_animation");
stats.bonus = (stats.bonus + _arg1);
engine.payMoney(-(_arg1));
}
public function updateAll():void{
engine.buttons.update();
updateResources();
}
public function getNextRoad():RoadPath{
road_index++;
if (road_index >= roads.length){
road_index = 0;
};
return (roads[road_index]);
}
public function updateResources():void{
var _local1:int;
game_ui.resources.score_txt.text = engine.score.toString();
game_ui.resources.money_txt.text = (engine.playerMoney.toString() + "$");
_local1 = int(((engine.goalMoney / engine.lastLevel.money_goal) * 100));
game_ui.resources.goal_bar.goal_txt.text = (_local1.toString() + "%");
if (_local1 <= 100){
game_ui.resources.goal_bar.bar.scaleX = ((engine.goalMoney / engine.lastLevel.money_goal) * initial_bar_scale);
} else {
game_ui.resources.goal_bar.bar.scaleX = initial_bar_scale;
};
game_ui.resources.wave_txt.text = ((engine.scenario.currentDay.toString() + "/") + engine.lastLevel.days.toString());
next_day_blocked = ((!((engine.customers.size() == 0))) || (!(engine.scenario.isBuyerQueueEmpty())));
if (next_day_blocked){
engine.playWindow.ui.next_day_button.alpha = 0.5;
} else {
engine.playWindow.ui.next_day_button.alpha = 1;
};
}
}
}//package fai.logic
Section 31
//RoadGraph (fai.logic.RoadGraph)
package fai.logic {
import fai.ui.*;
public class RoadGraph {
private var road:RoadPath;// = null
private var counter:int;// = 0
public function RoadGraph(_arg1:RoadPath):void{
road = null;
counter = 0;
super();
road = _arg1;
}
public function lookAnyNext():RoadPoint{
if (counter >= road.points.size()){
return (road.points.values[(road.points.size() - 1)]);
};
return (road.points.values[counter]);
}
public function getNext():RoadPoint{
if ((counter + 1) >= road.points.size()){
return (null);
};
counter++;
return (road.points.values[counter]);
}
public function getFirst():RoadPoint{
counter = 0;
return (road.firstNode());
}
}
}//package fai.logic
Section 32
//Scenario (fai.logic.Scenario)
package fai.logic {
import fai.goals.*;
import fai.*;
public class Scenario {
private var engine:Engine;// = null
private var buyer_queue:Array;
private var level:Level;// = null
private var generate_pause:int;// = 0
private var current_day:int;// = 0
private static const GENERATE_PAUSE:int = 20;
public function Scenario(_arg1:Engine, _arg2:Level):void{
engine = null;
buyer_queue = [];
level = null;
current_day = 0;
generate_pause = 0;
super();
engine = _arg1;
level = _arg2;
}
private function generateCustomers():void{
var _local1:int;
var _local2:Customer;
var _local3:int;
_local1 = DataProxy.getBuyerCount(current_day);
_local2 = null;
_local3 = 0;
_local3 = 0;
while (_local3 < _local1) {
_local2 = DataProxy.getCustomer(current_day);
_local2.setEngine(engine);
buyer_queue.push(_local2);
_local3++;
};
}
public function get currentDay():int{
return (current_day);
}
private function victoryCondition():Boolean{
return ((engine.goalMoney >= level.money_goal));
}
public function nextDay():void{
if (current_day >= level.days){
return;
};
engine.not_spent = false;
current_day++;
generateCustomers();
engine.upgrades.nextDay();
engine.playWindow.updateResources();
engine.playWindow.next_day_blocked = true;
engine.playWindow.ui.next_day_button.alpha = 0.5;
}
public function think():void{
if (gameOverCondition()){
engine.gameOver();
return;
};
if (victoryCondition()){
engine.victory();
return;
};
}
public function isBuyerQueueEmpty():Boolean{
return ((buyer_queue.length == 0));
}
private function gameOverCondition():Boolean{
return ((((((((((buyer_queue.length == 0)) && ((engine.customers.size() == 0)))) && (engine.upgrades.busWent()))) && ((current_day >= level.days)))) && ((engine.goalMoney < level.money_goal))));
}
public function generate():void{
var _local1:Customer;
var _local2:BuyerGoal;
if (generate_pause > 0){
generate_pause--;
return;
};
generate_pause = GENERATE_PAUSE;
if (buyer_queue.length > 0){
_local1 = buyer_queue.shift();
_local2 = new BuyerGoal(engine, _local1);
engine.goal_system.add(_local2);
};
}
}
}//package fai.logic
Section 33
//ShopItem (fai.logic.ShopItem)
package fai.logic {
import fai.ui.*;
import flash.display.*;
import flash.filters.*;
import fai.common.*;
import fai.goals.*;
import fai.*;
public class ShopItem extends MovieClip {
public var building_bar:MovieClip;
private var color_matrix:Array;// = null
private var shop_sprite;// = null
private var customer_bar:ShopCustomerBar;// = null
private var engine:Engine;// = null
public var hammer_icon:MovieClip;
public var health:Number;// = 100
public var move_beacon:Sprite;
public var shoppable:Boolean;// = true
public var platform:MovieClip;
private var awaits_building:Boolean;// = false
public var fire_icon:MovieClip;
private var building_icon;// = null
private var money_value:int;// = 0
private var type:String;
public var thief_icon:MovieClip;
private var number:int;// = 0
private var particles_goal;// = null
private var level:int;// = 0
private var upgrading_goal:UpgradingGoal;// = null
private var building_goal:BuildingGoal;// = null
public var busy:Boolean;// = false
public function ShopItem():void{
engine = null;
level = 0;
building_icon = null;
color_matrix = null;
number = 0;
particles_goal = null;
awaits_building = false;
building_goal = null;
upgrading_goal = null;
shop_sprite = null;
customer_bar = null;
money_value = 0;
shoppable = true;
health = 100;
busy = false;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
move_beacon.visible = false;
hammer_icon.visible = false;
hammer_icon.stop();
fire_icon.visible = false;
fire_icon.stop();
thief_icon.visible = false;
thief_icon.internal_animation.stop();
thief_icon.stop();
}
public function hideBuildingState():void{
awaits_building = false;
stopParticles();
if (building_icon){
removeChild(building_icon);
building_icon = null;
};
}
public function get shopIdString():String{
return ((shopType + currentLevel.toString()));
}
public function get itemNumber():int{
return (number);
}
public function handleClick():void{
if (awaits_building){
setType(engine.shops.buildingType);
engine.shops.hideBuildingIcons();
visible = true;
startBuilding();
};
}
public function setNumber(_arg1:int):void{
number = _arg1;
}
function frame3(){
stop();
}
public function setLevel(_arg1:int):void{
if (level != _arg1){
level = _arg1;
engine.playWindow.updateAll();
};
}
public function updateRepairState():void{
if (((fire_icon.visible) || (thief_icon.visible))){
hammer_icon.stop();
hammer_icon.visible = false;
return;
};
if (health < 20){
if (false == hammer_icon.visible){
engine.playSound(SoundConsts.alarm);
};
hammer_icon.play();
hammer_icon.visible = true;
} else {
hammer_icon.stop();
hammer_icon.visible = false;
};
}
function frame1(){
stop();
}
public function startParticles():void{
stopParticles();
particles_goal = new VParticleEffectGoal(this);
engine.goal_system.add(particles_goal);
}
function frame2(){
stop();
}
public function get moneyValue():int{
return (money_value);
}
public function cancel():void{
if (underBuilding()){
building_goal.deactivate();
building_goal = null;
visible = false;
gotoAndStop("building_state");
building_bar.bar.scaleX = 1;
engine.returnMoney(DataProxy.getBuildCost(type, 0));
type = "";
awaits_building = false;
setLevel(0);
level = 0;
} else {
if (underUpgrading()){
upgrading_goal.cancel();
upgrading_goal = null;
engine.returnMoney(DataProxy.getBuildCost(type, (level + 1)));
};
};
}
public function setType(_arg1:String):void{
type = _arg1;
}
public function stopParticles():void{
if (particles_goal){
particles_goal.deactivate();
particles_goal = null;
};
}
private function trySpecialCase():void{
var _local1:Number;
if (health > 35){
return;
};
_local1 = Math.random();
if (engine.scenario.currentDay >= 13){
if (_local1 < 0.01){
engine.goal_system.add(new FireGoal(engine, this, StringConsts.fire_dept));
engine.playSound(SoundConsts.alarm);
engine.playSound(SoundConsts.alarm);
} else {
if (_local1 < 0.02){
engine.goal_system.add(new FireGoal(engine, this, StringConsts.police));
engine.playSound(SoundConsts.alarm);
engine.playSound(SoundConsts.alarm);
};
};
};
}
public function doSellLogic():void{
setLevel(0);
setShopIcon(null);
customer_bar.visible = false;
customer_bar.destroy();
hammer_icon.visible = false;
hammer_icon.stop();
visible = false;
}
public function get shopHealth():int{
return (health);
}
public function getRepairCost():Number{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (100 - shopHealth);
_local2 = DataProxy.getBuildCost(shopType, currentLevel);
_local3 = ((_local1 * _local2) / 100);
return (_local3);
}
public function setBuildingState(_arg1:String):void{
var _local2:ColorMatrixFilter;
var _local3:Array;
if (!color_matrix){
color_matrix = new Array();
color_matrix = color_matrix.concat([1, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([1, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([1, 0, 0, 0, 0]);
color_matrix = color_matrix.concat([0, 0, 0, 1, 0]);
};
hideBuildingState();
awaits_building = true;
gotoAndStop("building_state");
building_icon = DataProxy.getShopIcon(_arg1);
Utils.posPlatforms(building_icon, this);
addChild(building_icon);
_local2 = new ColorMatrixFilter(color_matrix);
_local3 = new Array();
_local3.push(_local2);
building_icon.filters = _local3;
visible = true;
building_bar.visible = false;
startParticles();
}
public function setShopIcon(_arg1):void{
if (shop_sprite){
removeChild(shop_sprite);
shop_sprite = null;
};
if (_arg1){
shop_sprite = _arg1;
if ((((shopType == StringConsts.fire_dept)) || ((shopType == StringConsts.police)))){
shop_sprite.service_icon.stop();
shop_sprite.service_icon.visible = false;
};
Utils.posPlatforms(shop_sprite, this);
addChild(shop_sprite);
swapChildren(customer_bar, shop_sprite);
removeChild(hammer_icon);
hammer_icon.visible = false;
addChild(hammer_icon);
removeChild(fire_icon);
fire_icon.visible = false;
addChild(fire_icon);
removeChild(thief_icon);
thief_icon.visible = false;
addChild(thief_icon);
updateRepairState();
platform.visible = false;
};
}
public function startBuilding():void{
engine.payMoney(DataProxy.getBuildCost(type, 0));
building_goal = new BuildingGoal(engine, this);
engine.goal_system.add(building_goal);
}
public function get shopBar():ShopCustomerBar{
return (customer_bar);
}
public function updateState():void{
customer_bar.destroy();
if (((shoppable) && (shop_sprite))){
customer_bar.create(DataProxy.getSeatsCount(type, level));
customer_bar.x = building_bar.x;
if (getChildIndex(customer_bar) < getChildIndex(shop_sprite)){
swapChildren(customer_bar, shop_sprite);
};
building_bar.y = (customer_bar.y = platform.y);
customer_bar.y = ((((platform.y + platform.height) - height) - customer_bar.height) - 15);
building_bar.y = ((customer_bar.y - building_bar.height) - 5);
money_value = DataProxy.getGoodsCost(type, level);
};
engine.showTooltip(null);
}
public function reset():void{
busy = false;
fire_icon.visible = false;
fire_icon.stop();
thief_icon.internal_animation.stop();
thief_icon.stop();
thief_icon.visible = false;
repair();
}
public function get shopType():String{
return (type);
}
public function setUpgradingState():void{
setLevel(Consts.ShopUpgrading);
}
public function getShopSprite(){
return (shop_sprite);
}
public function sell():void{
engine.returnMoney(getSellCost());
doSellLogic();
}
public function get currentLevel():int{
return (level);
}
public function initialize(_arg1:Engine):void{
engine = _arg1;
customer_bar = new ShopCustomerBar();
customer_bar.assign(engine, this);
customer_bar.visible = false;
addChild(customer_bar);
visible = false;
building_bar.visible = false;
stop();
buttonMode = true;
mouseChildren = false;
building_bar.x = 5;
}
public function startUpgrading():void{
if (!customer_bar.wereCreated()){
return;
};
if (!customer_bar.isFree()){
engine.log("You can't upgrade the shop when the customers are shopping.");
return;
};
engine.payMoney(DataProxy.getBuildCost(type, (level + 1)));
upgrading_goal = new UpgradingGoal(engine, this);
engine.goal_system.add(upgrading_goal);
}
public function repair():void{
health = 100;
updateRepairState();
}
public function get awaitsBuilding():Boolean{
return (awaits_building);
}
public function underBuilding():Boolean{
return (((building_goal) && (building_goal.active)));
}
public function getSellCost():Number{
var _local1:Number;
_local1 = (DataProxy.getBuildCost(type, level) * Consts.SellDownturn);
_local1 = (_local1 * (health / 100));
return (_local1);
}
public function underUpgrading():Boolean{
return (((upgrading_goal) && (upgrading_goal.active)));
}
public function customerPassed():void{
if (!engine.playWindow){
return;
};
health = (health - Consts.ShopHealthPortion);
updateRepairState();
if (engine.selected_item == this){
engine.playWindow.ui.repair_dialog.money_txt.text = (getRepairCost().toString() + "$");
};
if (health <= 0){
doSellLogic();
} else {
if (shoppable){
trySpecialCase();
};
};
}
public function showMenu(_arg1:Boolean):void{
if (_arg1){
startParticles();
} else {
stopParticles();
};
if (_arg1){
engine.playWindow.ui.upgrade_dialog.x = ((x + width) - engine.playWindow.ui.upgrade_dialog.width);
engine.playWindow.ui.upgrade_dialog.y = ((y + (height / 2)) - (engine.playWindow.ui.upgrade_dialog.height * 2));
if (engine.playWindow.ui.upgrade_dialog.x < 0){
engine.playWindow.ui.upgrade_dialog.x = 0;
};
if (engine.playWindow.ui.upgrade_dialog.x > (Consts.ScreenWidth - engine.playWindow.ui.upgrade_dialog.width)){
engine.playWindow.ui.upgrade_dialog.x = ((Consts.ScreenWidth - engine.playWindow.ui.upgrade_dialog.width) - 5);
};
if ((engine.playWindow.ui.upgrade_dialog.y - engine.playWindow.ui.upgrade_dialog.height) < 0){
engine.playWindow.ui.upgrade_dialog.y = (engine.playWindow.ui.upgrade_dialog.height + 5);
};
if ((engine.playWindow.ui.upgrade_dialog.y + engine.playWindow.ui.upgrade_dialog.height) > Consts.ScreenHeight){
engine.playWindow.ui.upgrade_dialog.y = ((Consts.ScreenHeight - engine.playWindow.ui.upgrade_dialog.height) - 5);
};
engine.playWindow.ui.sell_dialog.x = engine.playWindow.ui.upgrade_dialog.x;
engine.playWindow.ui.sell_dialog.y = (engine.playWindow.ui.upgrade_dialog.y + engine.playWindow.ui.upgrade_dialog.height);
engine.playWindow.ui.repair_dialog.x = engine.playWindow.ui.upgrade_dialog.x;
engine.playWindow.ui.repair_dialog.y = (engine.playWindow.ui.upgrade_dialog.y - engine.playWindow.ui.upgrade_dialog.height);
};
engine.playWindow.ui.upgrade_dialog.visible = _arg1;
engine.playWindow.ui.sell_dialog.visible = _arg1;
if (health < 30){
engine.playWindow.ui.repair_dialog.visible = _arg1;
} else {
engine.playWindow.ui.repair_dialog.visible = false;
};
if (level == Consts.ShopLevel3){
engine.playWindow.ui.upgrade_dialog.visible = false;
} else {
engine.playWindow.ui.upgrade_dialog.money_txt.text = (DataProxy.getBuildCost(shopType, (currentLevel + 1)).toString() + "$");
};
engine.playWindow.ui.repair_dialog.money_txt.text = (getRepairCost().toString() + "$");
engine.playWindow.ui.sell_dialog.money_txt.text = (getSellCost().toString() + "$");
}
}
}//package fai.logic
Section 34
//Shops (fai.logic.Shops)
package fai.logic {
import flash.events.*;
public class Shops {
private var engine:Engine;// = null
private var building_type:String;
private var shops:Array;
public function Shops(_arg1:Engine):void{
engine = null;
shops = [];
super();
engine = _arg1;
}
public function size():int{
return (shops.length);
}
public function getItem(_arg1:int):ShopItem{
return (shops[_arg1]);
}
public function hideBuildingIcons():void{
var _local1:int;
building_type = "";
_local1 = 0;
_local1 = 0;
while (_local1 < size()) {
if (shops[_local1].awaitsBuilding){
shops[_local1].hideBuildingState();
shops[_local1].visible = false;
};
_local1++;
};
engine.playWindow.updateAll();
}
public function get buildingType():String{
return (building_type);
}
public function showBuildingIcons(_arg1:String):void{
var _local2:int;
building_type = _arg1;
hideMenus();
_local2 = 0;
_local2 = 0;
while (_local2 < size()) {
if (shops[_local2].currentLevel == 0){
shops[_local2].setBuildingState(_arg1);
};
_local2++;
};
engine.playWindow.updateAll();
engine.extras.cancelSketchyState();
}
public function awaitBuilding():Boolean{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < size()) {
if (shops[_local1].awaitsBuilding){
return (true);
};
_local1++;
};
return (false);
}
public function getItemByType(_arg1:String):ShopItem{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < shops.length) {
if (shops[_local2].shopType == _arg1){
return (shops[_local2]);
};
_local2++;
};
return (null);
}
public function addItem(_arg1:ShopItem):void{
_arg1.setNumber(shops.length);
shops.push(_arg1);
}
public function hideMenus():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < size()) {
shops[_local1].showMenu(false);
_local1++;
};
}
public function hasType(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
_local2 = 0;
while (_local2 < shops.length) {
if (((((!((shops[_local2] == null))) && ((shops[_local2].currentLevel > 0)))) && ((shops[_local2].shopType == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public function destroy():void{
}
}
}//package fai.logic
Section 35
//ShopSeat (fai.logic.ShopSeat)
package fai.logic {
public class ShopSeat {
public var loaded:Boolean;// = false
public var percents:Number;// = 0
public var velocity:Number;// = 1
public var customer:Customer;// = null
public function ShopSeat():void{
loaded = false;
percents = 0;
velocity = 1;
customer = null;
super();
}
}
}//package fai.logic
Section 36
//Upgrades (fai.logic.Upgrades)
package fai.logic {
import fai.*;
public class Upgrades {
public var bus_stop:Boolean;// = false
private var engine:Engine;// = null
private var bus_loops:int;// = 0
public function Upgrades(_arg1:Engine):void{
bus_stop = false;
bus_loops = 0;
engine = null;
super();
engine = _arg1;
}
public function addBusLoop():void{
bus_loops++;
}
public function upgradeBusStop():void{
if (bus_stop){
return;
};
bus_stop = true;
engine.playWindow.ui.bus_stop.gotoAndPlay("start_animation");
engine.playWindow.ui.bus_stop_sign.gotoAndPlay("start_animation");
if (engine.scenario.currentDay > 0){
addBusLoop();
};
}
public function carsStopped():void{
if (bus_loops == 0){
return;
};
engine.playWindow.ui.car_motion.stop();
engine.playWindow.ui.bus_clip.gotoAndPlay("start_animation");
}
public function decBusLoop():void{
bus_loops--;
}
public function busWent():Boolean{
if (((!(bus_stop)) || ((bus_loops == 0)))){
return (true);
};
return (false);
}
public function nextDay():void{
if (bus_stop){
addBusLoop();
};
}
}
}//package fai.logic
Section 37
//CoinMotion (fai.ui.CoinMotion)
package fai.ui {
import flash.display.*;
public class CoinMotion extends MovieClip {
public var finished:Boolean;// = false
public function CoinMotion():void{
finished = false;
super();
addFrameScript(31, frame32);
}
function frame32(){
finished = true;
}
}
}//package fai.ui
Section 38
//CustomersBar (fai.ui.CustomersBar)
package fai.ui {
import flash.display.*;
public dynamic class CustomersBar extends Sprite {
public var bar:MovieClip;
}
}//package fai.ui
Section 39
//ExtraItem (fai.ui.ExtraItem)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.*;
public class ExtraItem extends MovieClip {
private var loaded:int;// = 0
private var seats:Array;
private var seats_length:int;// = 0
private var current_state:String;
private var engine:Engine;// = null
public var vice_versa:Boolean;// = false
private var awaits:Boolean;// = false
public var inner_extra:MovieClip;
public function ExtraItem():void{
var _local1:int;
engine = null;
awaits = false;
loaded = 0;
seats = [];
seats_length = 0;
vice_versa = false;
super();
addFrameScript(0, frame1, 1, frame2);
current_state = StringConsts.empty;
seats.length = 10;
_local1 = 0;
_local1 = 0;
while (_local1 < seats.length) {
seats[_local1] = null;
_local1++;
};
}
public function loadCustomer(_arg1:Customer):int{
var _local2:int;
if (hasRoom()){
_local2 = 0;
_local2 = 0;
while (_local2 < seats_length) {
if (seats[_local2] == null){
seats[_local2] = _arg1;
loaded++;
return ((_local2 + 1));
};
_local2++;
};
};
return (-1);
}
public function setCurrentState(_arg1:String):void{
current_state = _arg1;
correctState();
}
public function get isAwaiting():Boolean{
return (awaits);
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function setAwaiting(_arg1:Boolean):void{
awaits = _arg1;
}
public function correctState():void{
switch (current_state){
case StringConsts.bench:
inner_extra.gotoAndStop(StringConsts.bench);
seats_length = Consts.BenchSpace;
break;
case StringConsts.music_box:
inner_extra.gotoAndStop(StringConsts.music_box);
seats_length = Consts.MusicBoxSpace;
break;
case StringConsts.news_box:
inner_extra.gotoAndStop(StringConsts.news_box);
seats_length = Consts.NewsBoxSpace;
break;
case StringConsts.ice_cream:
inner_extra.gotoAndStop(StringConsts.ice_cream);
seats_length = Consts.IceCreamSpace;
break;
};
}
public function sell():void{
engine.returnMoney((DataProxy.getExtraBuildCost(current_state) * Consts.SellDownturn));
visible = false;
current_state = StringConsts.empty;
}
function frame1(){
stop();
correctState();
}
public function setNormalState():void{
gotoAndStop("normal");
correctState();
}
function frame2(){
correctState();
}
public function get currentState():String{
return (current_state);
}
public function hasRoom():Boolean{
switch (current_state){
case StringConsts.bench:
if (loaded >= Consts.BenchSpace){
return (false);
};
break;
case StringConsts.music_box:
if (loaded >= Consts.MusicBoxSpace){
return (false);
};
break;
case StringConsts.news_box:
if (loaded >= Consts.NewsBoxSpace){
return (false);
};
break;
case StringConsts.ice_cream:
if (loaded >= Consts.IceCreamSpace){
return (false);
};
break;
};
return (true);
}
public function setSketchyState():void{
gotoAndStop("sketchy");
correctState();
}
public function unloadCustomer(_arg1:Customer):void{
var _local2:int;
if (loaded > 0){
_local2 = 0;
_local2 = 0;
while (_local2 < seats_length) {
if (seats[_local2] == _arg1){
seats[_local2] = null;
loaded--;
return;
};
_local2++;
};
};
}
}
}//package fai.ui
Section 40
//LevelButton (fai.ui.LevelButton)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.filters.*;
public class LevelButton extends MovieClip {
public var filter_back:MovieClip;
private var engine:Engine;// = null
private var level_id:int;// = 0
public var red_back:MovieClip;
public var won_back:MovieClip;
public function LevelButton():void{
engine = null;
level_id = 0;
super();
}
public function select(_arg1:Boolean):void{
var _local2:BitmapFilter;
var _local3:Array;
if (_arg1){
_local2 = getBitmapFilter();
_local3 = new Array();
_local3.push(_local2);
filter_back.filters = _local3;
} else {
filter_back.filters = new Array();
};
}
public function levelClosed():void{
clear();
red_back.visible = true;
won_back.visible = false;
}
public function levelCurrent():void{
clear();
red_back.visible = true;
won_back.visible = false;
startAnimation();
}
public function levelWon():void{
clear();
won_back.visible = true;
red_back.visible = false;
}
public function initialize(_arg1:Engine, _arg2:int):void{
engine = _arg1;
level_id = _arg2;
buttonMode = true;
mouseChildren = false;
}
public function clear():void{
stopAnimation();
}
public function stopAnimation():void{
}
public function startAnimation():void{
stopAnimation();
}
public function get levelId():int{
return (level_id);
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number;
_local1 = 9540095;
_local2 = 1;
_local3 = 35;
_local4 = 35;
_local5 = 3;
_local6 = false;
_local7 = false;
_local8 = BitmapFilterQuality.HIGH;
return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7));
}
}
}//package fai.ui
Section 41
//LevelInfoPanel (fai.ui.LevelInfoPanel)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.text.*;
public class LevelInfoPanel extends MovieClip {
public var resume_game_button:SimpleButton;
public var title:TextField;
public var desc:TextField;
public var days_txt:TextField;
public var play_button:SimpleButton;
public var goal_amount_txt:TextField;
public function showLevelInfo(_arg1:Level):void{
if (_arg1){
title.text = _arg1.type;
days_txt.text = _arg1.days.toString();
goal_amount_txt.text = (_arg1.money_goal.toString() + "$");
};
}
}
}//package fai.ui
Section 42
//LevelSelection (fai.ui.LevelSelection)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import flash.utils.*;
import fai.*;
import flash.net.*;
public class LevelSelection extends Sprite {
private var level_msg_timer:Timer;// = null
public var instructions_button:SimpleButton;
public var hello_mc:MovieClip;
public var sound_control:MovieClip;
public var level2:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var level7:MovieClip;
public var level1:MovieClip;
public var level9:MovieClip;
public var level3:MovieClip;
public var level4:MovieClip;
public var level8:MovieClip;
public var current_level:int;// = 0
public var dedegames_button:SimpleButton;
private var engine:Engine;// = null
private var music_sound:Sound;// = null
public var level_msg:MovieClip;
public var level_info:MovieClip;
private var hello_closed:Boolean;// = false
private var level_array:Array;
public var music_channel:SoundChannel;// = null
public function LevelSelection():void{
engine = null;
current_level = 0;
level_array = [];
level_msg_timer = null;
hello_closed = false;
music_sound = null;
music_channel = null;
super();
}
private function resumeGameClickHandler(_arg1:MouseEvent):void{
visible = false;
stopMusic();
engine.playSound(SoundConsts.click);
engine.play_window.show();
engine.pause();
}
public function loadLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal("build_your_resort_4", "/");
current_level = _local1.data.current_level;
}
public function initializeLevelButtons(_arg1:Array):void{
var _local2:int;
var _local3:LevelButton;
_local2 = 0;
_local2 = 0;
while (_local2 < level_array.length) {
_local3 = level_array[_local2];
_local3.initialize(engine, _local2);
_local3.addEventListener(MouseEvent.MOUSE_DOWN, levelClickHandler);
_local3.addEventListener(MouseEvent.MOUSE_OVER, levelOverHandler);
_local3.addEventListener(MouseEvent.MOUSE_OUT, levelOutHandler);
_local2++;
};
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function saveLevels():void{
var _local1:*;
_local1 = SharedObject.getLocal("build_your_resort_4", "/");
_local1.data.current_level = current_level;
_local1.flush();
}
private function playNextClickHanler(_arg1:MouseEvent):void{
hello_closed = true;
hello_mc.visible = false;
engine.playSound(SoundConsts.click);
playLevel(current_level);
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (!engine.volumeOff){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, 99999, _local1);
};
}
public function initialize(_arg1:Engine):void{
var _local2:Array;
engine = _arg1;
level_info.play_button.addEventListener(MouseEvent.MOUSE_DOWN, playNextClickHanler);
level_info.resume_game_button.addEventListener(MouseEvent.MOUSE_DOWN, resumeGameClickHandler);
level_info.resume_game_button.visible = false;
hello_mc.start_button.addEventListener(MouseEvent.MOUSE_DOWN, startHelloHandler);
level_msg_timer = new Timer(1000, 0);
level_msg_timer.addEventListener(TimerEvent.TIMER, levelMsgTimer);
level_msg_timer.stop();
level_msg.visible = false;
level_msg.stop();
level_array = [level1, level2, level3, level4, level5, level6, level7, level8, level9];
music_sound = new Sound_music();
sound_control.setEngine(engine);
_local2 = engine.gameData.getLevels();
initializeLevelButtons(_local2);
setLevel(0);
loadLevels();
updateLevels();
dedegames_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
}
public function updateLevels():void{
var _local1:int;
_local1 = 0;
_local1 = 0;
while (_local1 < level_array.length) {
if (_local1 < current_level){
level_array[_local1].levelWon();
} else {
if (_local1 == current_level){
level_array[_local1].levelCurrent();
} else {
level_array[_local1].levelClosed();
};
};
_local1++;
};
}
public function clear():void{
}
private function levelClickHandler(_arg1:MouseEvent):void{
var _local2:int;
if ((_arg1.currentTarget is LevelButton)){
engine.playSound(SoundConsts.click);
_local2 = (_arg1.currentTarget as LevelButton).levelId;
if (_local2 <= current_level){
playLevel(_local2);
} else {
showLevelMessage();
};
};
}
private function showLevelMessage():void{
level_msg_timer.stop();
level_msg.msg.text = (("Level " + (current_level + 1).toString()) + " wasn't completed");
level_msg.visible = true;
level_msg_timer.start();
}
private function playLevel(_arg1:int):void{
hello_closed = true;
hello_mc.visible = false;
visible = false;
stopMusic();
if (_arg1 < engine.gameData.getLevels().length){
engine.playLevel(engine.gameData.getLevel(_arg1));
} else {
engine.playLevel(engine.gameData.getLevel((engine.gameData.getLevels().length - 1)));
};
}
public function setLevel(_arg1:int):void{
var _local2:Level;
_local2 = engine.gameData.getLevel(_arg1);
level_info.showLevelInfo(_local2);
current_level = _arg1;
}
private function levelOverHandler(_arg1:MouseEvent):void{
if ((_arg1.currentTarget is LevelButton)){
_arg1.currentTarget.select(true);
};
}
private function levelOutHandler(_arg1:MouseEvent):void{
if ((_arg1.currentTarget is LevelButton)){
_arg1.currentTarget.select(false);
};
}
private function startHelloHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
hello_closed = true;
hello_mc.visible = false;
}
private function instructionsHandler(_arg1:MouseEvent):void{
}
private function levelMsgTimer(_arg1:TimerEvent):void{
level_msg.visible = false;
}
public function show():void{
if (engine.playWindow != null){
level_info.play_button.visible = false;
level_info.resume_game_button.visible = true;
} else {
level_info.play_button.visible = true;
level_info.resume_game_button.visible = false;
};
updateLevels();
saveLevels();
setLevel(current_level);
playMusic();
if ((((0 == current_level)) && (!(hello_closed)))){
hello_mc.visible = true;
} else {
hello_mc.visible = false;
};
visible = true;
}
}
}//package fai.ui
Section 43
//RoadPath (fai.ui.RoadPath)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.common.*;
import fai.*;
public dynamic class RoadPath extends MovieClip {
public var points:Map;// = null
public function RoadPath():void{
points = null;
super();
}
public function initialize():void{
var _local1:int;
var _local2:int;
var _local3:*;
points = new Map();
_local1 = numChildren;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
_local3 = getChildAt(_local2);
if ((_local3 is RoadPoint)){
points.add(_local3.name, _local3);
};
_local2++;
};
}
public function firstNode():RoadPoint{
return (points.values[0]);
}
}
}//package fai.ui
Section 44
//ShopBuilding (fai.ui.ShopBuilding)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import fai.*;
public class ShopBuilding extends MovieClip {
public var shop_holder:MovieClip;
private var shop_sprite;// = null
private var parent_item:ShopItem;// = null
public function ShopBuilding(_arg1:ShopItem, _arg2):void{
shop_sprite = null;
parent_item = null;
super();
addFrameScript(29, frame30);
shop_sprite = _arg2;
parent_item = _arg1;
if (shop_holder){
shop_sprite.x = (-(shop_sprite.width) / 2);
shop_holder.addChild(shop_sprite);
};
}
function frame30(){
stop();
finish();
}
public function finish():void{
shop_sprite.x = 3;
shop_sprite.y = ((parent_item.height - shop_sprite.height) + 20);
parent_item.setShopIcon(shop_sprite);
parent_item.setLevel(Consts.ShopLevel1);
parent_item.updateState();
}
}
}//package fai.ui
Section 45
//ShopButton (fai.ui.ShopButton)
package fai.ui {
import fai.logic.*;
import flash.display.*;
public class ShopButton extends MovieClip {
public var button_stars:MovieClip;
public var icon_holder:MovieClip;
private var engine:Engine;// = null
private var type:String;
public function ShopButton():void{
engine = null;
super();
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
}
public function updateButton(_arg1, _arg2):void{
}
public function get buttonType():String{
return (type);
}
public function setType(_arg1:String):void{
type = _arg1;
}
}
}//package fai.ui
Section 46
//ShopCustomerBar (fai.ui.ShopCustomerBar)
package fai.ui {
import fai.logic.*;
import flash.display.*;
import flash.text.*;
import fai.goals.*;
public class ShopCustomerBar extends Sprite {
private var shop_capacity:int;// = 0
private var seats:Array;// = null
public var bar:MovieClip;
private var engine:Engine;// = null
public var count_txt:TextField;
private var seats_goal:SeatsGoal;// = null
private var shop:ShopItem;// = null
public function ShopCustomerBar():void{
engine = null;
seats_goal = null;
shop = null;
seats = null;
shop_capacity = 0;
super();
}
public function create(_arg1:int):void{
var _local2:int;
destroy();
seats = new Array();
shop_capacity = _arg1;
_local2 = 0;
_local2 = 0;
while (_local2 < shop_capacity) {
seats.push(new ShopSeat());
_local2++;
};
seats_goal = new SeatsGoal(engine, seats, shop);
engine.goal_system.add(seats_goal);
visible = true;
bar.visible = false;
update();
}
public function wereCreated():Boolean{
return (!((seats_goal == null)));
}
public function hasRoom():Boolean{
if (!seats_goal){
return (false);
};
return ((seats_goal.loadedCount < shop_capacity));
}
public function isFree():Boolean{
if (!seats_goal){
return (true);
};
return ((seats_goal.loadedCount == 0));
}
public function update():void{
if (seats_goal){
count_txt.text = ((seats_goal.loadedCount.toString() + "/") + shop_capacity.toString());
if (seats_goal.loadedCount){
bar.visible = true;
bar.scaleX = (seats_goal.loadedCount / shop_capacity);
} else {
bar.visible = false;
};
};
}
public function load(_arg1:Customer):ShopSeat{
return (seats_goal.loadCustomer(_arg1));
}
public function assign(_arg1:Engine, _arg2:ShopItem):void{
engine = _arg1;
shop = _arg2;
}
public function destroy():void{
if (seats_goal){
seats_goal.deactivate();
seats_goal = null;
};
if (seats){
seats.length = 0;
seats = null;
};
}
}
}//package fai.ui
Section 47
//SoundControlMC (fai.ui.SoundControlMC)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import fl.controls.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import fl.events.*;
public class SoundControlMC extends MovieClip {
private var sound_slider:Slider;// = null
public var engine:Engine;// = null
public function SoundControlMC():void{
engine = null;
sound_slider = null;
super();
sound_slider = new Slider();
sound_slider.liveDragging = true;
sound_slider.setSize(100, 0);
sound_slider.maximum = 100;
sound_slider.minimum = 0;
sound_slider.tickInterval = 5;
sound_slider.addEventListener(SliderEvent.CHANGE, musicChange);
sound_slider.x = 60;
sound_slider.y = -10;
addChild(sound_slider);
sound_slider.value = 100;
}
public function destroy():void{
sound_slider.removeEventListener(SliderEvent.CHANGE, musicChange);
removeChild(sound_slider);
sound_slider = null;
}
private function musicChange(_arg1:SliderEvent):void{
var _local2:SoundTransform;
engine.volume = (sound_slider.value / 100);
if (GameStage.welcomeScreen.levelSelection.music_channel){
_local2 = GameStage.welcomeScreen.levelSelection.music_channel.soundTransform;
_local2.volume = engine.volume;
GameStage.welcomeScreen.levelSelection.music_channel.soundTransform = _local2;
};
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
sound_slider.value = (engine.volume * 100);
}
}
}//package fai.ui
Section 48
//Statistics (fai.ui.Statistics)
package fai.ui {
import fai.logic.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.common.*;
import flash.utils.*;
import fai.*;
public class Statistics extends Sprite {
public var dede_games:MovieClip;
public var stat_caption:MovieClip;
public var bonus:int;// = 0
private var replay_music_count:int;// = 1
public var spent_txt:TextField;
public var built_txt:TextField;
public var score_txt:TextField;
private var engine:Engine;// = null
public var bonus_txt:TextField;
public var final_victory:MovieClip;
public var spent:int;// = 0
private var music_sound:Sound;// = null
public var earned:int;// = 0
public var built:int;// = 0
private var score:int;// = 0
public var earned_txt:TextField;
private var counterTimer:Timer;// = null
public var sad_smileys:MovieClip;
public var happy_smileys:MovieClip;
public var continue_button:SimpleButton;
public var firework1:MovieClip;
public var firework2:MovieClip;
public var music_channel:SoundChannel;// = null
private var back:AnimatedBitmap;// = null
public function Statistics():void{
earned = 0;
spent = 0;
built = 0;
bonus = 0;
score = 0;
engine = null;
counterTimer = null;
back = null;
music_sound = null;
music_channel = null;
replay_music_count = 1;
super();
}
public function victory():void{
firework1.play();
firework2.play();
stat_caption.innerc.stat_title.text = "Well Done!";
continue_button.visible = true;
happy_smileys.visible = true;
sad_smileys.visible = false;
engine.playSound(SoundConsts.victory);
music_sound = new Sound_final_victory();
replay_music_count = 2;
}
private function counter(_arg1, _arg2:int):int{
var _local3:int;
if (_arg2 > 0){
_local3 = ((_arg2 > 30)) ? (_arg2 / 30) : _arg2;
_arg1.text = (int(_arg1.text) + _local3).toString();
return (_local3);
};
return (0);
}
public function setEngine(_arg1:Engine):void{
engine = _arg1;
continue_button.addEventListener(MouseEvent.MOUSE_DOWN, showLevels);
dede_games.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
happy_smileys.visible = false;
sad_smileys.visible = false;
firework1.stop();
firework2.stop();
}
public function stopMusic():void{
if (music_channel){
music_channel.stop();
music_channel = null;
};
}
public function start():void{
playMusic();
earned_txt.text = "0";
spent_txt.text = "0";
built_txt.text = "0";
bonus_txt.text = "0";
score_txt.text = "0";
score = engine.score;
counterTimer = new Timer(30, 0);
counterTimer.addEventListener(TimerEvent.TIMER, counterTick);
counterTimer.start();
}
public function playMusic():void{
var _local1:SoundTransform;
stopMusic();
if (((!(engine.volumeOff)) && (music_sound))){
_local1 = new SoundTransform();
_local1.volume = engine.volume;
music_channel = music_sound.play(0, replay_music_count, _local1);
};
}
public function defeat():void{
stat_caption.innerc.stat_title.text = "Failed. Try Again!";
happy_smileys.visible = false;
sad_smileys.visible = true;
music_sound = new Sound_sigh();
}
private function playAgain(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.playLevel(engine.lastLevel);
}
private function mainMenu(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
GameStage.welcomeScreen.showWelcome();
}
private function counterTick(_arg1:TimerEvent):void{
earned = (earned - counter(earned_txt, earned));
spent = (spent - counter(spent_txt, spent));
built = (built - counter(built_txt, built));
bonus = (bonus - counter(bonus_txt, bonus));
score = (score - counter(score_txt, score));
if (((((earned + spent) + built) + bonus) + score) == 0){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
}
private function showLevels(_arg1:MouseEvent):void{
visible = false;
engine.playSound(SoundConsts.click);
engine.clearAll();
if (engine.lastLevel.number >= (engine.gameData.getLevels().length - 1)){
GameStage.welcomeScreen.showWelcome();
} else {
GameStage.welcomeScreen.showLevelSelection();
};
}
public function destroy():void{
if (counterTimer){
counterTimer.stop();
counterTimer.removeEventListener(TimerEvent.TIMER, counterTick);
counterTimer = null;
};
stopMusic();
dede_games.removeEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, showLevels);
}
}
}//package fai.ui
Section 49
//TutorialMC (fai.ui.TutorialMC)
package fai.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import fai.*;
public class TutorialMC extends MovieClip {
public var next_button:SimpleButton;
public var close_button:SimpleButton;
private var engine:Engine;// = null
public var page1:MovieClip;
public var current_page:String;// = "page1"
public function TutorialMC():void{
engine = null;
current_page = "page1";
super();
addFrameScript(0, frame1);
}
public function destroy():void{
next_button.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
close_button.removeEventListener(MouseEvent.MOUSE_DOWN, skipClick);
}
public function init(_arg1:Engine):void{
engine = _arg1;
next_button.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
close_button.addEventListener(MouseEvent.MOUSE_DOWN, skipClick);
}
private function continueClick(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
switch (current_page){
case "page1":
gotoPage("page2");
break;
case "page2":
gotoPage("page3");
break;
default:
gotoPage("page1");
break;
};
}
private function skipClick(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
hideTutorial();
}
function frame1(){
stop();
}
public function showTutorial():void{
gotoPage("page1");
visible = true;
}
public function gotoPage(_arg1:String):void{
current_page = _arg1;
gotoAndStop(_arg1);
}
private function hideTutorial():void{
destroy();
visible = false;
}
}
}//package fai.ui
Section 50
//WelcomeScreen (fai.ui.WelcomeScreen)
package fai.ui {
import fai.logic.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fai.*;
public dynamic class WelcomeScreen extends MovieClip {
public var more_games_button:SimpleButton;
private var engine:Engine;// = null
private var level_selection:LevelSelection;// = null
public var start_game_button:SimpleButton;
private var initialized:Boolean;// = false
public function WelcomeScreen():void{
level_selection = null;
engine = null;
initialized = false;
super();
}
private function startGameHandler(_arg1:MouseEvent):void{
showLevelSelection();
}
public function get levelSelection():LevelSelection{
return (level_selection);
}
public function initialize():void{
start_game_button.addEventListener(MouseEvent.MOUSE_DOWN, startGameHandler);
more_games_button.addEventListener(MouseEvent.MOUSE_DOWN, GameStage.sponsorClick);
GameStage.play_holder = new Sprite();
addChild(GameStage.play_holder);
engine = new Engine(GameStage.main_stage);
level_selection = new LevelSelection();
level_selection.initialize(engine);
level_selection.visible = false;
GameStage.play_holder.addChild(level_selection);
}
public function clear():void{
if (engine){
level_selection.stopMusic();
removeChild(GameStage.play_holder);
engine.clearAll();
engine = null;
};
}
public function showWelcome():void{
visible = true;
level_selection.visible = false;
}
public function showLevelSelection():void{
if (!level_selection){
return;
};
level_selection.show();
}
private function hsHandler(_arg1:MouseEvent):void{
engine.playSound(SoundConsts.click);
}
private function instructionsHandler(_arg1:MouseEvent):void{
}
}
}//package fai.ui
Section 51
//Consts (fai.Consts)
package fai {
public class Consts {
public static const NewsBoxSpace:int = 5;
public static const CustomerWalkRange:int = 25;
public static const ScreenWidth:int = 700;
public static const MusicBoxSpace:int = 5;
public static const Left:uint = 0;
public static const SellDownturn:Number = 0.8;
public static const Top:uint = 2;
public static const Down:uint = 3;
public static const BusPeopleCount:int = 10;
public static const CustomerShopEnteringLine:int = 275;
public static const ScreenHeight:int = 525;
public static const BenchSpace:int = 3;
public static const SpriteWidth:int = 20;
public static const ShopLevel1:int = 1;
public static const IcecreamCost:int = 15;
public static const ShopLevel3:int = 3;
public static const NewspaperCost:int = 5;
public static const ExtraLiveTime:int = 800;
public static const ShopLevel2:int = 2;
public static const SpriteHeight:int = 35;
public static const GOALSCLEANPAUSE:uint = 10;
public static const IceCreamSpace:int = 5;
public static const ShopBuilding:int = 4;
public static const ShopUpgrading:int = 5;
public static const ShopHealthPortion:Number = 0.3;
public static const CustomerWalkLine:int = 290;
public static const Right:uint = 1;
}
}//package fai
Section 52
//SoundConsts (fai.SoundConsts)
package fai {
public final class SoundConsts {
public static var coins:int = 4;
public static var click:int = 3;
public static var repair:int = 8;
public static var alarm:int = 9;
public static var victory:int = 0;
public static var build:int = 1;
public static var fire:int = 6;
public static var sigh:int = 2;
public static var final_victory:int = 11;
public static var sell:int = 10;
public static var new_day:int = 5;
public static var police:int = 7;
}
}//package fai
Section 53
//StringConsts (fai.StringConsts)
package fai {
public class StringConsts {
public static const super_market:String = "Super Market";
public static const pet_shop:String = "Pet Shop";
public static const not_enough_money:String = "You don't have enough money.";
public static const police:String = "Police";
public static const level10:String = "Level 10";
public static const nclub:String = "Night Club";
public static const level12:String = "Level 12";
public static const level13:String = "Level 13";
public static const level14:String = "Level 14";
public static const level15:String = "Level 15";
public static const level16:String = "Level 16";
public static const level11:String = "Level 11";
public static const level1:String = "Level 1";
public static const level2:String = "Level 2";
public static const level3:String = "Level 3";
public static const level4:String = "Level 4";
public static const level5:String = "Level 5";
public static const level6:String = "Level 6";
public static const level7:String = "Level 7";
public static const level8:String = "Level 8";
public static const level9:String = "Level 9";
public static const bench:String = "Benches";
public static const computers:String = "Computers";
public static const fire_dept:String = "Fire Dept";
public static const toy_store:String = "Toy Store";
public static const music_box:String = "Music Box";
public static const empty:String = "Empty";
public static const jewelry:String = "Jewelry";
public static const ice_cream:String = "Ice Cream";
public static const news_box:String = "News Box";
public static const food:String = "Food";
public static const boutique:String = "Boutique";
}
}//package fai
Section 54
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.events.*;
import flash.utils.*;
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 55
//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 56
//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 57
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 58
//Slider (fl.controls.Slider)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class Slider extends UIComponent implements IFocusManagerComponent {
protected var _direction:String;
protected var _liveDragging:Boolean;// = false
protected var _value:Number;// = 0
protected var _snapInterval:Number;// = 0
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var track:BaseButton;
protected var _tickInterval:Number;// = 0
protected var tickContainer:Sprite;
protected var thumb:BaseButton;
protected static const TICK_STYLES:Object = {upSkin:"tickSkin"};
protected static const TRACK_STYLES:Object = {upSkin:"sliderTrackSkin", overSkin:"sliderTrackSkin", downSkin:"sliderTrackSkin", disabledSkin:"sliderTrackDisabledSkin"};
protected static const THUMB_STYLES:Object = {upSkin:"thumbUpSkin", overSkin:"thumbOverSkin", downSkin:"thumbDownSkin", disabledSkin:"thumbDisabledSkin"};
protected static var defaultStyles:Object = {thumbUpSkin:"SliderThumb_upSkin", thumbOverSkin:"SliderThumb_overSkin", thumbDownSkin:"SliderThumb_downSkin", thumbDisabledSkin:"SliderThumb_disabledSkin", sliderTrackSkin:"SliderTrack_skin", sliderTrackDisabledSkin:"SliderTrack_disabledSkin", tickSkin:"SliderTick_skin", focusRectSkin:null, focusRectPadding:null};
public function Slider(){
_direction = SliderDirection.HORIZONTAL;
_minimum = 0;
_maximum = 10;
_value = 0;
_tickInterval = 0;
_snapInterval = 0;
_liveDragging = false;
super();
setStyles();
}
public function get minimum():Number{
return (_minimum);
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
this.value = Math.max(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get maximum():Number{
return (_maximum);
}
protected function positionThumb():void{
thumb.x = ((((_direction)==SliderDirection.VERTICAL) ? ((maximum - minimum) - value) : (value - minimum) / (maximum - minimum)) * _width);
}
protected function clearTicks():void{
if (((!(tickContainer)) || (!(tickContainer.parent)))){
return;
};
removeChild(tickContainer);
}
protected function onTrackClick(_arg1:MouseEvent):void{
calculateValue(track.mouseX, InteractionInputType.MOUSE, SliderEventClickTarget.TRACK);
if (!liveDragging){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.TRACK, InteractionInputType.MOUSE));
};
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
this.value = Math.min(_arg1, this.value);
invalidate(InvalidationType.DATA);
}
public function get liveDragging():Boolean{
return (_liveDragging);
}
protected function doDrag(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_width / snapInterval);
_local3 = track.mouseX;
calculateValue(_local3, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_DRAG, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
if (!enabled){
return;
};
_local2 = ((snapInterval)>0) ? snapInterval : 1;
_local4 = (direction == SliderDirection.HORIZONTAL);
if ((((((_arg1.keyCode == Keyboard.DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.LEFT)) && (_local4))))){
_local3 = (value - _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.RIGHT)) && (_local4))))){
_local3 = (value + _local2);
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_DOWN)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.HOME)) && (_local4))))){
_local3 = minimum;
} else {
if ((((((_arg1.keyCode == Keyboard.PAGE_UP)) && (!(_local4)))) || ((((_arg1.keyCode == Keyboard.END)) && (_local4))))){
_local3 = maximum;
};
};
};
};
if (!isNaN(_local3)){
_arg1.stopPropagation();
doSetValue(_local3, InteractionInputType.KEYBOARD, null, _arg1.keyCode);
};
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
super.enabled = _arg1;
track.enabled = (thumb.enabled = _arg1);
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_PRESS, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
}
public function get snapInterval():Number{
return (_snapInterval);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
dispatchEvent(new SliderEvent(SliderEvent.THUMB_RELEASE, value, InteractionInputType.MOUSE, SliderEventClickTarget.THUMB));
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, SliderEventClickTarget.THUMB, InteractionInputType.MOUSE));
}
public function set liveDragging(_arg1:Boolean):void{
_liveDragging = _arg1;
}
public function set value(_arg1:Number):void{
doSetValue(_arg1);
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
_direction = _arg1;
_local2 = (_direction == SliderDirection.VERTICAL);
if (isLivePreview){
if (_local2){
setScaleY(-1);
y = track.height;
} else {
setScaleY(1);
y = 0;
};
positionThumb();
return;
};
if (((_local2) && (componentInspectorSetting))){
if ((rotation % 90) == 0){
setScaleY(-1);
};
};
if (!componentInspectorSetting){
rotation = (_local2) ? 90 : 0;
};
}
public function set tickInterval(_arg1:Number):void{
_tickInterval = _arg1;
invalidate(InvalidationType.SIZE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
track.setSize(_width, track.height);
track.drawNow();
thumb.drawNow();
};
if (tickInterval > 0){
drawTicks();
} else {
clearTicks();
};
positionThumb();
super.draw();
}
override protected function configUI():void{
super.configUI();
thumb = new BaseButton();
thumb.setSize(13, 13);
thumb.autoRepeat = false;
addChild(thumb);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
track = new BaseButton();
track.move(0, 0);
track.setSize(80, 4);
track.autoRepeat = false;
track.useHandCursor = false;
track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
addChildAt(track, 0);
}
public function set snapInterval(_arg1:Number):void{
_snapInterval = _arg1;
}
public function get value():Number{
return (_value);
}
public function get direction():String{
return (_direction);
}
public function get tickInterval():Number{
return (_tickInterval);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if ((((_direction == SliderDirection.VERTICAL)) && (!(isLivePreview)))){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
invalidate(InvalidationType.SIZE);
}
protected function drawTicks():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:uint;
var _local5:DisplayObject;
clearTicks();
tickContainer = new Sprite();
_local1 = ((maximum)<1) ? (tickInterval / 100) : tickInterval;
_local2 = ((maximum - minimum) / _local1);
_local3 = (_width / _local2);
_local4 = 0;
while (_local4 <= _local2) {
_local5 = getDisplayObjectInstance(getStyleValue("tickSkin"));
_local5.x = (_local3 * _local4);
_local5.y = ((track.y - _local5.height) - 2);
tickContainer.addChild(_local5);
_local4++;
};
addChild(tickContainer);
}
protected function calculateValue(_arg1:Number, _arg2:String, _arg3:String, _arg4:int=undefined):void{
var _local5:Number;
_local5 = ((_arg1 / _width) * (maximum - minimum));
if (_direction == SliderDirection.VERTICAL){
_local5 = (maximum - _local5);
} else {
_local5 = (minimum + _local5);
};
doSetValue(_local5, _arg2, _arg3, _arg4);
}
protected function getPrecision(_arg1:Number):Number{
var _local2:String;
_local2 = _arg1.toString();
if (_local2.indexOf(".") == -1){
return (0);
};
return (_local2.split(".").pop().length);
}
protected function doSetValue(_arg1:Number, _arg2:String=null, _arg3:String=null, _arg4:int=undefined):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local5 = _value;
if (((!((_snapInterval == 0))) && (!((_snapInterval == 1))))){
_local6 = Math.pow(10, getPrecision(snapInterval));
_local7 = (_snapInterval * _local6);
_local8 = Math.round((_arg1 * _local6));
_local9 = (Math.round((_local8 / _local7)) * _local7);
_arg1 = (_local9 / _local6);
_value = Math.max(minimum, Math.min(maximum, _arg1));
} else {
_value = Math.max(minimum, Math.min(maximum, Math.round(_arg1)));
};
if (((!((_local5 == _value))) && (((((liveDragging) && (!((_arg3 == null))))) || ((_arg2 == InteractionInputType.KEYBOARD)))))){
dispatchEvent(new SliderEvent(SliderEvent.CHANGE, value, _arg3, _arg2, _arg4));
};
positionThumb();
}
protected function setStyles():void{
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 59
//SliderDirection (fl.controls.SliderDirection)
package fl.controls {
public class SliderDirection {
public static var HORIZONTAL:String = "horizontal";
public static var VERTICAL:String = "vertical";
}
}//package fl.controls
Section 60
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 61
//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 62
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
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 63
//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 64
//InteractionInputType (fl.events.InteractionInputType)
package fl.events {
public class InteractionInputType {
public static const MOUSE:String = "mouse";
public static const KEYBOARD:String = "keyboard";
}
}//package fl.events
Section 65
//SliderEvent (fl.events.SliderEvent)
package fl.events {
import flash.events.*;
public class SliderEvent extends Event {
protected var _triggerEvent:String;
protected var _keyCode:Number;
protected var _value:Number;
protected var _clickTarget:String;
public static const CHANGE:String = "change";
public static const THUMB_PRESS:String = "thumbPress";
public static const THUMB_DRAG:String = "thumbDrag";
public static const THUMB_RELEASE:String = "thumbRelease";
public function SliderEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:String, _arg5:int=0){
_value = _arg2;
_keyCode = _arg5;
_triggerEvent = _arg4;
_clickTarget = _arg3;
super(_arg1);
}
public function get clickTarget():String{
return (_clickTarget);
}
override public function clone():Event{
return (new SliderEvent(type, _value, _clickTarget, _triggerEvent, _keyCode));
}
override public function toString():String{
return (formatToString("SliderEvent", "type", "value", "bubbles", "cancelable", "keyCode", "triggerEvent", "clickTarget"));
}
public function get triggerEvent():String{
return (_triggerEvent);
}
public function get value():Number{
return (_value);
}
public function get keyCode():Number{
return (_keyCode);
}
}
}//package fl.events
Section 66
//SliderEventClickTarget (fl.events.SliderEventClickTarget)
package fl.events {
public class SliderEventClickTarget {
public static const TRACK:String = "track";
public static const THUMB:String = "thumb";
}
}//package fl.events
Section 67
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.events.*;
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 68
//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 69
//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 70
//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 71
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 72
//af7_804 (shopping_city_fla.af7_804)
package shopping_city_fla {
import flash.display.*;
public dynamic class af7_804 extends MovieClip {
public function af7_804(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package shopping_city_fla
Section 73
//BonusAnimation_307 (shopping_city_fla.BonusAnimation_307)
package shopping_city_fla {
import flash.display.*;
public dynamic class BonusAnimation_307 extends MovieClip {
public var inner:MovieClip;
public function BonusAnimation_307(){
addFrameScript(0, frame1, 89, frame90);
}
function frame90(){
stop();
visible = false;
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 74
//BonusAnimationInner_308 (shopping_city_fla.BonusAnimationInner_308)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BonusAnimationInner_308 extends MovieClip {
public var bonus_txt:TextField;
}
}//package shopping_city_fla
Section 75
//CustomerFace_424 (shopping_city_fla.CustomerFace_424)
package shopping_city_fla {
import flash.display.*;
public dynamic class CustomerFace_424 extends MovieClip {
public function CustomerFace_424(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 76
//ExtraButtons_337 (shopping_city_fla.ExtraButtons_337)
package shopping_city_fla {
import flash.display.*;
public dynamic class ExtraButtons_337 extends MovieClip {
public var news_box:SimpleButton;
public var music_box:SimpleButton;
public var ice_cream:SimpleButton;
public var benches:SimpleButton;
}
}//package shopping_city_fla
Section 77
//ExtraItemInner_438 (shopping_city_fla.ExtraItemInner_438)
package shopping_city_fla {
import flash.display.*;
public dynamic class ExtraItemInner_438 extends MovieClip {
public function ExtraItemInner_438(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 78
//fb_head_mc_187 (shopping_city_fla.fb_head_mc_187)
package shopping_city_fla {
import flash.display.*;
public dynamic class fb_head_mc_187 extends MovieClip {
public function fb_head_mc_187(){
addFrameScript(0, frame1, 12, frame13, 22, frame23);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame23(){
gotoAndStop("turnhead_stop");
}
}
}//package shopping_city_fla
Section 79
//fb_head_mc_844 (shopping_city_fla.fb_head_mc_844)
package shopping_city_fla {
import flash.display.*;
public dynamic class fb_head_mc_844 extends MovieClip {
public function fb_head_mc_844(){
addFrameScript(0, frame1, 12, frame13, 22, frame23);
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame23(){
gotoAndStop("turnhead_stop");
}
}
}//package shopping_city_fla
Section 80
//flonga_button3_430 (shopping_city_fla.flonga_button3_430)
package shopping_city_fla {
import flash.display.*;
public dynamic class flonga_button3_430 extends MovieClip {
public var fButton:SimpleButton;
}
}//package shopping_city_fla
Section 81
//flongabot_185 (shopping_city_fla.flongabot_185)
package shopping_city_fla {
import flash.display.*;
public dynamic class flongabot_185 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_185(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package shopping_city_fla
Section 82
//flongabot_842 (shopping_city_fla.flongabot_842)
package shopping_city_fla {
import flash.display.*;
public dynamic class flongabot_842 extends MovieClip {
public var fbHead:MovieClip;
public function flongabot_842(){
addFrameScript(0, frame1, 75, frame76, 88, frame89, 99, frame100);
}
public function doEndFly(){
this.gotoAndPlay("flying_end");
}
function frame76(){
gotoAndPlay("normal");
}
function frame89(){
gotoAndPlay("flying");
}
public function doNormal(){
this.gotoAndPlay("normal");
}
function frame1(){
}
function frame100(){
gotoAndPlay("normal");
}
public function doTurnhead(){
this.fbHead.gotoAndPlay("turnhead");
}
public function doNormalHead(){
this.fbHead.gotoAndPlay("normal");
}
public function doWink(){
this.fbHead.gotoAndPlay("wink_start");
}
public function doFly(){
this.gotoAndPlay("flying_start");
}
}
}//package shopping_city_fla
Section 83
//FlongaIntro_840 (shopping_city_fla.FlongaIntro_840)
package shopping_city_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.filters.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FlongaIntro_840 extends MovieClip {
public var flobot:MovieClip;
public function FlongaIntro_840(){
addFrameScript(0, frame1, 29, frame30, 62, frame63, 72, frame73, 92, frame93, 200, frame201, 0xFF, frame256);
}
function frame73(){
flobot.doTurnhead();
}
function frame201(){
flobot.doWink();
}
function frame93(){
flobot.doWink();
}
function frame1(){
}
function frame30(){
flobot.doFly();
}
function frame256(){
stop();
GameStage.itself.flongaFinished();
}
function frame63(){
flobot.doEndFly();
}
}
}//package shopping_city_fla
Section 84
//HelloMC_281 (shopping_city_fla.HelloMC_281)
package shopping_city_fla {
import flash.display.*;
public dynamic class HelloMC_281 extends MovieClip {
public var start_button:SimpleButton;
}
}//package shopping_city_fla
Section 85
//LevelClosedMessageMC_280 (shopping_city_fla.LevelClosedMessageMC_280)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelClosedMessageMC_280 extends MovieClip {
public var msg:TextField;
}
}//package shopping_city_fla
Section 86
//LevelGoalBar_306 (shopping_city_fla.LevelGoalBar_306)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class LevelGoalBar_306 extends MovieClip {
public var bar:MovieClip;
public var goal_txt:TextField;
}
}//package shopping_city_fla
Section 87
//Man1Sitting_94 (shopping_city_fla.Man1Sitting_94)
package shopping_city_fla {
import flash.display.*;
public dynamic class Man1Sitting_94 extends MovieClip {
public function Man1Sitting_94(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package shopping_city_fla
Section 88
//OutputMessage_335 (shopping_city_fla.OutputMessage_335)
package shopping_city_fla {
import flash.display.*;
public dynamic class OutputMessage_335 extends MovieClip {
public var msg:MovieClip;
public function OutputMessage_335(){
addFrameScript(34, frame35);
}
function frame35(){
visible = false;
stop();
}
}
}//package shopping_city_fla
Section 89
//OutputMessageInner_336 (shopping_city_fla.OutputMessageInner_336)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class OutputMessageInner_336 extends MovieClip {
public var msg_txt:TextField;
}
}//package shopping_city_fla
Section 90
//Page1_362 (shopping_city_fla.Page1_362)
package shopping_city_fla {
import flash.display.*;
public dynamic class Page1_362 extends MovieClip {
public var icon_holder:MovieClip;
public var repair_dialog:MovieClip;
public var upgrade_dialog:MovieClip;
public var sell_dialog:MovieClip;
}
}//package shopping_city_fla
Section 91
//PauseMC_359 (shopping_city_fla.PauseMC_359)
package shopping_city_fla {
import flash.display.*;
public dynamic class PauseMC_359 extends MovieClip {
public function PauseMC_359(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package shopping_city_fla
Section 92
//PreloaderBibbs_53 (shopping_city_fla.PreloaderBibbs_53)
package shopping_city_fla {
import flash.display.*;
public dynamic class PreloaderBibbs_53 extends MovieClip {
public function PreloaderBibbs_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 93
//PreloadingBibb3_52 (shopping_city_fla.PreloadingBibb3_52)
package shopping_city_fla {
import flash.display.*;
public dynamic class PreloadingBibb3_52 extends MovieClip {
public function PreloadingBibb3_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 94
//RepairDialog_332 (shopping_city_fla.RepairDialog_332)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class RepairDialog_332 extends MovieClip {
public var repair_button:SimpleButton;
public var money_txt:TextField;
}
}//package shopping_city_fla
Section 95
//Resources_305 (shopping_city_fla.Resources_305)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Resources_305 extends MovieClip {
public var wave_txt:TextField;
public var score_txt:TextField;
public var money_txt:TextField;
public var goal_bar:MovieClip;
}
}//package shopping_city_fla
Section 96
//SellDialog_329 (shopping_city_fla.SellDialog_329)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SellDialog_329 extends MovieClip {
public var money_txt:TextField;
public var sell_button:SimpleButton;
}
}//package shopping_city_fla
Section 97
//ShopButtonIconHolder_313 (shopping_city_fla.ShopButtonIconHolder_313)
package shopping_city_fla {
import flash.display.*;
public dynamic class ShopButtonIconHolder_313 extends MovieClip {
public function ShopButtonIconHolder_313(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 25, frame26, 27, frame28);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame19(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame22(){
stop();
}
function frame16(){
stop();
}
function frame8(){
stop();
}
function frame21(){
stop();
}
function frame2(){
stop();
}
function frame15(){
stop();
}
function frame23(){
stop();
}
function frame24(){
stop();
}
function frame28(){
stop();
}
function frame20(){
stop();
}
function frame11(){
stop();
}
function frame26(){
stop();
}
}
}//package shopping_city_fla
Section 98
//ShopSeat_835 (shopping_city_fla.ShopSeat_835)
package shopping_city_fla {
import flash.display.*;
public dynamic class ShopSeat_835 extends MovieClip {
public var fill_square:MovieClip;
public function ShopSeat_835(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package shopping_city_fla
Section 99
//ShopTooltip_309 (shopping_city_fla.ShopTooltip_309)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ShopTooltip_309 extends MovieClip {
public var title_txt:TextField;
public var params_txt:TextField;
public var tooltip_back:MovieClip;
public function ShopTooltip_309(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
title_txt.visible = false;
params_txt.visible = false;
stop();
}
function frame2(){
title_txt.visible = false;
params_txt.visible = false;
tooltip_back.gotoAndPlay("show_animation");
}
function frame11(){
title_txt.visible = true;
params_txt.visible = true;
stop();
tooltip_back.stop();
}
}
}//package shopping_city_fla
Section 100
//ShopTooltipBack_310 (shopping_city_fla.ShopTooltipBack_310)
package shopping_city_fla {
import flash.display.*;
public dynamic class ShopTooltipBack_310 extends MovieClip {
public function ShopTooltipBack_310(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package shopping_city_fla
Section 101
//Sitting_466 (shopping_city_fla.Sitting_466)
package shopping_city_fla {
import flash.display.*;
public dynamic class Sitting_466 extends MovieClip {
public function Sitting_466(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package shopping_city_fla
Section 102
//Sitting_638 (shopping_city_fla.Sitting_638)
package shopping_city_fla {
import flash.display.*;
public dynamic class Sitting_638 extends MovieClip {
public function Sitting_638(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package shopping_city_fla
Section 103
//Sitting_699 (shopping_city_fla.Sitting_699)
package shopping_city_fla {
import flash.display.*;
public dynamic class Sitting_699 extends MovieClip {
public function Sitting_699(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package shopping_city_fla
Section 104
//Sitting_760 (shopping_city_fla.Sitting_760)
package shopping_city_fla {
import flash.display.*;
public dynamic class Sitting_760 extends MovieClip {
public function Sitting_760(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package shopping_city_fla
Section 105
//Sndbibb_800 (shopping_city_fla.Sndbibb_800)
package shopping_city_fla {
import flash.display.*;
public dynamic class Sndbibb_800 extends MovieClip {
public function Sndbibb_800(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package shopping_city_fla
Section 106
//SoundsBibb_436 (shopping_city_fla.SoundsBibb_436)
package shopping_city_fla {
import flash.display.*;
public dynamic class SoundsBibb_436 extends MovieClip {
public function SoundsBibb_436(){
addFrameScript(2, frame3, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
}
}//package shopping_city_fla
Section 107
//StatCaption_418 (shopping_city_fla.StatCaption_418)
package shopping_city_fla {
import flash.display.*;
public dynamic class StatCaption_418 extends MovieClip {
public var innerc:MovieClip;
}
}//package shopping_city_fla
Section 108
//StatCaptionInner_419 (shopping_city_fla.StatCaptionInner_419)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class StatCaptionInner_419 extends MovieClip {
public var stat_title:TextField;
}
}//package shopping_city_fla
Section 109
//Symbol2_542 (shopping_city_fla.Symbol2_542)
package shopping_city_fla {
import flash.display.*;
public dynamic class Symbol2_542 extends MovieClip {
public function Symbol2_542(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package shopping_city_fla
Section 110
//Symbol2_588 (shopping_city_fla.Symbol2_588)
package shopping_city_fla {
import flash.display.*;
public dynamic class Symbol2_588 extends MovieClip {
public function Symbol2_588(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package shopping_city_fla
Section 111
//ThiefIcon_397 (shopping_city_fla.ThiefIcon_397)
package shopping_city_fla {
import flash.display.*;
public dynamic class ThiefIcon_397 extends MovieClip {
public var internal_animation:MovieClip;
}
}//package shopping_city_fla
Section 112
//UNDER_CONSTRUCTION_MC_178 (shopping_city_fla.UNDER_CONSTRUCTION_MC_178)
package shopping_city_fla {
import flash.display.*;
public dynamic class UNDER_CONSTRUCTION_MC_178 extends MovieClip {
public function UNDER_CONSTRUCTION_MC_178(){
addFrameScript(34, frame35);
}
function frame35(){
gotoAndPlay(1);
}
}
}//package shopping_city_fla
Section 113
//UpgradeDialog_326 (shopping_city_fla.UpgradeDialog_326)
package shopping_city_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradeDialog_326 extends MovieClip {
public var money_txt:TextField;
public var upgrade_button:SimpleButton;
}
}//package shopping_city_fla
Section 114
//BlueStar (BlueStar)
package {
import flash.display.*;
public dynamic class BlueStar extends Sprite {
}
}//package
Section 115
//BoutiqueIcon (BoutiqueIcon)
package {
import fai.ui.*;
public dynamic class BoutiqueIcon extends ShopButton {
public function BoutiqueIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 116
//BoutiqueShop (BoutiqueShop)
package {
import flash.display.*;
public dynamic class BoutiqueShop extends MovieClip {
public var platform:MovieClip;
public function BoutiqueShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 117
//BuildingProgressBar (BuildingProgressBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class BuildingProgressBar extends MovieClip {
public var bar:MovieClip;
public var percents:TextField;
}
}//package
Section 118
//ComputersShop (ComputersShop)
package {
import flash.display.*;
public dynamic class ComputersShop extends MovieClip {
public var platform:MovieClip;
public function ComputersShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 119
//Customer1 (Customer1)
package {
import flash.display.*;
public dynamic class Customer1 extends MovieClip {
public function Customer1(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 120
//Customer2 (Customer2)
package {
import flash.display.*;
public dynamic class Customer2 extends MovieClip {
public function Customer2(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 121
//Customer3 (Customer3)
package {
import flash.display.*;
public dynamic class Customer3 extends MovieClip {
public function Customer3(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 122
//Customer4 (Customer4)
package {
import flash.display.*;
public dynamic class Customer4 extends MovieClip {
public function Customer4(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 123
//Customer5 (Customer5)
package {
import flash.display.*;
public dynamic class Customer5 extends MovieClip {
public function Customer5(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 124
//Customer6 (Customer6)
package {
import flash.display.*;
public dynamic class Customer6 extends MovieClip {
public function Customer6(){
addFrameScript(0, frame1, 10, frame11, 12, frame13, 14, frame15, 16, frame17);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame13(){
stop();
}
function frame17(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 125
//Customer7 (Customer7)
package {
import flash.display.*;
public dynamic class Customer7 extends MovieClip {
public function Customer7(){
addFrameScript(0, frame1, 9, frame10, 11, frame12, 13, frame14, 15, frame16);
}
function frame10(){
stop();
}
function frame14(){
stop();
}
function frame12(){
stop();
}
function frame16(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 126
//CustomerMoney (CustomerMoney)
package {
import fai.ui.*;
import flash.display.*;
public dynamic class CustomerMoney extends MovieClip {
public var bar:CustomersBar;
public function CustomerMoney(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 127
//CustomerStar (CustomerStar)
package {
import flash.display.*;
public dynamic class CustomerStar extends MovieClip {
}
}//package
Section 128
//ElectronicsIcon (ElectronicsIcon)
package {
import fai.ui.*;
public dynamic class ElectronicsIcon extends ShopButton {
public function ElectronicsIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 129
//FireDept (FireDept)
package {
import flash.display.*;
public dynamic class FireDept extends MovieClip {
public var platform:MovieClip;
public var service_icon:MovieClip;
public function FireDept(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
service_icon.stop();
service_icon.visible = false;
}
}
}//package
Section 130
//FireDeptIcon (FireDeptIcon)
package {
import fai.ui.*;
public dynamic class FireDeptIcon extends ShopButton {
public function FireDeptIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 131
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 132
//FurnitureIcon (FurnitureIcon)
package {
import fai.ui.*;
public dynamic class FurnitureIcon extends ShopButton {
public function FurnitureIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 133
//GameStage (GameStage)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
public class GameStage extends MovieClip {
public var sponsor_games:SimpleButton;
private var atimer:Timer;// = null
public var wscreen:MovieClip;
public var loadingMC:MovieClip;
private var initialized:Boolean;// = false
public var flonga_clip:MovieClip;
private static var linkTimer:Timer = null;
private static var goto_window:String;
private static var goto_url:String;
private static var link1Timer:Timer = null;
public static var play_holder = null;
public static var main_stage = null;
public static var welcomeScreen;
public static var itself = null;
public function GameStage():void{
initialized = false;
atimer = null;
super();
addFrameScript(0, frame1, 4, frame5);
Security.allowDomain("*");
itself = this;
}
public function progressUpdate(_arg1:Event):void{
var _local2:Number;
_local2 = Math.round(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if ((loadingMC is MovieClip)){
loadingMC.progress_mc.gotoAndStop(_local2);
loadingMC.loaded_txt.text = (("Loading: " + _local2.toString()) + "%");
};
if (!!((this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal))){
loadingMC.removeEventListener(Event.ENTER_FRAME, progressUpdate);
loadingMC.progress_mc.stop();
loadingMC.progress_mc.visible = false;
removeChild(loadingMC);
loadingMC = null;
gotoAndStop(5);
};
}
private function handleUnload(_arg1:Event):void{
welcomeScreen.clear();
}
public function flongaFinished():void{
flonga_clip.visible = false;
this.removeChild(flonga_clip);
}
function frame1(){
loadingMC.addEventListener(Event.ENTER_FRAME, progressUpdate);
sponsor_games.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
stop();
if (initialized){
loadingMC.removeEventListener(Event.ENTER_FRAME, progressUpdate);
sponsor_games.removeEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
gotoAndStop(5);
};
}
function frame5(){
flonga_clip.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
this.initTheGame();
stop();
}
public function loadEnded():void{
wscreen.loadEnded();
}
public function initTheGame():void{
var _local1:ContextMenu;
if (initialized){
return;
};
main_stage = this.stage;
welcomeScreen = wscreen;
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
contextMenu = _local1;
initialized = true;
wscreen.initialize();
root.loaderInfo.addEventListener(Event.UNLOAD, handleUnload);
}
public static function sponsorClick(_arg1:MouseEvent):void{
var urlRequest:URLRequest;
var evt = _arg1;
try {
urlRequest = new URLRequest("http://www.flonga.com/");
navigateToURL(urlRequest, "_blank");
} catch(e:Error) {
};
}
}
}//package
Section 134
//IsoBeacon (IsoBeacon)
package {
import flash.display.*;
public dynamic class IsoBeacon extends MovieClip {
public var inner:MovieClip;
}
}//package
Section 135
//JewelryIcon (JewelryIcon)
package {
import fai.ui.*;
public dynamic class JewelryIcon extends ShopButton {
public function JewelryIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 136
//JewelryShop (JewelryShop)
package {
import flash.display.*;
public dynamic class JewelryShop extends MovieClip {
public var platform:MovieClip;
public function JewelryShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 137
//LevelBack1 (LevelBack1)
package {
import flash.display.*;
public dynamic class LevelBack1 extends MovieClip {
public var road1:RoadPath1;
public var level_ground:MovieClip;
public var back_customers:MovieClip;
}
}//package
Section 138
//LevelBack2 (LevelBack2)
package {
import flash.display.*;
public dynamic class LevelBack2 extends MovieClip {
public var road1:RoadPath2;
}
}//package
Section 139
//LevelBack3 (LevelBack3)
package {
import flash.display.*;
public dynamic class LevelBack3 extends MovieClip {
public var road1:RoadPath3;
}
}//package
Section 140
//LevelBack4 (LevelBack4)
package {
import flash.display.*;
public dynamic class LevelBack4 extends MovieClip {
public var road1:RoadPath4;
}
}//package
Section 141
//LevelBack5 (LevelBack5)
package {
import flash.display.*;
public dynamic class LevelBack5 extends MovieClip {
}
}//package
Section 142
//LevelBack6 (LevelBack6)
package {
import flash.display.*;
public dynamic class LevelBack6 extends MovieClip {
}
}//package
Section 143
//LevelBack7 (LevelBack7)
package {
import flash.display.*;
public dynamic class LevelBack7 extends MovieClip {
}
}//package
Section 144
//LevelBack8 (LevelBack8)
package {
import flash.display.*;
public dynamic class LevelBack8 extends MovieClip {
}
}//package
Section 145
//LevelBack9 (LevelBack9)
package {
import flash.display.*;
public dynamic class LevelBack9 extends MovieClip {
}
}//package
Section 146
//LoadingMC (LoadingMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadingMC extends MovieClip {
public var loaded_txt:TextField;
public var error_txt:TextField;
public var progress_mc:MovieClip;
}
}//package
Section 147
//NightClubShop (NightClubShop)
package {
import flash.display.*;
public dynamic class NightClubShop extends MovieClip {
public var platform:MovieClip;
public function NightClubShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 148
//PetShopIcon (PetShopIcon)
package {
import fai.ui.*;
public dynamic class PetShopIcon extends ShopButton {
public function PetShopIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 149
//PetShopShop (PetShopShop)
package {
import flash.display.*;
public dynamic class PetShopShop extends MovieClip {
public var platform:MovieClip;
public function PetShopShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 150
//PlayWindowUI (PlayWindowUI)
package {
import fai.ui.*;
import flash.display.*;
public dynamic class PlayWindowUI extends MovieClip {
public var next_day_button:SimpleButton;
public var back_holder:MovieClip;
public var fast_mode_button:SimpleButton;
public var slow_mode_button:SimpleButton;
public var menu_button:SimpleButton;
public var tutorial_mc:TutorialMC;
public var fire_dept_button:FireDeptIcon;
public var build_button:SimpleButton;
public var resources:MovieClip;
public var mute_button:SimpleButton;
public var extra_button:SimpleButton;
public var jewelry_button:JewelryIcon;
public var sound_button:SimpleButton;
public var extra_buttons:MovieClip;
public var bonus_animation:MovieClip;
public var boutique_button:BoutiqueIcon;
public var restaurant_button:RestaurantIcon;
public var pet_shop_button:PetShopIcon;
public var click_next_day_button:SimpleButton;
public var toy_store_button:ToyStoreIcon;
public var pause_mc:MovieClip;
public var computers_button:ElectronicsIcon;
public var customers:MovieClip;
public var repair_dialog:MovieClip;
public var market_button:SuperMarketIcon;
public var police_button:PoliceIcon;
public var shop_tooltip:MovieClip;
public var extra_holder:MovieClip;
public var pause_button:SimpleButton;
public var nclub_button:FurnitureIcon;
public var output_message:MovieClip;
public var upgrade_dialog:MovieClip;
public var sell_dialog:MovieClip;
public var background_holder:MovieClip;
}
}//package
Section 151
//Police (Police)
package {
import flash.display.*;
public dynamic class Police extends MovieClip {
public var platform:MovieClip;
public var service_icon:MovieClip;
public function Police(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
service_icon.stop();
service_icon.visible = false;
}
}
}//package
Section 152
//PoliceIcon (PoliceIcon)
package {
import fai.ui.*;
public dynamic class PoliceIcon extends ShopButton {
public function PoliceIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 153
//RestaurantIcon (RestaurantIcon)
package {
import fai.ui.*;
public dynamic class RestaurantIcon extends ShopButton {
public function RestaurantIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 154
//RestaurantShop (RestaurantShop)
package {
import flash.display.*;
public dynamic class RestaurantShop extends MovieClip {
public var platform:MovieClip;
public function RestaurantShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 155
//RoadPath1 (RoadPath1)
package {
import fai.ui.*;
public dynamic class RoadPath1 extends RoadPath {
}
}//package
Section 156
//RoadPath2 (RoadPath2)
package {
import fai.ui.*;
public dynamic class RoadPath2 extends RoadPath {
}
}//package
Section 157
//RoadPath21 (RoadPath21)
package {
import fai.ui.*;
public dynamic class RoadPath21 extends RoadPath {
}
}//package
Section 158
//RoadPath3 (RoadPath3)
package {
import fai.ui.*;
public dynamic class RoadPath3 extends RoadPath {
}
}//package
Section 159
//RoadPath31 (RoadPath31)
package {
import fai.ui.*;
public dynamic class RoadPath31 extends RoadPath {
}
}//package
Section 160
//RoadPath4 (RoadPath4)
package {
import fai.ui.*;
public dynamic class RoadPath4 extends RoadPath {
}
}//package
Section 161
//RoadPath41 (RoadPath41)
package {
import fai.ui.*;
public dynamic class RoadPath41 extends RoadPath {
}
}//package
Section 162
//RoadPath5 (RoadPath5)
package {
import fai.ui.*;
public dynamic class RoadPath5 extends RoadPath {
}
}//package
Section 163
//RoadPath51 (RoadPath51)
package {
import fai.ui.*;
public dynamic class RoadPath51 extends RoadPath {
}
}//package
Section 164
//RoadPath52 (RoadPath52)
package {
import fai.ui.*;
public dynamic class RoadPath52 extends RoadPath {
}
}//package
Section 165
//RoadPath6 (RoadPath6)
package {
import fai.ui.*;
public dynamic class RoadPath6 extends RoadPath {
}
}//package
Section 166
//RoadPath61 (RoadPath61)
package {
import fai.ui.*;
public dynamic class RoadPath61 extends RoadPath {
}
}//package
Section 167
//RoadPath62 (RoadPath62)
package {
import fai.ui.*;
public dynamic class RoadPath62 extends RoadPath {
}
}//package
Section 168
//RoadPath63 (RoadPath63)
package {
import fai.ui.*;
public dynamic class RoadPath63 extends RoadPath {
}
}//package
Section 169
//RoadPath7 (RoadPath7)
package {
import fai.ui.*;
public dynamic class RoadPath7 extends RoadPath {
}
}//package
Section 170
//RoadPath71 (RoadPath71)
package {
import fai.ui.*;
public dynamic class RoadPath71 extends RoadPath {
}
}//package
Section 171
//RoadPath72 (RoadPath72)
package {
import fai.ui.*;
public dynamic class RoadPath72 extends RoadPath {
}
}//package
Section 172
//RoadPath73 (RoadPath73)
package {
import fai.ui.*;
public dynamic class RoadPath73 extends RoadPath {
}
}//package
Section 173
//RoadPath74 (RoadPath74)
package {
import fai.ui.*;
public dynamic class RoadPath74 extends RoadPath {
}
}//package
Section 174
//RoadPath8 (RoadPath8)
package {
import fai.ui.*;
public dynamic class RoadPath8 extends RoadPath {
}
}//package
Section 175
//RoadPath81 (RoadPath81)
package {
import fai.ui.*;
public dynamic class RoadPath81 extends RoadPath {
}
}//package
Section 176
//RoadPath9 (RoadPath9)
package {
import fai.ui.*;
public dynamic class RoadPath9 extends RoadPath {
}
}//package
Section 177
//RoadPath91 (RoadPath91)
package {
import fai.ui.*;
public dynamic class RoadPath91 extends RoadPath {
}
}//package
Section 178
//RoadPath92 (RoadPath92)
package {
import fai.ui.*;
public dynamic class RoadPath92 extends RoadPath {
}
}//package
Section 179
//RoadPath93 (RoadPath93)
package {
import fai.ui.*;
public dynamic class RoadPath93 extends RoadPath {
}
}//package
Section 180
//RoadPoint (RoadPoint)
package {
import flash.display.*;
public dynamic class RoadPoint extends Sprite {
}
}//package
Section 181
//SliderThumb_disabledSkin (SliderThumb_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_disabledSkin extends MovieClip {
}
}//package
Section 182
//SliderThumb_downSkin (SliderThumb_downSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_downSkin extends MovieClip {
}
}//package
Section 183
//SliderThumb_overSkin (SliderThumb_overSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_overSkin extends MovieClip {
}
}//package
Section 184
//SliderThumb_upSkin (SliderThumb_upSkin)
package {
import flash.display.*;
public dynamic class SliderThumb_upSkin extends MovieClip {
}
}//package
Section 185
//SliderTick_skin (SliderTick_skin)
package {
import flash.display.*;
public dynamic class SliderTick_skin extends MovieClip {
}
}//package
Section 186
//SliderTrack_disabledSkin (SliderTrack_disabledSkin)
package {
import flash.display.*;
public dynamic class SliderTrack_disabledSkin extends MovieClip {
}
}//package
Section 187
//SliderTrack_skin (SliderTrack_skin)
package {
import flash.display.*;
public dynamic class SliderTrack_skin extends MovieClip {
}
}//package
Section 188
//Sound_alarm (Sound_alarm)
package {
import flash.media.*;
public dynamic class Sound_alarm extends Sound {
}
}//package
Section 189
//Sound_build (Sound_build)
package {
import flash.media.*;
public dynamic class Sound_build extends Sound {
}
}//package
Section 190
//Sound_click3 (Sound_click3)
package {
import flash.media.*;
public dynamic class Sound_click3 extends Sound {
}
}//package
Section 191
//Sound_coins (Sound_coins)
package {
import flash.media.*;
public dynamic class Sound_coins extends Sound {
}
}//package
Section 192
//Sound_final_victory (Sound_final_victory)
package {
import flash.media.*;
public dynamic class Sound_final_victory extends Sound {
}
}//package
Section 193
//Sound_fire (Sound_fire)
package {
import flash.media.*;
public dynamic class Sound_fire extends Sound {
}
}//package
Section 194
//Sound_level_selection (Sound_level_selection)
package {
import flash.media.*;
public dynamic class Sound_level_selection extends Sound {
}
}//package
Section 195
//Sound_music (Sound_music)
package {
import flash.media.*;
public dynamic class Sound_music extends Sound {
}
}//package
Section 196
//Sound_new_day (Sound_new_day)
package {
import flash.media.*;
public dynamic class Sound_new_day extends Sound {
}
}//package
Section 197
//Sound_police (Sound_police)
package {
import flash.media.*;
public dynamic class Sound_police extends Sound {
}
}//package
Section 198
//Sound_repair (Sound_repair)
package {
import flash.media.*;
public dynamic class Sound_repair extends Sound {
}
}//package
Section 199
//Sound_sell (Sound_sell)
package {
import flash.media.*;
public dynamic class Sound_sell extends Sound {
}
}//package
Section 200
//Sound_sigh (Sound_sigh)
package {
import flash.media.*;
public dynamic class Sound_sigh extends Sound {
}
}//package
Section 201
//Sound_tada (Sound_tada)
package {
import flash.media.*;
public dynamic class Sound_tada extends Sound {
}
}//package
Section 202
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
}
}//package
Section 203
//SuperMarketIcon (SuperMarketIcon)
package {
import fai.ui.*;
public dynamic class SuperMarketIcon extends ShopButton {
public function SuperMarketIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 204
//SuperMarketShop (SuperMarketShop)
package {
import flash.display.*;
public dynamic class SuperMarketShop extends MovieClip {
public var platform:MovieClip;
public function SuperMarketShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 205
//ToyStoreIcon (ToyStoreIcon)
package {
import fai.ui.*;
public dynamic class ToyStoreIcon extends ShopButton {
public function ToyStoreIcon(){
addFrameScript(0, frame1, 1, frame2, 3, frame4);
}
function frame4(){
stop();
updateButton(button_stars, icon_holder);
}
function frame1(){
stop();
updateButton(button_stars, icon_holder);
}
function frame2(){
stop();
updateButton(button_stars, icon_holder);
}
}
}//package
Section 206
//ToyStoreShop (ToyStoreShop)
package {
import flash.display.*;
public dynamic class ToyStoreShop extends MovieClip {
public var platform:MovieClip;
public function ToyStoreShop(){
addFrameScript(0, frame1, 10, frame11, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame11(){
stop();
}
}
}//package
Section 207
//WhiteStar (WhiteStar)
package {
import flash.display.*;
public dynamic class WhiteStar extends MovieClip {
}
}//package