Section 1
//AwardsService (com.spilgames.api.AwardsService)
package com.spilgames.api {
public class AwardsService {
public static function submitAward(_arg1:String, _arg2:Function=null):int{
return (SpilGamesServices.getInstance().send("Awards", "submitAward", _arg2, {tag:_arg1, userName:User.getUserName(), userHash:User.getUserHash()}));
}
}
}//package com.spilgames.api
Section 2
//ScoreService (com.spilgames.api.ScoreService)
package com.spilgames.api {
public class ScoreService {
public static function submitScore(_arg1:int, _arg2:Function=null):int{
return (SpilGamesServices.getInstance().send("Score", "submitScore", _arg2, {score:_arg1, userName:User.getUserName(), userHash:User.getUserHash()}));
}
}
}//package com.spilgames.api
Section 3
//SpilGamesServices (com.spilgames.api.SpilGamesServices)
package com.spilgames.api {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class SpilGamesServices extends MovieClip {
private var _connected:Boolean;// = false
private var _connecting:Boolean;// = false
private var DEFAULT_CONNECTION_LOCATION:String;// = "http://www8.agame.com/games/flash/services/ServicesConnection.swf"
private var _loader:Loader;
private var _servicesConnection;// = null
public static const INVALID_ID:int = -1;
private static var _instance:SpilGamesServices = null;
public function SpilGamesServices(_arg1:Private=null){
if (!_arg1){
throw (new Error("Cannot instantiate this class, use SpilGamesServices.getInstance"));
};
}
private function handleRemovedFromStage(_arg1:Event):void{
}
private function handleLoadComplete(_arg1:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_servicesConnection = LoaderInfo(_arg1.target).content;
_servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.addEventListener("serviceError", handleServiceError);
addChild(_servicesConnection);
}
public function send(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null):int{
if (isReady()){
return (_servicesConnection.send(_arg1, _arg2, _arg3, _arg4));
};
return (INVALID_ID);
}
private function handleServicesFailed(_arg1:ErrorEvent):void{
_servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.addEventListener("serviceError", handleServiceError);
_connecting = false;
if (hasEventListener("servicesFailed")){
dispatchEvent(new ErrorEvent("servicesFailed", false, false, _arg1.text));
};
}
public function get version():String{
return ("1.0");
}
public function isReady():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isReady())));
}
private function handleIOError(_arg1:IOErrorEvent):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_connecting = false;
if (hasEventListener(_arg1.type)){
dispatchEvent(_arg1);
};
}
private function handleServiceError(_arg1:Event):void{
var _local2:String;
if (hasEventListener("serviceError")){
_local2 = "";
if ((_arg1 is ErrorEvent)){
_local2 = ErrorEvent(_arg1).text;
} else {
_local2 = _arg1.toString();
};
dispatchEvent(new ErrorEvent("serviceError", false, false, _local2));
};
}
public function disconnect():void{
if (_servicesConnection){
_servicesConnection.removeEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.removeEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.removeEventListener("serviceError", handleServiceError);
if (_connected){
_servicesConnection.disconnect();
};
removeChild(_servicesConnection);
};
_servicesConnection = null;
if (_loader){
try {
_loader.close();
} catch(e:Error) {
} finally {
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
};
_loader = null;
};
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage);
if (parent){
parent.removeChild(this);
};
_connected = (_connecting = false);
}
private function handleServicesReady(_arg1:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_connected = true;
_connecting = false;
dispatchEvent(new Event("servicesReady"));
}
public function get connection(){
return (_servicesConnection);
}
public function getSiteID():int{
if (_servicesConnection != null){
return (_servicesConnection.getSiteID());
};
return (INVALID_ID);
}
public function getChannelID():int{
if (_servicesConnection != null){
return (_servicesConnection.getChannelID());
};
return (INVALID_ID);
}
public function connect(_arg1:DisplayObjectContainer):void{
var _local2:URLRequest;
var _local3:String;
var _local4:URLVariables;
var _local5:Date;
if (((!(_connecting)) && (!(_connected)))){
if (!_arg1.stage){
throw (new Error("The given clip must be present in the display list (added to stage)"));
};
_connecting = true;
_arg1.stage.addChild(this);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage);
if (((root.loaderInfo.parameters["servicesLoc"]) && ((root.loaderInfo.parameters["servicesLoc"].length > 0)))){
_local3 = root.loaderInfo.parameters["servicesLoc"];
_local2 = new URLRequest(_local3);
} else {
_local3 = DEFAULT_CONNECTION_LOCATION;
_local4 = new URLVariables();
_local5 = new Date();
_local4.nocache = (((_local5.month + 1) * 31) + _local5.day);
_local2 = new URLRequest(_local3);
_local2.data = _local4;
};
allowDomain(_local3);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_loader.load(_local2);
};
}
public function getItemID():int{
if (_servicesConnection != null){
return (_servicesConnection.getItemID());
};
return (INVALID_ID);
}
public function allowDomain(_arg1:String):void{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
}
public function get connecting():Boolean{
return (_connecting);
}
public function isDomainAllowed():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isDomainValid())));
}
public function bringToFront(_arg1:Event=null):void{
var e = _arg1;
if (parent){
try {
parent.setChildIndex(this, (parent.numChildren - 1));
} catch(e:Error) {
removeEventListener(Event.ENTER_FRAME, bringToFront);
};
};
}
public static function getInstance():SpilGamesServices{
if (!_instance){
_instance = new SpilGamesServices(new Private());
};
return (_instance);
}
}
}//package com.spilgames.api
class Private {
private function Private(){
}
}
Section 4
//User (com.spilgames.api.User)
package com.spilgames.api {
import flash.display.*;
public class User {
public static function getUserName():String{
var _local1:* = SpilGamesServices.getInstance().connection;
if (_local1 != null){
return (_local1.getUserName());
};
return ("");
}
public static function isGuest():Boolean{
var _local2:DisplayObject;
var _local3:Object;
var _local1:* = SpilGamesServices.getInstance().connection;
if (_local1 != null){
return (_local1.isGuest());
};
_local2 = SpilGamesServices.getInstance().root;
if (_local2.loaderInfo != null){
_local3 = _local2.loaderInfo.parameters;
return (((((((!(_local3.username)) || ((_local3.username == "")))) || (!(_local3.hash)))) || ((_local3.hash == ""))));
};
return (false);
}
public static function getUserHash():String{
var _local1:* = SpilGamesServices.getInstance().connection;
if (_local1 != null){
return (_local1.getUserHash());
};
return ("");
}
}
}//package com.spilgames.api
Section 5
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 6
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 7
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 8
//Brand (spill.localisation.Brand)
package spill.localisation {
import flash.xml.*;
public class Brand {
public var domain:String;
public var emailPage:String;
public var name:String;
public var site_id:uint;
public var isExternal:Boolean;// = false
public var id:Number;
public var hostingDomain:String;// = ""
public var preferedLanguage:String;// = ""
public var moreLink:String;// = ""
public var hasSendToFriendLink:Boolean;// = true
public var emailLink:String;// = "game"
public var portalGroup:uint;
public var useGoogleAnalitics:Boolean;// = true
private static const topLevelDoubles:String = (((((((((((((("ac.cn,ac.jp,ac.uk,ad.jp,adm.br,adv.br,agr.br," + "ah.cn,am.br,arq.br,art.br,asn.au,ato.br,av.tr,bel.tr,bio.br,biz.tr,bj.cn,bmd.br,") + "cim.br,cng.br,cnt.br,co.at,co.jp,co.uk,com.au,com.br,com.cn,com.eg,com.hk,com.mx,") + "com.ru,com.tr,com.tw,conf.au,cq.cn,csiro.au,dr.tr,ecn.br,edu.au,edu.br,edu.tr,") + "emu.id.au,eng.br,esp.br,etc.br,eti.br,eun.eg,far.br,fj.cn,fm.br,fnd.br,fot.br,") + "fst.br,g12.br,gb.com,gb.net,gd.cn,gen.tr,ggf.br,gob.mx,gov.au,gov.br,gov.cn,") + "gov.hk,gov.tr,gr.jp,gs.cn,gx.cn,gz.cn,ha.cn,hb.cn,he.cn,hi.cn,hk.cn,hl.cn,hn.cn,") + "id.au,idv.tw,imb.br,ind.br,inf.br,info.au,info.tr,jl.cn,jor.br,js.cn,jx.cn,k12.tr,") + "lel.br,ln.cn,ltd.uk,mat.br,me.uk,med.br,mil.br,mil.tr,mo.cn,mus.br,name.tr,ne.jp,") + "net.au,net.br,net.cn,net.eg,net.hk,net.lu,net.mx,net.ru,net.tr,net.tw,net.uk,") + "nm.cn,no.com,nom.br,not.br,ntr.br,nx.cn,odo.br,oop.br,or.at,or.jp,org.au,org.br,") + "org.cn,org.hk,org.lu,org.ru,org.tr,org.tw,org.uk,plc.uk,pol.tr,pp.ru,ppg.br,pro.br,") + "psc.br,psi.br,qh.cn,qsl.br,rec.br,sc.cn,sd.cn,se.com,se.net,sh.cn,slg.br,sn.cn,") + "srv.br,sx.cn,tel.tr,tj.cn,tmp.br,trd.br,tur.br,tv.br,tw.cn,uk.com,uk.net,vet.br,") + "wattle.id.au,web.tr,xj.cn,xz.cn,yn.cn,zj.cn,zlg.br,co.nr,co.nz,com.fr,com.ph,com.ar,");
private function get utm_campaign():String{
if (isExternal){
return (("utm_campaign=" + hostingDomain));
};
return ("");
}
public function exportXML():XML{
var _local3:XML;
var _local1:XML = <portal/>
;
_local1.@id = site_id;
_local1.@language = preferedLanguage;
_local1.@channel = portalGroup;
var _local2:XML = <domain/>
;
_local2.appendChild(new XMLNode(3, domain));
_local1.appendChild(_local2);
if (moreLink){
_local3 = <more_games_path/>
;
_local3.appendChild(new XMLNode(3, moreLink));
_local1.appendChild(_local3);
};
_local2 = <game_path/>
;
_local2.appendChild(new XMLNode(3, emailLink));
_local1.appendChild(_local2);
if (!useGoogleAnalitics){
_local1.attributes.noGoogleAnalitics = true;
};
if (!hasSendToFriendLink){
_local1.attributes.noSendToFriendLink = true;
};
return (_local1);
}
public function getPromotionLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String="", _arg5:String=""):String{
var _local6:String = ("http://" + domain);
_local6 = (_local6 + ((("/" + emailLink) + "/") + _arg2));
if (useGoogleAnalitics){
_local6 = (_local6 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal"));
_local6 = (_local6 + ("&utm_campaign=" + _arg1));
_arg4 = stripSubDomain(_arg4);
if (_arg4 == "localhost"){
_arg4 = "offline_play";
};
_local6 = (_local6 + ("&utm_source=" + _arg4));
if (((!((_arg5 == ""))) && (!((_arg5 == null))))){
_local6 = (_local6 + ("&utm_content=" + _arg5));
};
};
return (_local6);
}
private function get utm_source():String{
return (("utm_source=brandedgames_" + (isExternal) ? "external" : "internal"));
}
public function getMoreGamesLink(_arg1:String, _arg2:Boolean, _arg3:String="", _arg4:String=""):String{
var _local5:String = ("http://" + domain);
_local5 = (_local5 + ("/" + moreLink));
if (useGoogleAnalitics){
_local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg2) ? "external" : "internal"));
_local5 = (_local5 + ("&utm_campaign=" + _arg1));
_arg3 = stripSubDomain(_arg3);
if (_arg3 == "localhost"){
_arg3 = "offline_play";
};
_local5 = (_local5 + ("&utm_source=" + _arg3));
if (((!((_arg4 == ""))) && (!((_arg4 == null))))){
_local5 = (_local5 + ("&utm_content=" + _arg4));
};
};
return (_local5);
}
public function get backgroundColor():uint{
return (PortalGroup.backgroundColors[portalGroup]);
}
private function get utm_term():String{
return ("utm_term=");
}
public function importXML(_arg1:XMLNode):void{
}
public function getSendToFriendLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String=""):String{
if (!hasSendToFriendLink){
return (getMoreGamesLink(_arg1, _arg3));
};
var _local5:String = ("http://" + domain);
_local5 = (_local5 + ((("/" + emailLink) + "/") + _arg2));
if (useGoogleAnalitics){
_local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal"));
_local5 = (_local5 + ("&utm_campaign=" + _arg1));
_arg4 = stripSubDomain(_arg4);
if (_arg4 == "localhost"){
_arg4 = "offline_play";
};
_local5 = (_local5 + ("&utm_source=" + _arg4));
_local5 = (_local5 + "&utm_content=send_to_friend");
};
return (_local5);
}
private static function stripSubDomain(_arg1:String):String{
if (!_arg1){
return ("");
};
var _local2:Array = _arg1.split(".");
if (_local2.length <= 2){
return (_arg1);
};
_local2 = _local2.reverse();
if (topLevelDoubles.indexOf((((_local2[1] + ".") + _local2[0]) + ",")) > 0){
return (((((_local2[2] + ".") + _local2[1]) + ".") + _local2[0]));
};
return (((_local2[1] + ".") + _local2[0]));
}
}
}//package spill.localisation
Section 9
//BrandingLogo (spill.localisation.BrandingLogo)
package spill.localisation {
import flash.display.*;
import flash.events.*;
public class BrandingLogo extends MovieClip {
public function BrandingLogo(){
addFrameScript(0, frame1);
super();
stop();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
if (stage){
added();
};
brandingChanged();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("brandingChanged", brandingChanged, false, 0, true);
brandingChanged();
}
private function brandingChanged(_arg1:Event=null):void{
if (SpilGame.currentBranding){
gotoAndStop(SpilGame.currentBranding.domain);
};
}
function frame1(){
stop();
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("brandingChanged", brandingChanged);
}
}
}//package spill.localisation
Section 10
//Brandings (spill.localisation.Brandings)
package spill.localisation {
public class Brandings {
private static var brands_by_id:Object = new Object();
private static var brands_by_domain:Object = new Object();
public static function getBrandByID(_arg1:Number):Brand{
return (brands_by_id[_arg1]);
}
public static function getBrandsArray():Array{
var _local2:Brand;
var _local1:Array = new Array();
for each (_local2 in brands_by_domain) {
_local1.push(_local2);
};
return (_local1);
}
private static function addBrand(_arg1:Brand):Brand{
if (brands_by_domain[_arg1.domain]){
} else {
brands_by_domain[_arg1.domain] = _arg1;
};
if (brands_by_id[_arg1.site_id]){
} else {
brands_by_id[_arg1.site_id] = _arg1;
};
return (_arg1);
}
public static function initialize():void{
var _local1:Brand;
_local1 = new Brand();
_local1.site_id = 79;
_local1.domain = "www.agame.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.TWEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 88;
_local1.domain = "www.gamesgames.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 90;
_local1.domain = "www.girlsgogames.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.GIRL;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 45;
_local1.domain = "www.a10.com";
_local1.preferedLanguage = "en_us";
_local1.portalGroup = PortalGroup.TEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 92;
_local1.domain = "www.games.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 107;
_local1.domain = "www.agame.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.TWEEN;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 102;
_local1.domain = "www.girlsgogames.co.uk";
_local1.preferedLanguage = "en_uk";
_local1.portalGroup = PortalGroup.GIRL;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 2;
_local1.domain = "www.game.com.cn";
_local1.moreLink = "moregames/";
_local1.preferedLanguage = "cn";
_local1.portalGroup = PortalGroup.NONE;
_local1.useGoogleAnalitics = false;
_local1.hasSendToFriendLink = false;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 25;
_local1.domain = "www.spel.nl";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 1;
_local1.domain = "www.spelletjes.nl";
_local1.emailLink = "spel";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 93;
_local1.domain = "www.girlsgogames.nl";
_local1.emailLink = "spel";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 12;
_local1.domain = "www.jeu.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 95;
_local1.domain = "www.girlsgogames.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 11;
_local1.domain = "www.jeux.fr";
_local1.emailLink = "jeu";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "fr";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 26;
_local1.domain = "www.spielen.com";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 94;
_local1.domain = "www.girlsgogames.de";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 5;
_local1.domain = "www.jetztspielen.de";
_local1.emailLink = "spiel";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "de";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 109;
_local1.domain = "www.minigry.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 16;
_local1.domain = "www.gry.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 98;
_local1.domain = "www.girlsgogames.pl";
_local1.emailLink = "gra";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "pl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 108;
_local1.domain = "www.spel.se";
_local1.emailLink = "spel_";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "se";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 100;
_local1.domain = "www.girlsgogames.se";
_local1.emailLink = "spel_";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "se";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 44;
_local1.domain = "www.spela.se";
_local1.emailLink = "spel_";
_local1.preferedLanguage = "se";
_local1.portalGroup = PortalGroup.FAMILY;
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 106;
_local1.domain = "www.giocaregratis.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 15;
_local1.domain = "www.gioco.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 99;
_local1.domain = "www.girlsgogames.it";
_local1.emailLink = "gioco";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "it";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 97;
_local1.domain = "www.zapjuegos.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 86;
_local1.domain = "www.juegos.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 96;
_local1.domain = "www.juegosdechicas.com";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 122;
_local1.domain = "www.girlsgogames.es";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 125;
_local1.domain = "www.juegos.com.mx";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 126;
_local1.domain = "www.juegosdechicas.mx";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 127;
_local1.domain = "www.juegos.com.ar";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 128;
_local1.domain = "www.juegosdechicas.com.ar";
_local1.emailLink = "juego";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "es";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 91;
_local1.domain = "www.clickjogos.com";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 101;
_local1.domain = "www.girlsgogames.com.br";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 50;
_local1.domain = "www.ojogos.com.br";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "br";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 55;
_local1.domain = "www.games.co.id";
_local1.emailLink = "permainanme";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "id";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 105;
_local1.domain = "www.flashgames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 104;
_local1.domain = "www.girlsgogames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.GIRL;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 103;
_local1.domain = "www.ourgames.ru";
_local1.emailLink = "igra";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "ru";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 24;
_local1.domain = "www.game.co.in";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "in";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 87;
_local1.domain = "www.ojogos.pt";
_local1.emailLink = "jogo";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "pt";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 120;
_local1.domain = "www.egames.jp";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.TWEEN;
_local1.preferedLanguage = "jp";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 121;
_local1.domain = "www.dailygame.com";
_local1.emailLink = "/game/";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "en_us";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 123;
_local1.domain = "www.zapapa.com";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.ZAPAPA;
_local1.preferedLanguage = "en_us";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 124;
_local1.domain = "www.zapapa.nl";
_local1.emailLink = "game";
_local1.portalGroup = PortalGroup.HYVES;
_local1.preferedLanguage = "nl";
addBrand(_local1);
_local1 = new Brand();
_local1.site_id = 0;
_local1.domain = "gamedev.dev.spilgames.com";
_local1.portalGroup = PortalGroup.FAMILY;
_local1.preferedLanguage = "en_us";
addBrand(_local1);
}
public static function exportXML():XML{
var _local2:Brand;
var _local1:XML = <portals/>
;
for each (_local2 in brands_by_domain) {
_local1.appendChild(_local2.exportXML());
};
return (_local1);
}
public static function getBrandByDomain(_arg1:String):Brand{
return (brands_by_domain[_arg1]);
}
public static function hasDomain(_arg1:String):Boolean{
return (!((brands_by_domain[_arg1] == null)));
}
}
}//package spill.localisation
Section 11
//Language (spill.localisation.Language)
package spill.localisation {
import flash.xml.*;
public class Language {
public var portal_groups:Array;
public var references:Array;
public var name:String;
public var embedInputFonts:Boolean;// = true
public var id:uint;
public var forceFont:String;// = null
public var textLanguage:String;
public var bwcId:int;
public var embedFonts:Boolean;// = true
public var displayName:String;// = ""
public var dname:String;
public function Language(_arg1:String, _arg2:String=null){
references = [];
super();
name = _arg1;
dname = _arg2;
portal_groups = new Array();
}
public function exportXML():XMLNode{
var _local1:XMLNode = new XMLNode(1, "language");
_local1.attributes.name = name;
if (textLanguage != null){
_local1.attributes.textLanguage = textLanguage;
};
if (references.length){
_local1.attributes.references = references.toString();
};
_local1.attributes.id = bwcId;
var _local2:XMLNode = new XMLNode(1, "display_name");
_local2.firstChild = new XMLNode(3, displayName);
_local1.appendChild(_local2);
var _local3:Array = [];
var _local4:Array = PortalGroup.channelNames;
var _local5:int;
while (_local5 < _local4.length) {
_local3.push(Brandings.getBrandByDomain(portal_groups[_local5]).site_id);
_local5++;
};
_local1.attributes.channels = _local3.join(",");
return (_local1);
}
public function get p_teen():String{
return (portal_groups[PortalGroup.TEEN]);
}
public function set p_hyves(_arg1:String):void{
portal_groups[PortalGroup.HYVES] = _arg1;
}
public function set p_teen(_arg1:String):void{
portal_groups[PortalGroup.TEEN] = _arg1;
}
public function get p_tween():String{
return (portal_groups[PortalGroup.TWEEN]);
}
public function get p_family():String{
return (portal_groups[PortalGroup.FAMILY]);
}
public function get p_girl():String{
return (portal_groups[PortalGroup.GIRL]);
}
public function get p_hyves():String{
return (portal_groups[PortalGroup.HYVES]);
}
public function set p_girl(_arg1:String):void{
portal_groups[PortalGroup.GIRL] = _arg1;
}
public function set p_zapapa(_arg1:String):void{
portal_groups[PortalGroup.ZAPAPA] = _arg1;
}
public function get displayAcronim():String{
return ((dname) ? dname : name);
}
public function set p_family(_arg1:String):void{
portal_groups[PortalGroup.FAMILY] = _arg1;
}
public function set p_tween(_arg1:String):void{
portal_groups[PortalGroup.TWEEN] = _arg1;
}
public function get p_zapapa():String{
return (portal_groups[PortalGroup.ZAPAPA]);
}
}
}//package spill.localisation
Section 12
//Languages (spill.localisation.Languages)
package spill.localisation {
import flash.xml.*;
public class Languages {
public static var languages:Object = new Object();
private static var _init:Boolean = false;
public static function initialize():void{
var _local1:Language;
if (_init){
return;
};
_init = true;
_local1 = new Language("nl");
_local1.displayName = "Nederlands";
_local1.p_family = "www.spelletjes.nl";
_local1.p_tween = "www.spel.nl";
_local1.p_girl = "www.girlsgogames.nl";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.p_hyves = "www.zapapa.nl";
_local1.bwcId = 3;
addLanguage(_local1);
_local1 = new Language("es");
_local1.displayName = "Español";
_local1.p_family = "www.juegos.com";
_local1.p_tween = "www.zapjuegos.com";
_local1.p_girl = "www.girlsgogames.es";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 9;
addLanguage(_local1);
_local1 = new Language("pl");
_local1.displayName = "Polski";
_local1.p_family = "www.gry.pl";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.pl";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 6;
addLanguage(_local1);
_local1 = new Language("fr");
_local1.displayName = "Français";
_local1.p_family = "www.jeux.fr";
_local1.p_tween = "www.jeu.fr";
_local1.p_girl = "www.girlsgogames.fr";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 4;
addLanguage(_local1);
_local1 = new Language("en_us", "us");
_local1.displayName = "English";
_local1.p_family = "www.gamesgames.com";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 1;
addLanguage(_local1);
addReference(_local1, "en");
_local1 = new Language("id");
_local1.displayName = "Bahasa Ind.";
_local1.p_family = "www.gamesgames.com";
_local1.p_tween = "www.games.co.id";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 11;
addLanguage(_local1);
_local1 = new Language("ru");
_local1.displayName = "Русский";
_local1.p_family = "www.ourgames.ru";
_local1.p_tween = "www.flashgames.ru";
_local1.p_girl = "www.girlsgogames.ru";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 12;
addLanguage(_local1);
_local1 = new Language("se");
_local1.displayName = "Svenska";
_local1.p_family = "www.spela.se";
_local1.p_tween = "www.spel.se";
_local1.p_girl = "www.girlsgogames.se";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 7;
addLanguage(_local1);
addReference(_local1, "sv");
_local1 = new Language("it");
_local1.displayName = "Italiano";
_local1.p_family = "www.gioco.it";
_local1.p_tween = "www.gioco.it";
_local1.p_girl = "www.girlsgogames.it";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 8;
addLanguage(_local1);
_local1 = new Language("en_uk", "uk");
_local1.displayName = "English";
_local1.p_family = "www.games.co.uk";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.co.uk";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 13;
addLanguage(_local1);
_local1 = new Language("cn");
_local1.displayName = "中文";
_local1.p_family = "www.game.com.cn";
_local1.p_tween = "www.game.com.cn";
_local1.p_girl = "www.game.com.cn";
_local1.p_teen = "www.game.com.cn";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 2;
_local1.embedFonts = false;
_local1.embedInputFonts = false;
_local1.forceFont = "_sans";
addLanguage(_local1);
addReference(_local1, "zh-CN");
addReference(_local1, "zh-TW");
_local1 = new Language("pt");
_local1.displayName = "Português";
_local1.p_family = "www.ojogos.pt";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 17;
addLanguage(_local1);
_local1 = new Language("in");
_local1.displayName = "English";
_local1.p_family = "www.gamesgames.com";
_local1.p_tween = "www.game.co.in";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.textLanguage = "en_uk";
_local1.bwcId = 14;
addLanguage(_local1);
_local1 = new Language("de");
_local1.displayName = "Deutsch";
_local1.p_family = "www.jetztspielen.de";
_local1.p_tween = "www.spielen.com";
_local1.p_girl = "www.girlsgogames.de";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 5;
addLanguage(_local1);
_local1 = new Language("br");
_local1.displayName = "Português (BR)";
_local1.p_family = "www.ojogos.com.br";
_local1.p_tween = "www.clickjogos.com";
_local1.p_girl = "www.girlsgogames.com.br";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 10;
addLanguage(_local1);
_local1 = new Language("jp");
_local1.displayName = "日本語";
_local1.p_family = "www.gamesgames.com";
_local1.p_tween = "www.egames.jp";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.embedFonts = true;
_local1.embedInputFonts = false;
_local1.forceFont = "MS UI Gothic";
_local1.bwcId = 19;
addLanguage(_local1);
addReference(_local1, "ja");
_local1 = new Language("ar");
_local1.displayName = "English";
_local1.p_family = "www.dailygame.com";
_local1.p_tween = "www.agame.com";
_local1.p_girl = "www.girlsgogames.com";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.bwcId = 20;
addLanguage(_local1);
addReference(_local1, "ar");
_local1 = new Language("es_mx", "mx");
_local1.displayName = "Español";
_local1.p_family = "www.juegos.com.mx";
_local1.p_tween = "www.juegos.com.mx";
_local1.p_girl = "www.juegosdechicas.mx";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.textLanguage = "es";
addLanguage(_local1);
addReference(_local1, "mx");
_local1 = new Language("es_ar", "arg");
_local1.displayName = "Español";
_local1.p_family = "www.juegos.com.ar";
_local1.p_tween = "www.juegos.com.ar";
_local1.p_girl = "www.juegosdechicas.com.ar";
_local1.p_teen = "www.a10.com";
_local1.p_zapapa = "www.zapapa.com";
_local1.textLanguage = "es";
addLanguage(_local1);
addReference(_local1, "arg");
}
public static function exportXML():XMLNode{
var _local3:Language;
var _local1:Array = getLanguagesArray();
var _local2:XMLNode = new XMLNode(1, "languages");
for each (_local3 in _local1) {
_local2.appendChild(_local3.exportXML());
};
return (_local2);
}
public static function getLanguagesArray():Array{
var _local3:Language;
var _local1:Array = new Array();
var _local2:Object = new Object();
for each (_local3 in languages) {
if (!_local2[_local3.name]){
_local1.push(_local3);
_local2[_local3.name] = true;
};
};
return (_local1);
}
public static function getLanguage(_arg1:String):Language{
return (languages[_arg1]);
}
private static function addLanguage(_arg1:Language):void{
languages[_arg1.name] = _arg1;
}
private static function addReference(_arg1:Language, _arg2:String):void{
languages[_arg2] = _arg1;
_arg1.references.push(_arg2);
}
public static function getLanguageByOldID(_arg1:int):Language{
var _local2:Language;
for each (_local2 in languages) {
if (_local2.bwcId == _arg1){
return (_local2);
};
};
return (null);
}
}
}//package spill.localisation
Section 13
//LanguageSelectBox (spill.localisation.LanguageSelectBox)
package spill.localisation {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class LanguageSelectBox extends MovieClip {
private var flag:MovieClip;
private var languageName_text:TextField;
private var popup:MovieClip;
private var mc:MovieClip;
public function LanguageSelectBox(){
if (numChildren > 0){
removeChildAt(0);
};
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true);
addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true);
Languages.initialize();
popup = new LanguageSelectPopup_mc();
x = Math.round(x);
y = Math.round(y);
popup.y = (-(Math.floor(popup.height)) + 1);
popup.visible = false;
addChild(popup);
mc = new LanguageSelectBox_mc();
addChild(mc);
flag = mc.flag;
languageName_text = mc.languageName_text;
if (stage){
added();
};
init();
languageChanged();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true);
}
private function mouseOut(_arg1:MouseEvent):void{
popup.visible = false;
}
public function set popupLocation(_arg1:String):void{
if (_arg1 == "bottom"){
popup.y = Math.floor(mc.height);
} else {
popup.y = (-(Math.floor(mc.height)) + 1);
};
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("languageChanged", languageChanged);
}
public function init():void{
var _local3:MovieClip;
var _local4:Language;
var _local1:Array = new Array(popup.l_br, popup.l_de, popup.l_en_us, popup.l_fr, popup.l_in, popup.l_jp, popup.l_pt, popup.l_ru, popup.l_ar, popup.l_cn, popup.l_en_uk, popup.l_es, popup.l_id, popup.l_it, popup.l_nl, popup.l_pl, popup.l_se, popup.l_es_mx, popup.l_es_ar);
var _local2:int;
for (;_local2 < _local1.length;_local2++) {
_local3 = MovieClip(_local1[_local2]);
if (_local3){
_local3.addEventListener(MouseEvent.CLICK, itemClicked, true, 0, true);
_local3.flag.gotoAndStop(_local3.name.substr(2));
_local3.flag.mouseEnabled = false;
_local3.text.mouseEnabled = false;
_local4 = Languages.getLanguage(_local3.name.substr(2));
if (_local4){
_local3.text.text = _local4.displayAcronim;
//unresolved jump
};
continue;
};
};
}
private function itemClicked(_arg1:MouseEvent):void{
SpilGame.changeLanguage(_arg1.currentTarget.name.substr(2));
popup.visible = false;
}
private function mouseOver(_arg1:MouseEvent):void{
popup.visible = true;
}
private function languageChanged(_arg1:Event=null):void{
if (SpilGame.currentLanguage){
flag.gotoAndStop(SpilGame.currentLanguage.name);
languageName_text.text = SpilGame.currentLanguage.displayName;
languageName_text.embedFonts = SpilGame.currentLanguage.embedInputFonts;
};
}
}
}//package spill.localisation
Section 14
//LanguageSelectBox_mc (spill.localisation.LanguageSelectBox_mc)
package spill.localisation {
import flash.display.*;
import flash.text.*;
public dynamic class LanguageSelectBox_mc extends MovieClip {
public var languageName_text:TextField;
public var flag:MovieClip;
}
}//package spill.localisation
Section 15
//LanguageSelectPopup_mc (spill.localisation.LanguageSelectPopup_mc)
package spill.localisation {
import flash.display.*;
public dynamic class LanguageSelectPopup_mc extends MovieClip {
public var l_cn:MovieClip;
public var l_br:MovieClip;
public var l_se:MovieClip;
public var l_id:MovieClip;
public var l_es_ar:MovieClip;
public var l_es_mx:MovieClip;
public var l_in:MovieClip;
public var l_en_uk:MovieClip;
public var l_en_us:MovieClip;
public var l_es:MovieClip;
public var l_ar:MovieClip;
public var l_it:MovieClip;
public var l_pl:MovieClip;
public var l_nl:MovieClip;
public var l_de:MovieClip;
public var l_ru:MovieClip;
public var l_pt:MovieClip;
public var l_jp:MovieClip;
public var l_fr:MovieClip;
}
}//package spill.localisation
Section 16
//LocalizedTextField (spill.localisation.LocalizedTextField)
package spill.localisation {
import flash.events.*;
public class LocalizedTextField extends TextFieldFit {
private var regex:RegExp;
private var originalText:String;
public function LocalizedTextField(){
regex = /{([^{}]*)}/g;
super();
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
added();
}
private function added(_arg1:Event=null):void{
SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true);
text = originalText;
}
private function replaceFn():String{
var _local2:String = SpilGame.getString(arguments[1]);
if (((!(_local2)) || ((_local2 == "")))){
return ((("{" + arguments[1]) + "}"));
};
return (_local2);
}
private function removed(_arg1:Event):void{
SpilGame.removeEventListener("languageChanged", languageChanged);
}
override public function set text(_arg1:String):void{
originalText = _arg1;
if ((_arg1 is String)){
super.text = _arg1.replace(regex, replaceFn);
} else {
super.text = "";
};
}
private function languageChanged(_arg1:Event):void{
text = originalText;
updateProperties();
}
}
}//package spill.localisation
Section 17
//PortalGroup (spill.localisation.PortalGroup)
package spill.localisation {
import flash.xml.*;
public class PortalGroup {
public static const FAMILY:uint = 0;
public static const channelNames:Array = ["family", "tween", "girl", "teen", "zapapa", "hyves"];
public static const ZAPAPA:uint = 4;
public static const TWEEN:uint = 1;
public static const HYVES:uint = 5;
public static const TEEN:uint = 3;
public static const GIRL:uint = 2;
public static const backgroundColors:Array = [0xFFFFFF, 0xFFFFFF, 16742331, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF];
public static const NONE:uint = 6;
public static function getName(_arg1:int):String{
return (channelNames[_arg1]);
}
public static function exportXML():XMLNode{
var _local3:XMLNode;
var _local1:XMLNode = new XMLNode(1, "channels");
var _local2:int;
while (_local2 < 5) {
_local3 = new XMLNode(1, "channel");
_local3.attributes.name = channelNames[_local2];
_local3.attributes.id = _local2;
_local1.appendChild(_local3);
_local2++;
};
return (_local1);
}
}
}//package spill.localisation
Section 18
//spil_internal (spill.localisation.spil_internal)
package spill.localisation {
public namespace spil_internal = "spill.localisation";
}//package spill.localisation
Section 19
//SpilGame (spill.localisation.SpilGame)
package spill.localisation {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.net.*;
import flash.ui.*;
import flash.system.*;
import flash.external.*;
public class SpilGame {
private static const cookieName:String = "spilgames_language_v100";
private static const cookiePath:String = "/";
private static const cookieLanguageVar:String = "savedLang";
public static const LANGUAGE_CHANGED:String = "languageChanged";
public static const BRANDING_CHANGED:String = "brandingChanged";
private static var strings:Object = new Object();
public static var currentBranding:Brand;
private static var contexMenuItem:ContextMenuItem;
spil_internal static var gameName:String;
spil_internal static var debugHostDomain:String = "";
private static var localDomains:Object = new Object();
spil_internal static var emailPage:String;
private static var channelLock:Boolean = false;
spil_internal static var debugEmbedDomain:String = "";
private static var eventDispatcher:EventDispatcher;
private static var _init:Boolean = false;
public static var currentLanguage:Language;
spil_internal static var portalGroup:uint;
private static var stage:Sprite;
public static function getSpilCompanyLink():String{
if (currentLanguage.name == "cn"){
return ("http://www.game.com.cn/downloads/");
};
return ("http://www.gameportal.net");
}
public static function getPromotionLink(_arg1:String="feature_promotion"):String{
var _local2:String = (embedDomain) ? embedDomain : hostingDomain;
return (currentBranding.getPromotionLink(gameName, emailPage, isExternal, _local2, _arg1));
}
public static function traceAllBrands():void{
}
public static function getString(_arg1:String):String{
var _local2:Object = strings[_arg1];
if (_local2){
if (currentLanguage.textLanguage){
return (_local2[currentLanguage.textLanguage]);
};
return (_local2[currentLanguage.name]);
//unresolved jump
};
return ("");
}
public static function initialize(_arg1:String, _arg2:int, _arg3:String, _arg4:Sprite, _arg5:Boolean=false):void{
stage = _arg4;
if (_init){
return;
};
_init = true;
localDomains["localhost"] = true;
localDomains["www8.agame.com"] = true;
localDomains["gamedev.dev.spilgames.com"] = true;
localDomains["stg.spel.nl"] = true;
localDomains["stg.girlsgogames.nl"] = true;
localDomains["stg.pl.spel.nl"] = true;
localDomains["stg.pl.girlsgogames.nl"] = true;
Brandings.initialize();
Languages.initialize();
initContexMenu(_arg4);
channelLock = _arg5;
gameName = _arg1.replace(" ", "_");
portalGroup = _arg2;
emailPage = _arg3;
chooseLanguage();
chooseBranding();
}
public static function get isExternal():Boolean{
return (((((!(Brandings.hasDomain(embedDomain))) && (!(localDomains[embedDomain])))) && (!(isStagingDomain))));
}
private static function initContexMenu(_arg1:Sprite):void{
contexMenuItem = new ContextMenuItem("");
_arg1.contextMenu = new ContextMenu();
_arg1.contextMenu.customItems.push(contexMenuItem);
contexMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contexMenuClicked);
}
private static function replaceFn():String{
var _local2:String = SpilGame.getString(arguments[1]);
if (((!(_local2)) || ((_local2 == "")))){
return ((("{" + arguments[1]) + "}"));
};
return (_local2);
}
spil_internal static function get hostingDomain():String{
var _local1:LocalConnection;
if (debugHostDomain != ""){
return (debugHostDomain);
};
_local1 = new LocalConnection();
return (_local1.domain);
}
spil_internal static function chooseLanguage():void{
if (cookieLanguage != null){
currentLanguage = cookieLanguage;
} else {
if (isExternal){
currentLanguage = systemLanguage;
} else {
currentLanguage = portalLanguage;
if (!currentLanguage){
currentLanguage = systemLanguage;
};
};
};
if (!currentLanguage){
currentLanguage = Languages.getLanguage("en_us");
};
TextFieldFit.embedFonts = currentLanguage.embedFonts;
TextFieldFit.forceFont = currentLanguage.forceFont;
dispatchEvent(new Event(LANGUAGE_CHANGED));
}
private static function contexMenuClicked(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest(getMoreGamesLink("Contex_Menu")));
}
public static function initTextField(_arg1:TextField):void{
var _local2:TextFormat;
_arg1.text = _arg1.text.replace(/{([^{}]*)}/g, replaceFn);
_arg1.embedFonts = currentLanguage.embedFonts;
if (currentLanguage.forceFont != ""){
_local2 = new TextFormat();
_local2.font = currentLanguage.forceFont;
_arg1.setTextFormat(_local2);
};
}
public static function importXMLv2(_arg1:XML):void{
var _local2:XML;
var _local3:Object;
var _local4:XML;
for each (_local2 in _arg1.children()) {
_local3 = (strings[_local2.attribute("identifier")] = new Object());
for each (_local4 in _local2.children()) {
if (_local4.children().length() > 0){
_local3[_local4.name()] = _local4.children()[0].toString();
} else {
_local3[_local4.name()] = "";
};
};
};
}
spil_internal static function changeLanguage(_arg1:String):void{
var _local2:Language = Languages.getLanguage(_arg1);
if (!_local2){
} else {
cookieLanguage = _local2;
currentLanguage = _local2;
};
TextFieldFit.embedFonts = currentLanguage.embedFonts;
TextFieldFit.forceFont = currentLanguage.forceFont;
chooseBranding();
dispatchEvent(new Event(LANGUAGE_CHANGED));
}
public static function getSendToFriendLink():String{
return (currentBranding.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain));
}
spil_internal static function chooseBranding():void{
currentBranding = Brandings.getBrandByDomain(currentLanguage.portal_groups[portalGroup]);
if (!(currentBranding is Brand)){
currentBranding = Brandings.getBrandByDomain("www.agame.com");
};
contexMenuItem.caption = ("More Games: " + currentBranding.domain);
dispatchEvent(new Event(BRANDING_CHANGED));
}
spil_internal static function get systemLanguage():Language{
return (Languages.getLanguage(Capabilities.language));
}
spil_internal static function set cookieLanguage(_arg1:Language):void{
var _local2:SharedObject = SharedObject.getLocal(cookieName, cookiePath);
if (_arg1 == null){
_local2.data[cookieLanguageVar] = null;
} else {
_local2.data[cookieLanguageVar] = _arg1.name;
};
_local2.flush();
}
public static function importXML(_arg1:XML):void{
var _local2:XML;
var _local3:Object;
var _local4:XML;
for each (_local2 in _arg1.children()) {
_local3 = (strings[_local2.identifier] = new Object());
for each (_local4 in _local2.children()) {
_local3[_local4.name()] = _local4.children()[0].toString();
};
};
}
spil_internal static function dispatchEvent(_arg1:Event):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.dispatchEvent(_arg1);
}
private static function getDomain(_arg1:String):String{
var _local2:String;
var _local3:uint;
if (_arg1.indexOf("file") == 0){
return ("offline_play");
};
_local2 = new String();
_local3 = 7;
while (_local3 < _arg1.length) {
if (_arg1.charAt(_local3) == "/"){
break;
};
_local2 = (_local2 + _arg1.charAt(_local3));
_local3++;
};
if (_local2 == "localhost"){
_local2 = "offline_play";
};
return (_local2);
}
public static function exportXML():XML{
var _local1:XML = <spil_games/>
;
_local1.appendChild(Brandings.exportXML());
_local1.appendChild(Languages.exportXML());
_local1.appendChild(PortalGroup.exportXML());
return (_local1);
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public static function outputAllBrands():String{
var _local3:Brand;
var _local1:Array = Brandings.getBrandsArray();
var _local2 = "";
for each (_local3 in _local1) {
_local2 = (_local2 + (_local3.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain) + "\n"));
};
return (_local2);
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function getMoreGamesLink(_arg1:String=""):String{
var _local2:String = (embedDomain) ? embedDomain : hostingDomain;
return (currentBranding.getMoreGamesLink(gameName, isExternal, _local2, _arg1));
}
public static function get isStagingDomain():Boolean{
var _local1:String = ("http://" + embedDomain);
return ((_local1.indexOf("http://stg.") >= 0));
}
spil_internal static function get cookieLanguage():Language{
var _local1:SharedObject = SharedObject.getLocal(cookieName, cookiePath);
var _local2:String = String(_local1.data[cookieLanguageVar]);
return (Languages.getLanguage(_local2));
}
private static function get portalLanguage():Language{
var _local1:Brand;
var _local2:String;
var _local3:Language;
if (isExternal){
return (null);
};
if (!embedDomain){
return (null);
};
_local1 = Brandings.getBrandByDomain(embedDomain);
if (!_local1){
return (null);
};
_local2 = _local1.preferedLanguage;
if (!_local2){
return (null);
};
_local3 = Languages.getLanguage(_local2);
if (!_local3){
return (null);
};
return (_local3);
}
spil_internal static function get embedDomain():String{
var loc:String;
if (debugEmbedDomain != ""){
return (debugEmbedDomain);
};
if (ExternalInterface.available){
try {
loc = ExternalInterface.call("window.location.href.toString");
if (((!((loc == ""))) && (!((loc == null))))){
return (getDomain(loc));
};
} catch(e:SecurityError) {
} catch(e:Error) {
};
};
return (null);
}
}
}//package spill.localisation
Section 20
//SpilGamesLink (spill.localisation.SpilGamesLink)
package spill.localisation {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class SpilGamesLink extends SimpleButton {
public function SpilGamesLink(){
addEventListener(MouseEvent.CLICK, buttonClicked);
}
private function buttonClicked(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(SpilGame.getSpilCompanyLink()), "_blank");
}
}
}//package spill.localisation
Section 21
//TextFieldFit (spill.localisation.TextFieldFit)
package spill.localisation {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
import flash.filters.*;
public class TextFieldFit extends MovieClip {
protected var _glowQuality:Number;// = 1
protected var _gridFitType:String;// = "pixel"
protected var _text:String;// = "default"
private var debugBounding:Sprite;
protected var _disableWordwrap:Boolean;// = false
protected var _textSize:Number;// = 12
protected var _multiline:Boolean;// = false
protected var _font:String;// = ""
protected var _embedFonts:Boolean;// = true
protected var _underline:Boolean;// = false
protected var _vAlign:String;// = "top"
protected var _italic:Boolean;// = false
protected var _useGlowFilter:Boolean;// = false
protected var _glowColor:uint;// = 0
protected var _bold:Boolean;// = false
private var h:Number;
protected var _antiAliasType:String;// = "advanced"
private var sizeChanged:Boolean;// = true
private var w:Number;
private var embeddedFonts:Array;
protected var _hAlign:String;// = "left"
protected var _textColor:uint;// = 0
protected var _glowStrength:Number;// = 5
protected var _glowBlur:Number;// = 3
protected var _selectable:Boolean;// = false
private var format:TextFormat;
private var field:TextField;
private var valid:Boolean;// = true
private static const gutter:Number = 2;
spil_internal static var embedFonts:Boolean = true;
spil_internal static var forceAAType:String = null;
spil_internal static var forceFont:String = null;
public static var alwaysCheckWidth:Boolean = false;
public function TextFieldFit(){
var _local1:Boolean = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")));
var _local2:Number = width;
var _local3:Number = height;
if (numChildren > 0){
removeChildAt(0);
};
if (!field){
field = new TextField();
addChild(field);
};
field.border = false;
field.background = false;
field.type = TextFieldType.DYNAMIC;
mouseEnabled = false;
mouseChildren = false;
format = new TextFormat();
embeddedFonts = Font.enumerateFonts(false);
setSize(_local2, _local3);
validate();
if (stage){
addEventListener(Event.RENDER, init);
stage.invalidate();
};
init();
}
private function resizeText(_arg1:Boolean=false):void{
if (!doesTextFit()){
format.size = Object((Number(format.size) - 1));
if (format.size <= 3){
return;
};
field.setTextFormat(format);
resizeText(true);
} else {
if (_arg1 == false){
while (doesTextFit()) {
if (format.size <= textSize){
format.size = Object((Number(format.size) + 1));
field.setTextFormat(format);
if (!doesTextFit()){
format.size = Object((Number(format.size) - 1));
field.setTextFormat(format);
break;
};
} else {
break;
};
};
};
};
}
public function set hAlign(_arg1:String):void{
_hAlign = _arg1;
invalidate();
}
public function set bold(_arg1:Boolean):void{
_bold = _arg1;
invalidate();
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.RENDER, init);
updateProperties();
layoutText();
}
private function validate(_arg1:Event=null):void{
updateProperties();
layoutText();
removeEventListener(Event.ENTER_FRAME, validate);
valid = true;
}
public function set glowBlur(_arg1:Number):void{
_glowBlur = _arg1;
invalidate();
}
public function get vAlign():String{
return (_vAlign);
}
public function get italic():Boolean{
return (_italic);
}
public function get textColor():uint{
return (_textColor);
}
private function invalidate():void{
if (valid){
addEventListener(Event.ENTER_FRAME, validate);
if (stage){
stage.invalidate();
};
valid = false;
};
}
public function get text():String{
return (_text);
}
public function get useGlowFilter():Boolean{
return (_useGlowFilter);
}
public function get selectable():Boolean{
return (_selectable);
}
public function set text(_arg1:String):void{
_text = _arg1;
invalidate();
}
public function set embedFonts(_arg1:Boolean):void{
_embedFonts = _arg1;
invalidate();
}
public function set vAlign(_arg1:String):void{
_vAlign = _arg1;
invalidate();
}
public function set italic(_arg1:Boolean):void{
_italic = _arg1;
invalidate();
}
public function get font():String{
return (_font);
}
public function set multiline(_arg1:Boolean):void{
_multiline = _arg1;
invalidate();
}
public function get disableWordwrap():Boolean{
return (_disableWordwrap);
}
public function set textColor(_arg1:uint):void{
_textColor = _arg1;
invalidate();
}
public function get antiAliasType():String{
return (_antiAliasType);
}
private function layoutText():void{
resizeText();
field.height = (field.textHeight + (gutter * 2));
if (vAlign == "top"){
field.y = 0;
} else {
if (vAlign == "middle"){
field.y = ((h - field.height) / 2);
} else {
if (vAlign == "bottom"){
field.y = (h - field.height);
};
};
};
}
public function set glowQuality(_arg1:Number):void{
_glowQuality = _arg1;
invalidate();
}
public function get hAlign():String{
return (_hAlign);
}
public function setSize(_arg1:Number, _arg2:Number):void{
w = _arg1;
h = _arg2;
scaleX = (scaleY = 1);
field.width = w;
field.height = h;
invalidate();
}
public function get bold():Boolean{
return (_bold);
}
public function set gridFitType(_arg1:String):void{
_gridFitType = _arg1;
invalidate();
}
public function set underline(_arg1:Boolean):void{
_underline = _arg1;
invalidate();
}
public function get glowBlur():Number{
return (_glowBlur);
}
public function set useGlowFilter(_arg1:Boolean):void{
_useGlowFilter = _arg1;
invalidate();
}
public function set font(_arg1:String):void{
_font = _arg1;
invalidate();
}
public function set textSize(_arg1:Number):void{
_textSize = _arg1;
sizeChanged = true;
invalidate();
}
public function set selectable(_arg1:Boolean):void{
_selectable = _arg1;
invalidate();
}
public function get multiline():Boolean{
return (_multiline);
}
public function get embedFonts():Boolean{
return (_embedFonts);
}
public function set glowColor(_arg1:uint):void{
_glowColor = _arg1;
invalidate();
}
public function set disableWordwrap(_arg1:Boolean):void{
_disableWordwrap = _arg1;
invalidate();
}
public function get glowQuality():Number{
return (_glowQuality);
}
public function get gridFitType():String{
return (_gridFitType);
}
public function get underline():Boolean{
return (_underline);
}
public function get textSize():Number{
return (_textSize);
}
public function get glowColor():uint{
return (_glowColor);
}
public function set antiAliasType(_arg1:String):void{
_antiAliasType = _arg1;
invalidate();
}
public function set glowStrength(_arg1:Number):void{
_glowStrength = _arg1;
invalidate();
}
protected function updateProperties():void{
var _local1:Boolean;
var _local2:Font;
field.text = _text;
field.multiline = ((((_text.indexOf(" ") < 0)) && ((_text.length < 14)))) ? false : _multiline;
field.wordWrap = ((field.multiline) && (!(_disableWordwrap)));
field.selectable = _selectable;
field.antiAliasType = (forceAAType) ? forceAAType : _antiAliasType;
field.gridFitType = _gridFitType;
embeddedFonts = Font.enumerateFonts(false);
if (((((_embedFonts) && (!((_font == ""))))) && (TextFieldFit.embedFonts))){
_local1 = false;
for each (_local2 in embeddedFonts) {
if (_font == _local2.fontName){
_local1 = true;
break;
};
};
field.embedFonts = _local1;
if (!_local1){
};
} else {
field.embedFonts = false;
};
if (TextFieldFit.forceFont){
format.font = TextFieldFit.forceFont;
} else {
if (_font != ""){
format.font = _font;
};
};
if (sizeChanged){
format.size = _textSize;
};
format.color = _textColor;
format.align = _hAlign;
format.bold = _bold;
format.italic = _italic;
format.underline = _underline;
format.leftMargin = 0;
format.rightMargin = 0;
field.setTextFormat(format);
if (_useGlowFilter){
filters = [new GlowFilter(_glowColor, 1, _glowBlur, _glowBlur, _glowStrength, _glowQuality)];
} else {
filters = [];
};
}
private function doesTextFit():Boolean{
if (((((field.textHeight + (gutter * 2)) > h)) || (((((field.textWidth + (gutter * 2)) > w)) && (((!(field.multiline)) || (alwaysCheckWidth))))))){
return (false);
};
return (true);
}
public function get glowStrength():Number{
return (_glowStrength);
}
}
}//package spill.localisation
Section 22
//Submitter (Spill.Components.Submitter)
package Spill.Components {
import flash.display.*;
public dynamic class Submitter extends MovieClip {
}
}//package Spill.Components
Section 23
//achDescr_381 (TowerBloxx2v2_big_fla.achDescr_381)
package TowerBloxx2v2_big_fla {
import flash.display.*;
public dynamic class achDescr_381 extends MovieClip {
public function achDescr_381(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TowerBloxx2v2_big_fla
Section 24
//flag_icon_434 (TowerBloxx2v2_big_fla.flag_icon_434)
package TowerBloxx2v2_big_fla {
import flash.display.*;
public dynamic class flag_icon_434 extends MovieClip {
public function flag_icon_434(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package TowerBloxx2v2_big_fla
Section 25
//starLight_90 (TowerBloxx2v2_big_fla.starLight_90)
package TowerBloxx2v2_big_fla {
import flash.display.*;
import flash.events.*;
public dynamic class starLight_90 extends MovieClip {
public function starLight_90(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ACTIVATE, starLight);
}
public function starLight(_arg1:Event):void{
var _local2:Number = Math.round(((Math.random() / 6) * 1000));
gotoAndPlay(_local2);
}
}
}//package TowerBloxx2v2_big_fla
Section 26
//a1 (a1)
package {
import flash.display.*;
public dynamic class a1 extends MovieClip {
}
}//package
Section 27
//a10 (a10)
package {
import flash.display.*;
public dynamic class a10 extends MovieClip {
}
}//package
Section 28
//a11 (a11)
package {
import flash.display.*;
public dynamic class a11 extends MovieClip {
}
}//package
Section 29
//a12 (a12)
package {
import flash.display.*;
public dynamic class a12 extends MovieClip {
}
}//package
Section 30
//a2 (a2)
package {
import flash.display.*;
public dynamic class a2 extends MovieClip {
}
}//package
Section 31
//a3 (a3)
package {
import flash.display.*;
public dynamic class a3 extends MovieClip {
}
}//package
Section 32
//a4 (a4)
package {
import flash.display.*;
public dynamic class a4 extends MovieClip {
}
}//package
Section 33
//a5 (a5)
package {
import flash.display.*;
public dynamic class a5 extends MovieClip {
}
}//package
Section 34
//a6 (a6)
package {
import flash.display.*;
public dynamic class a6 extends MovieClip {
}
}//package
Section 35
//a7 (a7)
package {
import flash.display.*;
public dynamic class a7 extends MovieClip {
}
}//package
Section 36
//a8 (a8)
package {
import flash.display.*;
public dynamic class a8 extends MovieClip {
}
}//package
Section 37
//a9 (a9)
package {
import flash.display.*;
public dynamic class a9 extends MovieClip {
}
}//package
Section 38
//act1 (act1)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act1 extends MovieClip {
public var txt:TextField;
}
}//package
Section 39
//act10 (act10)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act10 extends MovieClip {
public var txt:TextField;
}
}//package
Section 40
//act11 (act11)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act11 extends MovieClip {
public var txt:TextField;
}
}//package
Section 41
//act12 (act12)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act12 extends MovieClip {
public var txt:TextField;
}
}//package
Section 42
//act2 (act2)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act2 extends MovieClip {
public var txt:TextField;
}
}//package
Section 43
//act3 (act3)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act3 extends MovieClip {
public var txt:TextField;
}
}//package
Section 44
//act4 (act4)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act4 extends MovieClip {
public var txt:TextField;
}
}//package
Section 45
//act5 (act5)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act5 extends MovieClip {
public var txt:TextField;
}
}//package
Section 46
//act6 (act6)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act6 extends MovieClip {
public var txt:TextField;
}
}//package
Section 47
//act7 (act7)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act7 extends MovieClip {
public var txt:TextField;
}
}//package
Section 48
//act8 (act8)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act8 extends MovieClip {
public var txt:TextField;
}
}//package
Section 49
//act9 (act9)
package {
import flash.display.*;
import flash.text.*;
public dynamic class act9 extends MovieClip {
public var txt:TextField;
}
}//package
Section 50
//allAchivments (allAchivments)
package {
import flash.display.*;
public dynamic class allAchivments extends MovieClip {
public var ach_silver_mc:MovieClip;
public var ach_master_mc:MovieClip;
public var ach_gold_mc:MovieClip;
public var ach_finish_lock:MovieClip;
public var ach_head_mc:MovieClip;
public var ach_chal_mc:MovieClip;
public var ach_master_lock:MovieClip;
public var ach_gold_lock:MovieClip;
public var achDescr_mc:MovieClip;
public var ach_chal_lock:MovieClip;
public var ach_hero_mc:MovieClip;
public var ach_enemy_mc:MovieClip;
public var ach_finish_mc:MovieClip;
public var ach_vulc_mc:MovieClip;
public var ach_head_lock:MovieClip;
public var ach_hero_lock:MovieClip;
public var ach_vulc_lock:MovieClip;
public var ach_mill_mc:MovieClip;
public var ach_silver_lock:MovieClip;
public var ach_bronze_mc:MovieClip;
public var ach_damb_mc:MovieClip;
public var ach_enemy_lock:MovieClip;
public var ach_mill_lock:MovieClip;
public var ach_bronze_lock:MovieClip;
public var ach_damb_lock:MovieClip;
}
}//package
Section 51
//armory_text (armory_text)
package {
import flash.display.*;
public dynamic class armory_text extends MovieClip {
}
}//package
Section 52
//armoryIco (armoryIco)
package {
import flash.display.*;
public dynamic class armoryIco extends MovieClip {
}
}//package
Section 53
//Awesome (Awesome)
package {
import flash.display.*;
public dynamic class Awesome extends MovieClip {
public function Awesome(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 54
//b1 (b1)
package {
import flash.display.*;
public dynamic class b1 extends SimpleButton {
}
}//package
Section 55
//b2 (b2)
package {
import flash.display.*;
public dynamic class b2 extends SimpleButton {
}
}//package
Section 56
//b3 (b3)
package {
import flash.display.*;
public dynamic class b3 extends SimpleButton {
}
}//package
Section 57
//b4 (b4)
package {
import flash.display.*;
public dynamic class b4 extends SimpleButton {
}
}//package
Section 58
//b5 (b5)
package {
import flash.display.*;
public dynamic class b5 extends SimpleButton {
}
}//package
Section 59
//barackIco (barackIco)
package {
import flash.display.*;
public dynamic class barackIco extends MovieClip {
}
}//package
Section 60
//baracks_text (baracks_text)
package {
import flash.display.*;
public dynamic class baracks_text extends MovieClip {
}
}//package
Section 61
//bg_tower_block (bg_tower_block)
package {
import flash.display.*;
public dynamic class bg_tower_block extends MovieClip {
}
}//package
Section 62
//bg_tower_top (bg_tower_top)
package {
import flash.display.*;
public dynamic class bg_tower_top extends MovieClip {
}
}//package
Section 63
//bgDay (bgDay)
package {
import flash.display.*;
public dynamic class bgDay extends MovieClip {
}
}//package
Section 64
//blank (blank)
package {
import flash.display.*;
public dynamic class blank extends MovieClip {
}
}//package
Section 65
//blankPixel (blankPixel)
package {
import flash.display.*;
public dynamic class blankPixel extends MovieClip {
}
}//package
Section 66
//blinkArrow (blinkArrow)
package {
import flash.display.*;
public dynamic class blinkArrow extends MovieClip {
}
}//package
Section 67
//bp1 (bp1)
package {
import flash.display.*;
public dynamic class bp1 extends MovieClip {
}
}//package
Section 68
//bp2 (bp2)
package {
import flash.display.*;
public dynamic class bp2 extends MovieClip {
}
}//package
Section 69
//bp3 (bp3)
package {
import flash.display.*;
public dynamic class bp3 extends MovieClip {
}
}//package
Section 70
//bp4 (bp4)
package {
import flash.display.*;
public dynamic class bp4 extends MovieClip {
}
}//package
Section 71
//bp5 (bp5)
package {
import flash.display.*;
public dynamic class bp5 extends MovieClip {
}
}//package
Section 72
//buildingCompleted (buildingCompleted)
package {
import flash.media.*;
public dynamic class buildingCompleted extends Sound {
}
}//package
Section 73
//castle_text (castle_text)
package {
import flash.display.*;
public dynamic class castle_text extends MovieClip {
}
}//package
Section 74
//castleIco (castleIco)
package {
import flash.display.*;
public dynamic class castleIco extends MovieClip {
}
}//package
Section 75
//citybg (citybg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
public class citybg extends MovieClip {
private var sowDay:MovieClip;
private var transSowNight:Transform;
var dambMc:MovieClip;
public var river2_d:MovieClip;
public var holl_mc:MovieClip;
public var river2_n:MovieClip;
private var transMillDay:Transform;
private var matrixSow:Matrix;
private var sowX:Number;
public var dummy_wall_btn:SimpleButton;
private var star1:MovieClip;
public var back_wall:MovieClip;
public var damb_mc:MovieClip;
private var sowY:Number;
private var baracksFlagDay:MovieClip;
var armoryMC:MovieClip;
public var dummy_dumb_btn:SimpleButton;
public var castle_mc:MovieClip;
public var farm_mc:MovieClip;
private var riverNight1:MovieClip;
private var riverDay1:MovieClip;
private var riverDay2:MovieClip;
public var river1_d:MovieClip;
public var dust_night:MovieClip;
var farmMC:MovieClip;
private var riverNight2:MovieClip;
private var riverCounter:Number;// = 0
public var walls_front:MovieClip;
private var flagD:Number;// = 1
private var streamX1:Number;
private var streamX2:Number;
public var river1_n:MovieClip;
var towerMC:MovieClip;
public var stars:MovieClip;
private var streamX3:Number;
var sowMC:MovieClip;
private var streamY1:Number;
public var market_mc:MovieClip;
private var onOffLongitude:Number;// = 30000
private var streamY2:Number;
private var streamY3:Number;
private var windows:Array;
private var dustNight:MovieClip;
private var castleFlagDay:MovieClip;
public var dummy_farm_btn:SimpleButton;
public var dummy_castle_btn:SimpleButton;
var castleMC:MovieClip;
public var dust_day:MovieClip;
public var tower_mc:MovieClip;
public var mill_mc:MovieClip;
var hollMC:MovieClip;
public var bg_day:bgDay;
public var dummy_holl_btn:SimpleButton;
private var onOrder:Array;
public var stream_mc:MovieClip;
private var streamNight1:MovieClip;
public var sow_mc:MovieClip;
private var streamNight2:MovieClip;
public var cloud1_night:MovieClip;
private var streamNight3:MovieClip;
private var transSowDay:Transform;
var marketMC:MovieClip;
var millMC:MovieClip;
public var armory_mc:MovieClip;
private var cloud1Night:MovieClip;
public var dummy_wine_btn:SimpleButton;
private var baracksFlagNight:MovieClip;
private var clipW:Number;
public var cloud2_day:MovieClip;
private var angMill:Number;// = 0
public var dummy_sow_btn:SimpleButton;
private var dayAlpha:Number;// = 100
var streamMC:MovieClip;
public var dummy_baraks_btn:SimpleButton;
private var sowNight:MovieClip;
private var alphaNightDirection:Number;// = 1
var tawernMC:MovieClip;
public var dummy_tower_btn:SimpleButton;
var backWall:MovieClip;
private var alphaNight:Number;// = 0
public var tawern_mc:MovieClip;
var wineMC:MovieClip;
private var cloud1Day:MovieClip;
private var angSow:Number;// = 0
private var millNight:MovieClip;
private var riverNight:MovieClip;
public var dummy_mill_btn:SimpleButton;
private var dayLongitude:Number;// = 600000
public var baracks_mc:MovieClip;
public var cloud1_day:MovieClip;
private var cloud2Night:MovieClip;
private var matrixMill:Matrix;
private var timeOfDay:Number;// = 0
private var dustDay:MovieClip;
public var dummy_tawern_btn:SimpleButton;
public var wine_mc:MovieClip;
private var transMillNight:Transform;
public var bg_night:MovieClip;
private var townElements:Array;
public var dummy_armory_btn:SimpleButton;
private var streamDay1:MovieClip;
private var streamDay3:MovieClip;
private var sunsetLongitude:Number;// = 10000
private var millX:Number;
private var millY:Number;
private var cloud2Day:MovieClip;
private var streamDay2:MovieClip;
var wallsFront:MovieClip;
public var dummy_market_btn:SimpleButton;
private var lamp:Number;// = 0
private var millDay:MovieClip;
private var dustX:Number;
private var dustY:Number;
private var riverDay:MovieClip;
var baracksMC:MovieClip;
private var castleFlagNight:MovieClip;
public var cloud2_night:MovieClip;
public function citybg(){
var _local1:Number;
windows = new Array();
onOrder = new Array();
matrixSow = new Matrix();
matrixMill = new Matrix();
townElements = new Array();
super();
clipW = 533;
getBuildings();
cloud1Day = (getChildByName("cloud1_day") as MovieClip);
cloud2Day = (getChildByName("cloud2_day") as MovieClip);
cloud1Night = (getChildByName("cloud1_night") as MovieClip);
cloud2Night = (getChildByName("cloud2_night") as MovieClip);
dustDay = (getChildByName("dust_day") as MovieClip);
dustNight = (getChildByName("dust_night") as MovieClip);
dustX = dustDay.x;
dustY = dustDay.y;
sowDay = (sowMC.getChildByName("sow2_day") as MovieClip);
sowNight = (sowMC.getChildByName("sow2_night") as MovieClip);
sowX = (sowDay.width / 2);
sowY = (sowDay.height / 2);
transSowDay = new Transform(sowDay);
transSowNight = new Transform(sowNight);
millDay = (millMC.getChildByName("wings_day") as MovieClip);
millNight = (millMC.getChildByName("wings_night") as MovieClip);
millX = ((millDay.width / 2) + 5.6);
millY = ((millDay.height / 2) + 4.3);
transMillDay = new Transform(millDay);
transMillNight = new Transform(millNight);
castleFlagDay = (castleMC.getChildByName("castle_flag_day") as MovieClip);
castleFlagNight = (castleMC.getChildByName("castle_flag_night") as MovieClip);
baracksFlagDay = (baracksMC.getChildByName("baracks_flag_day") as MovieClip);
baracksFlagNight = (baracksMC.getChildByName("baracks_flag_night") as MovieClip);
var _local2:Timer = new Timer(100);
_local2.addEventListener(TimerEvent.TIMER, cloudTimerHandler);
_local2.start();
riverDay1 = (getChildByName("river1_d") as MovieClip);
riverDay2 = (getChildByName("river2_d") as MovieClip);
riverNight1 = (getChildByName("river1_n") as MovieClip);
riverNight2 = (getChildByName("river2_n") as MovieClip);
var _local3:Timer = new Timer(500);
_local3.addEventListener(TimerEvent.TIMER, riverTimerHandler);
_local3.start();
streamDay1 = (streamMC.getChildByName("stream1_day") as MovieClip);
streamNight1 = (streamMC.getChildByName("stream1_night") as MovieClip);
streamX1 = streamDay1.x;
streamY1 = streamDay1.y;
streamDay2 = (streamMC.getChildByName("stream2_day") as MovieClip);
streamNight2 = (streamMC.getChildByName("stream2_night") as MovieClip);
streamX2 = streamDay2.x;
streamY2 = streamDay2.y;
streamDay3 = (streamMC.getChildByName("stream3_day") as MovieClip);
streamNight3 = (streamMC.getChildByName("stream3_night") as MovieClip);
streamX3 = streamDay3.x;
streamY3 = streamDay3.y;
var _local4:Timer = new Timer(50);
_local4.addEventListener(TimerEvent.TIMER, streamTimerHandler);
_local4.start();
_local1 = 0;
while (_local1 < numChildren) {
townElements[_local1] = getChildAt(_local1);
_local1++;
};
getWindows();
townElements.forEach(setTimeOfDay);
var _local5:Timer = new Timer((dayLongitude / 2));
_local5.addEventListener(TimerEvent.TIMER, dayController);
_local5.start();
}
private function changeMill(_arg1){
millMC.getChildByName("mill_night").alpha = _arg1;
millMC.getChildByName("wings_night").alpha = _arg1;
}
private function changeFarm(_arg1){
farmMC.getChildByName("farm_night").alpha = _arg1;
farmMC.getChildByName("derevo_night").alpha = _arg1;
}
private function changeMarket(_arg1){
marketMC.getChildByName("market_night").alpha = _arg1;
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function inArray(_arg1, _arg2):Boolean{
var _local3:Number;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg1 == _arg2[_local3]){
return (true);
};
_local3++;
};
return (false);
}
private function onLamp(_arg1:TimerEvent):void{
if (lamp < windows.length){
if (timeOfDay == 1){
windows[onOrder[lamp]].alpha = 1;
};
lamp++;
} else {
stop();
lamp = 0;
};
}
private function getWindows(){
windows[0] = farmMC.getChildByName("w0_night");
windows[1] = farmMC.getChildByName("w1_night");
windows[2] = millMC.getChildByName("w2_night");
windows[3] = millMC.getChildByName("w3_night");
windows[4] = millMC.getChildByName("w4_night");
windows[5] = wineMC.getChildByName("w5_night");
windows[6] = hollMC.getChildByName("w6_night");
windows[7] = hollMC.getChildByName("w7_night");
windows[8] = hollMC.getChildByName("w8_night");
windows[9] = hollMC.getChildByName("w9_night");
windows[10] = tawernMC.getChildByName("w10_night");
windows[11] = tawernMC.getChildByName("w11_night");
windows[12] = tawernMC.getChildByName("w12_night");
windows[13] = tawernMC.getChildByName("w13_night");
windows[14] = tawernMC.getChildByName("w14_night");
windows[15] = tawernMC.getChildByName("w15_night");
windows[16] = towerMC.getChildByName("w16_night");
windows[17] = towerMC.getChildByName("w17_night");
windows[18] = towerMC.getChildByName("w18_night");
windows[19] = marketMC.getChildByName("w19_night");
windows[20] = marketMC.getChildByName("w20_night");
windows[21] = armoryMC.getChildByName("w21_night");
windows[22] = armoryMC.getChildByName("w22_night");
windows[23] = armoryMC.getChildByName("w23_night");
windows[24] = baracksMC.getChildByName("w24_night");
windows[25] = baracksMC.getChildByName("w25_night");
windows[26] = baracksMC.getChildByName("w26_night");
windows[27] = baracksMC.getChildByName("w27_night");
windows[28] = baracksMC.getChildByName("w28_night");
windows[29] = castleMC.getChildByName("w29_night");
windows[30] = castleMC.getChildByName("w30_night");
windows[31] = castleMC.getChildByName("w31_night");
windows[32] = castleMC.getChildByName("w32_night");
windows[33] = castleMC.getChildByName("w33_night");
windows[34] = castleMC.getChildByName("w34_night");
windows[35] = castleMC.getChildByName("w35_night");
windows[36] = castleMC.getChildByName("w36_night");
}
private function dayController(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
if ((timeOfDay == 0)){
alphaNight = 0;
} else {
alphaNight = 1;
};
if ((timeOfDay == 0)){
alphaNightDirection = 1;
} else {
alphaNightDirection = -1;
};
if ((timeOfDay == 0)){
timeOfDay = 1;
} else {
timeOfDay = 0;
};
onOrder = new Array();
_local2 = 0;
while (onOrder.length < windows.length) {
_local3 = randRange(0, (windows.length - 1));
if (!inArray(_local3, onOrder)){
onOrder[_local2] = _local3;
_local2++;
};
};
var _local4:Timer = new Timer((sunsetLongitude / 100), 100);
_local4.addEventListener(TimerEvent.TIMER, changeTimeOfDay);
_local4.start();
}
private function changeHoll(_arg1){
hollMC.getChildByName("holl_night").alpha = _arg1;
}
private function changeTime(_arg1, _arg2:int, _arg3:Array):void{
var _local4:String;
var _local5:Number;
if (_arg1.name.search("night") != -1){
_arg1.alpha = alphaNight;
backWall.getChildByName("back_walls_night").alpha = alphaNight;
dambMc.getChildByName("damb_night").alpha = alphaNight;
wallsFront.getChildByName("walls_night").alpha = alphaNight;
changeFarm(alphaNight);
changeMill(alphaNight);
changeWine(alphaNight);
changeHoll(alphaNight);
changeTawern(alphaNight);
changeTower(alphaNight);
changeMarket(alphaNight);
changeArmory(alphaNight);
changeSow(alphaNight);
changeBaracks(alphaNight);
changeCastle(alphaNight);
};
riverNight1.alpha = alphaNight;
riverNight2.alpha = alphaNight;
_local5 = 0;
while (_local5 < windows.length) {
windows[_local5].alpha = 0;
_local5++;
};
}
public function riverTimerHandler(_arg1:TimerEvent):void{
if (timeOfDay == 1){
riverDay1.alpha = 0;
riverDay2.alpha = 0;
};
switch ((riverCounter % 3)){
case 0:
if (timeOfDay == 0){
riverDay1.alpha = 0;
riverDay2.alpha = 0;
} else {
riverNight1.alpha = 1;
riverNight2.alpha = 0;
};
break;
case 1:
if (timeOfDay == 0){
riverDay1.alpha = 1;
riverDay2.alpha = 0;
} else {
riverNight1.alpha = 1;
riverNight2.alpha = 0;
};
break;
case 2:
if (timeOfDay == 0){
riverDay1.alpha = 1;
riverDay2.alpha = 1;
} else {
riverNight1.alpha = 1;
riverNight2.alpha = 1;
};
break;
};
riverCounter = (riverCounter + 1);
}
private function changeCastle(_arg1){
castleMC.getChildByName("castle_night").alpha = _arg1;
castleMC.getChildByName("castle_flag_night").alpha = _arg1;
}
private function changeArmory(_arg1){
armoryMC.getChildByName("armory_night").alpha = _arg1;
}
public function cloudTimerHandler(_arg1:TimerEvent):void{
cloud1Day.x = (cloud1Day.x + 1);
if (cloud1Day.x > (clipW + 10)){
if (timeOfDay == 0){
cloud1Day.x = -(cloud1Day.width);
};
};
cloud2Day.x = (cloud2Day.x + 2);
if (cloud2Day.x > (clipW + 10)){
if (timeOfDay == 0){
cloud2Day.x = -(cloud2Day.width);
};
};
cloud1Night.x = (cloud1Night.x + 1);
if (cloud1Night.x > (clipW + 10)){
if (timeOfDay == 0){
cloud1Night.x = -(cloud1Day.width);
};
};
cloud2Night.x = (cloud2Night.x + 2);
if (cloud2Night.x > (clipW + 10)){
if (timeOfDay == 0){
cloud2Night.x = -(cloud2Night.width);
};
};
dustDay.x = (dustDay.x + 2);
dustDay.y = (dustDay.y - 2);
dustDay.scaleY = (dustDay.scaleY + 0.01);
dustDay.scaleX = (dustDay.scaleX + 0.01);
dustNight.x = (dustNight.x + 2);
dustNight.y = (dustNight.y - 2);
dustNight.scaleY = (dustNight.scaleY + 0.01);
dustNight.scaleX = (dustNight.scaleX + 0.01);
if (dustDay.y < -(dustDay.height)){
dustDay.x = dustX;
dustDay.y = dustY;
dustDay.scaleX = 1;
dustDay.scaleY = 1;
dustNight.x = dustX;
dustNight.y = dustY;
dustNight.scaleY = 1;
dustNight.scaleX = 1;
};
if (timeOfDay == 0){
angSow = (angSow + 6);
if (angSow > 360){
angSow = 0;
};
setTransform(35, 6, angSow, matrixSow, transSowDay, transSowNight, sowX, sowY);
};
if (timeOfDay == 0){
angMill = (angMill + 1);
if (angMill > 360){
angMill = 0;
};
setTransform(-3, -10, angMill, matrixMill, transMillDay, transMillNight, millX, millY);
};
castleFlagDay.rotation = (castleFlagDay.rotation + flagD);
castleFlagNight.rotation = (castleFlagNight.rotation + flagD);
baracksFlagDay.rotation = (baracksFlagDay.rotation + flagD);
baracksFlagNight.rotation = (baracksFlagNight.rotation + flagD);
if (baracksFlagDay.rotation > 4){
flagD = -1;
};
if (baracksFlagDay.rotation < -4){
flagD = 1;
};
}
public function setTransform(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5, _arg6, _arg7:int=20, _arg8:int=40):void{
_arg4.identity();
_arg4.tx = (_arg4.tx - _arg7);
_arg4.ty = (_arg4.ty - _arg8);
_arg4.rotate(((_arg3 * Math.PI) / 180));
_arg4.tx = (_arg4.tx + _arg1);
_arg4.ty = (_arg4.ty + _arg2);
_arg5.matrix = _arg4;
_arg6.matrix = _arg4;
}
private function changeTower(_arg1){
towerMC.getChildByName("tower_night").alpha = _arg1;
}
private function changeTawern(_arg1){
tawernMC.getChildByName("tawern_night").alpha = _arg1;
}
private function setTimeOfDay(_arg1, _arg2:int, _arg3:Array):void{
var _local4:String;
var _local5:Number;
if ((timeOfDay == 0)){
_local4 = "night";
} else {
_local4 = "day";
};
if (_arg1.name.search(_local4) != -1){
_arg1.alpha = 0;
backWall.getChildByName("back_walls_night").alpha = 0;
dambMc.getChildByName("damb_night").alpha = 0;
wallsFront.getChildByName("walls_night").alpha = 0;
changeFarm(0);
changeMill(0);
changeWine(0);
changeHoll(0);
changeTawern(0);
changeTower(0);
changeMarket(0);
changeArmory(0);
changeSow(0);
changeBaracks(0);
changeCastle(0);
};
if ((timeOfDay == 0)){
riverNight1.alpha = 0;
} else {
riverNight1.alpha = 1;
};
if ((timeOfDay == 0)){
riverNight2.alpha = 0;
} else {
riverNight2.alpha = 1;
};
_local5 = 0;
while (_local5 < windows.length) {
windows[_local5].alpha = 0;
_local5++;
};
}
private function waitOfLights(_arg1:TimerEvent):void{
var _local2:Timer = new Timer((onOffLongitude / windows.length), windows.length);
_local2.addEventListener(TimerEvent.TIMER, offLamp);
_local2.start();
}
private function getBuildings(){
backWall = (getChildByName("back_wall") as MovieClip);
dambMc = (getChildByName("damb_mc") as MovieClip);
wallsFront = (getChildByName("walls_front") as MovieClip);
farmMC = (getChildByName("farm_mc") as MovieClip);
millMC = (getChildByName("mill_mc") as MovieClip);
wineMC = (getChildByName("wine_mc") as MovieClip);
hollMC = (getChildByName("holl_mc") as MovieClip);
tawernMC = (getChildByName("tawern_mc") as MovieClip);
towerMC = (getChildByName("tower_mc") as MovieClip);
marketMC = (getChildByName("market_mc") as MovieClip);
armoryMC = (getChildByName("armory_mc") as MovieClip);
sowMC = (getChildByName("sow_mc") as MovieClip);
baracksMC = (getChildByName("baracks_mc") as MovieClip);
castleMC = (getChildByName("castle_mc") as MovieClip);
streamMC = (getChildByName("stream_mc") as MovieClip);
}
private function changeTimeOfDay(_arg1:TimerEvent):void{
var _local2:Timer;
var _local3:Timer;
alphaNight = (alphaNight + (0.01 * alphaNightDirection));
townElements.forEach(changeTime);
if ((((alphaNight >= 1)) || ((alphaNight <= 0)))){
stop();
_local2 = new Timer((onOffLongitude / windows.length), windows.length);
_local2.addEventListener(TimerEvent.TIMER, onLamp);
_local2.start();
_local3 = new Timer((((dayLongitude / 2) - (2 * onOffLongitude)) - sunsetLongitude), 1);
_local3.addEventListener(TimerEvent.TIMER, waitOfLights);
_local3.start();
};
}
private function changeSow(_arg1){
sowMC.getChildByName("sow1_night").alpha = _arg1;
sowMC.getChildByName("sow2_night").alpha = _arg1;
sowMC.getChildByName("sow3_night").alpha = _arg1;
}
private function changeBaracks(_arg1){
baracksMC.getChildByName("baracks_night").alpha = _arg1;
baracksMC.getChildByName("baracks_flag_night").alpha = _arg1;
}
private function changeWine(_arg1){
wineMC.getChildByName("wine_night").alpha = _arg1;
}
public function streamTimerHandler(_arg1:TimerEvent):void{
streamDay1.y = (streamDay1.y - 1);
streamDay1.x = (streamDay1.x + 0.5);
streamNight1.y = (streamNight1.y - 1);
streamNight1.x = (streamNight1.x + 0.5);
streamDay1.alpha = (streamDay1.alpha - 0.05);
streamNight1.alpha = (streamNight1.alpha - 0.05);
if (streamDay1.y <= -30){
if ((timeOfDay == 0)){
streamDay1.alpha = 1;
} else {
streamDay1.alpha = alphaNight;
};
streamNight1.alpha = alphaNight;
streamDay1.y = streamY1;
streamDay1.x = streamX1;
streamNight1.y = streamY1;
streamNight1.x = streamX1;
};
streamDay2.y = (streamDay2.y - 1);
streamDay2.x = (streamDay2.x + 0.5);
streamNight2.y = (streamNight2.y - 1);
streamNight2.x = (streamNight2.x + 0.5);
streamDay2.alpha = (streamDay2.alpha - 0.05);
streamNight2.alpha = (streamNight2.alpha - 0.05);
if (streamDay2.y <= -30){
if ((timeOfDay == 0)){
streamDay2.alpha = 1;
} else {
streamDay2.alpha = alphaNight;
};
streamNight2.alpha = alphaNight;
streamDay2.y = streamY2;
streamDay2.x = streamX2;
streamNight2.y = streamY2;
streamNight2.x = streamX2;
};
streamDay3.y = (streamDay3.y - 1);
streamDay3.x = (streamDay3.x + 0.5);
streamNight3.y = (streamNight3.y - 1);
streamNight3.x = (streamNight3.x + 0.5);
streamDay3.alpha = (streamDay3.alpha - 0.05);
streamNight3.alpha = (streamNight3.alpha - 0.05);
if (streamDay3.y <= -30){
if ((timeOfDay == 0)){
streamDay3.alpha = 1;
} else {
streamDay3.alpha = alphaNight;
};
streamNight3.alpha = alphaNight;
streamDay3.y = streamY3;
streamDay3.x = streamX3;
streamNight3.y = streamY3;
streamNight3.x = streamX3;
};
}
private function offLamp(_arg1:TimerEvent):void{
if (lamp < windows.length){
windows[onOrder[lamp]].alpha = 0;
lamp++;
} else {
stop();
lamp = 0;
};
}
}
}//package
Section 76
//cityInterface (cityInterface)
package {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.geom.*;
public class cityInterface extends MovieClip {
public var to_menu_btn:SimpleButton;
public var scrollPositionX:Number;// = 0
public var levelsLine:MovieClip;
public var gameScore:MovieClip;
private var moveRight:SimpleButton;
private var numLevels:Number;// = 13
public var fxFlag:Boolean;// = true
public var sound_btn:SimpleButton;
public var move_right:SimpleButton;
public var fx_btn:SimpleButton;
public var snd_B:Sound;
public var move_left:SimpleButton;
public var scrollStop:Number;// = 0
private var moveLeft:SimpleButton;
public function cityInterface(){
snd_B = new snd_Button();
super();
moveRight = (getChildByName("move_right") as SimpleButton);
moveLeft = (getChildByName("move_left") as SimpleButton);
moveRight.addEventListener(MouseEvent.MOUSE_UP, scroolRight);
moveLeft.addEventListener(MouseEvent.MOUSE_UP, scroolLeft);
}
private function scrollLevelsLeft(_arg1:Event):void{
if (scrollPositionX <= scrollStop){
removeEventListener(Event.ENTER_FRAME, scrollLevelsLeft);
};
var _local2:* = (getChildByName("levelsLine") as MovieClip);
scrollPositionX = (scrollPositionX - 4);
if (scrollPositionX < scrollStop){
scrollPositionX = scrollStop;
};
_local2.scrollRect = new Rectangle(scrollPositionX, 0, 410, 62);
}
private function playFX(_arg1){
if (fxFlag == true){
_arg1.play();
};
}
private function scroolLeft(_arg1:MouseEvent):void{
playFX(snd_B);
if (scrollStop > 0){
scrollStop = (scrollStop - 82);
addEventListener(Event.ENTER_FRAME, scrollLevelsLeft);
};
}
private function scroolRight(_arg1:MouseEvent):void{
playFX(snd_B);
if (scrollStop < ((numLevels - 5) * 82)){
addEventListener(Event.ENTER_FRAME, scrollLevelsRight);
scrollStop = (scrollStop + 82);
};
}
private function scrollLevelsRight(_arg1:Event):void{
if (scrollPositionX >= scrollStop){
removeEventListener(Event.ENTER_FRAME, scrollLevelsRight);
};
var _local2:* = (getChildByName("levelsLine") as MovieClip);
scrollPositionX = (scrollPositionX + 4);
if (scrollPositionX > scrollStop){
scrollPositionX = scrollStop;
};
_local2.scrollRect = new Rectangle(scrollPositionX, 0, 410, 62);
}
}
}//package
Section 77
//clear_saves_text (clear_saves_text)
package {
import flash.display.*;
public dynamic class clear_saves_text extends MovieClip {
}
}//package
Section 78
//Clouds (Clouds)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Clouds extends MovieClip {
public var s:MovieClip;
public var d:MovieClip;
public var c:Array;
public function Clouds(){
var _local2:Number;
c = new Array();
super();
var _local1:Number = 0;
_local2 = 0;
while (_local2 < numChildren) {
if (getChildAt(_local2).name.search("cl") != -1){
c[_local1] = (getChildAt(_local2) as MovieClip);
_local1++;
};
_local2++;
};
d = (getChildByName("dr") as MovieClip);
s = (getChildByName("shar") as MovieClip);
var _local3:Timer = new Timer(50);
_local3.addEventListener(TimerEvent.TIMER, cloudHandler);
_local3.start();
}
public function cloudHandler(_arg1:TimerEvent):void{
c.forEach(moveClouds);
d.x = (d.x - 4);
if (d.x < -(d.width)){
d.x = 1000;
d.y = randRange(d.height, (700 - d.height));
};
s.x = (s.x + 3);
if (s.x > (533 + 10)){
s.x = -500;
s.y = randRange(s.height, (700 - s.height));
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function moveClouds(_arg1, _arg2:int, _arg3:Array):void{
_arg1.x = (_arg1.x + 1);
if (_arg1.x > (533 + 10)){
_arg1.x = -(_arg1.width);
_arg1.y = randRange(_arg1.height, (700 - _arg1.height));
};
}
}
}//package
Section 79
//comboStars (comboStars)
package {
import flash.display.*;
public dynamic class comboStars extends MovieClip {
public function comboStars(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package
Section 80
//completeLevel (completeLevel)
package {
import flash.display.*;
public dynamic class completeLevel extends MovieClip {
}
}//package
Section 81
//completeLevelBW (completeLevelBW)
package {
import flash.display.*;
public dynamic class completeLevelBW extends MovieClip {
}
}//package
Section 82
//countDownBg (countDownBg)
package {
import flash.display.*;
import flash.text.*;
public dynamic class countDownBg extends MovieClip {
public var countDown_txt:TextField;
}
}//package
Section 83
//damb_text (damb_text)
package {
import flash.display.*;
public dynamic class damb_text extends MovieClip {
}
}//package
Section 84
//dambIco (dambIco)
package {
import flash.display.*;
public dynamic class dambIco extends MovieClip {
}
}//package
Section 85
//detail_svitok (detail_svitok)
package {
import flash.display.*;
public class detail_svitok extends MovieClip {
public var c:MovieClip;
public var d:MovieClip;
public var sv_center:MovieClip;
public var u:MovieClip;
public var sv_up:MovieClip;
public var sv_down:MovieClip;
public function detail_svitok(){
u = (getChildByName("sv_up") as MovieClip);
d = (getChildByName("sv_down") as MovieClip);
c = (getChildByName("sv_center") as MovieClip);
}
}
}//package
Section 86
//earthQuake (earthQuake)
package {
import flash.display.*;
public dynamic class earthQuake extends MovieClip {
public var quake_line:MovieClip;
}
}//package
Section 87
//enemyMess (enemyMess)
package {
import flash.display.*;
public dynamic class enemyMess extends MovieClip {
}
}//package
Section 88
//enterGame_text (enterGame_text)
package {
import flash.display.*;
public dynamic class enterGame_text extends MovieClip {
}
}//package
Section 89
//enterGame_text1 (enterGame_text1)
package {
import flash.display.*;
public dynamic class enterGame_text1 extends MovieClip {
}
}//package
Section 90
//Era1 (Era1)
package {
import flash.display.*;
import flash.events.*;
public class Era1 extends MovieClip {
public var success:Number;// = 0
public var level:MovieClip;
private var bgTowerBlocks:Array;
public var closeLevel:Number;// = 0
public var levelBG_mc:MovieClip;
public function Era1(_arg1:Number, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean=false){
var _local6:Number;
var _local8:Number;
var _local9:*;
var _local10:Number;
bgTowerBlocks = new Array();
super();
var _local5:MovieClip = (getChildByName("levelBG_mc") as MovieClip);
var _local7:Number = 0;
_local6 = 0;
while (_local6 < 2) {
_local9 = randRange(2, 10);
if (_local6 == 0){
_local8 = randRange(0, 50);
} else {
_local8 = randRange(400, 480);
};
_local10 = 0;
while (_local10 < _local9) {
bgTowerBlocks[_local7] = new bg_tower_block();
bgTowerBlocks[_local7].y = ((370 - bgTowerBlocks[_local7].height) - (_local10 * bgTowerBlocks[_local7].height));
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local10++;
};
bgTowerBlocks[_local7] = new bg_tower_top();
bgTowerBlocks[_local7].y = ((370 - (_local9 * 56)) - bgTowerBlocks[_local7].height);
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local6++;
};
level = new TowerBloxxLevel(_arg1, _local5, _arg2, _arg3, _arg4);
addChild(level);
addEventListener(Event.ENTER_FRAME, testComplete);
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function testComplete(_arg1:Event):void{
closeLevel = level.closeLevel;
success = level.success;
}
}
}//package
Section 91
//era1_block1 (era1_block1)
package {
import flash.display.*;
public dynamic class era1_block1 extends MovieClip {
}
}//package
Section 92
//era1_block2 (era1_block2)
package {
import flash.display.*;
public dynamic class era1_block2 extends MovieClip {
}
}//package
Section 93
//era1_block3 (era1_block3)
package {
import flash.display.*;
public dynamic class era1_block3 extends MovieClip {
}
}//package
Section 94
//era1_block4 (era1_block4)
package {
import flash.display.*;
public dynamic class era1_block4 extends MovieClip {
}
}//package
Section 95
//Era2 (Era2)
package {
import flash.display.*;
import flash.events.*;
public class Era2 extends MovieClip {
public var success:Number;// = 0
public var level:MovieClip;
private var bgTowerBlocks:Array;
public var closeLevel:Number;// = 0
public var levelBG_mc:MovieClip;
public function Era2(_arg1:Number, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean=false){
var _local6:Number;
var _local8:Number;
var _local9:*;
var _local10:Number;
bgTowerBlocks = new Array();
super();
var _local5:MovieClip = (getChildByName("levelBG_mc") as MovieClip);
var _local7:Number = 0;
_local6 = 0;
while (_local6 < 2) {
_local9 = randRange(2, 10);
if (_local6 == 0){
_local8 = randRange(0, 50);
} else {
_local8 = randRange(400, 480);
};
_local10 = 0;
while (_local10 < _local9) {
bgTowerBlocks[_local7] = new bg_tower_block();
bgTowerBlocks[_local7].y = ((370 - bgTowerBlocks[_local7].height) - (_local10 * bgTowerBlocks[_local7].height));
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local10++;
};
bgTowerBlocks[_local7] = new bg_tower_top();
bgTowerBlocks[_local7].y = ((370 - (_local9 * 56)) - bgTowerBlocks[_local7].height);
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local6++;
};
level = new TowerBloxxLevel(_arg1, _local5, _arg2, _arg3, _arg4);
addChild(level);
addEventListener(Event.ENTER_FRAME, testComplete);
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function testComplete(_arg1:Event):void{
closeLevel = level.closeLevel;
success = level.success;
}
}
}//package
Section 96
//era2_block1 (era2_block1)
package {
import flash.display.*;
public dynamic class era2_block1 extends MovieClip {
}
}//package
Section 97
//era2_block2 (era2_block2)
package {
import flash.display.*;
public dynamic class era2_block2 extends MovieClip {
}
}//package
Section 98
//era2_block3 (era2_block3)
package {
import flash.display.*;
public dynamic class era2_block3 extends MovieClip {
}
}//package
Section 99
//era2_block4 (era2_block4)
package {
import flash.display.*;
public dynamic class era2_block4 extends MovieClip {
}
}//package
Section 100
//Era3 (Era3)
package {
import flash.display.*;
import flash.events.*;
public class Era3 extends MovieClip {
public var success:Number;// = 0
public var level:MovieClip;
private var bgTowerBlocks:Array;
public var closeLevel:Number;// = 0
public var levelBG_mc:levelBgEra3;
public function Era3(_arg1:Number, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean=false){
var _local6:Number;
var _local8:Number;
var _local9:*;
var _local10:Number;
bgTowerBlocks = new Array();
super();
var _local5:MovieClip = (getChildByName("levelBG_mc") as MovieClip);
var _local7:Number = 0;
_local6 = 0;
while (_local6 < 2) {
_local9 = randRange(2, 10);
if (_local6 == 0){
_local8 = randRange(0, 50);
} else {
_local8 = randRange(400, 480);
};
_local10 = 0;
while (_local10 < _local9) {
bgTowerBlocks[_local7] = new bg_tower_block();
bgTowerBlocks[_local7].y = ((370 - bgTowerBlocks[_local7].height) - (_local10 * bgTowerBlocks[_local7].height));
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local10++;
};
bgTowerBlocks[_local7] = new bg_tower_top();
bgTowerBlocks[_local7].y = ((370 - (_local9 * 56)) - bgTowerBlocks[_local7].height);
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local6++;
};
level = new TowerBloxxLevel(_arg1, _local5, _arg2, _arg3, _arg4);
addChild(level);
addEventListener(Event.ENTER_FRAME, testComplete);
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function testComplete(_arg1:Event):void{
closeLevel = level.closeLevel;
success = level.success;
}
}
}//package
Section 101
//era3_block1 (era3_block1)
package {
import flash.display.*;
public dynamic class era3_block1 extends MovieClip {
}
}//package
Section 102
//era3_block2 (era3_block2)
package {
import flash.display.*;
public dynamic class era3_block2 extends MovieClip {
}
}//package
Section 103
//era3_block3 (era3_block3)
package {
import flash.display.*;
public dynamic class era3_block3 extends MovieClip {
}
}//package
Section 104
//era3_block4 (era3_block4)
package {
import flash.display.*;
public dynamic class era3_block4 extends MovieClip {
}
}//package
Section 105
//Era4 (Era4)
package {
import flash.display.*;
import flash.events.*;
public class Era4 extends MovieClip {
public var success:Number;// = 0
public var level:MovieClip;
private var bgTowerBlocks:Array;
public var closeLevel:Number;// = 0
public var levelBG_mc:MovieClip;
public function Era4(_arg1:Number, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean=false){
var _local6:Number;
var _local8:Number;
var _local9:*;
var _local10:Number;
bgTowerBlocks = new Array();
super();
var _local5:MovieClip = (getChildByName("levelBG_mc") as MovieClip);
var _local7:Number = 0;
_local6 = 0;
while (_local6 < 2) {
_local9 = randRange(2, 10);
if (_local6 == 0){
_local8 = randRange(0, 50);
} else {
_local8 = randRange(400, 480);
};
_local10 = 0;
while (_local10 < _local9) {
bgTowerBlocks[_local7] = new bg_tower_block();
bgTowerBlocks[_local7].y = ((370 - bgTowerBlocks[_local7].height) - (_local10 * bgTowerBlocks[_local7].height));
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local10++;
};
bgTowerBlocks[_local7] = new bg_tower_top();
bgTowerBlocks[_local7].y = ((370 - (_local9 * 56)) - bgTowerBlocks[_local7].height);
bgTowerBlocks[_local7].x = _local8;
_local5.addChild(bgTowerBlocks[_local7]);
_local7++;
_local6++;
};
level = new TowerBloxxLevel(_arg1, _local5, _arg2, _arg3, _arg4);
addChild(level);
addEventListener(Event.ENTER_FRAME, testComplete);
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function testComplete(_arg1:Event):void{
closeLevel = level.closeLevel;
success = level.success;
}
}
}//package
Section 106
//era4_block1 (era4_block1)
package {
import flash.display.*;
public dynamic class era4_block1 extends MovieClip {
}
}//package
Section 107
//era4_block2 (era4_block2)
package {
import flash.display.*;
public dynamic class era4_block2 extends MovieClip {
}
}//package
Section 108
//era4_block3 (era4_block3)
package {
import flash.display.*;
public dynamic class era4_block3 extends MovieClip {
}
}//package
Section 109
//era4_block4 (era4_block4)
package {
import flash.display.*;
public dynamic class era4_block4 extends MovieClip {
}
}//package
Section 110
//errorSnd (errorSnd)
package {
import flash.media.*;
public dynamic class errorSnd extends Sound {
}
}//package
Section 111
//exit_level_text (exit_level_text)
package {
import flash.display.*;
public dynamic class exit_level_text extends MovieClip {
}
}//package
Section 112
//exitBtn (exitBtn)
package {
import flash.display.*;
public dynamic class exitBtn extends SimpleButton {
}
}//package
Section 113
//Fabulous (Fabulous)
package {
import flash.display.*;
public dynamic class Fabulous extends MovieClip {
public function Fabulous(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 114
//Fantastic (Fantastic)
package {
import flash.display.*;
public dynamic class Fantastic extends MovieClip {
public function Fantastic(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 115
//farm_text (farm_text)
package {
import flash.display.*;
public class farm_text extends MovieClip {
}
}//package
Section 116
//farmIco (farmIco)
package {
import flash.display.*;
public dynamic class farmIco extends MovieClip {
}
}//package
Section 117
//finishGameMess (finishGameMess)
package {
import flash.display.*;
public dynamic class finishGameMess extends MovieClip {
}
}//package
Section 118
//firework (firework)
package {
import flash.display.*;
public dynamic class firework extends MovieClip {
}
}//package
Section 119
//firstLevelFinishMessMC (firstLevelFinishMessMC)
package {
import flash.display.*;
public dynamic class firstLevelFinishMessMC extends MovieClip {
}
}//package
Section 120
//game (game)
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import spill.localisation.*;
import com.spilgames.api.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.geom.*;
import flash.filters.*;
public class game extends MovieClip {
public var scaleXpoint:Number;// = 0
public var startCamp:SimpleButton;
public var showFinishMess:Boolean;// = true
public var newblock_mess:MovieClip;
public var name_ok:SimpleButton;
public var levelFinished:Number;// = 1
public var highScore:SimpleButton;
public var brLogo:BrandingLogo;
public var languageSelectionBox:LanguageSelectBox;
public var water_mess:MovieClip;
public var clear_txt_no:SimpleButton;
public var music:Sound;
public var lvl:int;
public var fxBtn:SimpleButton;
var detailDirection:Number;// = 2
private var damb_b:MovieClip;
private var damb_c:MovieClip;
public var buildings:Array;
private var baracks_c:MovieClip;
public var bg:MovieClip;
public var iface:MovieClip;
public var clearSaves:SimpleButton;
public var enemy_mess:MovieClip;
public var sc;
private var detail:MovieClip;
public var ac4:MovieClip;
public var ac5:MovieClip;
public var ac7:MovieClip;
public var ac1:MovieClip;
public var bulidOrder:Array;
public var ac8:MovieClip;
public var ac9:MovieClip;
public var ac2:MovieClip;
public var quake_mess:MovieClip;
public var ac6:MovieClip;
private var totalSum:Number;// = 0
public var ac3:MovieClip;
public var l:MovieClip;
private var baracks_b:MovieClip;
public var bClosed:MovieClip;
public var levelAch:Boolean;// = true
private var menuBtn:SimpleButton;
public var mouseDisable:Boolean;// = false
private var armory_b:MovieClip;
private var armory_c:MovieClip;
private var detail_text:MovieClip;
public var achivments:Array;
public var moreGames:SimpleButton;
public var history:MovieClip;
public var glowFlag:Number;// = 20
private var farm_c:MovieClip;
public var panelMC:MovieClip;
public var submitScoreBtn:SimpleButton;
public var clear_txt_yes:SimpleButton;
private var farm_b:MovieClip;
private var tower_b:MovieClip;
private var tower_c:MovieClip;
public var dummy:Array;
var appearTimer:Timer;
public var messLevel:int;
public var gameMode:String;// = "wellcome"
public var soundBtnLevel:SimpleButton;
public var scaleYpoint:Number;// = 0
private var sow_b:MovieClip;
private var sow_c:MovieClip;
public var lvlReplay:String;
private var showDescription:String;
public var buildingsCompleted:Number;// = 0
public var soundBtn:SimpleButton;
public var finishGame_mess:MovieClip;
public var startChal:SimpleButton;
private var castle_b:MovieClip;
private var castle_c:MovieClip;
public var enemy_history:MovieClip;
var detailTimerClose:Timer;
public var actxt3:MovieClip;
public var actxt4:MovieClip;
public var actxt6:MovieClip;
public var actxt7:MovieClip;
private var holl_c:MovieClip;
public var snd_B:Sound;
public var snd_C:Sound;
public var actxt5:MovieClip;
private var holl_b:MovieClip;
public var actxt1:MovieClip;
public var actxt2:MovieClip;
private var replayBtn:SimpleButton;
public var viewHightScoreBtn:SimpleButton;
public var actxt8:MovieClip;
private var mill_b:MovieClip;
public var actxt9:MovieClip;
private var mill_c:MovieClip;
public var snd_P:Sound;
private var levelDescr:Array;
public var Submitter;
public var firstLevelFinishMess:MovieClip;
public var achCNT:Number;// = 0
public var streamMC:MovieClip;
var soundFlag:Boolean;// = true
private var market_b:MovieClip;
private var market_c:MovieClip;
public var pName:String;
public var channel:SoundChannel;
private var blankShaddow:MovieClip;
public var resume_Btn:SimpleButton;
public var quake_history:MovieClip;
public var mySo:SharedObject;
public var win_history:MovieClip;
public var pName_mc:MovieClip;
public var firstGameEnter:Boolean;// = true
public var order:Array;
public var totalLength:Number;// = 0
public var blink:MovieClip;
var fxFlag:Boolean;// = true
public var firstStartLevel1:Boolean;// = true
public var history_ok:SimpleButton;
public var water_history:MovieClip;
public var buildingReplace:Array;
public var mMenu:MovieClip;
public var lButtons:MovieClip;
public var firstStartLevel2:Boolean;// = true
public var fxBtnLevel:SimpleButton;
var showIfaceTimer:Timer;
public var closeAch:SimpleButton;
public var historyStep:Number;// = 0
var hideIfaceTimer:Timer;
public var pic:MovieClip;
private var walls_b:MovieClip;
public var glow:Number;// = 0
public var swap:Array;
private var walls_c:MovieClip;
public var exit_Btn:SimpleButton;
var panelTimer:Timer;
private var tawern_c:MovieClip;
public var glowBdr:MovieClip;
public var progress2:MovieClip;
private var detail_ico:MovieClip;
public var all:MovieClip;
private var tawern_b:MovieClip;
public var returnToMainMenu:SimpleButton;
private var wine_b:MovieClip;
private var wine_c:MovieClip;
public var actxt11:MovieClip;
public var actxt12:MovieClip;
public var progress1:MovieClip;
public var actxt10:MovieClip;
public var progress3:MovieClip;
public var gameScore:Number;// = 0
public var ac11:MovieClip;
public var ac12:MovieClip;
public var buildingsIndex:Array;
public var ac10:MovieClip;
public var background_city:citybg;
var detailTimerOpen:Timer;
public var start_level_txt_ok:SimpleButton;
var detailSize:Number;// = 1
private var replayFlag:Boolean;// = false
private var levelIcons:MovieClip;
public static const SEND_DEBUG:Boolean = false;
public function game(_arg1){
var _local2:Number;
var _local5:TextField;
var _local6:URLLoader;
var _local7:URLRequest;
history_ok = new upBtn();
mMenu = new MainMenu();
snd_P = new snd_Paper();
snd_B = new snd_Button();
snd_C = new buildingCompleted();
viewHightScoreBtn = new viewHightScore();
submitScoreBtn = new submitScore();
buildings = new Array();
order = new Array();
swap = new Array();
bulidOrder = new Array();
water_mess = new waterMess();
quake_mess = new quakeMess();
enemy_mess = new enemyMess();
newblock_mess = new newBlockMess();
firstLevelFinishMess = new firstLevelFinishMessMC();
finishGame_mess = new finishGameMess();
water_history = new history3();
quake_history = new history4();
enemy_history = new history5();
win_history = new history6();
sc = new plScore();
appearTimer = new Timer(5);
panelTimer = new Timer(10);
hideIfaceTimer = new Timer(5);
showIfaceTimer = new Timer(5);
detailTimerOpen = new Timer(5);
detailTimerClose = new Timer(5);
levelDescr = new Array();
buildingsIndex = new Array();
buildingReplace = new Array();
dummy = new Array();
achivments = new Array();
all = new allAchivments();
panelMC = new panel();
ac1 = new a1();
actxt1 = new act1();
ac2 = new a2();
actxt2 = new act2();
ac3 = new a3();
actxt3 = new act3();
ac4 = new a4();
actxt4 = new act4();
ac5 = new a5();
actxt5 = new act5();
ac6 = new a6();
actxt6 = new act6();
ac7 = new a7();
actxt7 = new act7();
ac8 = new a8();
actxt8 = new act8();
ac9 = new a9();
actxt9 = new act9();
ac10 = new a10();
actxt10 = new act10();
ac11 = new a11();
actxt11 = new act11();
ac12 = new a12();
actxt12 = new act12();
music = new MenuMusic();
brLogo = new BrandingLogo();
languageSelectionBox = new LanguageSelectBox();
super();
Submitter = _arg1;
history_ok.rotation = 270;
history_ok.x = 495;
history_ok.y = 340;
startMusic();
panelTimer.addEventListener(TimerEvent.TIMER, panelTimerHandler);
mySo = SharedObject.getLocal("TowerBurgData");
addChild(mMenu);
bClosed = (mMenu.getChildByName("bookClosed_mc") as MovieClip);
name_ok = new ok_btn();
name_ok.x = 287;
name_ok.y = 325;
name_ok.addEventListener(MouseEvent.MOUSE_UP, nameOK);
brLogo.x = ((533 - (brLogo.width / 2)) - 20);
brLogo.y = 370;
brLogo.mouseEnabled = (brLogo.buttonMode = (brLogo.useHandCursor = true));
brLogo.addEventListener(MouseEvent.MOUSE_UP, clickLogo);
languageSelectionBox.y = 15;
languageSelectionBox.x = 370;
languageSelectionBox.popupLocation = "bottom";
addChild(languageSelectionBox);
addChild(brLogo);
addChild(languageSelectionBox);
if ((((mySo.data.PlayerName == undefined)) || ((mySo.data.gameScore == undefined)))){
levelFinished = 1;
buildingsCompleted = 0;
gameScore = 0;
mMenu.addChild(name_ok);
firstGameEnter = true;
achivments = new Array();
firstStartLevel1 = true;
firstStartLevel2 = true;
} else {
firstStartLevel1 = mySo.data.firstStartLevel1;
firstStartLevel2 = mySo.data.firstStartLevel2;
firstGameEnter = false;
gameScore = mySo.data.gameScore;
levelFinished = mySo.data.levelFinished;
buildingsCompleted = mySo.data.buildingsCompleted;
if (mySo.data.achivments != null){
achivments = mySo.data.achivments;
};
_local5 = (bClosed.getChildByName("pl_txt") as TextField);
mMenu.gotoAndStop(2);
pName_mc = new playerNameText();
pName_mc.x = 154;
pName_mc.y = 15;
_local5 = (pName_mc.getChildByName("playerName") as TextField);
_local5.text = mySo.data.PlayerName;
mMenu.addChild(pName_mc);
openBook();
};
all.getChildByName("ach_mill_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_mill_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_mill_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_mill_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_bronze_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_bronze_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_bronze_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_bronze_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_head_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_head_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_head_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_head_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_damb_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_damb_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_damb_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_damb_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_silver_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_silver_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_silver_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_silver_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_gold_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_gold_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_gold_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_gold_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_vulc_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_vulc_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_vulc_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_vulc_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_enemy_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_enemy_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_enemy_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_enemy_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_master_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_master_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_master_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_master_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_finish_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_finish_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_finish_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_finish_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_hero_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_hero_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_hero_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_hero_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_chal_mc").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_chal_mc").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
all.getChildByName("ach_chal_lock").addEventListener(MouseEvent.MOUSE_OVER, showAchivmentDescr);
all.getChildByName("ach_chal_lock").addEventListener(MouseEvent.MOUSE_OUT, hideAchivmentDescr);
_local2 = 0;
while (_local2 < 12) {
if (achivments[_local2] != null){
all.getChildByName(achivments[_local2]).alpha = 1;
switch (achivments[_local2]){
case "ach_mill_mc":
all.getChildByName("ach_mill_lock").y = (all.getChildByName("ach_mill_lock").y + 400);
break;
case "ach_bronze_mc":
all.getChildByName("ach_bronze_lock").y = (all.getChildByName("ach_bronze_lock").y + 400);
break;
case "ach_head_mc":
all.getChildByName("ach_head_lock").y = (all.getChildByName("ach_head_lock").y + 400);
break;
case "ach_damb_mc":
all.getChildByName("ach_damb_lock").y = (all.getChildByName("ach_damb_lock").y + 400);
break;
case "ach_silver_mc":
all.getChildByName("ach_silver_lock").y = (all.getChildByName("ach_silver_lock").y + 400);
break;
case "ach_gold_mc":
all.getChildByName("ach_gold_lock").y = (all.getChildByName("ach_gold_lock").y + 400);
break;
case "ach_vulc_mc":
all.getChildByName("ach_vulc_lock").y = (all.getChildByName("ach_vulc_lock").y + 400);
break;
case "ach_enemy_mc":
all.getChildByName("ach_enemy_lock").y = (all.getChildByName("ach_enemy_lock").y + 400);
break;
case "ach_master_mc":
all.getChildByName("ach_master_lock").y = (all.getChildByName("ach_master_lock").y + 400);
break;
case "ach_finish_mc":
all.getChildByName("ach_finish_lock").y = (all.getChildByName("ach_finish_lock").y + 400);
break;
case "ach_hero_mc":
all.getChildByName("ach_hero_lock").y = (all.getChildByName("ach_hero_lock").y + 400);
break;
case "ach_chal_mc":
all.getChildByName("ach_chal_lock").y = (all.getChildByName("ach_chal_lock").y + 400);
break;
};
};
_local2++;
};
bg = (getChildByName("background_city") as MovieClip);
getBuildings();
order[0] = 0;
order[1] = 11;
order[2] = 5;
order[3] = 3;
order[4] = 7;
order[5] = 4;
order[6] = 6;
order[7] = 8;
order[8] = 9;
order[9] = 10;
order[10] = 12;
order[11] = 13;
order[12] = 1;
order[13] = 2;
bulidOrder[0] = "3";
swap[3] = 27;
bulidOrder[1] = "11";
swap[11] = 23;
bulidOrder[2] = "5";
swap[5] = 25;
bulidOrder[3] = "1";
swap[1] = 16;
bulidOrder[4] = "7";
swap[7] = 22;
bulidOrder[5] = "9";
swap[9] = 20;
bulidOrder[6] = "4";
swap[4] = 26;
bulidOrder[7] = "8";
swap[8] = 21;
bulidOrder[8] = "6";
swap[6] = 24;
bulidOrder[9] = "0,2";
swap[0] = 15;
swap[2] = 28;
bulidOrder[10] = "12";
swap[12] = 18;
bulidOrder[11] = "10";
swap[10] = 19;
bulidOrder[12] = "13";
swap[13] = 17;
buildings.forEach(removeBuildings);
order.forEach(showCompletedBuildings);
createInterface();
levelDescr[-1] = new Array();
levelDescr[-1]["pic"] = null;
levelDescr[-1]["drow"] = 55;
levelDescr[-1]["show"] = false;
levelDescr[-1]["lock"] = null;
levelDescr[-1]["era"] = "Era4";
var _local3:Number = 0;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = farm_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_1";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["ach"] = new Array();
levelDescr[_local3]["finishMess"] = firstLevelFinishMess;
levelDescr[_local3]["ach"][0] = (all.getChildByName("ach_mill_mc") as MovieClip);
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = sow_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = sow_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_2";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = wine_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_3";
levelDescr[_local3]["numtowers"] = 3;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 2;
levelDescr[_local3]["ach"] = new Array();
levelDescr[_local3]["ach"][0] = (all.getChildByName("ach_head_mc") as MovieClip);
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = damb_c;
levelDescr[_local3]["drow"] = 20;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era2";
levelDescr[_local3]["history"] = water_history;
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = damb_c;
levelDescr[_local3]["drow"] = 40;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era2";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = damb_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_4";
levelDescr[_local3]["era"] = "Era2";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["replayhistory"] = water_history;
levelDescr[_local3]["finishMess"] = newblock_mess;
levelDescr[_local3]["ach"] = new Array();
levelDescr[_local3]["ach"][0] = (all.getChildByName("ach_damb_mc") as MovieClip);
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = tawern_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = tawern_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_5";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = market_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = market_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_6";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = mill_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 0;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = mill_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_7";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["reduce"] = 1;
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = tower_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_8";
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["reduce"] = 2;
levelDescr[_local3]["size"] = 5;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = holl_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_9";
levelDescr[_local3]["numtowers"] = 3;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["size"] = 5;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = walls_c;
levelDescr[_local3]["drow"] = 15;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era3";
levelDescr[_local3]["history"] = quake_history;
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = walls_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era3";
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = walls_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_10";
levelDescr[_local3]["era"] = "Era3";
levelDescr[_local3]["numtowers"] = 2;
levelDescr[_local3]["replayhistory"] = quake_history;
levelDescr[_local3]["finishMess"] = newblock_mess;
levelDescr[_local3]["ach"] = new Array();
levelDescr[_local3]["ach"][0] = (all.getChildByName("ach_vulc_mc") as MovieClip);
levelDescr[_local3]["size"] = 5;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = baracks_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = baracks_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_11";
levelDescr[_local3]["numtowers"] = 3;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["size"] = 10;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = armory_c;
levelDescr[_local3]["drow"] = 20;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = armory_c;
levelDescr[_local3]["drow"] = 40;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = armory_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = "lock_12";
levelDescr[_local3]["numtowers"] = 4;
levelDescr[_local3]["era"] = "Era1";
levelDescr[_local3]["finishMess"] = newblock_mess;
levelDescr[_local3]["size"] = 15;
levelDescr[_local3]["reduce"] = 1;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = castle_c;
levelDescr[_local3]["drow"] = 30;
levelDescr[_local3]["show"] = false;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era4";
levelDescr[_local3]["history"] = enemy_history;
levelDescr[_local3]["size"] = 0;
levelDescr[_local3]["reduce"] = 2;
_local3++;
levelDescr[_local3] = new Array();
levelDescr[_local3]["pic"] = castle_c;
levelDescr[_local3]["drow"] = 55;
levelDescr[_local3]["show"] = true;
levelDescr[_local3]["lock"] = null;
levelDescr[_local3]["era"] = "Era4";
levelDescr[_local3]["replayhistory"] = enemy_history;
levelDescr[_local3]["finishhistory"] = win_history;
levelDescr[_local3]["ach"] = new Array();
levelDescr[_local3]["ach"][0] = (all.getChildByName("ach_enemy_mc") as MovieClip);
levelDescr[_local3]["ach"][1] = (all.getChildByName("ach_finish_mc") as MovieClip);
levelDescr[_local3]["size"] = 25;
levelDescr[_local3]["reduce"] = 2;
_local2 = 0;
while (_local2 < (levelFinished - 1)) {
unlockLevels(_local2);
_local2++;
};
_local2 = 0;
while (_local2 < levelDescr.length) {
totalLength = (totalLength + levelDescr[_local2]["size"]);
_local2++;
};
var _local4:Number = 0;
_local2 = 0;
while (_local2 < (levelFinished - 1)) {
if (_local2 <= _local3){
_local4 = (_local4 + levelDescr[_local2]["size"]);
};
_local2++;
};
progress2.width = Math.round(((237 * _local4) / totalLength));
progress3.x = (progress2.width + 148);
if (SEND_DEBUG == true){
_local6 = new URLLoader();
_local7 = new URLRequest("debug.php?mode=gamestarted");
_local6.load(_local7);
};
}
public function showCompletedBuildings(_arg1, _arg2:int, _arg3:Array):void{
var _local4:Number;
var _local7:Number;
var _local8:*;
var _local5:Array = new Array();
var _local6:Number = 0;
_local4 = 0;
while (_local4 < buildingsCompleted) {
_local8 = bulidOrder[_local4].toString().split(",");
if (_local8.length > 1){
_local7 = 0;
while (_local7 < _local8.length) {
_local5[_local6] = _local8[_local7];
_local6++;
_local7++;
};
} else {
_local5[_local6] = _local8[0];
_local6++;
};
_local4++;
};
_local4 = 0;
while (_local4 < _local5.length) {
bg.removeChildAt(buildingsIndex[_local5[_local4]]);
bg.addChildAt(buildings[_local5[_local4]], buildingsIndex[_local5[_local4]]);
dummy[_local5[_local4]].addEventListener(MouseEvent.MOUSE_UP, showDetail);
_local4++;
};
}
public function startChalHandler(_arg1:MouseEvent):void{
playFX(snd_B);
channel.stop();
gameMode = "chal";
playFX(snd_B);
replayFlag = false;
remove(1);
var _local2:Class = (loaderInfo.applicationDomain.getDefinition(levelDescr[-1]["era"]) as Class);
l = new _local2(0, fxFlag, soundFlag);
removeChild(mMenu);
removeChild(bg);
addChild(l);
addChild(lButtons);
if (all.getChildByName("ach_chal_mc").alpha != 1){
all.getChildByName("ach_chal_mc").alpha = 1;
showAchivment(all.getChildByName("ach_chal_mc"));
};
addEventListener(Event.ENTER_FRAME, checkLevelStatus);
}
private function showSubmitScore(_arg1:MouseEvent):void{
playFX(snd_B);
}
private function inArray(_arg1, _arg2):Boolean{
var _local3:Number;
_local3 = 0;
while (_local3 < _arg2.length) {
if (_arg1 == _arg2[_local3]){
return (true);
};
_local3++;
};
return (false);
}
public function startLevel(_arg1:MouseEvent):void{
var _local2:URLLoader;
var _local3:URLRequest;
var _local4:Class;
if (mouseDisable == false){
if (SEND_DEBUG == true){
_local2 = new URLLoader();
_local3 = new URLRequest("debug.php?mode=levelbegin");
_local2.load(_local3);
};
gameMode = "level";
playFX(snd_B);
replayFlag = false;
if (blink != null){
removeChild(blink);
blink = null;
};
if (glowBdr != null){
iface.removeChild(glowBdr);
glowBdr = null;
};
if (firstGameEnter == true){
remove();
firstGameEnter = false;
returnToMainMenu.addEventListener(MouseEvent.MOUSE_UP, returnToMainMenuHandler);
} else {
remove(1);
};
removeChild(iface);
removeChild(bg);
if (levelDescr[(levelFinished - 1)]["history"] != null){
addChild(levelDescr[(levelFinished - 1)]["history"]);
addChild(history_ok);
history_ok.addEventListener(MouseEvent.MOUSE_UP, closeHistory);
} else {
channel.stop();
_local4 = (loaderInfo.applicationDomain.getDefinition(levelDescr[(levelFinished - 1)]["era"]) as Class);
if (levelFinished == 1){
l = new _local4(levelFinished, fxFlag, soundFlag, firstStartLevel1);
mySo.data.firstStartLevel1 = false;
firstStartLevel1 = false;
} else {
if (levelFinished == 4){
l = new _local4(levelFinished, fxFlag, soundFlag, firstStartLevel2);
firstStartLevel2 = false;
mySo.data.firstStartLevel2 = false;
} else {
l = new _local4(levelFinished, fxFlag, soundFlag);
};
};
addChild(l);
if (levelDescr[(levelFinished - 1)]["message"] != null){
showStartLevelMessage();
};
addChild(lButtons);
addEventListener(Event.ENTER_FRAME, checkLevelStatus);
};
};
}
public function removeBuildings(_arg1, _arg2:int, _arg3:Array):void{
if (bg.getChildByName(_arg1.name) != null){
bg.removeChild(_arg1);
bg.addChildAt(buildingReplace[_arg2], buildingsIndex[_arg2]);
};
}
private function hideAchivmentDescr(_arg1:MouseEvent):void{
var _local2:MovieClip = (all.getChildByName("achDescr_mc") as MovieClip);
_local2.gotoAndStop(1);
}
private function showAch(_arg1:MouseEvent):void{
playFX(snd_B);
mMenu.gotoAndStop(3);
mMenu.removeChild(moreGames);
mMenu.removeChild(highScore);
mMenu.removeChild(clearSaves);
mMenu.removeChild(startChal);
mMenu.removeChild(startCamp);
removeChild(languageSelectionBox);
sc.x = 20;
sc.y = 65;
mMenu.addChild(sc);
var _local2:* = (sc.getChildByName("plScr") as TextField);
_local2.text = gameScore;
submitScoreBtn.x = 105;
submitScoreBtn.y = 160;
viewHightScoreBtn.x = 60;
viewHightScoreBtn.y = 220;
if (closeAch == null){
closeAch = new ok_btn();
closeAch.x = ((533 - closeAch.width) / 2);
closeAch.y = ((400 - closeAch.height) - 30);
closeAch.addEventListener(MouseEvent.MOUSE_UP, closeAchiv);
};
mMenu.addChild(closeAch);
all.x = 400;
all.y = 15;
mMenu.addChild(all);
}
public function openBook(){
startCamp = new b5();
startCamp.x = 122;
startCamp.y = 90;
startCamp.name = "startCamp";
mMenu.addChild(startCamp);
startCamp.addEventListener(MouseEvent.MOUSE_UP, enterCityHandler);
startCamp.addEventListener(MouseEvent.MOUSE_OVER, showPicture);
startCamp.addEventListener(MouseEvent.MOUSE_OUT, hidePicture);
startChal = new b4();
startChal.x = 122;
startChal.y = 132;
startChal.name = "startChal";
mMenu.addChild(startChal);
startChal.addEventListener(MouseEvent.MOUSE_UP, startChalHandler);
startChal.addEventListener(MouseEvent.MOUSE_OVER, showPicture);
startChal.addEventListener(MouseEvent.MOUSE_OUT, hidePicture);
clearSaves = new b3();
clearSaves.x = 122;
clearSaves.y = 171;
clearSaves.name = "clearSaves";
mMenu.addChild(clearSaves);
clearSaves.addEventListener(MouseEvent.MOUSE_UP, showDetail);
clearSaves.addEventListener(MouseEvent.MOUSE_OVER, showPicture);
clearSaves.addEventListener(MouseEvent.MOUSE_OUT, hidePicture);
highScore = new b2();
highScore.x = 122;
highScore.y = 210;
highScore.name = "highScore";
mMenu.addChild(highScore);
highScore.addEventListener(MouseEvent.MOUSE_UP, showAch);
highScore.addEventListener(MouseEvent.MOUSE_OVER, showPicture);
highScore.addEventListener(MouseEvent.MOUSE_OUT, hidePicture);
moreGames = new b1();
moreGames.x = 122;
moreGames.y = 249;
moreGames.name = "moreGames";
mMenu.addChild(moreGames);
moreGames.addEventListener(MouseEvent.MOUSE_UP, MoreGamesHandler);
moreGames.addEventListener(MouseEvent.MOUSE_OVER, showPicture);
moreGames.addEventListener(MouseEvent.MOUSE_OUT, hidePicture);
}
public function fxBtnLevelHandler(_arg1:MouseEvent):void{
playFX(snd_B);
if ((fxFlag == true)){
fxFlag = false;
} else {
fxFlag = true;
};
l.level.fxFlag = fxFlag;
iface.fxFlag = fxFlag;
}
function checkLevelStatus(_arg1:Event){
var _local2:MovieClip;
var _local3:*;
var _local4:Number;
var _local5:*;
var _local6:MovieClip;
var _local7:*;
var _local8:TextField;
var _local9:int;
if (l.closeLevel == 1){
gameScore = (gameScore + l.level.totalScore);
mySo.data.gameScore = gameScore;
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
ScoreService.submitScore(mySo.data.gameScore, mySubmitScoreCallback);
};
};
_local2 = (iface.getChildByName("gameScore") as MovieClip);
_local3 = (_local2.getChildByName("gameScoreTXT") as TextField);
_local3.text = gameScore;
startMusic();
if (gameMode == "level"){
gameMode = "city";
if (soundFlag == true){
l.level.channel.stop();
};
_local4 = l.level.reduceCnt;
removeChild(l);
removeChild(lButtons);
addChild(bg);
addChild(iface);
if (replayFlag == false){
messLevel = (levelFinished - 2);
} else {
messLevel--;
};
showFinishMess = true;
if (((!((levelDescr[messLevel]["finishhistory"] == null))) && ((showFinishMess == true)))){
addChild(levelDescr[messLevel]["finishhistory"]);
addChild(history_ok);
history_ok.addEventListener(MouseEvent.MOUSE_UP, closeFinishHistory);
};
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, checkLevelStatus);
};
if ((((l.success == 1)) && ((replayFlag == false)))){
levelDescr[(levelFinished - 1)]["pic"].scrollRect = new Rectangle(0, 0, 82, levelDescr[(levelFinished - 1)]["drow"]);
if (levelDescr[(levelFinished - 1)]["show"] == true){
mouseDisable = true;
buildingsCompleted++;
showBuildingHandler();
if ((((((buildingsCompleted >= 3)) && ((buildingsCompleted < 13)))) && ((iface.scrollStop < ((13 - 5) * 82))))){
iface.scrollStop = (iface.scrollStop + 82);
iface.scrollPositionX = iface.scrollStop;
_local5 = (iface.getChildByName("levelsLine") as MovieClip);
_local5.scrollRect = new Rectangle(iface.scrollPositionX, 0, 410, 62);
};
levelDescr[(levelFinished - 1)]["pic"].removeEventListener(MouseEvent.MOUSE_UP, startLevel);
levelDescr[(levelFinished - 1)]["pic"].addEventListener(MouseEvent.MOUSE_UP, showDetail);
};
if (levelDescr[(levelFinished - 1)]["lock"] != null){
if (levelIcons.getChildByName("infoTowers") != null){
levelIcons.removeChild(levelIcons.getChildByName("infoTowers"));
};
_local6 = new numTowersInfo();
_local6.name = "infoTowers";
_local6.y = levelIcons.getChildByName(levelDescr[(levelFinished - 1)]["lock"]).y;
_local6.x = (levelIcons.getChildByName(levelDescr[(levelFinished - 1)]["lock"]).x + 4);
(_local6.getChildByName("numTowersTxt_txt") as TextField).text = levelDescr[(levelFinished - 1)]["numtowers"];
levelIcons.addChild(_local6);
levelIcons.getChildByName(levelDescr[(levelFinished - 1)]["lock"]).y = 100;
} else {
if (levelIcons.getChildByName("infoTowers") != null){
_local7 = (levelIcons.getChildByName("infoTowers") as MovieClip);
_local8 = (_local7.getChildByName("numTowersTxt_txt") as TextField);
_local9 = int(_local8.text);
_local9 = (_local9 - _local4);
_local8.text = String(_local9);
if (_local9 == 0){
levelIcons.removeChild(levelIcons.getChildByName("infoTowers"));
};
};
};
levelFinished++;
mySo.data.levelFinished = levelFinished;
mySo.data.buildingsCompleted = buildingsCompleted;
} else {
if (l.success == 1){
};
};
} else {
gameMode = "wellcome";
if (soundFlag == true){
l.level.channel.stop();
};
removeChild(l);
removeChild(lButtons);
addChild(bg);
addChild(mMenu);
addChild(brLogo);
addChild(languageSelectionBox);
removeEventListener(Event.ENTER_FRAME, checkLevelStatus);
};
l.level.hookTimer.stop();
l = null;
if (((!((all.getChildByName("ach_bronze_mc").alpha == 1))) && ((gameScore > 5000)))){
all.getChildByName("ach_bronze_mc").alpha = 1;
showAchivment(all.getChildByName("ach_bronze_mc"));
};
if (((!((all.getChildByName("ach_silver_mc").alpha == 1))) && ((gameScore > 40000)))){
all.getChildByName("ach_silver_mc").alpha = 1;
showAchivment(all.getChildByName("ach_silver_mc"));
};
if (((!((all.getChildByName("ach_gold_mc").alpha == 1))) && ((gameScore > 100000)))){
all.getChildByName("ach_gold_mc").alpha = 1;
showAchivment(all.getChildByName("ach_gold_mc"));
};
if (((!((all.getChildByName("ach_master_mc").alpha == 1))) && ((gameScore > 200000)))){
all.getChildByName("ach_master_mc").alpha = 1;
showAchivment(all.getChildByName("ach_master_mc"));
};
if (((!((all.getChildByName("ach_hero_mc").alpha == 1))) && ((gameScore > 400000)))){
all.getChildByName("ach_hero_mc").alpha = 1;
showAchivment(all.getChildByName("ach_hero_mc"));
};
};
}
private function panelTimerHandler(_arg1:TimerEvent):void{
if (panelTimer.currentCount < 80){
panelMC.y++;
} else {
if (panelTimer.currentCount < 130){
} else {
if (panelTimer.currentCount < 180){
panelMC.alpha = (panelMC.alpha - 0.02);
} else {
panelTimer.stop();
panelMC.alpha = 1;
panelMC.y = -(panelMC.height);
if (levelAch != false){
panelTimer.removeEventListener(TimerEvent.TIMER, panelTimerHandler);
achCNT++;
if (levelDescr[(levelFinished - 2)]["ach"][achCNT] != null){
showAchivment(levelDescr[(levelFinished - 2)]["ach"][achCNT]);
};
};
};
};
};
}
function mySubmitScoreCallback(_arg1:int, _arg2:Object):void{
if (_arg2.errorMessage){
//unresolved jump
};
}
private function detailResizeOpen(_arg1:TimerEvent):void{
var _local2:String;
var _local3:String;
var _local4:Class;
var _local5:Class;
if (detailSize < 60){
detailSize = (detailSize + detailDirection);
detail.c.scaleY = (detailSize / 15);
detail.c.y = (detail.c.y - detailDirection);
detail.u.y = (detail.u.y - detailDirection);
detail.d.y = (detail.d.y + detailDirection);
} else {
if (showDescription == "menu_btn"){
if (detail_text == null){
detail_text = (new exit_level_text() as MovieClip);
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
};
if (resume_Btn == null){
resume_Btn = new resumeBtn();
resume_Btn.x = (((detail.width - (2 * resume_Btn.width)) / 3) + 5);
resume_Btn.y = 80;
resume_Btn.addEventListener(MouseEvent.MOUSE_UP, resumeLevel);
detail.addChild(resume_Btn);
};
if (exit_Btn == null){
exit_Btn = new exitBtn();
detail.addChild(exit_Btn);
exit_Btn.addEventListener(MouseEvent.MOUSE_UP, closeLevel);
exit_Btn.x = ((exit_Btn.width + ((2 * (detail.width - (2 * exit_Btn.width))) / 3)) - 5);
exit_Btn.y = 80;
};
detailTimerOpen.stop();
} else {
if (showDescription == "clearSaves"){
if (detail_text == null){
detail_text = (new clear_saves_text() as MovieClip);
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
};
if (clear_txt_yes == null){
clear_txt_yes = new yesBtn();
clear_txt_yes.x = (((detail.width - (2 * clear_txt_yes.width)) / 3) + 5);
clear_txt_yes.y = 80;
clear_txt_yes.addEventListener(MouseEvent.MOUSE_UP, clearSavesYes);
detail.addChild(clear_txt_yes);
};
if (clear_txt_no == null){
clear_txt_no = new noBtn();
detail.addChild(clear_txt_no);
clear_txt_no.addEventListener(MouseEvent.MOUSE_UP, clearSavesNo);
clear_txt_no.x = ((clear_txt_yes.width + ((2 * (detail.width - (2 * clear_txt_no.width))) / 3)) - 5);
clear_txt_no.y = 80;
};
detailTimerOpen.stop();
} else {
if (showDescription == "startgamemessage"){
detail_text = (new enterGame_text() as MovieClip);
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
detailTimerOpen.stop();
} else {
if (showDescription == "startlevelmessage"){
detail_text = levelDescr[(levelFinished - 1)]["message"];
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
if (start_level_txt_ok == null){
start_level_txt_ok = new ok_btn();
start_level_txt_ok.x = ((detail.width - start_level_txt_ok.width) / 2);
start_level_txt_ok.y = 90;
start_level_txt_ok.addEventListener(MouseEvent.MOUSE_UP, removeSelf);
detail.addChild(start_level_txt_ok);
};
detailTimerOpen.stop();
} else {
if (showDescription == "finishlevelmessage"){
detail_text = levelDescr[(levelFinished - 2)]["finishMess"];
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
if ((levelFinished - 2) < 28){
if ((levelFinished - 2) == 6){
detail_ico = new era2_block2();
detail.addChild(detail_ico);
detail_ico.x = (((detail.width - detail_ico.width) / 2) + 15);
detail_ico.y = (detail_text.height + 15);
} else {
if ((levelFinished - 2) == 17){
detail_ico = new era3_block2();
detail.addChild(detail_ico);
detail_ico.x = (((detail.width - detail_ico.width) / 2) + 15);
detail_ico.y = (detail_text.height + 15);
} else {
if ((levelFinished - 2) == 22){
detail_ico = new era4_block2();
detail.addChild(detail_ico);
detail_ico.x = (((detail.width - detail_ico.width) / 2) + 15);
detail_ico.y = (detail_text.height + 15);
};
};
};
} else {
detail_ico = new korona();
detail.addChild(detail_ico);
detail_ico.x = (((detail.width - detail_ico.width) / 2) + 11);
detail_ico.y = -50;
};
if (start_level_txt_ok == null){
start_level_txt_ok = new ok_btn();
start_level_txt_ok.x = ((detail.width - start_level_txt_ok.width) / 2);
start_level_txt_ok.y = 90;
start_level_txt_ok.addEventListener(MouseEvent.MOUSE_UP, removeSelf);
detail.addChild(start_level_txt_ok);
};
detailTimerOpen.stop();
} else {
replayBtn = new replay();
switch (showDescription){
case "farm_mc":
case "dummy_farm_btn":
case "icon_farm_c":
_local2 = "farm_text";
_local3 = "farmIco";
replayBtn.name = "replay_farm_btn";
break;
case "sow_mc":
case "dummy_sow_btn":
case "icon_sow_c":
_local2 = "sow_text";
_local3 = "sowIco";
replayBtn.name = "replay_sow_btn";
break;
case "mill_mc":
case "dummy_mill_btn":
case "icon_mill_c":
_local2 = "mill_text";
_local3 = "millIco";
replayBtn.name = "replay_mill_btn";
break;
case "tawern_mc":
case "dummy_tawern_btn":
case "icon_tawern_c":
_local2 = "tawern_text";
_local3 = "tawernIco";
replayBtn.name = "replay_tawern_btn";
break;
case "wine_mc":
case "dummy_wine_btn":
case "icon_wine_c":
_local2 = "wine_text";
_local3 = "wineIco";
replayBtn.name = "replay_wine_btn";
break;
case "damb_mc":
case "dummy_dumb_btn":
case "icon_damb_c":
_local2 = "damb_text";
_local3 = "dambIco";
replayBtn.name = "replay_damb_btn";
break;
case "market_mc":
case "dummy_market_btn":
case "icon_market_c":
_local2 = "market_text";
_local3 = "marketIco";
replayBtn.name = "replay_market_btn";
break;
case "tower_mc":
case "dummy_tower_btn":
case "icon_tower_c":
_local2 = "tower_text";
_local3 = "towerIco";
replayBtn.name = "replay_tower_btn";
break;
case "holl_mc":
case "dummy_holl_btn":
case "icon_holl_c":
_local2 = "holl_text";
_local3 = "hollIco";
replayBtn.name = "replay_holl_btn";
break;
case "walls_front":
case "dummy_wall_btn":
case "back_wall":
case "icon_walls_c":
_local2 = "wall_text";
_local3 = "wallsIco";
replayBtn.name = "replay_walls_btn";
break;
case "baracks_mc":
case "dummy_baraks_btn":
case "icon_baracks_c":
_local2 = "baracks_text";
_local3 = "barackIco";
replayBtn.name = "replay_baracks_btn";
break;
case "armory_mc":
case "dummy_armory_btn":
case "icon_armory_c":
_local2 = "armory_text";
_local3 = "armoryIco";
replayBtn.name = "replay_armory_btn";
break;
case "castle_mc":
case "dummy_castle_btn":
case "icon_castle_c":
_local2 = "castle_text";
_local3 = "castleIco";
replayBtn.name = "replay_castle_btn";
break;
};
_local4 = (loaderInfo.applicationDomain.getDefinition(_local2) as Class);
_local5 = (loaderInfo.applicationDomain.getDefinition(_local3) as Class);
detail_text = (new (_local4) as MovieClip);
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
detail_ico = (new (_local5) as MovieClip);
detail.addChild(detail_ico);
detail_ico.x = 30;
detail_ico.y = (detail_text.height + 5);
replayBtn.x = ((detail_ico.width + detail_ico.x) + 10);
replayBtn.y = (detail_text.height + 18);
detail.addChild(replayBtn);
replayBtn.addEventListener(MouseEvent.MOUSE_UP, replayLevel);
addEventListener(MouseEvent.MOUSE_UP, removeSelf);
detailTimerOpen.stop();
};
};
};
};
};
};
}
public function appearTimerHandler(_arg1:TimerEvent):void{
var _local4:Number;
var _local6:Number;
var _local2:Array = new Array();
var _local3:Number = 0;
var _local5:Number = 0;
var _local7:* = bulidOrder[(buildingsCompleted - 1)].toString().split(",");
if (_local7.length > 1){
_local4 = 0;
while (_local4 < _local7.length) {
_local2[_local3] = _local7[_local4];
_local3++;
_local4++;
};
} else {
_local2[_local3] = _local7[0];
_local3++;
};
if (appearTimer.currentCount < 125){
_local6 = 0;
while (_local6 < _local2.length) {
if (((!((_local2[_local6] == 0))) && (!((_local2[_local6] == 2))))){
buildings[_local2[_local6]].scaleX = (buildings[_local2[_local6]].scaleX + 0.004);
buildings[_local2[_local6]].scaleY = (buildings[_local2[_local6]].scaleY + 0.004);
bg.x = -(((scaleXpoint * bg.scaleX) - scaleXpoint));
bg.y = -(((scaleYpoint * bg.scaleY) - scaleYpoint));
bg.scaleX = (bg.scaleX + 0.002);
bg.scaleY = (bg.scaleY + 0.002);
} else {
buildings[_local2[_local6]].scaleX = (buildings[_local2[_local6]].scaleX - 0.004);
buildings[_local2[_local6]].scaleY = (buildings[_local2[_local6]].scaleY - 0.004);
};
_local6++;
};
} else {
if (appearTimer.currentCount < 185){
_local6 = 0;
while (_local6 < _local2.length) {
if (((!((_local2[_local6] == 0))) && (!((_local2[_local6] == 2))))){
bg.scaleX = (bg.scaleX - 0.004);
bg.scaleY = (bg.scaleY - 0.004);
bg.x = -(((scaleXpoint * bg.scaleX) - scaleXpoint));
bg.y = -(((scaleYpoint * bg.scaleY) - scaleYpoint));
};
_local6++;
};
} else {
if (appearTimer.currentCount == 185){
_local6 = 0;
while (_local6 < _local2.length) {
buildings[_local2[_local6]].scaleX = 1;
buildings[_local2[_local6]].scaleY = 1;
bg.scaleX = 1;
bg.scaleY = 1;
bg.x = 0;
bg.y = 0;
_local6++;
};
} else {
if (appearTimer.currentCount == 186){
if (levelDescr[(levelFinished - 2)]["lock"] == "lock_1"){
progress1.alpha = 0;
progress2.alpha = 0;
progress3.alpha = 0;
iface.addChild(progress1);
iface.addChild(progress2);
iface.addChild(progress3);
progress2.width = 0;
progress3.x = (progress2.width + 149);
};
totalSum = 0;
} else {
if (appearTimer.currentCount < 437){
if (levelDescr[(levelFinished - 2)]["lock"] == "lock_1"){
progress1.alpha = (progress1.alpha + (1 / 200));
progress2.alpha = (progress2.alpha + (1 / 200));
progress3.alpha = (progress3.alpha + (1 / 200));
};
if ((((((progress1.alpha > 0.7)) || ((progress2.alpha > 0.7)))) || ((progress3.alpha > 0.7)))){
progress1.alpha = 1;
progress2.alpha = 1;
progress3.alpha = 1;
};
_local5 = 0;
_local6 = 0;
while (_local6 < (levelFinished - 1)) {
if (_local6 < 28){
_local5 = (_local5 + levelDescr[_local6]["size"]);
};
_local6++;
};
totalSum = (totalSum + ((237 * (levelDescr[(levelFinished - 2)]["size"] / totalLength)) / 200));
if (totalSum > (237 * (levelDescr[(levelFinished - 2)]["size"] / totalLength))){
progress2.width = (237 * (_local5 / totalLength));
progress3.x = (progress2.width + 148);
} else {
progress2.width = (progress2.width + ((237 * (levelDescr[(levelFinished - 2)]["size"] / totalLength)) / 200));
progress3.x = (progress2.width + 148);
};
} else {
mouseDisable = false;
appearTimer.stop();
appearTimer.removeEventListener(TimerEvent.TIMER, appearTimerHandler);
if (levelDescr[(levelFinished - 2)]["finishMess"] != null){
showDescription = "finishlevelmessage";
showFinishLevelMessage();
};
if (levelDescr[(levelFinished - 2)]["ach"] != null){
_local6 = 0;
while (_local6 < levelDescr[(levelFinished - 2)]["ach"].length) {
levelDescr[(levelFinished - 2)]["ach"][_local6].alpha = 1;
_local6++;
};
achCNT = 0;
showAchivment(levelDescr[(levelFinished - 2)]["ach"][0]);
};
};
};
};
};
};
}
private function remove(_arg1=null){
playFX(snd_P);
if (detail_text != null){
detail.removeChild(detail_text);
detail_text = null;
};
if (detail_ico != null){
detail.removeChild(detail_ico);
detail_ico = null;
};
if (replayBtn != null){
replayBtn.removeEventListener(MouseEvent.MOUSE_UP, replayLevel);
detail.removeChild(replayBtn);
replayBtn = null;
};
if (exit_Btn != null){
exit_Btn.removeEventListener(MouseEvent.MOUSE_UP, closeLevel);
detail.removeChild(exit_Btn);
exit_Btn = null;
};
if (l != null){
if (l.level.countDownTimer != null){
l.level.countDownTimer.start();
};
if (l.level.earthQuakeTimer != null){
l.level.earthQuakeTimer.start();
};
if (l.level.floodTimer != null){
l.level.floodTimer.start();
};
};
if (firstGameEnter == false){
addEventListener(MouseEvent.MOUSE_MOVE, Interface);
};
if (start_level_txt_ok != null){
start_level_txt_ok.removeEventListener(MouseEvent.MOUSE_UP, removeSelf);
detail.removeChild(start_level_txt_ok);
start_level_txt_ok = null;
_arg1 = null;
};
if (resume_Btn != null){
detail.removeChild(resume_Btn);
resume_Btn = null;
};
if (_arg1 == null){
detailDirection = -2;
removeEventListener(MouseEvent.MOUSE_UP, removeSelf);
detailTimerClose.addEventListener(TimerEvent.TIMER, detailResizeClose);
detailTimerClose.start();
};
}
public function hideIfaceTimerHandler(_arg1:TimerEvent):void{
iface.y = (iface.y + 2);
if (iface.y >= 400){
hideIfaceTimer.stop();
hideIfaceTimer.removeEventListener(TimerEvent.TIMER, hideIfaceTimerHandler);
};
}
private function detailResizeClose(_arg1:TimerEvent):void{
if ((((detailSize > 0)) && (!((detail == null))))){
detailSize = (detailSize + detailDirection);
detail.c.scaleY = (detailSize / 15);
detail.c.y = (detail.c.y - detailDirection);
detail.u.y = (detail.u.y - detailDirection);
detail.d.y = (detail.d.y + detailDirection);
} else {
detailDirection = 2;
detailTimerClose.stop();
detailTimerClose.removeEventListener(TimerEvent.TIMER, detailResizeClose);
if (blankShaddow != null){
removeChild(blankShaddow);
blankShaddow = null;
};
if (detail != null){
removeChild(detail);
detail = null;
};
};
}
public function soundBtnLevelHandler(_arg1:MouseEvent):void{
playFX(snd_B);
if ((soundFlag == true)){
soundFlag = false;
} else {
soundFlag = true;
};
l.level.soundFlag = soundFlag;
if (soundFlag == true){
l.level.channel = l.level.music.play(0, int.MAX_VALUE);
} else {
l.level.channel.stop();
};
}
public function returnToMainMenuHandler(_arg1:MouseEvent):void{
if (mouseDisable == false){
playFX(snd_B);
gameMode = "wellcome";
removeChild(iface);
addChild(mMenu);
addChild(brLogo);
addChild(languageSelectionBox);
};
}
public function showInterface(_arg1:MouseEvent):void{
if (iface.y >= ((400 - iface.height) + 2)){
hideIfaceTimer.stop();
hideIfaceTimer.removeEventListener(TimerEvent.TIMER, hideIfaceTimerHandler);
showIfaceTimer.addEventListener(TimerEvent.TIMER, showIfaceTimerHandler);
showIfaceTimer.start();
};
}
public function closeHistoryReplay(_arg1:MouseEvent):void{
removeChild(levelDescr[(lvl - 1)]["replayhistory"]);
history_ok.removeEventListener(MouseEvent.MOUSE_UP, closeHistoryReplay);
removeChild(history_ok);
switch (lvlReplay){
case "replay_farm_btn":
l = new Era1(1, fxFlag, soundFlag);
break;
case "replay_sow_btn":
l = new Era1(3, fxFlag, soundFlag);
break;
case "replay_wine_btn":
l = new Era1(4, fxFlag, soundFlag);
break;
case "replay_damb_btn":
l = new Era2(7, fxFlag, soundFlag);
break;
case "replay_tawern_btn":
l = new Era1(9, fxFlag, soundFlag);
break;
case "replay_market_btn":
l = new Era1(11, fxFlag, soundFlag);
break;
case "replay_mill_btn":
l = new Era1(13, fxFlag, soundFlag);
break;
case "replay_tower_btn":
l = new Era1(14, fxFlag, soundFlag);
break;
case "replay_holl_btn":
l = new Era1(15, fxFlag, soundFlag);
break;
case "replay_walls_btn":
l = new Era3(18, fxFlag, soundFlag);
break;
case "replay_baracks_btn":
l = new Era1(20, fxFlag, soundFlag);
break;
case "replay_armory_btn":
l = new Era1(23, fxFlag, soundFlag);
break;
case "replay_castle_btn":
l = new Era4(25, fxFlag, soundFlag);
break;
};
addChild(l);
addChild(lButtons);
addEventListener(Event.ENTER_FRAME, checkLevelStatus);
}
private function showAchivmentDescr(_arg1:MouseEvent):void{
playFX(snd_B);
var _local2:MovieClip = (all.getChildByName("achDescr_mc") as MovieClip);
switch (_arg1.currentTarget.name){
case "ach_mill_mc":
_local2.gotoAndStop(3);
break;
case "ach_mill_lock":
_local2.gotoAndStop(2);
break;
case "ach_bronze_mc":
_local2.gotoAndStop(13);
break;
case "ach_bronze_lock":
_local2.gotoAndStop(12);
break;
case "ach_head_mc":
_local2.gotoAndStop(5);
break;
case "ach_head_lock":
_local2.gotoAndStop(4);
break;
case "ach_damb_mc":
_local2.gotoAndStop(7);
break;
case "ach_damb_lock":
_local2.gotoAndStop(6);
break;
case "ach_silver_mc":
_local2.gotoAndStop(15);
break;
case "ach_silver_lock":
_local2.gotoAndStop(14);
break;
case "ach_gold_mc":
_local2.gotoAndStop(17);
break;
case "ach_gold_lock":
_local2.gotoAndStop(16);
break;
case "ach_vulc_mc":
_local2.gotoAndStop(9);
break;
case "ach_vulc_lock":
_local2.gotoAndStop(8);
break;
case "ach_enemy_mc":
_local2.gotoAndStop(11);
break;
case "ach_enemy_lock":
_local2.gotoAndStop(10);
break;
case "ach_master_mc":
_local2.gotoAndStop(19);
break;
case "ach_master_lock":
_local2.gotoAndStop(18);
break;
case "ach_finish_mc":
_local2.gotoAndStop(25);
break;
case "ach_finish_lock":
_local2.gotoAndStop(24);
break;
case "ach_hero_mc":
_local2.gotoAndStop(21);
break;
case "ach_hero_lock":
_local2.gotoAndStop(20);
break;
case "ach_chal_mc":
_local2.gotoAndStop(23);
break;
case "ach_chal_lock":
_local2.gotoAndStop(22);
break;
};
}
private function showHistory(){
if (historyStep == 0){
history = new history1();
} else {
if (historyStep == 1){
history = new history2();
};
};
addChild(history);
addChild(history_ok);
history_ok.addEventListener(MouseEvent.MOUSE_UP, historyAddStep);
}
private function startMusic(){
var _local1:SoundTransform;
if (soundFlag == true){
channel = music.play(0, int.MAX_VALUE);
_local1 = channel.soundTransform;
_local1.volume = 0.4;
channel.soundTransform = _local1;
};
}
private function playFX(_arg1){
if (fxFlag == true){
_arg1.play();
};
}
public function closeLevel(_arg1:MouseEvent){
playFX(snd_B);
l.level.closeLevel = 1;
if (l.level.flood_mc != null){
l.level.flood_mc.tm.stop();
l.level.flood_mc.tm.removeEventListener(TimerEvent.TIMER, l.level.flood_mc.enterFr);
};
menuBtn.addEventListener(MouseEvent.MOUSE_UP, exitLevel);
addEventListener(MouseEvent.MOUSE_UP, removeSelf);
}
public function Interface(_arg1:MouseEvent):void{
if (mouseDisable == false){
if (_arg1.stageY > (400 - iface.height)){
if (((!((blink == null))) && ((_arg1.stageX < 200)))){
blink.y = 200;
blink.x = 70;
if (detail_text != null){
detail.removeChild(detail_text);
detail_text = (new enterGame_text1() as MovieClip);
detail_text.x = 30;
detail_text.y = 0;
detail.addChild(detail_text);
};
if (glowBdr == null){
glowBdr = new glowBorder();
glowBdr.x = 65.4;
glowBdr.y = 52.9;
iface.addChild(glowBdr);
};
};
if (iface.y > ((400 - iface.height) + 2)){
hideIfaceTimer.stop();
hideIfaceTimer.removeEventListener(TimerEvent.TIMER, hideIfaceTimerHandler);
showIfaceTimer.addEventListener(TimerEvent.TIMER, showIfaceTimerHandler);
showIfaceTimer.start();
};
} else {
if (iface.y < 400){
showIfaceTimer.stop();
showIfaceTimer.removeEventListener(TimerEvent.TIMER, showIfaceTimerHandler);
hideIfaceTimer.addEventListener(TimerEvent.TIMER, hideIfaceTimerHandler);
hideIfaceTimer.start();
};
};
};
}
public function exitLevel(_arg1:MouseEvent){
if (((!((l.level.success == 1))) && ((l.level.testCompleteAll() == false)))){
menuBtn.removeEventListener(MouseEvent.MOUSE_UP, exitLevel);
playFX(snd_B);
if (l.level.countDownTimer != null){
l.level.countDownTimer.stop();
};
if (l.level.earthQuakeTimer != null){
l.level.earthQuakeTimer.stop();
};
if (l.level.floodTimer != null){
l.level.floodTimer.stop();
};
l.level.dropNext = 0;
blankShaddow = new blank();
blankShaddow.alpha = 0;
addChild(blankShaddow);
showDescription = _arg1.currentTarget.name;
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
detailTimerOpen.addEventListener(TimerEvent.TIMER, detailResizeOpen);
addChild(detail);
detailTimerOpen.start();
};
}
public function showIfaceTimerHandler(_arg1:TimerEvent):void{
iface.y = (iface.y - 2);
if (iface.y <= (400 - iface.height)){
showIfaceTimer.stop();
showIfaceTimer.removeEventListener(TimerEvent.TIMER, showIfaceTimerHandler);
};
}
private function closeAchiv(_arg1:MouseEvent):void{
playFX(snd_B);
mMenu.gotoAndStop(2);
mMenu.addChild(moreGames);
mMenu.addChild(highScore);
mMenu.addChild(clearSaves);
mMenu.addChild(startChal);
mMenu.addChild(startCamp);
mMenu.addChild(pName_mc);
mMenu.removeChild(closeAch);
mMenu.removeChild(sc);
mMenu.removeChild(all);
addChild(languageSelectionBox);
}
public function showBuildingHandler():void{
var _local1:Number;
var _local4:Number;
var _local2:Array = new Array();
var _local3:Number = 0;
var _local5:* = bulidOrder[(buildingsCompleted - 1)].toString().split(",");
if (_local5.length > 1){
_local4 = 0;
while (_local4 < _local5.length) {
_local2[_local3] = _local5[_local4];
_local3++;
_local4++;
};
} else {
_local2[_local3] = _local5[0];
_local3++;
};
_local1 = 0;
while (_local1 < _local2.length) {
bg.removeChildAt(buildingsIndex[_local2[_local1]]);
bg.addChildAt(buildings[_local2[_local1]], buildingsIndex[_local2[_local1]]);
if (((!((_local2[_local1] == 0))) && (!((_local2[_local1] == 2))))){
buildings[_local2[_local1]].scaleX = 0.5;
buildings[_local2[_local1]].scaleY = 0.5;
} else {
buildings[_local2[_local1]].scaleX = 1.5;
buildings[_local2[_local1]].scaleY = 1.5;
};
scaleXpoint = buildings[_local2[_local1]].x;
scaleYpoint = buildings[_local2[_local1]].y;
dummy[_local2[_local1]].addEventListener(MouseEvent.MOUSE_UP, showDetail);
_local1++;
};
glow = 0;
glowFlag = 20;
appearTimer = new Timer(5);
appearTimer.addEventListener(TimerEvent.TIMER, appearTimerHandler);
appearTimer.start();
playFX(snd_C);
}
private function showPicture(_arg1:MouseEvent):void{
switch (_arg1.currentTarget.name){
case "startCamp":
pic = new bp1();
pic.x = 290;
pic.y = 100;
mMenu.addChild(pic);
break;
case "startChal":
pic = new bp2();
pic.x = 290;
pic.y = 100;
mMenu.addChild(pic);
break;
case "clearSaves":
pic = new bp4();
pic.x = 290;
pic.y = 100;
mMenu.addChild(pic);
break;
case "highScore":
pic = new bp5();
pic.x = 290;
pic.y = 100;
mMenu.addChild(pic);
break;
case "moreGames":
pic = new bp3();
pic.x = 290;
pic.y = 100;
mMenu.addChild(pic);
break;
};
}
public function resumeLevel(_arg1:MouseEvent){
playFX(snd_B);
addEventListener(MouseEvent.MOUSE_UP, removeSelf);
menuBtn.addEventListener(MouseEvent.MOUSE_UP, exitLevel);
if (l.level.countDownTimer != null){
l.level.countDownTimer.start();
};
if (l.level.earthQuakeTimer != null){
l.level.earthQuakeTimer.start();
};
if (l.level.floodTimer != null){
l.level.floodTimer.start();
};
l.level.dropNext = 1;
}
private function clickLogo(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest(SpilGame.getMoreGamesLink("button_mainmenu_moregames"));
navigateToURL(_local2, "_blank");
}
private function hidePicture(_arg1:MouseEvent):void{
mMenu.removeChild(pic);
}
private function MoreGamesHandler(_arg1:MouseEvent=null):void{
var _local2:URLRequest = new URLRequest(SpilGame.getMoreGamesLink("button_moregames_moregames"));
navigateToURL(_local2, "_blank");
}
function closeFinishHistory(_arg1:MouseEvent):void{
removeChild(levelDescr[messLevel]["finishhistory"]);
removeChild(history_ok);
history_ok.removeEventListener(MouseEvent.MOUSE_UP, closeFinishHistory);
showFinishMess = false;
}
public function enterCityHandler(_arg1:MouseEvent):void{
var _local2:URLLoader;
var _local3:URLRequest;
playFX(snd_B);
if (SEND_DEBUG == true){
_local2 = new URLLoader();
_local3 = new URLRequest("debug.php?mode=citystarted");
_local2.load(_local3);
};
removeChild(brLogo);
removeChild(languageSelectionBox);
if ((((firstGameEnter == true)) || ((firstGameEnter == false)))){
showHistory();
} else {
gameMode = "city";
removeChild(mMenu);
addChild(iface);
};
}
private function showStartCityMessage(){
if (detail == null){
playFX(snd_P);
showDescription = "startgamemessage";
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
detailTimerOpen.addEventListener(TimerEvent.TIMER, detailResizeOpen);
addChild(detail);
detailTimerOpen.start();
blink = new blinkArrow();
blink.y = 200;
blink.x = 70;
addChild(blink);
addEventListener(MouseEvent.MOUSE_MOVE, Interface);
};
}
private function getBuildings(){
var _local1:Number;
buildings[0] = (bg.getChildByName("back_wall") as MovieClip);
buildingsIndex[0] = bg.getChildIndex(buildings[0]);
buildings[1] = (bg.getChildByName("damb_mc") as MovieClip);
buildingsIndex[1] = bg.getChildIndex(buildings[1]);
buildings[2] = (bg.getChildByName("walls_front") as MovieClip);
buildingsIndex[2] = bg.getChildIndex(buildings[2]);
buildings[3] = (bg.getChildByName("farm_mc") as MovieClip);
buildingsIndex[3] = bg.getChildIndex(buildings[3]);
buildings[4] = (bg.getChildByName("mill_mc") as MovieClip);
buildingsIndex[4] = bg.getChildIndex(buildings[4]);
buildings[5] = (bg.getChildByName("wine_mc") as MovieClip);
buildingsIndex[5] = bg.getChildIndex(buildings[5]);
buildings[6] = (bg.getChildByName("holl_mc") as MovieClip);
buildingsIndex[6] = bg.getChildIndex(buildings[6]);
buildings[7] = (bg.getChildByName("tawern_mc") as MovieClip);
buildingsIndex[7] = bg.getChildIndex(buildings[7]);
buildings[8] = (bg.getChildByName("tower_mc") as MovieClip);
buildingsIndex[8] = bg.getChildIndex(buildings[8]);
buildings[9] = (bg.getChildByName("market_mc") as MovieClip);
buildingsIndex[9] = bg.getChildIndex(buildings[9]);
buildings[10] = (bg.getChildByName("armory_mc") as MovieClip);
buildingsIndex[10] = bg.getChildIndex(buildings[10]);
buildings[11] = (bg.getChildByName("sow_mc") as MovieClip);
buildingsIndex[11] = bg.getChildIndex(buildings[11]);
buildings[12] = (bg.getChildByName("baracks_mc") as MovieClip);
buildingsIndex[12] = bg.getChildIndex(buildings[12]);
buildings[13] = (bg.getChildByName("castle_mc") as MovieClip);
buildingsIndex[13] = bg.getChildIndex(buildings[13]);
dummy[3] = (bg.getChildByName("dummy_farm_btn") as SimpleButton);
dummy[5] = (bg.getChildByName("dummy_wine_btn") as SimpleButton);
dummy[11] = (bg.getChildByName("dummy_sow_btn") as SimpleButton);
dummy[9] = (bg.getChildByName("dummy_market_btn") as SimpleButton);
dummy[8] = (bg.getChildByName("dummy_tower_btn") as SimpleButton);
dummy[7] = (bg.getChildByName("dummy_tawern_btn") as SimpleButton);
dummy[1] = (bg.getChildByName("dummy_dumb_btn") as SimpleButton);
dummy[6] = (bg.getChildByName("dummy_holl_btn") as SimpleButton);
dummy[10] = (bg.getChildByName("dummy_armory_btn") as SimpleButton);
dummy[12] = (bg.getChildByName("dummy_baraks_btn") as SimpleButton);
dummy[4] = (bg.getChildByName("dummy_mill_btn") as SimpleButton);
dummy[13] = (bg.getChildByName("dummy_castle_btn") as SimpleButton);
dummy[0] = (bg.getChildByName("dummy_wall_btn") as SimpleButton);
dummy[2] = (bg.getChildByName("dummy_wall_btn") as SimpleButton);
_local1 = 0;
while (_local1 < buildings.length) {
dummy[_local1].useHandCursor = false;
_local1++;
};
_local1 = 0;
while (_local1 < buildings.length) {
buildingReplace[_local1] = new blankPixel();
buildingReplace[_local1].x = buildings[_local1].x;
buildingReplace[_local1].y = buildings[_local1].y;
_local1++;
};
streamMC = (bg.getChildByName("stream_mc") as MovieClip);
}
public function closeHistory(_arg1:MouseEvent):void{
channel.stop();
removeChild(levelDescr[(levelFinished - 1)]["history"]);
history_ok.removeEventListener(MouseEvent.MOUSE_UP, closeHistory);
removeChild(history_ok);
var _local2:Class = (loaderInfo.applicationDomain.getDefinition(levelDescr[(levelFinished - 1)]["era"]) as Class);
if (levelFinished == 1){
l = new _local2(levelFinished, fxFlag, soundFlag, firstStartLevel1);
firstStartLevel1 = false;
mySo.data.firstStartLevel1 = false;
} else {
if (levelFinished == 4){
l = new _local2(levelFinished, fxFlag, soundFlag, firstStartLevel2);
firstStartLevel2 = false;
mySo.data.firstStartLevel2 = false;
} else {
l = new _local2(levelFinished, fxFlag, soundFlag);
};
};
addChild(l);
if (levelDescr[(levelFinished - 1)]["message"] != null){
showStartLevelMessage();
};
addChild(lButtons);
addEventListener(Event.ENTER_FRAME, checkLevelStatus);
}
private function showHightScore(_arg1:MouseEvent):void{
playFX(snd_B);
}
public function createInterface(){
progress1 = new progressBarLeftMC();
progress1.name = "progress1";
progress1.y = 9;
progress1.x = 133;
progress2 = new progressBarMC();
progress2.name = "progress2";
progress2.y = 9;
progress2.x = 148;
progress3 = new progressBarRightMC();
progress3.name = "progress3";
progress3.y = 9;
progress3.x = 385;
iface = new cityInterface();
iface.addChild(progress1);
iface.addChild(progress2);
iface.addChild(progress3);
var _local1:MovieClip = (iface.getChildByName("gameScore") as MovieClip);
var _local2:* = (_local1.getChildByName("gameScoreTXT") as TextField);
_local2.text = gameScore;
if (buildingsCompleted == 0){
iface.removeChild(progress1);
iface.removeChild(progress2);
iface.removeChild(progress3);
iface.getChildByName("levelsLine").scrollRect = new Rectangle(0, 0, 410, 62);
} else {
if (buildingsCompleted > 5){
iface.scrollStop = ((buildingsCompleted - 5) * 82);
} else {
iface.scrollStop = 0;
};
iface.scrollPositionX = iface.scrollStop;
iface.getChildByName("levelsLine").scrollRect = new Rectangle(iface.scrollPositionX, 0, 410, 62);
};
iface.x = 0;
iface.y = 400;
iface.fxFlag = fxFlag;
if (firstGameEnter != true){
addEventListener(MouseEvent.MOUSE_MOVE, Interface);
};
returnToMainMenu = (iface.getChildByName("to_menu_btn") as SimpleButton);
if (firstGameEnter == false){
returnToMainMenu.addEventListener(MouseEvent.MOUSE_UP, returnToMainMenuHandler);
};
soundBtn = (iface.getChildByName("sound_btn") as SimpleButton);
soundBtn.addEventListener(MouseEvent.MOUSE_UP, soundBtnHandler);
fxBtn = (iface.getChildByName("fx_btn") as SimpleButton);
fxBtn.addEventListener(MouseEvent.MOUSE_UP, fxBtnHandler);
lButtons = new levelButtons();
menuBtn = (lButtons.getChildByName("menu_btn") as SimpleButton);
menuBtn.addEventListener(MouseEvent.MOUSE_UP, exitLevel);
fxBtnLevel = (lButtons.getChildByName("fx_btn") as SimpleButton);
fxBtnLevel.addEventListener(MouseEvent.MOUSE_UP, fxBtnLevelHandler);
soundBtnLevel = (lButtons.getChildByName("sound_btn") as SimpleButton);
soundBtnLevel.addEventListener(MouseEvent.MOUSE_UP, soundBtnLevelHandler);
levelIcons = (iface.getChildByName("levelsLine") as MovieClip);
farm_b = (levelIcons.getChildByName("icon_farm_b") as MovieClip);
farm_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
farm_c = (levelIcons.getChildByName("icon_farm_c") as MovieClip);
farm_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
farm_c.scrollRect = new Rectangle(0, 0, 82, 0);
sow_b = (levelIcons.getChildByName("icon_sow_b") as MovieClip);
sow_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
sow_c = (levelIcons.getChildByName("icon_sow_c") as MovieClip);
sow_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
sow_c.scrollRect = new Rectangle(0, 0, 82, 0);
wine_b = (levelIcons.getChildByName("icon_wine_b") as MovieClip);
wine_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
wine_c = (levelIcons.getChildByName("icon_wine_c") as MovieClip);
wine_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
wine_c.scrollRect = new Rectangle(0, 0, 82, 0);
damb_b = (levelIcons.getChildByName("icon_damb_b") as MovieClip);
damb_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
damb_c = (levelIcons.getChildByName("icon_damb_c") as MovieClip);
damb_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
damb_c.scrollRect = new Rectangle(0, 0, 82, 0);
market_b = (levelIcons.getChildByName("icon_market_b") as MovieClip);
market_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
market_c = (levelIcons.getChildByName("icon_market_c") as MovieClip);
market_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
market_c.scrollRect = new Rectangle(0, 0, 82, 0);
mill_b = (levelIcons.getChildByName("icon_mill_b") as MovieClip);
mill_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
mill_c = (levelIcons.getChildByName("icon_mill_c") as MovieClip);
mill_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
mill_c.scrollRect = new Rectangle(0, 0, 82, 0);
tower_b = (levelIcons.getChildByName("icon_tower_b") as MovieClip);
tower_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
tower_c = (levelIcons.getChildByName("icon_tower_c") as MovieClip);
tower_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
tower_c.scrollRect = new Rectangle(0, 0, 82, 0);
holl_b = (levelIcons.getChildByName("icon_holl_b") as MovieClip);
holl_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
holl_c = (levelIcons.getChildByName("icon_holl_c") as MovieClip);
holl_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
holl_c.scrollRect = new Rectangle(0, 0, 82, 0);
tawern_b = (levelIcons.getChildByName("icon_tawern_b") as MovieClip);
tawern_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
tawern_c = (levelIcons.getChildByName("icon_tawern_c") as MovieClip);
tawern_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
tawern_c.scrollRect = new Rectangle(0, 0, 82, 0);
walls_b = (levelIcons.getChildByName("icon_walls_b") as MovieClip);
walls_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
walls_c = (levelIcons.getChildByName("icon_walls_c") as MovieClip);
walls_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
walls_c.scrollRect = new Rectangle(0, 0, 82, 0);
baracks_b = (levelIcons.getChildByName("icon_baracks_b") as MovieClip);
baracks_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
baracks_c = (levelIcons.getChildByName("icon_baracks_c") as MovieClip);
baracks_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
baracks_c.scrollRect = new Rectangle(0, 0, 82, 0);
armory_b = (levelIcons.getChildByName("icon_armory_b") as MovieClip);
armory_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
armory_c = (levelIcons.getChildByName("icon_armory_c") as MovieClip);
armory_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
armory_c.scrollRect = new Rectangle(0, 0, 82, 0);
castle_b = (levelIcons.getChildByName("icon_castle_b") as MovieClip);
castle_b.addEventListener(MouseEvent.MOUSE_UP, startLevel);
castle_c = (levelIcons.getChildByName("icon_castle_c") as MovieClip);
castle_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
castle_c.scrollRect = new Rectangle(0, 0, 82, 0);
}
private function showDetail(_arg1:MouseEvent):void{
playFX(snd_P);
if ((((detail == null)) && ((mouseDisable == false)))){
blankShaddow = new blank();
blankShaddow.alpha = 0;
addChild(blankShaddow);
showDescription = _arg1.currentTarget.name;
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
detailTimerOpen.addEventListener(TimerEvent.TIMER, detailResizeOpen);
addChild(detail);
detailTimerOpen.start();
};
}
public function soundBtnHandler(_arg1:MouseEvent):void{
playFX(snd_B);
if ((soundFlag == true)){
soundFlag = false;
} else {
soundFlag = true;
};
if (soundFlag == true){
startMusic();
} else {
channel.stop();
};
}
public function fxBtnHandler(_arg1:MouseEvent):void{
playFX(snd_B);
if ((fxFlag == true)){
fxFlag = false;
} else {
fxFlag = true;
};
iface.fxFlag = fxFlag;
}
private function nameOK(_arg1:MouseEvent):void{
bClosed = (mMenu.getChildByName("bookClosed_mc") as MovieClip);
var _local2:TextField = (bClosed.getChildByName("pl_txt") as TextField);
pName = _local2.text;
mySo.data.PlayerName = pName;
mMenu.gotoAndStop(2);
pName_mc = new playerNameText();
pName_mc.x = 154;
pName_mc.y = 15;
_local2 = (pName_mc.getChildByName("playerName") as TextField);
_local2.text = pName;
mMenu.addChild(pName_mc);
mMenu.removeChild(name_ok);
openBook();
}
public function showBuildings(_arg1, _arg2:int, _arg3:Array):void{
bg.addChild(buildings[_arg1]);
}
private function historyAddStep(_arg1:MouseEvent):void{
playFX(snd_B);
if (historyStep < 1){
history_ok.removeEventListener(MouseEvent.MOUSE_UP, historyAddStep);
removeChild(history);
removeChild(history_ok);
historyStep++;
showHistory();
} else {
history_ok.removeEventListener(MouseEvent.MOUSE_UP, historyAddStep);
removeChild(history);
removeChild(history_ok);
historyStep++;
gameMode = "city";
removeChild(mMenu);
iface.y = 400;
addChild(iface);
if (firstGameEnter == true){
showStartCityMessage();
};
historyStep = 0;
};
}
public function unlockLevels(_arg1:Number){
var _local2:MovieClip;
var _local3:*;
var _local4:TextField;
var _local5:int;
levelDescr[_arg1]["pic"].scrollRect = new Rectangle(0, 0, 82, levelDescr[_arg1]["drow"]);
if (levelDescr[_arg1]["show"] == true){
levelDescr[_arg1]["pic"].removeEventListener(MouseEvent.MOUSE_UP, startLevel);
levelDescr[_arg1]["pic"].addEventListener(MouseEvent.MOUSE_UP, showDetail);
};
if (levelDescr[_arg1]["lock"] != null){
if (levelIcons.getChildByName("infoTowers") != null){
levelIcons.removeChild(levelIcons.getChildByName("infoTowers"));
};
_local2 = new numTowersInfo();
_local2.name = "infoTowers";
_local2.y = levelIcons.getChildByName(levelDescr[_arg1]["lock"]).y;
_local2.x = (levelIcons.getChildByName(levelDescr[_arg1]["lock"]).x + 4);
(_local2.getChildByName("numTowersTxt_txt") as TextField).text = String(levelDescr[_arg1]["numtowers"]);
levelIcons.addChild(_local2);
levelIcons.getChildByName(levelDescr[_arg1]["lock"]).y = 100;
} else {
if (levelIcons.getChildByName("infoTowers") != null){
_local3 = (levelIcons.getChildByName("infoTowers") as MovieClip);
_local4 = (_local3.getChildByName("numTowersTxt_txt") as TextField);
_local5 = int(_local4.text);
_local5 = (_local5 - levelDescr[_arg1]["reduce"]);
_local4.text = String(_local5);
if (_local5 == 0){
levelIcons.removeChild(levelIcons.getChildByName("infoTowers"));
};
};
};
}
public function clearSavesYes(_arg1:MouseEvent){
var _local2:Number;
playFX(snd_B);
farm_c.scrollRect = new Rectangle(0, 0, 82, 0);
farm_c.removeEventListener(MouseEvent.MOUSE_UP, showDetail);
farm_c.addEventListener(MouseEvent.MOUSE_UP, startLevel);
_local2 = 1;
while (_local2 < levelFinished) {
if (levelDescr[(_local2 - 1)]["lock"] != null){
levelIcons.getChildByName(levelDescr[(_local2 - 1)]["lock"]).y = 0;
};
levelDescr[(_local2 - 1)]["pic"].scrollRect = new Rectangle(0, 0, 82, 0);
levelDescr[(_local2 - 1)]["pic"].removeEventListener(MouseEvent.MOUSE_UP, showDetail);
levelDescr[(_local2 - 1)]["pic"].addEventListener(MouseEvent.MOUSE_UP, startLevel);
_local2++;
};
if (returnToMainMenu.hasEventListener(MouseEvent.MOUSE_UP)){
returnToMainMenu.removeEventListener(MouseEvent.MOUSE_UP, returnToMainMenuHandler);
};
if (levelIcons.getChildByName("infoTowers") != null){
levelIcons.removeChild(levelIcons.getChildByName("infoTowers"));
};
historyStep = 0;
mySo.data.PlayerName = undefined;
levelFinished = 1;
mySo.data.levelFinished = 1;
mySo.data.buildingsCompleted = 0;
mySo.data.gameScore = 0;
buildingsCompleted = 0;
firstGameEnter = true;
mySo.data.firstStartLevel1 = true;
mySo.data.firstStartLevel2 = true;
firstStartLevel2 = true;
firstStartLevel1 = true;
_local2 = 0;
while (_local2 < buildings.length) {
if (dummy[_local2].hasEventListener(MouseEvent.MOUSE_UP) == true){
dummy[_local2].removeEventListener(MouseEvent.MOUSE_UP, showDetail);
};
_local2++;
};
_local2 = 0;
while (_local2 < 12) {
if (achivments[_local2] != null){
all.getChildByName(achivments[_local2]).alpha = 0.2;
switch (achivments[_local2]){
case "ach_mill_mc":
if (all.getChildByName("ach_mill_lock").y > 400){
all.getChildByName("ach_mill_lock").y = (all.getChildByName("ach_mill_lock").y - 400);
};
break;
case "ach_bronze_mc":
if (all.getChildByName("ach_bronze_lock").y > 400){
all.getChildByName("ach_bronze_lock").y = (all.getChildByName("ach_bronze_lock").y - 400);
};
break;
case "ach_head_mc":
if (all.getChildByName("ach_head_lock").y > 400){
all.getChildByName("ach_head_lock").y = (all.getChildByName("ach_head_lock").y - 400);
};
break;
case "ach_damb_mc":
if (all.getChildByName("ach_damb_lock").y > 400){
all.getChildByName("ach_damb_lock").y = (all.getChildByName("ach_damb_lock").y - 400);
};
break;
case "ach_silver_mc":
if (all.getChildByName("ach_silver_lock").y > 400){
all.getChildByName("ach_silver_lock").y = (all.getChildByName("ach_silver_lock").y - 400);
};
break;
case "ach_gold_mc":
if (all.getChildByName("ach_gold_lock").y > 400){
all.getChildByName("ach_gold_lock").y = (all.getChildByName("ach_gold_lock").y - 400);
};
break;
case "ach_vulc_mc":
if (all.getChildByName("ach_vulc_lock").y > 400){
all.getChildByName("ach_vulc_lock").y = (all.getChildByName("ach_vulc_lock").y - 400);
};
break;
case "ach_enemy_mc":
if (all.getChildByName("ach_enemy_lock").y > 400){
all.getChildByName("ach_enemy_lock").y = (all.getChildByName("ach_enemy_lock").y - 400);
};
break;
case "ach_master_mc":
if (all.getChildByName("ach_master_lock").y >= 400){
all.getChildByName("ach_master_lock").y = (all.getChildByName("ach_master_lock").y - 400);
};
break;
case "ach_finish_mc":
if (all.getChildByName("ach_finish_lock").y >= 400){
all.getChildByName("ach_finish_lock").y = (all.getChildByName("ach_finish_lock").y - 400);
};
break;
case "ach_hero_mc":
if (all.getChildByName("ach_hero_lock").y >= 400){
all.getChildByName("ach_hero_lock").y = (all.getChildByName("ach_hero_lock").y - 400);
};
break;
case "ach_chal_mc":
if (all.getChildByName("ach_chal_lock").y >= 400){
all.getChildByName("ach_chal_lock").y = (all.getChildByName("ach_chal_lock").y - 400);
};
break;
};
};
_local2++;
};
achivments = new Array();
mySo.data.achivments = achivments;
var _local3:MovieClip = (iface.getChildByName("gameScore") as MovieClip);
var _local4:* = (_local3.getChildByName("gameScoreTXT") as TextField);
_local4.text = "0";
gameScore = 0;
iface.y = 400;
removeEventListener(MouseEvent.MOUSE_MOVE, Interface);
buildings.forEach(removeBuildings);
if (iface.getChildByName("progress1") != null){
iface.removeChild(progress1);
};
if (iface.getChildByName("progress2") != null){
iface.removeChild(progress2);
};
if (iface.getChildByName("progress3") != null){
iface.removeChild(progress3);
};
progress2.width = 0;
progress3.x = (progress2.width + 149);
iface.getChildByName("levelsLine").scrollRect = new Rectangle(0, 0, 410, 62);
mMenu.removeChild(startCamp);
mMenu.removeChild(startChal);
mMenu.removeChild(clearSaves);
mMenu.removeChild(moreGames);
mMenu.removeChild(highScore);
mMenu.removeChild(pName_mc);
if (detail_text != null){
detail.removeChild(detail_text);
detail_text = null;
};
if (clear_txt_yes != null){
detail.removeChild(clear_txt_yes);
clear_txt_yes = null;
};
if (clear_txt_no != null){
detail.removeChild(clear_txt_no);
clear_txt_no = null;
};
addEventListener(MouseEvent.MOUSE_UP, removeSelf);
mMenu.gotoAndStop(1);
mMenu.addChild(name_ok);
}
private function showStartLevelMessage(){
detailDirection = 2;
if (detail == null){
if (l.level.countDownTimer != null){
l.level.countDownTimer.stop();
};
if (l.level.earthQuakeTimer != null){
l.level.earthQuakeTimer.stop();
};
if (l.level.floodTimer != null){
l.level.floodTimer.stop();
};
playFX(snd_P);
showDescription = "startlevelmessage";
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
blankShaddow = new blank();
blankShaddow.alpha = 0;
addChild(blankShaddow);
detailTimerOpen.addEventListener(TimerEvent.TIMER, detailResizeOpen);
addChild(detail);
detailTimerOpen.start();
};
}
private function removeSelf(_arg1:MouseEvent):void{
remove();
}
public function clearSavesNo(_arg1:MouseEvent){
playFX(snd_B);
if (detail_text != null){
detail.removeChild(detail_text);
detail_text = null;
};
if (clear_txt_yes != null){
detail.removeChild(clear_txt_yes);
clear_txt_yes = null;
};
if (clear_txt_no != null){
detail.removeChild(clear_txt_no);
clear_txt_no = null;
};
addEventListener(MouseEvent.MOUSE_UP, removeSelf);
}
public function replayLevel(_arg1:MouseEvent):void{
gameMode = "level";
replayFlag = true;
remove(1);
channel.stop();
playFX(snd_B);
removeChild(iface);
removeChild(bg);
lvlReplay = _arg1.currentTarget.name;
switch (_arg1.currentTarget.name){
case "replay_farm_btn":
lvl = 1;
break;
case "replay_sow_btn":
lvl = 3;
break;
case "replay_wine_btn":
lvl = 4;
break;
case "replay_damb_btn":
lvl = 7;
break;
case "replay_tawern_btn":
lvl = 9;
break;
case "replay_market_btn":
lvl = 11;
break;
case "replay_mill_btn":
lvl = 13;
break;
case "replay_tower_btn":
lvl = 14;
break;
case "replay_holl_btn":
lvl = 15;
break;
case "replay_walls_btn":
lvl = 18;
break;
case "replay_baracks_btn":
lvl = 20;
break;
case "replay_armory_btn":
lvl = 23;
break;
case "replay_castle_btn":
lvl = 25;
break;
};
messLevel = lvl;
if (levelDescr[(lvl - 1)]["replayhistory"] != null){
addChild(levelDescr[(lvl - 1)]["replayhistory"]);
addChild(history_ok);
history_ok.addEventListener(MouseEvent.MOUSE_UP, closeHistoryReplay);
} else {
switch (_arg1.currentTarget.name){
case "replay_farm_btn":
l = new Era1(1, fxFlag, soundFlag);
break;
case "replay_sow_btn":
l = new Era1(3, fxFlag, soundFlag);
break;
case "replay_wine_btn":
l = new Era1(4, fxFlag, soundFlag);
break;
case "replay_damb_btn":
l = new Era2(7, fxFlag, soundFlag);
break;
case "replay_tawern_btn":
l = new Era1(9, fxFlag, soundFlag);
break;
case "replay_market_btn":
l = new Era1(11, fxFlag, soundFlag);
break;
case "replay_mill_btn":
l = new Era1(13, fxFlag, soundFlag);
break;
case "replay_tower_btn":
l = new Era1(14, fxFlag, soundFlag);
break;
case "replay_holl_btn":
l = new Era1(15, fxFlag, soundFlag);
break;
case "replay_walls_btn":
l = new Era3(18, fxFlag, soundFlag);
break;
case "replay_baracks_btn":
l = new Era1(20, fxFlag, soundFlag);
break;
case "replay_armory_btn":
l = new Era1(23, fxFlag, soundFlag);
break;
case "replay_castle_btn":
l = new Era4(25, fxFlag, soundFlag);
break;
};
addChild(l);
addChild(lButtons);
addEventListener(Event.ENTER_FRAME, checkLevelStatus);
};
}
private function showAchivment(_arg1){
panelMC = new panel();
panelMC.x = (533 / 2);
panelMC.y = -(panelMC.height);
addChild(panelMC);
levelAch = true;
switch (_arg1.name){
case "ach_mill_mc":
all.getChildByName("ach_mill_lock").y = (all.getChildByName("ach_mill_lock").y + 400);
break;
case "ach_bronze_mc":
all.getChildByName("ach_bronze_lock").y = (all.getChildByName("ach_bronze_lock").y + 400);
break;
case "ach_head_mc":
all.getChildByName("ach_head_lock").y = (all.getChildByName("ach_head_lock").y + 400);
break;
case "ach_damb_mc":
all.getChildByName("ach_damb_lock").y = (all.getChildByName("ach_damb_lock").y + 400);
break;
case "ach_silver_mc":
all.getChildByName("ach_silver_lock").y = (all.getChildByName("ach_silver_lock").y + 400);
break;
case "ach_gold_mc":
all.getChildByName("ach_gold_lock").y = (all.getChildByName("ach_gold_lock").y + 400);
break;
case "ach_vulc_mc":
all.getChildByName("ach_vulc_lock").y = (all.getChildByName("ach_vulc_lock").y + 400);
break;
case "ach_enemy_mc":
all.getChildByName("ach_enemy_lock").y = (all.getChildByName("ach_enemy_lock").y + 400);
break;
case "ach_master_mc":
all.getChildByName("ach_master_lock").y = (all.getChildByName("ach_master_lock").y + 400);
break;
case "ach_finish_mc":
all.getChildByName("ach_finish_lock").y = (all.getChildByName("ach_finish_lock").y + 400);
break;
case "ach_hero_mc":
all.getChildByName("ach_hero_lock").y = (all.getChildByName("ach_hero_lock").y + 400);
break;
case "ach_chal_mc":
all.getChildByName("ach_chal_lock").y = (all.getChildByName("ach_chal_lock").y + 400);
break;
};
switch (_arg1.name){
case "ach_mill_mc":
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
AwardsService.submitAward("award1");
};
};
ac1.x = -96;
ac1.y = 21;
panelMC.addChild(ac1);
actxt1.x = -56;
actxt1.y = 12;
panelMC.addChild(actxt1);
break;
case "ach_head_mc":
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
AwardsService.submitAward("award2");
};
};
ac2.x = -96;
ac2.y = 21;
panelMC.addChild(ac2);
actxt2.x = -56;
actxt2.y = 12;
panelMC.addChild(actxt2);
break;
case "ach_damb_mc":
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
AwardsService.submitAward("award3");
};
};
ac3.x = -96;
ac3.y = 21;
panelMC.addChild(ac3);
actxt3.x = -56;
actxt3.y = 12;
panelMC.addChild(actxt3);
break;
case "ach_vulc_mc":
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
AwardsService.submitAward("award4");
};
};
ac4.x = -96;
ac4.y = 21;
panelMC.addChild(ac4);
actxt4.x = -56;
actxt4.y = 12;
panelMC.addChild(actxt4);
break;
case "ach_enemy_mc":
if (Submitter != null){
if (Submitter.isDomainAllowed() == true){
AwardsService.submitAward("award5");
};
};
ac5.x = -96;
ac5.y = 21;
panelMC.addChild(ac5);
actxt5.x = -56;
actxt5.y = 12;
panelMC.addChild(actxt5);
break;
case "ach_finish_mc":
ac6.x = -71;
ac6.y = 21;
panelMC.addChild(ac6);
actxt6.x = -56;
actxt6.y = 12;
panelMC.addChild(actxt6);
break;
case "ach_chal_mc":
ac7.x = -96;
ac7.y = 21;
panelMC.addChild(ac7);
actxt7.x = -56;
actxt7.y = 12;
panelMC.addChild(actxt7);
levelAch = false;
break;
case "ach_bronze_mc":
ac8.x = -96;
ac8.y = 21;
panelMC.addChild(ac8);
actxt8.x = -56;
actxt8.y = 12;
panelMC.addChild(actxt8);
levelAch = false;
break;
case "ach_silver_mc":
ac9.x = -96;
ac9.y = 21;
panelMC.addChild(ac9);
actxt9.x = -56;
actxt9.y = 12;
panelMC.addChild(actxt9);
levelAch = false;
break;
case "ach_gold_mc":
ac10.x = -96;
ac10.y = 21;
panelMC.addChild(ac10);
actxt10.x = -56;
actxt10.y = 12;
panelMC.addChild(actxt10);
levelAch = false;
break;
case "ach_master_mc":
ac11.x = -96;
ac11.y = 21;
panelMC.addChild(ac11);
actxt11.x = -56;
actxt11.y = 12;
panelMC.addChild(actxt1);
levelAch = false;
break;
case "ach_hero_mc":
ac12.x = -96;
ac12.y = 21;
panelMC.addChild(ac12);
actxt12.x = -56;
actxt12.y = 12;
panelMC.addChild(actxt12);
levelAch = false;
break;
};
achivments.push(_arg1.name);
mySo.data.achivments = achivments;
panelTimer = new Timer(10);
panelTimer.addEventListener(TimerEvent.TIMER, panelTimerHandler);
panelTimer.start();
panelMC.alpha = 1;
}
private function showFinishLevelMessage(){
if (detail == null){
playFX(snd_P);
showDescription = "finishlevelmessage";
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
blankShaddow = new blank();
blankShaddow.alpha = 0;
addChild(blankShaddow);
detailTimerOpen.addEventListener(TimerEvent.TIMER, detailResizeOpen);
addChild(detail);
detailTimerOpen.start();
};
}
public function changeBG(_arg1:Event){
}
}
}//package
Section 121
//glowBorder (glowBorder)
package {
import flash.display.*;
public dynamic class glowBorder extends MovieClip {
}
}//package
Section 122
//Great (Great)
package {
import flash.display.*;
public dynamic class Great extends MovieClip {
public function Great(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 123
//history1 (history1)
package {
import flash.display.*;
public dynamic class history1 extends MovieClip {
}
}//package
Section 124
//history2 (history2)
package {
import flash.display.*;
public dynamic class history2 extends MovieClip {
}
}//package
Section 125
//history3 (history3)
package {
import flash.display.*;
public dynamic class history3 extends MovieClip {
}
}//package
Section 126
//history4 (history4)
package {
import flash.display.*;
public dynamic class history4 extends MovieClip {
}
}//package
Section 127
//history5 (history5)
package {
import flash.display.*;
public dynamic class history5 extends MovieClip {
}
}//package
Section 128
//history6 (history6)
package {
import flash.display.*;
public dynamic class history6 extends MovieClip {
}
}//package
Section 129
//holl_text (holl_text)
package {
import flash.display.*;
public dynamic class holl_text extends MovieClip {
}
}//package
Section 130
//hollIco (hollIco)
package {
import flash.display.*;
public dynamic class hollIco extends MovieClip {
}
}//package
Section 131
//hook (hook)
package {
import flash.display.*;
public dynamic class hook extends MovieClip {
}
}//package
Section 132
//korona (korona)
package {
import flash.display.*;
public dynamic class korona extends MovieClip {
}
}//package
Section 133
//level_bg (level_bg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class level_bg extends MovieClip {
public var cl0:MovieClip;
public var cl1:MovieClip;
public var cl2:MovieClip;
public var cl3:MovieClip;
public var c0:MovieClip;
public var c1:MovieClip;
public var c2:MovieClip;
public var c3:MovieClip;
public function level_bg(){
c0 = (getChildByName("cl0") as MovieClip);
c1 = (getChildByName("cl1") as MovieClip);
c2 = (getChildByName("cl2") as MovieClip);
c3 = (getChildByName("cl3") as MovieClip);
var _local1:Timer = new Timer(50);
_local1.addEventListener(TimerEvent.TIMER, cloudHandler);
_local1.start();
}
public function cloudHandler(_arg1:TimerEvent):void{
c0.x = (c0.x + 2);
if (c0.x > (533 + 10)){
c0.x = -(c0.width);
c0.y = randRange(c0.height, 200);
};
c1.x = (c1.x + 1);
if (c1.x > (533 + 10)){
c1.x = -(c1.width);
c1.y = randRange(c0.height, 200);
};
c2.x = (c2.x + 1.5);
if (c2.x > (533 + 10)){
c2.x = -(c2.width);
c2.y = randRange(c0.height, 200);
};
c3.x = (c3.x + 3);
if (c3.x > (533 + 10)){
c3.x = -(c3.width);
c3.y = randRange(c0.height, 200);
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
}
}//package
Section 134
//level_bg_hight1 (level_bg_hight1)
package {
import flash.display.*;
public class level_bg_hight1 extends Clouds {
public var shar:MovieClip;
public var cl0:MovieClip;
public var cl1:MovieClip;
public var cl3:MovieClip;
public var cl4:MovieClip;
public var dr:MovieClip;
}
}//package
Section 135
//level_svitok (level_svitok)
package {
import flash.display.*;
public dynamic class level_svitok extends MovieClip {
public var ok_btn1:ok_btn;
public var svitoc_mc:MovieClip;
}
}//package
Section 136
//levelBgEra3 (levelBgEra3)
package {
import flash.display.*;
public dynamic class levelBgEra3 extends MovieClip {
public var level_bg_copy1_mc:level_bg_hight1;
}
}//package
Section 137
//levelButtons (levelButtons)
package {
import flash.display.*;
public dynamic class levelButtons extends MovieClip {
public var menu_btn:SimpleButton;
public var sound_btn:SimpleButton;
public var fx_btn:SimpleButton;
}
}//package
Section 138
//LevelMusic (LevelMusic)
package {
import flash.media.*;
public dynamic class LevelMusic extends Sound {
}
}//package
Section 139
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends MovieClip {
public var bookClosed_mc:MovieClip;
public function MainMenu(){
addFrameScript(0, frame1, 3, frame4);
}
function frame1(){
stop();
}
function frame4(){
}
}
}//package
Section 140
//market_text (market_text)
package {
import flash.display.*;
public dynamic class market_text extends MovieClip {
}
}//package
Section 141
//marketIco (marketIco)
package {
import flash.display.*;
public dynamic class marketIco extends MovieClip {
}
}//package
Section 142
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 143
//mill_text (mill_text)
package {
import flash.display.*;
public dynamic class mill_text extends MovieClip {
}
}//package
Section 144
//millIco (millIco)
package {
import flash.display.*;
public dynamic class millIco extends MovieClip {
}
}//package
Section 145
//mistake (mistake)
package {
import flash.display.*;
public dynamic class mistake extends MovieClip {
}
}//package
Section 146
//newBlockMess (newBlockMess)
package {
import flash.display.*;
public dynamic class newBlockMess extends MovieClip {
}
}//package
Section 147
//noBtn (noBtn)
package {
import flash.display.*;
public dynamic class noBtn extends SimpleButton {
}
}//package
Section 148
//numTowersInfo (numTowersInfo)
package {
import flash.display.*;
import flash.text.*;
public dynamic class numTowersInfo extends MovieClip {
public var numTowersTxt_txt:TextField;
}
}//package
Section 149
//ok_btn (ok_btn)
package {
import flash.display.*;
public dynamic class ok_btn extends SimpleButton {
}
}//package
Section 150
//osnovanie (osnovanie)
package {
import flash.display.*;
public dynamic class osnovanie extends MovieClip {
}
}//package
Section 151
//panel (panel)
package {
import flash.display.*;
public dynamic class panel extends MovieClip {
}
}//package
Section 152
//playerNameText (playerNameText)
package {
import flash.display.*;
import flash.text.*;
public dynamic class playerNameText extends MovieClip {
public var playerName:TextField;
}
}//package
Section 153
//plScore (plScore)
package {
import flash.display.*;
import flash.text.*;
public dynamic class plScore extends MovieClip {
public var plScr:TextField;
}
}//package
Section 154
//Program (Program)
package {
import flash.display.*;
public class Program extends MovieClip {
public function Program(_arg1){
var _local2:MovieClip = new game(_arg1);
addChild(_local2);
}
}
}//package
Section 155
//progressBarLeftMC (progressBarLeftMC)
package {
import flash.display.*;
public dynamic class progressBarLeftMC extends MovieClip {
}
}//package
Section 156
//progressBarMC (progressBarMC)
package {
import flash.display.*;
public dynamic class progressBarMC extends MovieClip {
}
}//package
Section 157
//progressBarRightMC (progressBarRightMC)
package {
import flash.display.*;
public dynamic class progressBarRightMC extends MovieClip {
}
}//package
Section 158
//quakeMess (quakeMess)
package {
import flash.display.*;
public dynamic class quakeMess extends MovieClip {
}
}//package
Section 159
//replay (replay)
package {
import flash.display.*;
public dynamic class replay extends SimpleButton {
}
}//package
Section 160
//resumeBtn (resumeBtn)
package {
import flash.display.*;
public dynamic class resumeBtn extends SimpleButton {
}
}//package
Section 161
//score (score)
package {
import flash.display.*;
public dynamic class score extends MovieClip {
public var score_mc:MovieClip;
public function score(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 162
//scoreCount (scoreCount)
package {
import flash.media.*;
public dynamic class scoreCount extends Sound {
}
}//package
Section 163
//scoreForHeightMC (scoreForHeightMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scoreForHeightMC extends MovieClip {
public var scoreForHeightTXT:TextField;
}
}//package
Section 164
//snd_blockCombo (snd_blockCombo)
package {
import flash.media.*;
public dynamic class snd_blockCombo extends Sound {
}
}//package
Section 165
//snd_BlockOK (snd_BlockOK)
package {
import flash.media.*;
public dynamic class snd_BlockOK extends Sound {
}
}//package
Section 166
//snd_Button (snd_Button)
package {
import flash.media.*;
public dynamic class snd_Button extends Sound {
}
}//package
Section 167
//snd_Paper (snd_Paper)
package {
import flash.media.*;
public dynamic class snd_Paper extends Sound {
}
}//package
Section 168
//sow_text (sow_text)
package {
import flash.display.*;
public dynamic class sow_text extends MovieClip {
}
}//package
Section 169
//sowIco (sowIco)
package {
import flash.display.*;
public dynamic class sowIco extends MovieClip {
}
}//package
Section 170
//Spectacular (Spectacular)
package {
import flash.display.*;
public dynamic class Spectacular extends MovieClip {
public function Spectacular(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 171
//study1_mess (study1_mess)
package {
import flash.display.*;
public dynamic class study1_mess extends MovieClip {
}
}//package
Section 172
//study2_mess (study2_mess)
package {
import flash.display.*;
public dynamic class study2_mess extends MovieClip {
}
}//package
Section 173
//submitScore (submitScore)
package {
import flash.display.*;
public dynamic class submitScore extends SimpleButton {
}
}//package
Section 174
//SubmitterProxy (SubmitterProxy)
package {
import flash.display.*;
import flash.events.*;
import com.spilgames.api.*;
import flash.system.*;
public class SubmitterProxy extends MovieClip {
public var m_scoreXMLData:XML;
public var m_achievXMLData:XML;
private var parentObj;
public var m_scoreServerTimeXMLData:XML;
private static var _failed:Boolean = false;
private static var _loading:Boolean = false;
private static var _initialised:Boolean = false;
private static var SpilComp:SpilGamesServices;
public function SubmitterProxy():void{
var cld:*;
super();
Security.allowDomain("*");
parentObj = this.parent;
parentObj.stop();
var i:int = (parentObj.numChildren - 1);
while (i >= 0) {
cld = parentObj.getChildAt(i);
if ((cld is MovieClip)){
cld.visible = false;
} else {
if (cld != null){
parentObj.removeChild(cld);
};
};
i = (i - 1);
};
try {
parentObj["setLoader"] = setLoader;
parentObj["isDomainAllowed"] = isDomainAllowed;
parentObj["hasUserData"] = hasUserData;
parentObj["_O0000Ol01"] = setLoader;
parentObj["_O0Olll0lO"] = isDomainAllowed;
} catch(e:Error) {
trace(e);
};
}
private function SpilConfiguratorFailedToInitialise(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
_failed = true;
_loading = false;
parentObj.dispatchEvent(new Event("LoadingFailed"));
}
public function SpilCallback(_arg1:int, _arg2:Object):void{
}
private function onLoadDone():void{
parentObj["isSWFReady"] = isSWFReady;
parentObj["setServerSelect"] = setServerSelect;
parentObj["requestScoreServerTime"] = requestScoreServerTime;
parentObj["getScoreServerTime"] = getScoreServerTime;
parentObj["submitScore"] = submitScore;
parentObj["requestHighscoreList"] = requestHighscoreList;
parentObj["requestUserHighscoreList"] = requestUserHighscoreList;
parentObj["submitGrantAward"] = submitGrantAward;
parentObj["requestAwardList"] = requestAwardList;
parentObj["requestAwardInfo"] = requestAwardInfo;
parentObj["destroy"] = destroy;
parentObj["getSpilGamesConnector"] = getSpilGamesConnector;
parentObj["_O0O1l0OO0"] = isSWFReady;
parentObj["_O0lOO010l"] = requestScoreServerTime;
parentObj["_O01Ol1O1O"] = getScoreServerTime;
parentObj["_O01lOO10O"] = submitScore;
parentObj["_O110l10ll"] = requestHighscoreList;
parentObj["_O11lll1OO0"] = requestUserHighscoreList;
parentObj["_O00OOl1Ol"] = submitGrantAward;
parentObj["_O1OlO10OO"] = requestAwardList;
parentObj["_OOlOOOll1"] = requestAwardInfo;
parentObj["_O010ll111"] = destroy;
parentObj["OO00OO1l1l"] = OO00OO1l1l();
}
private function processTimeResults(_arg1:int, _arg2:Object):void{
if (_arg2){
if (_arg2.errorMessage){
} else {
if (_arg2.xml){
m_scoreServerTimeXMLData = _arg2.xml;
};
};
} else {
m_scoreServerTimeXMLData = new XML("<hyscore><time>123456789</time></hyscore>");
};
}
private function isSWFReady():Boolean{
return (((SpilComp) && (SpilComp.isSWFReady())));
}
private function requestAwardList():void{
if (SpilComp){
SpilComp.send("Awards", "getAwardList", processAwardResults, {userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
public function set O1lll0ll0(_arg1:XML):void{
m_scoreServerTimeXMLData = _arg1;
}
public function OO00OO1l1l():SubmitterProxy{
return (this);
}
private function hasUserData():Boolean{
return (!(SpilComp.hasValidUserData()));
}
public function get O0l00l0O0():XML{
return (m_scoreXMLData);
}
private function destroy():void{
parentObj = null;
m_scoreXMLData = null;
m_achievXMLData = null;
}
private function requestScoreServerTime():void{
if (SpilComp){
SpilComp.send("Score", "checkServerTime", processTimeResults);
};
}
private function requestUserHighscoreList(_arg1:String):void{
if (SpilComp){
SpilComp.send("Score", "getUserRankList", processScoreResults, {targetUserName:_arg1});
};
}
public function get O1OlOO00O():XML{
return (m_achievXMLData);
}
private function submitGrantAward(_arg1:String):void{
if (SpilComp){
SpilComp.send("Awards", "submitAward", processAwardResults, {tag:_arg1, userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
private function setLoader(_arg1=null, _arg2:String="default", _arg3="", _arg4:int=0, _arg5:String="normal", _arg6:String="", _arg7:int=0, _arg8:int=0, _arg9:int=1, _arg10:Boolean=false, _arg11:int=1):void{
if (!_initialised){
trace("Initialising for the first time");
_initialised = true;
if (_arg1){
SpilComp = SpilGamesServices.getInstance();
SpilComp.addEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.addEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.addEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
_loading = true;
SpilComp.connect(_arg1);
} else {
throw (new Error("'container' cannot be null"));
};
} else {
trace("Initialisation called multiple times");
if (!_loading){
trace("Ready with loading");
if (!_failed){
trace("Simulate Submitter complete");
onLoadDone();
parentObj.dispatchEvent(new Event(Event.COMPLETE));
} else {
trace("Simulate Submitter LoadingFailed");
parentObj.dispatchEvent(new Event("LoadingFailed"));
};
} else {
trace("Still loading");
};
};
}
private function requestHighscoreList():void{
if (SpilComp){
SpilComp.send("Score", "getRankingList", processScoreResults, null);
};
}
public function set O0l00l0O0(_arg1:XML):void{
m_scoreXMLData = _arg1;
}
private function setServerSelect(_arg1:int):void{
if (SpilComp){
};
}
private function requestAwardInfo(_arg1:int):void{
if (SpilComp){
SpilComp.send("Awards", "getAward", SpilCallback, {awardID:_arg1});
};
}
public function set O1OlOO00O(_arg1:XML):void{
m_achievXMLData = _arg1;
}
private function processAwardResults(_arg1:int, _arg2:Object):void{
if (_arg2){
m_achievXMLData = _arg2.xml;
} else {
m_achievXMLData = new XML("<hyscor><awardid>147</awardid></hyscor>");
};
}
public function getSpilGamesConnector(){
return (SpilComp);
}
public function get O1lll0ll0():XML{
return (m_scoreServerTimeXMLData);
}
private function processScoreResults(_arg1:int, _arg2:Object):void{
if (_arg2){
m_scoreXMLData = _arg2.xml;
} else {
m_scoreXMLData = <hyscor><resultset>
<group>daily</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
<resultset>
<group>weekly</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
<resultset>
<group>monthly</group>
<result>
<position>1</position>
<timestamp>1271247768</timestamp>
<username>noot</username>
<authenticated>1</authenticated>
<score>2</score>
<gamelevel>0</gamelevel>
<country>NL</country>
</result>
</resultset>
</hyscor>
;
};
}
private function getScoreServerTime():void{
if (SpilComp){
SpilComp.send("Score", "getLatestTimeCheck", processTimeResults);
};
}
private function SpilConfiguratorReady(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
_loading = false;
onLoadDone();
parentObj.dispatchEvent(new Event(Event.COMPLETE));
}
private function doCommTest():String{
if (SpilComp){
return ("y");
};
return (("FAILED " + SpilComp));
}
private function submitScore(_arg1:int):void{
if (SpilComp){
SpilComp.send("Score", "submitScore", processScoreResults, {score:_arg1, userName:SpilComp.getUserName(), userHash:SpilComp.getUserHash()});
};
}
private function SpilConfiguratorFailedToLoad(_arg1:Event):void{
if (SpilComp){
SpilComp.removeEventListener("servicesReady", SpilConfiguratorReady);
SpilComp.removeEventListener(IOErrorEvent.IO_ERROR, SpilConfiguratorFailedToLoad);
SpilComp.removeEventListener("servicesFailed", SpilConfiguratorFailedToInitialise);
};
trace("SpilConfiguratorFailedToLoad", _arg1.toString());
_failed = true;
_loading = false;
if (parentObj.hasEventListener(IOErrorEvent.IO_ERROR)){
parentObj.dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
};
}
private function onLegacyEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function isDomainAllowed(_arg1:Boolean=false):Boolean{
return (SpilComp.isDomainAllowed());
}
private function setLoader2(_arg1=null, _arg2:String="default", _arg3:int=1, _arg4="", _arg5:int=0, _arg6:String="normal", _arg7:String="", _arg8:int=0, _arg9:int=0, _arg10:int=1, _arg11:Boolean=false, _arg12:int=1):void{
setLoader(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12);
}
}
}//package
Section 175
//tawern_text (tawern_text)
package {
import flash.display.*;
public dynamic class tawern_text extends MovieClip {
}
}//package
Section 176
//tawernIco (tawernIco)
package {
import flash.display.*;
public dynamic class tawernIco extends MovieClip {
}
}//package
Section 177
//Tower (Tower)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tower extends MovieClip {
private var stopPos:Number;// = 0
private var amp:Number;// = -1
public var speed:Number;
private var minRange:Number;
public var step:Number;// = 0
public var towerHeight:Number;// = 0
private var maxRange:Number;
private var rCnt:Number;// = 0
private var ranges:Array;
public var topBlockX:Number;// = 0
public var st:Number;// = 0
private var Fi:Number;// = 0
private var towerN:Number;
public var rCntTimer:Timer;
private var moveDirection:Number;// = 1
private var moveSize:Number;// = 0
private var prev:Number;// = 0
public var t:Timer;
public var stopStep:Number;
private var raiseAmp:Number;// = 1
public var mH:Number;
private var range:Number;
public function Tower(_arg1, _arg2, _arg3, _arg4){
t = new Timer(5);
stopStep = randRange(20, 80);
ranges = new Array();
rCntTimer = new Timer(10000);
super();
maxRange = 370;
speed = 1;
minRange = -(maxRange);
ranges[0] = new Array(0, maxRange);
ranges[1] = new Array(minRange, 0);
ranges[2] = new Array(0, (maxRange / 2));
ranges[3] = new Array((minRange / 2), 0);
ranges[4] = new Array(minRange, maxRange);
ranges[5] = new Array((minRange / 2), (maxRange / 2));
towerN = _arg4;
if (_arg3 != 1){
range = ((((533 - 50) / _arg3) - 80) / 2);
} else {
range = 100;
};
mH = _arg1;
if (mH != 0){
t.addEventListener(TimerEvent.TIMER, moveTower);
t.start();
rCntTimer.addEventListener(TimerEvent.TIMER, rCntTimerHandler);
rCntTimer.start();
};
}
private function moveTowerBlocks(_arg1, _arg2:int, _arg3:Array):void{
_arg1.x = (_arg1.x + Fi);
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
public function rCntTimerHandler(_arg1:TimerEvent){
maxRange = (370 - Math.round((((6 * towerHeight) * 50) / 60)));
minRange = -(maxRange);
speed = (1 - (Math.round(((towerHeight / 60) * 100)) / 200));
ranges[0] = new Array(0, maxRange);
ranges[1] = new Array(minRange, 0);
ranges[2] = new Array(0, (maxRange / 2));
ranges[3] = new Array((minRange / 2), 0);
ranges[4] = new Array(minRange, maxRange);
ranges[5] = new Array((minRange / 2), (maxRange / 2));
if (rCnt == 5){
rCnt = 0;
} else {
rCnt++;
};
}
function moveTower(_arg1:TimerEvent){
var _local3:Number;
if (mH == 0){
t.stop();
t.removeEventListener(TimerEvent.TIMER, moveTower);
};
var _local2:Array = new Array();
_local3 = 0;
while (_local3 < towerHeight) {
_local2[_local3] = getChildAt(_local3);
_local3++;
};
var _local4:* = ((range / 2) + 25);
var _local5:Number = maxRange;
_local5 = maxRange;
var _local6:Number = (Math.random() / 5);
_local6 = speed;
if (moveSize >= ranges[rCnt][1]){
moveDirection = -1;
} else {
if (moveSize <= ranges[rCnt][0]){
moveDirection = 1;
};
};
if (moveSize > maxRange){
moveDirection = -1;
} else {
if (moveSize < minRange){
moveDirection = 1;
};
};
if (_local2.length >= mH){
Fi = (moveDirection * _local6);
moveSize = (moveSize + Fi);
rotation = (rotation + (Fi / 100));
};
}
}
}//package
Section 178
//tower_text (tower_text)
package {
import flash.display.*;
public dynamic class tower_text extends MovieClip {
}
}//package
Section 179
//TowerBloxx2v2 (TowerBloxx2v2)
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import spill.localisation.*;
import fl.transitions.*;
import com.spilgames.api.*;
import fl.transitions.easing.*;
import flash.utils.*;
import flash.net.*;
import mochi.as3.*;
public class TowerBloxx2v2 extends MovieClip {
public var linkBTN:BrandingLogo;
public var pBar:MovieClip;
private var displaytime:int;// = 0
private var myTween:Array;
var Sub:SpilGamesServices;
public var advet:MovieClip;
private var progressBar:Sprite;
private var logos:Array;
public var pBarLeft:progressBarLeftMC;
private var imgLoader:Array;
private var showTimer:Timer;
private var myXML:XML;
public var pBarRight:progressBarRightMC;
private var lText:TextField;
private var myLoader:URLLoader;
private var progressBarL:Sprite;
private var progressBarR:Sprite;
public var loading_txt:TextField;
public var mbd:MovieClip;
public static const ENTRY_FRAME:Number = 3;
public static const DOCUMENT_CLASS:String = "Program";
public static const SEND_DEBUG:Boolean = false;
public function TowerBloxx2v2(){
myXML = new XML();
logos = new Array();
imgLoader = new Array();
myTween = new Array();
addFrameScript(0, frame1);
super();
stop();
Sub = SpilGamesServices.getInstance();
Sub.addEventListener("servicesReady", onServicesReady);
Sub.addEventListener("servicesFailed", onServicesFailed);
Sub.connect(this);
SpilGame.initialize("towerburg", PortalGroup.FAMILY, "towerburg.html", this, true);
var _local1:MovieClip = (getChildByName("linkBTN") as MovieClip);
_local1.mouseEnabled = (_local1.buttonMode = (_local1.useHandCursor = true));
_local1.addEventListener(MouseEvent.MOUSE_UP, clickLogo);
var _local2:Boolean;
var _local3:Array = ["vss.vscc.ac.ru", "file", "fundemic", "fundemic.com", "www.fundemic.com", "flashgamelicense.com", "www.flashgamelicense.com", "realarcade.com", "gamehouse.com", "zylom.com", "trygames.com", "trymedia.com", "tmsrv.com"];
var _local4:* = loaderInfo.url;
var _local5:* = 0;
while (_local5 < _local3.length) {
if (_local4.indexOf(_local3[_local5]) >= 0){
_local2 = true;
break;
};
_local5++;
};
progressBar = (getChildByName("pBar") as Sprite);
progressBarL = (getChildByName("pBarLeft") as Sprite);
progressBarR = (getChildByName("pBarRight") as Sprite);
progressBar.scaleX = 0;
progressBarL.scaleX = 0;
progressBarR.scaleX = 0;
lText = (getChildByName("loading_txt") as TextField);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
}
function error(_arg1:IOErrorEvent):void{
}
private function enterFrameHandler(_arg1:Event):void{
if (currentFrame >= _slot1.ENTRY_FRAME){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
main();
};
}
function error1(_arg1:IOErrorEvent):void{
}
private function showLogos(){
imgLoader[0].x = ((533 - imgLoader[0].width) / 2);
imgLoader[0].y = ((400 - imgLoader[0].height) / 2);
addChild(imgLoader[0]);
myTween[0] = new Tween(imgLoader[0], "alpha", None.easeInOut, 0, 1, (displaytime / 1000), true);
showTimer.addEventListener(TimerEvent.TIMER, showLogosTimer);
showTimer.start();
}
function imgLoaded(_arg1:Event):void{
addChild(_arg1.currentTarget.data);
}
private function main():void{
var _local1:URLLoader;
var _local2:URLRequest;
var _local3:Class;
var _local4:Sprite;
if (SEND_DEBUG == true){
_local1 = new URLLoader();
_local2 = new URLRequest("debug.php?mode=gameloaded");
_local1.load(_local2);
};
if (displaytime != 0){
showLogos();
} else {
_local3 = (loaderInfo.applicationDomain.getDefinition(_slot1.DOCUMENT_CLASS) as Class);
_local4 = (new _local3(Sub) as Sprite);
addChild(_local4);
};
}
function onServicesReady(_arg1:Event):void{
}
private function completeHandler(_arg1:Event):void{
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function onFinish(_arg1:TweenEvent):void{
var _local2:* = 0;
while (_local2 < myTween.length) {
removeChild(imgLoader[_local2]);
_local2++;
};
}
private function progressHandler(_arg1:ProgressEvent):void{
var _local2:uint = _arg1.bytesLoaded;
var _local3:uint = _arg1.bytesTotal;
var _local4:* = (_local2 / _local3);
if (_local4 > 0.064){
lText.text = (("Loading " + Math.round(((100 * _local2) / _local3))) + "%");
progressBarL.scaleX = 1;
progressBar.scaleX = (_local2 / _local3);
progressBarR.scaleX = 1;
progressBarR.x = (16.5 + progressBar.width);
};
}
private function showLogosTimer(_arg1:TimerEvent):void{
var _local2:Class;
var _local3:Sprite;
if (_arg1.currentTarget.currentCount < imgLoader.length){
imgLoader[_arg1.currentTarget.currentCount].x = ((533 - imgLoader[_arg1.currentTarget.currentCount].width) / 2);
imgLoader[_arg1.currentTarget.currentCount].y = ((400 - imgLoader[_arg1.currentTarget.currentCount].height) / 2);
addChild(imgLoader[_arg1.currentTarget.currentCount]);
myTween[_arg1.currentTarget.currentCount] = new Tween(imgLoader[_arg1.currentTarget.currentCount], "alpha", None.easeInOut, 0, 1, (displaytime / 1000), true);
} else {
_local2 = (loaderInfo.applicationDomain.getDefinition(_slot1.DOCUMENT_CLASS) as Class);
_local3 = (new (_local2) as Sprite);
addChild(_local3);
};
myTween[(_arg1.currentTarget.currentCount - 1)].yoyo();
}
private function clickLogo(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest(SpilGame.getMoreGamesLink("button_preloader_moregames"));
navigateToURL(_local2, "_blank");
}
function frame1(){
}
function onServicesFailed(_arg1:Event):void{
}
function xmlLoaded(_arg1:Event):void{
var _local3:XML;
var _local4:URLRequest;
myXML = XML(myLoader.data);
displaytime = myXML.displaytime;
displaytime = 0;
var _local2:Number = 0;
for each (_local3 in myXML.splashsreens.image) {
logos[_local2] = _local3;
_local2++;
};
_local2 = 0;
while (_local2 < logos.length) {
imgLoader[_local2] = new Loader();
imgLoader[_local2].contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, error1);
_local4 = new URLRequest(("branding/" + logos[_local2]));
imgLoader[_local2].load(_local4);
_local2++;
};
showTimer = new Timer(displaytime, logos.length);
}
}
}//package
Section 180
//TowerBloxxLevel (TowerBloxxLevel)
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.geom.*;
public class TowerBloxxLevel extends MovieClip {
public var success:Number;// = 0
private var successFlag;// = false
public var comboLength:Number;// = 0
public var reduceCnt:Number;
public var music:Sound;
var detailDirection:Number;// = 2
private var completeL:MovieClip;
public var fire:Array;
private var hook_mc:MovieClip;
private var moveStep:Number;// = 0
public var rescaleX:Number;// = 0
public var rescaleY:Number;// = 0
private var bg:MovieClip;
public var speed:Number;// = 5
private var dropBlockFromTower:Array;
public var cL:Array;
var removeCnt:int;// = 2
private var minX:Number;
private var dFi:Number;// = 0.03
private var countDown:TextField;
public var Y:Number;// = 0
private var mess1_mc:MovieClip;
public var detail:MovieClip;
public var a:Number;// = 50.5
private var b:Number;// = 30
public var score_mc:MovieClip;
private var earthQuake_mc:MovieClip;
private var blockOnTop:Number;// = 1
private var sv;
private var l:Shape;
private var startBlockY:Number;
public var snd_OK:Sound;
private var scrollTimer:Timer;
private var rotateDropTimer:Timer;
private var startPosBase:Number;// = 0
private var quakeSteps:Number;// = 0
public var dropNext:Number;// = 1
private var yPosBase:Number;// = 0
private var rescaleTimer:Timer;
public var earthQuakeTimer:Timer;
private var towers:Array;
public var closeLevel:Number;// = 0
private var quakeTimer:Timer;
private var rotateTimer:Timer;
private var fallingX:Number;
private var fallingY:Number;
private var mess2_mc:MovieClip;
private var rotationPoint:Number;
private var transBlock:Transform;
private var rotateTowerTransf:Array;
public var cheat:Boolean;// = false
private var mistakes:Array;
private var angle:Number;// = 0
private var upBtn_btn;
private var scoreCountMode:String;// = ""
private var Fi:Number;// = 0
var detailTimerClose:Timer;
public var snd_B:Sound;
public var snd_E:Sound;
private var downBtn_btn:SimpleButton;
public var snd_S:Sound;
private var lower:Number;// = 0
public var channel:SoundChannel;
private var startBlockPos:Number;
public var stageH:Number;// = 400
public var osn:Array;
public var stageW:Number;// = 533
private var mess3_mc:MovieClip;
public var soundFlag:Boolean;// = true
public var floodDirection:Number;// = -1
private var dropBlockX:Array;
private var dropBlockY:Array;
public var snd_combo:Sound;
private var numSteps:Number;
private var destroyPrevBlock:Number;// = 0
private var fonCount:Number;// = 0
private var matrixBlock:Matrix;
private var addNextTexture:Number;// = 1
public var chan:SoundChannel;
public var fireCnt:Number;// = 0
private var maxMove:Number;
private var otherBlock:Timer;
public var fxFlag:Boolean;// = true
private var destroyFallingBlock:Number;// = 0
public var tBase:MovieClip;
private var dropBlockFromTowerMatrix:Array;
public var maxFallMove:Number;// = 0
public var countDownTimer:Timer;
private var allowScroll:Number;// = 0
public var flood_mc:MovieClip;
private var mess4_mc:MovieClip;
public var scaleEffect:Boolean;// = false
private var blocks:Array;
public var currentLevel:Number;
private var blocksCounter:Number;// = 0
public var fStart:Boolean;
private var deltaX:Number;
private var rotationDirection:Number;
private var fallingDistance:Number;// = 0
public var comboScore:Number;// = 0
private var dropBlockFrom:Array;
private var Lx:Number;
public var totalScore:Number;// = 0
private var firstBlock:Timer;
private var QuekeCounter:Number;// = 0
private var completeLBW:MovieClip;
private var angle1:Number;// = 0
private var rotateTowerMatrix:Array;
private var scoreTimer:Timer;
public var levelDescription:Array;
public var hookTimer:Timer;
private var shakeTimer:Timer;
public var floodTimer:Timer;
private var comboStars_mc:MovieClip;
private var mess5_mc:MovieClip;
public var levelBgTexture:Array;
private var moveTimer:Timer;
private var distance:Number;
private var scaleTower:Number;
var detailSize:Number;// = 1
private var countDownBg_mc:MovieClip;
public static const SEND_DEBUG:Boolean = false;
public function TowerBloxxLevel(_arg1:Number, _arg2:MovieClip, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean){
var _local7:Number;
var _local9:Number;
var _local10:URLLoader;
var _local11:URLRequest;
fire = new Array();
snd_OK = new snd_BlockOK();
snd_combo = new snd_blockCombo();
snd_B = new snd_Button();
snd_S = new scoreCount();
snd_E = new errorSnd();
music = new LevelMusic();
score_mc = new score();
hookTimer = new Timer(10);
scoreTimer = new Timer(10);
moveTimer = new Timer(10);
rotateTimer = new Timer(10);
rotateDropTimer = new Timer(20);
shakeTimer = new Timer(25);
scrollTimer = new Timer(10);
quakeTimer = new Timer(10);
firstBlock = new Timer(50, 6);
otherBlock = new Timer(50, 2);
rescaleTimer = new Timer(10);
blocks = new Array();
l = new Shape();
towers = new Array();
levelDescription = new Array();
cL = new Array();
matrixBlock = new Matrix();
mistakes = new Array();
levelBgTexture = new Array();
sv = new level_svitok();
hook_mc = new hook();
dropBlockFromTower = new Array();
dropBlockFromTowerMatrix = new Array();
dropBlockFrom = new Array();
dropBlockX = new Array();
dropBlockY = new Array();
rotateTowerMatrix = new Array();
rotateTowerTransf = new Array();
comboStars_mc = new comboStars();
mess1_mc = new Great();
mess2_mc = new Fabulous();
mess3_mc = new Awesome();
mess4_mc = new Spectacular();
mess5_mc = new Fantastic();
osn = new Array();
detailTimerClose = new Timer(5);
super();
fStart = _arg5;
score_mc.name = "score_mc";
comboStars_mc.name = "comboStars_mc";
mess1_mc.name = "mess1_mc";
mess2_mc.name = "mess2_mc";
mess3_mc.name = "mess3_mc";
mess4_mc.name = "mess4_mc";
mess5_mc.name = "mess5_mc";
soundFlag = _arg4;
fxFlag = _arg3;
startMusic();
currentLevel = _arg1;
bg = _arg2;
tBase = new transparentButton();
addChild(tBase);
var _local6:* = new transparentButton();
addChild(_local6);
var _local8:Number = 0;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era4";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 3;
levelDescription[_local8]["towerHeight"] = 1000;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 10;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 0;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 20;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 2;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 10;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = true;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 2000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 20;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = true;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 2500;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era1";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 25;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = true;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.025;
levelDescription[_local8]["bonus"] = 3000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 20;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 2;
levelDescription[_local8]["numOfMistakes"] = 3;
levelDescription[_local8]["towerHeight"] = 35;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.028;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 2;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 4000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 30;
levelDescription[_local8]["timer"] = 50;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 2000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 60;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 2000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era2";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 50;
levelDescription[_local8]["timer"] = 80;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 2000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era3";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era3";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 50;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era3";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era3";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era3";
levelDescription[_local8]["numOfTowers"] = 1;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 50;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 0;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 1000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era4";
levelDescription[_local8]["numOfTowers"] = 2;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 40;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 3;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.03;
levelDescription[_local8]["bonus"] = 3000;
_local8++;
levelDescription[_local8] = new Array();
levelDescription[_local8]["era"] = "era4";
levelDescription[_local8]["numOfTowers"] = 2;
levelDescription[_local8]["numOfMistakes"] = 4;
levelDescription[_local8]["towerHeight"] = 50;
levelDescription[_local8]["timer"] = 0;
levelDescription[_local8]["water"] = false;
levelDescription[_local8]["isFinished"] = false;
levelDescription[_local8]["earthquake"] = 2;
levelDescription[_local8]["towermove"] = 10;
levelDescription[_local8]["speed"] = 0.031;
levelDescription[_local8]["bonus"] = 4000;
cL = levelDescription[_arg1];
reduceCnt = cL["numOfTowers"];
dFi = cL["speed"];
if (cL["timer"] != 0){
countDownBg_mc = new countDownBg();
countDownBg_mc.x = 450;
addChild(countDownBg_mc);
countDown = (countDownBg_mc.getChildByName("countDown_txt") as TextField);
countDown.text = seconds2mm_ss(cL["timer"]);
countDownBg_mc.addChild(countDown);
numSteps = cL["timer"];
countDownTimer = new Timer(1000, cL["timer"]);
countDownTimer.addEventListener(TimerEvent.TIMER, countDownTimerHandler);
countDownTimer.start();
};
if (cL["earthquake"] != 0){
earthQuake_mc = new earthQuake();
earthQuake_mc.y = 5;
earthQuake_mc.x = 400;
addChild(earthQuake_mc);
earthQuakeTimer = new Timer(50);
earthQuakeTimer.addEventListener(TimerEvent.TIMER, earthQuakeTimerHandler);
earthQuakeTimer.start();
};
a = 65;
b = (a / 3);
if (_arg1 != 0){
completeLBW = new completeLevelBW();
completeLBW.x = 528;
completeLBW.y = 395;
completeLBW.rotation = 180;
addChild(completeLBW);
completeL = new completeLevel();
completeL.x = 528;
completeL.y = 395;
completeL.rotation = 180;
addChild(completeL);
completeL.scrollRect = new Rectangle(0, 0, 20, 0);
};
_local7 = 0;
while (_local7 < cL["numOfMistakes"]) {
mistakes[_local7] = new mistake();
mistakes[_local7].y = (375 - (20 * _local7));
mistakes[_local7].x = 5;
addChild(mistakes[_local7]);
_local7++;
};
deltaX = ((stageW - 50) / cL["numOfTowers"]);
minX = ((deltaX / 2) + 25);
bg.scrollRect = new Rectangle(0, 0, 533, 400);
_local7 = 0;
while (_local7 < cL["numOfTowers"]) {
_local9 = 0;
switch (_arg1){
case 1:
case 2:
case 3:
case 4:
_local9 = 30;
break;
case 5:
case 6:
case 7:
case 8:
_local9 = 120;
break;
case 9:
case 10:
case 11:
case 12:
_local9 = 90;
break;
case 13:
case 14:
case 15:
case 16:
_local9 = 120;
break;
};
osn[_local7] = new osnovanie();
osn[_local7].y = 370;
if (cL["numOfTowers"] == 1){
osn[_local7].x = (533 / 2);
} else {
osn[_local7].x = (minX + (_local7 * deltaX));
};
tBase.addChild(osn[_local7]);
towers[_local7] = new Tower(cL["towermove"], _local9, cL["numOfTowers"], _local7);
towers[_local7].y = 370;
towers[_local7].name = ("tower_" + _local7);
tBase.scrollRect = new Rectangle(0, startPosBase, stageW, stageH);
tBase.addChild(towers[_local7]);
rotateTowerMatrix[_local7] = new Matrix();
_local7++;
};
if (cL["water"] == true){
flood_mc = new waterBg();
flood_mc.alpha = 0.5;
flood_mc.y = 385;
flood_mc.x = 0;
flood_mc.cacheAsBitmap = true;
tBase.addChild(flood_mc);
floodTimer = new Timer(50);
floodTimer.addEventListener(TimerEvent.TIMER, floodTimerHandler);
floodTimer.start();
};
lower = getLowerTower();
Lx = getLx();
addChild(hook_mc);
if (_arg5 == false){
hookTimer.addEventListener(TimerEvent.TIMER, hookMovement);
hookTimer.start();
} else {
addEventListener(Event.ENTER_FRAME, startTutorial);
};
addEventListener(MouseEvent.MOUSE_UP, mouseLeftClick);
scrollTimer.addEventListener(TimerEvent.TIMER, scrollTimerHandler);
scrollTimer.start();
addEventListener(MouseEvent.MOUSE_WHEEL, winLevel);
if (SEND_DEBUG == true){
_local10 = new URLLoader();
_local11 = new URLRequest(("debug.php?mode=levelstarted_" + _arg1));
_local10.load(_local11);
};
}
private function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
private function scrollUp(_arg1:Event):void{
if ((Math.abs((startPosBase - yPosBase)) + 50) < (towers[0].towerHeight * 50)){
yPosBase = (yPosBase - 10);
tBase.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
if (yPosBase <= -50){
bg.scrollRect = new Rectangle(0, (-50 + ((yPosBase + 50) * 1.5)), stageW, stageH);
} else {
bg.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
};
};
}
public function showComboStars(_arg1, _arg2){
if (_arg2 == true){
switch (randRange(0, 4)){
case 0:
mess1_mc.x = (-(mess1_mc.width) / 2);
mess1_mc.y = -210;
mess1_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(mess1_mc);
break;
case 1:
mess2_mc.x = (-(mess2_mc.width) / 2);
mess2_mc.y = -210;
mess2_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(mess2_mc);
break;
case 2:
mess3_mc.x = (-(mess3_mc.width) / 2);
mess3_mc.y = -210;
mess3_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(mess3_mc);
break;
case 3:
mess4_mc.x = (-(mess4_mc.width) / 2);
mess4_mc.y = -210;
mess4_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(mess4_mc);
break;
case 4:
mess5_mc.x = (-(mess5_mc.width) / 2);
mess5_mc.y = -210;
mess5_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(mess5_mc);
break;
};
};
comboStars_mc.x = -30;
comboStars_mc.gotoAndPlay(1);
towers[_arg1].getChildAt((towers[_arg1].towerHeight - 1)).addChild(comboStars_mc);
}
public function otherBlockTimerHandler(_arg1:Event):void{
var _local4:Number;
var _local2:MovieClip = towers[scaleTower].getChildAt((towers[scaleTower].numChildren - 2));
var _local3:MovieClip = towers[scaleTower].getChildAt((towers[scaleTower].numChildren - 1));
_local2.scaleY = (Math.round((_local2.scaleY * 100)) / 100);
if ((_local2.scaleY == 0.98)){
_local2.scaleY = 1;
} else {
_local2.scaleY = 0.98;
};
if ((_local2.scaleY == 0.98)){
_local4 = 1;
} else {
_local4 = -1;
};
_local2.y = (_local2.y + ((_local4 * 50) * 0.02));
_local3.y = (_local3.y + ((_local4 * 50) * 0.02));
allowScroll++;
}
private function stopScrollUp(_arg1:MouseEvent):void{
sv.alpha = 1;
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, scrollUp);
};
}
private function getLowerTower(){
var _local3:Number;
var _local1:* = cL["towerHeight"];
var _local2:* = 0;
_local3 = 0;
while (_local3 < towers.length) {
if (towers[_local3].towerHeight < _local1){
_local1 = towers[_local3].towerHeight;
_local2 = _local3;
};
_local3++;
};
return (_local2);
}
private function showScoreTimerHandler(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:TextField;
var _local7:MovieClip;
var _local8:TextField;
var _local9:MovieClip;
var _local10:TextField;
var _local11:MovieClip;
var _local12:TextField;
var _local13:MovieClip;
var _local14:TextField;
var _local15:MovieClip;
var _local16:TextField;
var _local17:MovieClip;
var _local18:TextField;
var _local19:MovieClip;
var _local20:TextField;
var _local21:MovieClip;
var _local22:TextField;
var _local23:MovieClip;
var _local24:MovieClip;
if (cL["numOfMistakes"] == -1){
_local2 = 0;
} else {
_local2 = cL["numOfMistakes"];
};
switch (scoreTimer.currentCount){
case 1:
_local4 = new scoreForHeightMC();
_local4.x = 70;
_local4.y = 60;
_local4.name = "scoreForHeight";
sv.addChild(_local4);
if (fxFlag == true){
chan = snd_S.play();
};
break;
case 2:
_local5 = new scoreForHeightMC();
_local5.name = "scoreForHeightVal";
_local6 = (_local5.getChildByName("scoreForHeightTXT") as TextField);
_local6.text = "0";
_local5.x = 220;
_local5.y = 60;
_local5.name = "scoreForHeightVal";
sv.addChild(_local5);
scoreCountMode = "tower";
break;
case (3 + (towers[0].towerHeight * cL["numOfTowers"])):
_local3 = sv.getChildByName("scoreForHeightVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) - 10).toString();
_local7 = new scoreForHeightMC();
_local8 = (_local7.getChildByName("scoreForHeightTXT") as TextField);
_local8.text = "Accuracy";
_local7.x = 70;
_local7.y = 90;
_local7.name = "scoreForMistakes";
sv.addChild(_local7);
scoreCountMode = "";
break;
case (4 + (towers[0].towerHeight * cL["numOfTowers"])):
_local9 = new scoreForHeightMC();
_local9.name = "scoreForMistakesVal";
_local10 = (_local9.getChildByName("scoreForHeightTXT") as TextField);
_local10.text = "0";
_local9.x = 220;
_local9.y = 90;
_local9.name = "scoreForMistakesVal";
sv.addChild(_local9);
scoreCountMode = "mistakes";
break;
case ((5 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)):
_local3 = sv.getChildByName("scoreForMistakesVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) - 1).toString();
_local11 = new scoreForHeightMC();
_local12 = (_local11.getChildByName("scoreForHeightTXT") as TextField);
_local12.text = "Combo";
_local11.x = 70;
_local11.y = 120;
_local11.name = "scoreForCombo";
sv.addChild(_local11);
scoreCountMode = "";
break;
case ((6 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)):
_local13 = new scoreForHeightMC();
_local13.name = "scoreForComboVal";
_local14 = (_local13.getChildByName("scoreForHeightTXT") as TextField);
_local14.text = "0";
_local13.x = 220;
_local13.y = 120;
_local13.name = "scoreForComboVal";
sv.addChild(_local13);
scoreCountMode = "combo";
break;
case (((7 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)) + (comboScore / 10)):
_local3 = sv.getChildByName("scoreForComboVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) - 10).toString();
_local15 = new scoreForHeightMC();
_local16 = (_local15.getChildByName("scoreForHeightTXT") as TextField);
_local16.text = "Bonus";
_local15.x = 70;
_local15.y = 150;
_local15.name = "levelMultip";
sv.addChild(_local15);
scoreCountMode = "";
break;
case (((8 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)) + (comboScore / 10)):
_local17 = new scoreForHeightMC();
_local17.name = "scoreForBonusVal";
_local18 = (_local17.getChildByName("scoreForHeightTXT") as TextField);
_local18.text = "0";
_local17.x = 220;
_local17.y = 150;
sv.addChild(_local17);
scoreCountMode = "bonus";
break;
case ((((9 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)) + (comboScore / 10)) + (cL["bonus"] / 100)):
_local3 = sv.getChildByName("scoreForBonusVal").getChildByName("scoreForHeightTXT");
if (successFlag == true){
_local3.text = (Number(_local3.text) - 100).toString();
} else {
_local3.text = "0";
};
_local19 = new scoreForHeightMC();
_local20 = (_local19.getChildByName("scoreForHeightTXT") as TextField);
_local20.text = "Total";
_local19.x = 70;
_local19.y = 180;
_local19.name = "Total";
sv.addChild(_local19);
scoreCountMode = "";
break;
case ((((10 + (towers[0].towerHeight * cL["numOfTowers"])) + (_local2 * 10)) + (comboScore / 10)) + (cL["bonus"] / 100)):
_local21 = new scoreForHeightMC();
_local22 = (_local21.getChildByName("scoreForHeightTXT") as TextField);
_local22.text = totalScore.toString();
_local21.x = 220;
_local21.y = 180;
_local21.name = "scoreForTotalVal";
sv.addChild(_local21);
scoreTimer.stop();
scoreTimer.removeEventListener(TimerEvent.TIMER, showScoreTimerHandler);
_local23 = (sv.getChildByName("svitoc_mc") as MovieClip);
_local24 = (_local23.getChildByName("coin_mc") as MovieClip);
_local23.gotoAndStop(10);
_local23.removeChild(_local24);
if (chan != null){
chan.stop();
};
break;
};
switch (scoreCountMode){
case "tower":
_local3 = sv.getChildByName("scoreForHeightVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) + 10).toString();
break;
case "mistakes":
_local3 = sv.getChildByName("scoreForMistakesVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) + 1).toString();
break;
case "combo":
_local3 = sv.getChildByName("scoreForComboVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) + 10).toString();
break;
case "bonus":
_local3 = sv.getChildByName("scoreForBonusVal").getChildByName("scoreForHeightTXT");
_local3.text = (Number(_local3.text) + 100).toString();
break;
};
}
public function mouseLeftClick(_arg1:MouseEvent){
var _local2:Number;
if ((((hookTimer.hasEventListener(TimerEvent.TIMER) == false)) && ((testCompleteAll() == false)))){
if (blocksCounter >= (removeCnt - 1)){
detailTimerClose = new Timer(5);
if (getChildByName("blink1") != null){
removeChild(getChildByName("blink1"));
};
if (getChildByName("blink2") != null){
removeChild(getChildByName("blink2"));
};
detail.removeChildAt(1);
detailTimerClose.addEventListener(TimerEvent.TIMER, detailResizeClose);
detailTimerClose.start();
};
hookTimer.addEventListener(TimerEvent.TIMER, hookMovement);
hookTimer.start();
};
if (((((((!((dropNext == 0))) && ((testCompleteAll() == false)))) && ((blockOnTop == 1)))) && (!((blocks[blocksCounter] == null))))){
if (towers[lower].towerHeight == (cL["towerHeight"] - 1)){
scaleEffect = true;
speed = 2;
towers[lower].t.stop();
};
allowScroll = 0;
blockOnTop = 0;
dropNext = 0;
destroyFallingBlock = 0;
destroyPrevBlock = 0;
startBlockY = blocks[blocksCounter].y;
startBlockPos = startBlockY;
fallingDistance = 0;
fallingX = blocks[blocksCounter].x;
distance = ((((stageH - 30) - startBlockY) - (50 * (towers[lower].towerHeight + 1))) - yPosBase);
_local2 = Math.abs(Math.cos(Fi));
if (Math.sin(Fi) < 0){
if (Math.cos(Fi) > 0){
maxFallMove = (10 + (10 * _local2));
maxMove = (2 + (2 * _local2));
} else {
if (Math.cos(Fi) == 0){
maxFallMove = 10;
maxMove = 2;
} else {
maxFallMove = (10 - (10 * _local2));
maxMove = (2 - (2 * _local2));
};
};
} else {
if (Math.cos(Fi) < 0){
maxFallMove = -((10 + (10 * _local2)));
maxMove = -((2 + (2 * _local2)));
} else {
if (Math.cos(Fi) == 0){
maxFallMove = -10;
maxMove = -2;
} else {
maxFallMove = -((10 - (10 * _local2)));
maxMove = -((2 - (2 * _local2)));
};
};
};
if ((maxMove > 0)){
maxMove = Math.ceil(maxMove);
} else {
maxMove = Math.floor(maxMove);
};
maxFallMove = (maxFallMove / (distance / 10));
moveTimer.addEventListener(TimerEvent.TIMER, blockMovement);
moveTimer.start();
};
}
private function detailResizeClose(_arg1:TimerEvent):void{
if (detailTimerClose.currentCount < 30){
detailSize = (detailSize - detailDirection);
detail.c.scaleY = (detailSize / 15);
detail.c.y = (detail.c.y + detailDirection);
detail.u.y = (detail.u.y + detailDirection);
detail.d.y = (detail.d.y - detailDirection);
} else {
detailDirection = 2;
detailTimerClose.stop();
detailTimerClose.removeEventListener(TimerEvent.TIMER, detailResizeClose);
if (detail != null){
removeChild(detail);
detail = null;
};
};
}
function putBlock(){
var _local1:Number;
var _local2:Number = 0;
towers[lower].towerHeight++;
towers[lower].topBlockX = blocks[blocksCounter].x;
towers[lower].addChild(blocks[blocksCounter]);
towers[lower].getChildAt((towers[lower].towerHeight - 1)).x = blocks[blocksCounter].x;
towers[lower].getChildAt((towers[lower].towerHeight - 1)).y = -((50 * towers[lower].towerHeight));
blocksCounter++;
lower = getLowerTower();
Lx = getLx();
blockOnTop = 1;
dropNext = 1;
_local1 = 0;
while (_local1 < cL["numOfTowers"]) {
_local2 = (_local2 + towers[_local1].towerHeight);
_local1++;
};
if (currentLevel != 0){
completeL.scrollRect = new Rectangle(0, 0, 20, ((156 * _local2) / (cL["numOfTowers"] * cL["towerHeight"])));
};
}
private function quakeTimerHandler(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number = 0;
_local2 = 0;
while (_local2 < cL["numOfTowers"]) {
if (towers[_local2].towerHeight > 1){
dropBlockFrom[_local2] = towers[_local2].getChildAt((towers[_local2].numChildren - 1));
dropBlockX[_local2] = dropBlockFrom[_local2].x;
dropBlockY[_local2] = dropBlockFrom[_local2].y;
dropBlockFromTower[_local2] = new Transform(dropBlockFrom[_local2]);
dropBlockFromTowerMatrix[_local2] = new Matrix();
_local3++;
};
_local2++;
};
quakeTimer.stop();
if (_local3 != 0){
rotateDropTimer.addEventListener(TimerEvent.TIMER, rotateDropBlockTimerHandler);
rotateDropTimer.start();
} else {
dropNext = 1;
blockOnTop = 1;
earthQuakeTimer.start();
};
}
private function stopScrollDown(_arg1:MouseEvent):void{
sv.alpha = 1;
removeEventListener(Event.ENTER_FRAME, scrollDown);
}
public function blockMovement(_arg1:Event):void{
var _local2:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local3:MovieClip = towers[lower];
var _local4:MovieClip = blocks[blocksCounter];
if (_local3.towerHeight != 0){
_local2 = (_local3.topBlockX + ((50 * _local3.towerHeight) * Math.sin(((_local3.rotation * Math.PI) / 180))));
if (Math.abs(((fallingX - _local2) - _local3.x)) > 60){
distance = ((stageH - 30) - startBlockPos);
} else {
distance = ((((stageH - 30) - startBlockPos) - (50 * (_local3.towerHeight + 1))) - yPosBase);
};
} else {
distance = ((((stageH - 30) - startBlockPos) - (50 * (_local3.towerHeight + 1))) - yPosBase);
};
if (fallingDistance < (distance - speed)){
if (scaleEffect == true){
scaleX = (scaleX + 0.003);
scaleY = (scaleY + 0.003);
x = -(((blocks[blocksCounter].x * scaleX) - blocks[blocksCounter].x));
y = -(((blocks[blocksCounter].y * scaleY) - blocks[blocksCounter].y));
};
_local4.x = (_local4.x + maxFallMove);
fallingX = (fallingX + maxFallMove);
fallingDistance = (fallingDistance + speed);
startBlockY = (startBlockY + speed);
_local4.y = startBlockY;
} else {
if (scaleEffect == true){
rescaleX = blocks[blocksCounter].x;
rescaleY = blocks[blocksCounter].y;
rescaleTimer.addEventListener(TimerEvent.TIMER, rescaleTimerHandler);
rescaleTimer.start();
towers[lower].t.start();
};
if (_local3.towerHeight != 0){
_local2 = (_local3.topBlockX + ((50 * _local3.towerHeight) * Math.sin(((_local3.rotation * Math.PI) / 180))));
if ((((Math.abs(((fallingX - _local2) - _local3.x)) > ((60 / 2) + maxMove))) && ((Math.abs(((fallingX - _local2) - _local3.x)) < (60 + maxMove))))){
destroyFallingBlock = 1;
destroyPrevBlock = 1;
} else {
if (Math.abs(((fallingX - _local2) - _local3.x)) > (60 + maxMove)){
destroyFallingBlock = 1;
};
};
} else {
if (((((osn[lower].x - (osn[lower].width / 2)) > fallingX)) || (((osn[lower].x + (osn[lower].width / 2)) < fallingX)))){
destroyFallingBlock = 1;
};
};
moveTimer.stop();
moveTimer.removeEventListener(TimerEvent.TIMER, blockMovement);
_local4.y = (distance + startBlockPos);
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("score_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(score_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("comboStars_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(comboStars_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("mess1_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(mess1_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("mess2_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(mess2_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("mess3_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(mess3_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("mess4_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(mess4_mc);
};
};
if (_local3.towerHeight != 0){
if (towers[lower].getChildAt((_local3.towerHeight - 1)).getChildByName("mess5_mc") != null){
towers[lower].getChildAt((_local3.towerHeight - 1)).removeChild(mess5_mc);
};
};
if (destroyFallingBlock != 1){
_local2 = (_local3.topBlockX + ((50 * _local3.towerHeight) * Math.sin(((_local3.rotation * Math.PI) / 180))));
_local5 = Math.abs(((_local2 - _local4.x) + _local3.x));
if ((_local5 < (5 + maxMove))){
playFX(snd_combo);
} else {
playFX(snd_OK);
};
if (cL["earthquake"] != 0){
QuekeCounter = 0;
earthQuake_mc.scaleX = 1;
};
_local7 = 0;
if (_local3.towerHeight != 0){
if (_local5 < (5 + maxMove)){
comboLength++;
maxMove = 0;
moveStep = 0;
_local4.rotation = 0;
scaleTower = lower;
_local4.x = _local3.topBlockX;
_local8 = lower;
putBlock();
if (comboLength > 1){
showComboStars(_local8, true);
} else {
showComboStars(_local8, false);
};
showScore("+200", _local8);
otherBlock = new Timer(100, 2);
otherBlock.addEventListener(TimerEvent.TIMER, otherBlockTimerHandler);
otherBlock.start();
} else {
if (comboLength != 0){
comboScore = (comboScore + (Math.pow(2, (comboLength + 1)) * 10));
};
comboLength = 0;
if (_local4.rotation < 0){
rotationPoint = (30 - Math.abs(((fallingX - _local2) - _local3.x)));
rotationDirection = 1;
} else {
rotationPoint = (Math.abs(((fallingX - _local2) - _local3.x)) - 30);
rotationDirection = -1;
};
_local4.rotation = 0;
fallingY = _local4.y;
_local4.x = (_local4.x - (((50 * _local3.towerHeight) * Math.sin(((_local3.rotation * Math.PI) / 180))) + _local3.x));
scaleTower = lower;
_local8 = lower;
putBlock();
showScore("+100", _local8);
moveStep = 0;
transBlock = new Transform(towers[scaleTower].getChildAt((towers[scaleTower].towerHeight - 1)));
shakeTimer.addEventListener(TimerEvent.TIMER, shakeBlockTimerHandler);
shakeTimer.start();
};
} else {
_local3.x = _local4.x;
_local4.x = 0;
_local4.rotation = 0;
_local8 = lower;
putBlock();
showScore("+100", _local8);
firstBlock = new Timer(50, 6);
firstBlock.addEventListener(TimerEvent.TIMER, firstBlockTimerHandler);
firstBlock.start();
};
} else {
playFX(snd_E);
if (comboLength != 0){
comboScore = (comboScore + (Math.pow(2, (comboLength + 1)) * 10));
};
comboLength = 0;
allowScroll = 2;
var _local9 = cL;
var _local10 = "numOfMistakes";
var _local11 = (_local9[_local10] - 1);
_local9[_local10] = _local11;
if (mistakes[cL["numOfMistakes"]] != null){
removeChild(mistakes[cL["numOfMistakes"]]);
};
if (destroyPrevBlock == 1){
if (((fallingX - _local2) - towers[lower].x) > 30){
rotationPoint = (30 - Math.abs(((fallingX - _local2) - towers[lower].x)));
rotationDirection = 1;
} else {
rotationPoint = (Math.abs(((fallingX - _local2) - towers[lower].x)) - 30);
rotationDirection = -1;
};
fallingY = blocks[blocksCounter].y;
transBlock = new Transform(blocks[blocksCounter]);
rotateTimer.addEventListener(TimerEvent.TIMER, rotateBlockTimerHandler);
rotateTimer.start();
dropBlockFrom = new Array();
dropBlockX = new Array();
dropBlockY = new Array();
dropBlockFromTower = new Array();
dropBlockFromTowerMatrix = new Array();
dropBlockFrom[0] = towers[lower].getChildAt((towers[lower].numChildren - 1));
dropBlockX[0] = dropBlockFrom[0].x;
dropBlockY[0] = dropBlockFrom[0].y;
dropBlockFromTower[0] = new Transform(dropBlockFrom[0]);
dropBlockFromTowerMatrix[0] = new Matrix();
rotateDropTimer.addEventListener(TimerEvent.TIMER, rotateDropBlockOnErrorTimerHandler);
rotateDropTimer.start();
} else {
if (_local3.towerHeight != 0){
removeChild(blocks[blocksCounter]);
blocksCounter++;
lower = getLowerTower();
Lx = getLx();
blockOnTop = 1;
dropNext = 1;
} else {
blocks[blocksCounter].rotattion = 0;
if ((osn[lower].x - (osn[lower].width / 2)) > fallingX){
rotationPoint = Math.abs((fallingX - (osn[lower].x - (osn[lower].width / 2))));
rotationDirection = -1;
} else {
rotationPoint = (Math.abs(((fallingX - osn[lower].x) - (osn[lower].width / 2))) - 15);
rotationDirection = 1;
};
fallingY = blocks[blocksCounter].y;
transBlock = new Transform(blocks[blocksCounter]);
rotateTimer.addEventListener(TimerEvent.TIMER, rotateBlockTimerHandler);
rotateTimer.start();
};
};
};
};
}
private function startScrollUp(_arg1:MouseEvent):void{
playFX(snd_B);
sv.alpha = 0.2;
addEventListener(Event.ENTER_FRAME, scrollUp);
}
public function firstBlockTimerHandler(_arg1:Event):void{
var _local2:Number;
if ((tBase.scrollRect.y == 0)){
_local2 = -5;
} else {
_local2 = 5;
};
tBase.scrollRect = new Rectangle(0, (tBase.scrollRect.y + _local2), stageW, stageH);
bg.scrollRect = new Rectangle(0, (bg.scrollRect.y + _local2), stageW, stageH);
}
private function startMusic(){
var _local1:SoundTransform;
if (soundFlag == true){
channel = music.play(0, int.MAX_VALUE);
_local1 = channel.soundTransform;
_local1.volume = 0.4;
channel.soundTransform = _local1;
};
}
public function rescaleTimerHandler(_arg1:TimerEvent):void{
if (rescaleTimer.currentCount < 10){
scaleX = (scaleX - 0.025);
scaleY = (scaleY - 0.025);
x = -(((rescaleX * scaleX) - rescaleX));
y = -(((rescaleY * scaleY) - rescaleY));
} else {
scaleX = 1;
scaleY = 1;
x = -(((rescaleX * scaleX) - rescaleX));
y = -(((rescaleY * scaleY) - rescaleY));
scaleEffect = false;
speed = 5;
rescaleTimer.stop();
rescaleTimer.removeEventListener(TimerEvent.TIMER, rescaleTimerHandler);
};
}
public function hookMovement(_arg1:Event):void{
var _local4:Class;
var _local5:String;
var _local6:SharedObject;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:*;
Fi = (Fi + dFi);
var _local2:* = (Lx + (a * Math.cos(Fi)));
var _local3:* = (60 + (b * Math.sin(Fi)));
if (testCompleteAll() == false){
hook_mc.y = (_local3 + 20);
hook_mc.x = _local2;
hook_mc.rotation = ((-20 * Math.asin(Math.cos(Fi))) / Math.PI);
if (blocks[blocksCounter] != null){
if (blockOnTop == 1){
blocks[blocksCounter].x = _local2;
blocks[blocksCounter].y = _local3;
blocks[blocksCounter].rotation = ((-20 * Math.asin(Math.cos(Fi))) / Math.PI);
};
} else {
if (currentLevel == 0){
_local6 = SharedObject.getLocal("TowerBurgData");
if (_local6.data.levelFinished < 8){
_local5 = "era1";
} else {
if (_local6.data.levelFinished < 18){
_local5 = "era2";
} else {
if (_local6.data.levelFinished < 24){
_local5 = "era3";
} else {
_local5 = "era4";
};
};
};
} else {
_local5 = cL["era"];
};
if (towers[lower].towerHeight == 0){
_local4 = (loaderInfo.applicationDomain.getDefinition((_local5 + "_block1")) as Class);
blocks[blocksCounter] = new (_local4);
} else {
if (towers[lower].towerHeight == (cL["towerHeight"] - 1)){
_local4 = (loaderInfo.applicationDomain.getDefinition((_local5 + "_block4")) as Class);
blocks[blocksCounter] = new (_local4);
} else {
if (randRange(0, 1) == 1){
_local4 = (loaderInfo.applicationDomain.getDefinition((_local5 + "_block2")) as Class);
blocks[blocksCounter] = new (_local4);
} else {
_local4 = (loaderInfo.applicationDomain.getDefinition((_local5 + "_block3")) as Class);
blocks[blocksCounter] = new (_local4);
};
};
};
blocks[blocksCounter].AllowSmooting = true;
blockOnTop = 1;
blocks[blocksCounter].x = _local2;
blocks[blocksCounter].y = _local3;
addChild(blocks[blocksCounter]);
if ((((hookTimer.hasEventListener(TimerEvent.TIMER) == true)) && ((fStart == true)))){
_local7 = 0;
_local9 = 0;
while (_local9 < cL["numOfTowers"]) {
if (towers[_local9].towerHeight >= 2){
_local7++;
};
_local9++;
};
if (_local7 < cL["numOfTowers"]){
hookTimer.removeEventListener(TimerEvent.TIMER, hookMovement);
hookTimer.start();
} else {
dFi = cL["speed"];
fStart = false;
};
};
};
} else {
blockOnTop = 0;
dropNext = 0;
if (cL["timer"] != 0){
countDownTimer.stop();
countDownTimer.removeEventListener(TimerEvent.TIMER, countDownTimerHandler);
removeChild(countDownBg_mc);
};
if (cL["earthquake"] != 0){
earthQuakeTimer.stop();
earthQuakeTimer.removeEventListener(TimerEvent.TIMER, countDownTimerHandler);
removeChild(earthQuake_mc);
};
if (cL["water"] == true){
floodTimer.stop();
};
_local8 = 0;
_local9 = 0;
while (_local9 < towers.length) {
_local8 = (_local8 + towers[_local9].towerHeight);
_local9++;
};
if (((((cL["numOfTowers"] * cL["towerHeight"]) == _local8)) || ((cheat == true)))){
success = 1;
};
removeEventListener(MouseEvent.MOUSE_UP, mouseLeftClick);
if (success == 1){
floodDirection = 11;
if (cL["water"] == true){
floodTimer.start();
};
addEventListener(Event.ENTER_FRAME, scrollTowerDown);
} else {
if (flood_mc != null){
tBase.removeChild(flood_mc);
flood_mc = null;
};
sv.x = ((533 - sv.width) / 2);
sv.y = ((400 - sv.height) / 2);
_local10 = (sv.getChildByName("ok_btn1") as SimpleButton);
_local10.addEventListener(MouseEvent.MOUSE_UP, finishLevel);
addChild(sv);
if (comboLength != 0){
comboScore = (comboScore + (Math.pow(2, (comboLength + 1)) * 10));
};
if (cL["numOfMistakes"] < 0){
cL["numOfMistakes"] = 0;
};
if (successFlag == true){
totalScore = ((((cL["numOfMistakes"] * 10) + ((towers[0].towerHeight * cL["numOfTowers"]) * 10)) + comboScore) + cL["bonus"]);
} else {
totalScore = (((cL["numOfMistakes"] * 10) + ((towers[0].towerHeight * cL["numOfTowers"]) * 10)) + comboScore);
};
if (scoreTimer.hasEventListener(TimerEvent.TIMER) == false){
scoreTimer.addEventListener(TimerEvent.TIMER, showScoreTimerHandler);
scoreTimer.start();
};
};
removeChild(hook_mc);
hookTimer.stop();
hookTimer.removeEventListener(TimerEvent.TIMER, hookMovement);
scrollTimer.stop();
scrollTimer.removeEventListener(TimerEvent.TIMER, scrollTimerHandler);
};
}
private function scrollTowerDown(_arg1:Event):void{
var _local2:Number;
var _local3:*;
if (yPosBase < -10){
yPosBase = (yPosBase + 10);
if ((fireCnt % 10) == 0){
fire[fireCnt] = new firework();
fire[fireCnt].y = (yPosBase + 200);
fire[fireCnt].x = randRange(70, 470);
tBase.addChild(fire[fireCnt]);
};
fireCnt++;
tBase.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
if (yPosBase <= -50){
bg.scrollRect = new Rectangle(0, (-50 + ((yPosBase + 50) * 1.5)), stageW, stageH);
} else {
bg.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
};
} else {
removeEventListener(Event.ENTER_FRAME, scrollTowerDown);
scrollButtons();
sv.x = ((533 - sv.width) / 2);
sv.y = ((400 - sv.height) / 2);
_local3 = (sv.getChildByName("ok_btn1") as SimpleButton);
_local3.addEventListener(MouseEvent.MOUSE_UP, finishLevel);
addChild(sv);
successFlag = true;
if (comboLength != 0){
comboScore = (comboScore + (Math.pow(2, (comboLength + 1)) * 10));
};
if (cL["numOfMistakes"] < 0){
cL["numOfMistakes"] = 0;
};
if (successFlag == true){
totalScore = ((((cL["numOfMistakes"] * 10) + ((towers[0].towerHeight * cL["numOfTowers"]) * 10)) + comboScore) + cL["bonus"]);
} else {
totalScore = (((cL["numOfMistakes"] * 10) + ((towers[0].towerHeight * cL["numOfTowers"]) * 10)) + comboScore);
};
scoreTimer.addEventListener(TimerEvent.TIMER, showScoreTimerHandler);
scoreTimer.start();
};
}
private function winLevel(_arg1:MouseEvent):void{
if (_arg1.ctrlKey == true){
cheat = true;
removeEventListener(MouseEvent.MOUSE_WHEEL, winLevel);
};
}
private function playFX(_arg1){
if (fxFlag == true){
_arg1.play();
};
}
private function scrollDown(_arg1:Event):void{
if (yPosBase < -10){
yPosBase = (yPosBase + 10);
tBase.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
if (yPosBase <= -50){
bg.scrollRect = new Rectangle(0, (-50 + ((yPosBase + 50) * 1.5)), stageW, stageH);
} else {
bg.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
};
};
}
public function shakeBlockTimerHandler(_arg1:Event):void{
if (moveStep == 0){
if (Math.abs(angle) >= 8){
if ((rotationDirection == -1)){
rotationDirection = 1;
} else {
rotationDirection = -1;
};
angle = (angle - 8);
setTransform((towers[scaleTower].topBlockX + rotationPoint), (-50 * (towers[scaleTower].towerHeight - 1)), (rotationDirection * angle), matrixBlock, transBlock, rotationPoint, 50);
} else {
angle = (angle + 4);
setTransform((towers[scaleTower].topBlockX + rotationPoint), (-50 * (towers[scaleTower].towerHeight - 1)), (rotationDirection * angle), matrixBlock, transBlock, rotationPoint, 50);
};
};
if (angle == 0){
if (moveStep == 5){
shakeTimer.stop();
towers[scaleTower].topBlockX = towers[scaleTower].getChildAt((towers[scaleTower].towerHeight - 1)).x;
otherBlock = new Timer(100, 2);
otherBlock.addEventListener(TimerEvent.TIMER, otherBlockTimerHandler);
otherBlock.start();
} else {
if (maxMove == 0){
shakeTimer.removeEventListener(TimerEvent.TIMER, shakeBlockTimerHandler);
};
moveStep++;
towers[scaleTower].getChildAt((towers[scaleTower].towerHeight - 1)).x = (towers[scaleTower].getChildAt((towers[scaleTower].towerHeight - 1)).x + (maxMove / 5));
};
};
}
private function finishLevel(_arg1:MouseEvent):void{
playFX(snd_B);
closeLevel = 1;
}
private function startScrollDown(_arg1:MouseEvent):void{
playFX(snd_B);
sv.alpha = 0.2;
addEventListener(Event.ENTER_FRAME, scrollDown);
}
public function setTransform(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5, _arg6:int=30, _arg7:int=25):void{
_arg4.identity();
_arg4.tx = (_arg4.tx - _arg6);
_arg4.ty = (_arg4.ty - _arg7);
_arg4.rotate(((_arg3 * Math.PI) / 180));
_arg4.tx = (_arg4.tx + _arg1);
_arg4.ty = (_arg4.ty + _arg2);
_arg5.matrix = _arg4;
}
private function countDownTimerHandler(_arg1:TimerEvent):void{
if (numSteps != 0){
numSteps--;
countDown.text = seconds2mm_ss(numSteps);
} else {
countDownTimer.stop();
countDownTimer.removeEventListener(TimerEvent.TIMER, countDownTimerHandler);
};
}
public function rotateBlockTimerHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (angle >= 90){
if (blocks[blocksCounter].y < 400){
blocks[blocksCounter].y = (blocks[blocksCounter].y + 6);
} else {
angle = 0;
rotateTimer.stop();
blocksCounter++;
lower = getLowerTower();
Lx = getLx();
blockOnTop = 1;
dropNext = 1;
_local3 = 0;
_local2 = 0;
while (_local2 < cL["numOfTowers"]) {
_local3 = (_local3 + towers[_local2].towerHeight);
_local2++;
};
if (currentLevel != 0){
completeL.scrollRect = new Rectangle(0, 0, 20, ((156 * _local3) / (cL["numOfTowers"] * cL["towerHeight"])));
};
rotateTimer.removeEventListener(TimerEvent.TIMER, rotateBlockTimerHandler);
removeChild(blocks[(blocksCounter - 1)]);
};
} else {
angle = (angle + 10);
setTransform((fallingX + rotationPoint), (fallingY + 50), (rotationDirection * angle), matrixBlock, transBlock, rotationPoint, 50);
};
}
private function floodTimerHandler(_arg1:TimerEvent):void{
if (towers[0].towerHeight != 0){
flood_mc.y = (flood_mc.y + (1.4 * floodDirection));
};
}
private function getLx(){
var _local1:Number;
if (cL["numOfTowers"] == 1){
_local1 = minX;
} else {
_local1 = (minX + (lower * deltaX));
};
return (_local1);
}
private function earthQuakeTimerHandler(_arg1:TimerEvent):void{
var _local2:Number;
var _local4:Number;
var _local3:MovieClip = (earthQuake_mc.getChildByName("quake_line") as MovieClip);
if (QuekeCounter == ((cL["earthquake"] * 100) + 40)){
if (quakeSteps != 10){
scrollTimer.stop();
quakeSteps++;
dropNext = 0;
if ((quakeSteps % 2) == 0){
_local4 = 5;
} else {
_local4 = -5;
};
tBase.scrollRect = new Rectangle(0, (tBase.scrollRect.y + _local4), stageW, stageH);
bg.scrollRect = new Rectangle(0, (bg.scrollRect.y + _local4), stageW, stageH);
} else {
scrollTimer.start();
quakeSteps = 0;
QuekeCounter = 0;
earthQuakeTimer.stop();
quakeTimer.addEventListener(TimerEvent.TIMER, quakeTimerHandler);
quakeTimer.start();
};
if (scrollTimer.running == false){
scrollTimer.start();
};
} else {
if (QuekeCounter == (cL["earthquake"] * 100)){
dropNext = 0;
};
QuekeCounter = (QuekeCounter + 5);
};
if ((1 - (QuekeCounter / (cL["earthquake"] * 100))) > 0){
_local3.scaleX = (1 - (QuekeCounter / (cL["earthquake"] * 100)));
};
}
public function showScore(_arg1, _arg2){
score_mc.x = -50;
score_mc.y = 20;
score_mc.gotoAndPlay(1);
var _local3:MovieClip = (score_mc.getChildByName("score_mc") as MovieClip);
var _local4:TextField = (_local3.getChildByName("score") as TextField);
_local4.text = _arg1;
}
public function rotateDropBlockOnErrorTimerHandler(_arg1:Event):void{
var _local2:Number;
var _local3:*;
if (angle1 >= 90){
if (dropBlockFrom[0].y < (tBase.scrollRect.y - 50)){
dropBlockFrom[0].y = (dropBlockFrom[0].y + 10);
} else {
rotateDropTimer.stop();
rotateDropTimer.removeEventListener(TimerEvent.TIMER, rotateDropBlockOnErrorTimerHandler);
if (towers[lower].numChildren >= 2){
_local3 = towers[lower].getChildAt((towers[lower].numChildren - 2));
towers[lower].topBlockX = _local3.x;
towers[lower].towerHeight--;
towers[lower].removeChildAt((towers[lower].numChildren - 1));
} else {
towers[lower].topBlockX = 0;
towers[lower].towerHeight = 0;
towers[lower].removeChildAt((towers[lower].numChildren - 1));
};
angle1 = 0;
};
} else {
angle1 = (angle1 + 10);
setTransform(dropBlockX[0], (dropBlockY[0] + 50), (-(rotationDirection) * angle1), dropBlockFromTowerMatrix[0], dropBlockFromTower[0], 0, 50);
};
}
public function rotateDropBlockTimerHandler(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
if (angle >= 90){
if (dropBlockFrom[0].y < (tBase.scrollRect.y - 50)){
_local2 = 0;
while (_local2 < dropBlockFrom.length) {
dropBlockFrom[_local2].y = (dropBlockFrom[_local2].y + 6);
_local2++;
};
} else {
rotateDropTimer.stop();
rotateDropTimer.removeEventListener(TimerEvent.TIMER, rotateDropBlockTimerHandler);
_local2 = 0;
while (_local2 < towers.length) {
if (towers[_local2].towerHeight > 1){
towers[_local2].removeChildAt((towers[_local2].numChildren - 1));
towers[_local2].towerHeight--;
if (towers[_local2].numChildren != 0){
towers[_local2].topBlockX = towers[_local2].getChildAt((towers[_local2].numChildren - 1)).x;
} else {
towers[_local2].topBlockX = 0;
};
};
_local2++;
};
_local3 = 0;
_local2 = 0;
while (_local2 < cL["numOfTowers"]) {
_local3 = (_local3 + towers[_local2].towerHeight);
_local2++;
};
blockOnTop = 0;
removeChild(blocks[blocksCounter]);
blocks[blocksCounter] = null;
if (currentLevel != 0){
completeL.scrollRect = new Rectangle(0, 0, 20, ((156 * _local3) / (cL["numOfTowers"] * cL["towerHeight"])));
};
quakeTimer.stop();
dropNext = 1;
blockOnTop = 1;
earthQuakeTimer.start();
angle = 0;
};
} else {
angle = (angle + 10);
_local2 = 0;
while (_local2 < dropBlockFromTower.length) {
setTransform((dropBlockX[_local2] + 30), (dropBlockY[_local2] + 50), -(angle), dropBlockFromTowerMatrix[_local2], dropBlockFromTower[_local2], 10, 50);
_local2++;
};
};
}
function scrollTimerHandler(_arg1:Event){
var _local3:MovieClip;
var _local4:MovieClip;
if ((Math.abs((startPosBase - yPosBase)) + 80) < (towers[lower].towerHeight * 50)){
if ((yPosBase > -40)){
yPosBase = (yPosBase - 4);
} else {
yPosBase = (yPosBase - 2);
};
tBase.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
if (yPosBase <= -80){
bg.scrollRect = new Rectangle(0, (-80 + ((yPosBase + 80) * 1.5)), stageW, stageH);
} else {
bg.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
};
} else {
if ((((yPosBase < startPosBase)) && (((Math.abs((startPosBase - yPosBase)) + 80) > (towers[lower].towerHeight * 50))))){
if ((yPosBase >= -40)){
yPosBase = (yPosBase + 4);
} else {
yPosBase = (yPosBase + 2);
};
tBase.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
if (yPosBase <= -80){
bg.scrollRect = new Rectangle(0, (-80 + ((yPosBase + 80) * 1.5)), stageW, stageH);
} else {
bg.scrollRect = new Rectangle(0, yPosBase, stageW, stageH);
};
};
};
var _local2:* = (Math.abs((yPosBase * 1.5)) - (700 * Math.floor((Math.abs((yPosBase * 1.5)) / 700))));
if ((((((((_local2 == 0)) || ((_local2 == 25)))) || ((_local2 == 50)))) && ((addNextTexture == 1)))){
levelBgTexture[fonCount] = new level_bg_hight1();
if (fonCount <= 3){
_local3 = (levelBgTexture[fonCount].getChildByName("dr") as MovieClip);
_local3.x = 10000;
} else {
_local4 = (levelBgTexture[fonCount].getChildByName("shar") as MovieClip);
_local4.x = -5000;
};
bg.addChild(levelBgTexture[fonCount]);
fonCount++;
levelBgTexture[(fonCount - 1)].y = (-700 - (fonCount * 700));
addNextTexture = 0;
} else {
if (((((!((_local2 == 0))) && (!((_local2 == 25))))) && (!((_local2 == 50))))){
addNextTexture = 1;
};
};
}
private function seconds2mm_ss(_arg1){
var _local2:* = Math.floor((_arg1 / 60));
_arg1 = (_arg1 - (_local2 * 60));
if (_local2.toString().length == 1){
_local2 = ("0" + _local2);
};
if (_arg1.toString().length == 1){
_arg1 = ("0" + _arg1);
};
return (((_local2.toString() + ":") + _arg1.toString()));
}
public function testCompleteAll():Boolean{
var _local1:Number;
var _local3:Boolean;
var _local2:Number = 0;
if (cheat == true){
return (true);
};
if (cL["numOfMistakes"] < 0){
return (true);
};
if (cL["timer"] != 0){
if (numSteps == 0){
return (true);
};
};
if (cL["water"] != 0){
_local1 = 0;
while (_local1 < towers.length) {
if (flood_mc != null){
if ((towers[_local1].y - (towers[_local1].towerHeight * 50)) > (flood_mc.y + 20)){
return (true);
};
} else {
return (true);
};
_local1++;
};
};
_local1 = 0;
while (_local1 < towers.length) {
if (towers[_local1].towerHeight < cL["towerHeight"]){
_local2++;
};
_local1++;
};
if ((_local2 == 0)){
_local3 = true;
} else {
_local3 = false;
};
return (_local3);
}
private function startTutorial(_arg1:Event){
var _local4:MovieClip;
var _local5:Class;
var _local7:*;
removeEventListener(Event.ENTER_FRAME, startTutorial);
dFi = 0;
Fi = ((260 / 180) * Math.PI);
var _local2:* = (Lx + (a * Math.cos(Fi)));
var _local3:* = (60 + (b * Math.sin(Fi)));
hook_mc.y = (_local3 + 20);
hook_mc.x = _local2;
hook_mc.rotation = ((-20 * Math.asin(Math.cos(Fi))) / Math.PI);
detail = new detail_svitok();
detail.y = ((400 / 2) - (detail.height / 2));
detail.x = ((533 / 2) - (detail.width / 2));
detailSize = 30;
detail.c.scaleY = (detailSize / 15);
detail.c.y = (detail.c.y - detailSize);
detail.u.y = (detail.u.y - detailSize);
detail.d.y = (detail.d.y + detailSize);
if (cL["numOfTowers"] > 1){
_local4 = new study2_mess();
} else {
_local4 = new study1_mess();
};
_local4.x = 30;
_local4.y = 20;
detail.addChild(_local4);
addChild(detail);
lower = 0;
var _local6:* = 0;
while (_local6 < cL["numOfTowers"]) {
Fi = ((270 / 180) * Math.PI);
_local2 = (Lx + (a * Math.cos(Fi)));
_local3 = (60 + (b * Math.sin(Fi)));
_local5 = (loaderInfo.applicationDomain.getDefinition((cL["era"] + "_block2")) as Class);
blocks[blocksCounter] = new (_local5);
blocks[blocksCounter].x = 0;
blocks[blocksCounter].y = _local3;
blocks[blocksCounter].rotation = ((-20 * Math.asin(Math.cos(Fi))) / Math.PI);
towers[lower].x = _local2;
putBlock();
_local7 = new blinkArrow();
_local7.name = ("blink" + (_local6 + 1));
_local7.x = (_local2 - 25);
_local7.y = 200;
addChild(_local7);
_local6++;
};
Fi = ((260 / 180) * Math.PI);
_local2 = (Lx + (a * Math.cos(Fi)));
_local3 = (60 + (b * Math.sin(Fi)));
_local5 = (loaderInfo.applicationDomain.getDefinition((cL["era"] + "_block2")) as Class);
blocks[blocksCounter] = new (_local5);
blocks[blocksCounter].x = _local2;
blocks[blocksCounter].y = _local3;
blocks[blocksCounter].rotation = ((-20 * Math.asin(Math.cos(Fi))) / Math.PI);
addChild(blocks[blocksCounter]);
removeCnt = (2 * cL["numOfTowers"]);
}
private function scrollButtons():void{
upBtn_btn = new upBtn();
upBtn_btn.y = (upBtn_btn.height + 10);
upBtn_btn.x = (533 - 60);
upBtn_btn.rotation = -180;
upBtn_btn.addEventListener(MouseEvent.MOUSE_DOWN, startScrollUp);
upBtn_btn.addEventListener(MouseEvent.MOUSE_UP, stopScrollUp);
upBtn_btn.addEventListener(MouseEvent.MOUSE_OUT, stopScrollUp);
addChild(upBtn_btn);
downBtn_btn = new upBtn();
downBtn_btn.y = (390 - downBtn_btn.height);
downBtn_btn.x = (533 - 60);
downBtn_btn.rotation = 0;
downBtn_btn.addEventListener(MouseEvent.MOUSE_DOWN, startScrollDown);
downBtn_btn.addEventListener(MouseEvent.MOUSE_UP, stopScrollDown);
downBtn_btn.addEventListener(MouseEvent.MOUSE_OUT, stopScrollDown);
addChild(downBtn_btn);
}
}
}//package
Section 181
//towerIco (towerIco)
package {
import flash.display.*;
public dynamic class towerIco extends MovieClip {
}
}//package
Section 182
//transparentButton (transparentButton)
package {
import flash.display.*;
public dynamic class transparentButton extends MovieClip {
}
}//package
Section 183
//upBtn (upBtn)
package {
import flash.display.*;
public dynamic class upBtn extends SimpleButton {
}
}//package
Section 184
//wall_text (wall_text)
package {
import flash.display.*;
public dynamic class wall_text extends MovieClip {
}
}//package
Section 185
//wallsIco (wallsIco)
package {
import flash.display.*;
public dynamic class wallsIco extends MovieClip {
}
}//package
Section 186
//waterBg (waterBg)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class waterBg extends MovieClip {
public var tm:Timer;
var d:MovieClip;
var w:MovieClip;
var cnt:Number;// = 0
public function waterBg(){
tm = new Timer(70, 120);
super();
tm.addEventListener(TimerEvent.TIMER, enterFr);
tm.start();
}
public function enterFr(_arg1:Event):void{
if (numChildren < 40){
if ((cnt % 3) == 0){
d = new wave();
d.cacheAsBitmap = true;
d.x = (this.x + (Math.random() * width));
d.y = -(d.height);
d.scaleX = 2;
d.scaleY = 2;
addChild(d);
};
cnt++;
};
}
}
}//package
Section 187
//waterMess (waterMess)
package {
import flash.display.*;
public dynamic class waterMess extends MovieClip {
}
}//package
Section 188
//wave (wave)
package {
import flash.display.*;
public dynamic class wave extends MovieClip {
}
}//package
Section 189
//viewHightScore (viewHightScore)
package {
import flash.display.*;
public dynamic class viewHightScore extends SimpleButton {
}
}//package
Section 190
//wine_text (wine_text)
package {
import flash.display.*;
public dynamic class wine_text extends MovieClip {
}
}//package
Section 191
//wineIco (wineIco)
package {
import flash.display.*;
public dynamic class wineIco extends MovieClip {
}
}//package
Section 192
//yesBtn (yesBtn)
package {
import flash.display.*;
public dynamic class yesBtn extends SimpleButton {
}
}//package