Section 1
//ActionSource (com.omniture.ActionSource)
package com.omniture {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
import flash.external.*;
import flash.system.*;
public dynamic class ActionSource extends Sprite {
private var _useExternalVariables:Boolean;// = false
private var onLoadTracked:Boolean;// = false
public var account:String;
public var _movie:Object;
private var delayTrackingInterval:Number;
public var movieID:String;
public var debugTracking:Boolean;// = false
public var flashASVersion:Number;// = 3
private var _moduleMediaVariables:Object;
public var pageURL:String;
public var otherVariables:Object;
private var requestNum:Number;
public var dc:String;
public var visitorNamespace:String;
private var trackCalled:Boolean;// = false
public var mobile:Boolean;
public var flashVersion:Number;
public var trackingServerBase:String;
private var bufferTrackInterval:Number;// = 0
private var _trackOnLoad:Boolean;// = false
public var version:String;
public var trackingServer:String;
public var ClickMap:ActionSource_Module_ClickMap;
public var autoTrack:Boolean;
public var trackLocal:Boolean;// = true
private var bufferTrackQueue:Array;
public var trackingServerSecure:String;
private var flashRoot:Object;
private var accountConfigList:Array;
public var lastRequest:String;
public var trackClickMap:Boolean;
private var flashLivePreview:Boolean;// = false
public var charSet:String;
private var _configURL:String;
public var delayTracking:Number;
private var configXML:ActionSource_XML;
private var accountVarList:Array;
private var trackOnLoadInterval:Number;
public var pageName:String;
private var _root:Object;
private var requiredVarList:Array;
private var delayTrackingStage:Number;
public var requestList:Array;
public var Media:ActionSource_Module_Media;
private var externalVariables:Object;
public function ActionSource(){
var _local1:Object;
var _local2:Number;
var _local3:String;
var _local4:Array;
flashASVersion = 3;
flashLivePreview = false;
trackLocal = true;
debugTracking = false;
_useExternalVariables = false;
_trackOnLoad = false;
onLoadTracked = false;
bufferTrackInterval = 0;
trackCalled = false;
super();
_local1 = this;
_local1.version = "FAS-2.7";
_local3 = getVersion();
_local4 = _local3.split(" ");
_local1.flashVersion = parseInt(_local4[1].substr(0, 1));
_local1.initPre();
_local1.requestNum = 0;
_local1.requestList = new Array();
_local1.lastRequest = "";
_local1.requiredVarList = ["dynamicVariablePrefix", "visitorID", "vmk", "visitorMigrationKey", "visitorMigrationServer", "visitorMigrationServerSecure", "charSet", "visitorNamespace", "cookieDomainPeriods", "cookieLifetime", "pageName", "pageURL", "referrer", "currencyCode"];
_local1.accountVarList = ["purchaseID", "variableProvider", "channel", "server", "pageType", "transactionID", "campaign", "state", "zip", "events", "products", "tnt"];
_local2 = (_local1.requiredVarList.length - 1);
while (_local2 >= 0) {
_local1.accountVarList.unshift(_local1.requiredVarList[_local2]);
_local2--;
};
_local2 = 1;
while (_local2 <= 50) {
_local1.accountVarList.push(("prop" + _local2));
_local1.accountVarList.push(("eVar" + _local2));
_local1.accountVarList.push(("hier" + _local2));
_local1.accountVarList.push(("list" + _local2));
_local2++;
};
_local1.accountVarList.push("pe");
_local1.accountVarList.push("pev1");
_local1.accountVarList.push("pev2");
_local1.accountVarList.push("pev3");
_local1.requiredVarList.push("pe");
_local1.requiredVarList.push("pev1");
_local1.requiredVarList.push("pev2");
_local1.requiredVarList.push("pev3");
_local1.accountConfigList = ["account", "configURL", "linkObject", "linkURL", "linkName", "linkType", "trackDownloadLinks", "trackExternalLinks", "trackClickMap", "linkLeaveQueryString", "linkTrackVars", "linkTrackEvents", "trackingServer", "trackingServerSecure", "dc", "movieID", "autoTrack", "delayTracking", "trackLocal", "debugTracking"];
_local1.modulesInit();
_local1.setupInterval(_local1, "setVariableCallHandler", 1000, null);
_local1.initPost();
}
public function clearVars(){
var _local1:Object;
var _local2:Number;
var _local3:String;
_local1 = this;
_local2 = 0;
while (_local2 < accountVarList.length) {
_local3 = _local1.accountVarList[_local2];
if ((((((((((((((((((((((((_local3.substr(0, 4) == "prop")) || ((_local3.substr(0, 4) == "eVar")))) || ((_local3.substr(0, 4) == "hier")))) || ((_local3.substr(0, 4) == "list")))) || ((_local3 == "channel")))) || ((_local3 == "events")))) || ((_local3 == "purchaseID")))) || ((_local3 == "transactionID")))) || ((_local3 == "products")))) || ((_local3 == "state")))) || ((_local3 == "zip")))) || ((_local3 == "campaign")))){
_local1[_local3] = undefined;
};
_local2++;
};
}
private function updateExternalVariables(){
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:Number;
var _local5:Array;
var _local6:String;
var _local7:Object;
var _local8:String;
var _local9:String;
var _local10:Object;
_local1 = this;
_local6 = "";
_local1.externalVariables = new Object();
_local2 = _local1.getMovieClipURL(_local1);
if (_local1.isSet(_local2)){
_local3 = _local2.split("?");
_local6 = (_local6 + ("&" + _local3[1]));
};
if (_local1.isSet(_local1, "parent")){
_local2 = _local1.getMovieClipURL(_local1.parent);
if (_local1.isSet(_local2)){
_local3 = _local2.split("?");
_local6 = (_local6 + ("&" + _local3[1]));
};
} else {
if (_local1.isSet(_local1, "_parent")){
_local2 = _local1.getMovieClipURL(_local1._parent);
if (_local1.isSet(_local2)){
_local3 = _local2.split("?");
_local6 = (_local6 + ("&" + _local3[1]));
};
};
};
if (_local1.isSet(_local1.movie)){
_local2 = _local1.getMovieClipURL(_local1.movie);
if (_local1.isSet(_local2)){
_local3 = _local2.split("?");
_local6 = (_local6 + ("&" + _local3[1]));
};
};
if (_local1.isSet(_local6)){
_local3 = _local6.split("&");
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4].split("=");
_local8 = _local5[0];
if ((((_local8.substr(0, 2) == "s_")) || ((_local8.substr(0, 2) == "s.")))){
_local8 = _local8.substr(2);
_local9 = unescape(_local5[1]);
_local1.externalVariables[_local8] = _local9;
};
_local4++;
};
};
if (_local1.isSet(_local1.movie)){
_local7 = _local1.movie;
if (_local1.flashASVersion >= 3){
if (((_local1.isSet(_local1.movie, "loaderInfo")) && (_local1.isSet(_local1.movie.loaderInfo, "parameters")))){
_local7 = _local1.movie.loaderInfo.parameters;
};
};
for (_local8 in _local7) {
if ((((((_local8.substr(0, 2) == "s_")) || ((_local8.substr(0, 2) == "s.")))) && ((((typeof(_local7[_local8]) == "string")) || ((typeof(_local7[_local8]) == "boolean")))))){
_local9 = _local7[_local8];
_local8 = _local8.substr(2);
_local1.externalVariables[_local8] = _local9;
};
};
};
if (_local1.isSet(_local1.useExternalVariables)){
_local1.variableOverridesApply(_local1.externalVariables);
};
}
private function flushRequestList(){
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:Number;
_local1 = this;
while (_local1.requestNum < _local1.requestList.length) {
if (_local1.isSet(_local1.debugTracking)){
_local2 = ("ActionSource Debug: " + _local1.requestList[_local1.requestNum]);
_local3 = _local1.requestList[_local1.requestNum].split("&");
_local4 = 0;
while (_local4 < _local3.length) {
_local2 = (_local2 + ("\n\t" + unescape(_local3[_local4])));
_local4++;
};
_local1.logDebug(_local2);
};
_local1.requestURL(_local1.requestList[_local1.requestNum]);
_local1.lastRequest = _local1.requestList[_local1.requestNum];
_local1.requestNum++;
};
}
private function bufferRequest(_arg1:String, _arg2:String, _arg3:String){
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:Number;
var _local8:Number;
_local4 = this;
_local5 = _local4.getBufferedRequests();
if (_local4.isSet(_local5)){
if (!_local4.isSet(_local5.data)){
_local5.data = new Object();
};
if (!_local4.isSet(_local5.data.list)){
_local5.data.list = new Array();
};
_local8 = -1;
_local7 = 0;
while (_local7 < _local5.data.list.length) {
if (_local5.data.list[_local7].id == _arg2){
_local5.data.list[_local7].request = _arg3;
_arg3 = "";
} else {
if (!_local4.isSet(_local5.data.list[_local7].id)){
_local8 = _local7;
};
};
_local7++;
};
if (_local4.isSet(_arg3)){
_local6 = new Object();
_local6.account = _arg1;
_local6.id = _arg2;
_local6.request = _arg3;
if (_local8 >= 0){
_local5.data.list[_local8] = _local6;
} else {
_local5.data.list.push(_local6);
};
};
_local5.flush();
};
}
private function variableOverridesBuild(_arg1:Object, _arg2:Boolean){
var _local3:Object;
var _local4:Number;
var _local5:String;
_local3 = this;
_local4 = 0;
while (_local4 < _local3.accountVarList.length) {
_local5 = _local3.accountVarList[_local4];
if (!_local3.isSet(_arg1[_local5])){
_arg1[_local5] = _local3[_local5];
if (((!(_arg2)) && (!(_local3.isSet(_arg1[_local5]))))){
_arg1[("!" + _local5)] = 1;
};
};
_local4++;
};
_local4 = 0;
while (_local4 < _local3.accountConfigList.length) {
_local5 = _local3.accountConfigList[_local4];
if (!_local3.isSet(_arg1[_local5])){
_arg1[_local5] = _local3[_local5];
if (((!(_arg2)) && (!(_local3.isSet(_arg1[_local5]))))){
_arg1[("!" + _local5)] = 1;
};
};
_local4++;
};
}
public function set useExternalVariables(_arg1:Boolean){
this._useExternalVariables = _arg1;
if (this.isSet(this._useExternalVariables)){
this.updateExternalVariables();
};
}
private function requestURL(_arg1){
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
sendToURL(_local2);
}
public function setupInterval(_arg1:Object, _arg2:String, _arg3:Number, _arg4){
if (_arg4 != null){
return (setInterval(_arg1[_arg2], _arg3, _arg4));
};
return (setInterval(_arg1[_arg2], _arg3));
}
private function _trackLink(_arg1, _arg2:String, _arg3:String, _arg4:Object){
var _local5:Object;
var _local6:String;
_local5 = this;
if (((_local5.isSet(_arg1)) && ((typeof(_arg1) == "string")))){
_local6 = _arg1;
_arg1 = new Object();
_arg1.url = _local6;
};
_local5.linkObject = _arg1;
_local5.linkType = _arg2;
_local5.linkName = _arg3;
_local5.track(_arg4);
}
public function set movie(_arg1:Object){
var _local2:Object;
var _local3:String;
_local2 = this;
_local2._movie = _arg1;
if (!_local2.flashLivePreview){
_local3 = _local2.getMovieURL();
_local2.ssl = (_local3.toLowerCase().substr(0, 6) == "https:");
if (_local2.isSet(_local2._movie)){
if (_local2.flashASVersion < 3){
_local2._movie.s_s = this;
};
_local2.updateExternalVariables();
_local2.modulesUpdate();
};
};
}
private function queryStringLinkTracking():String{
var _local1:Object;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:String;
var _local9:Number;
_local1 = this;
_local2 = _local1.linkType;
_local3 = _local1.linkURL;
_local4 = _local1.linkName;
_local8 = "";
if (((!(_local1.isSet(_local3))) && (_local1.isSet(_local1.linkObject)))){
if (_local1.isSet(_local1.linkObject, "url")){
_local3 = _local1.linkObject.url;
} else {
if (_local1.isSet(_local1.linkObject, "URL")){
_local3 = _local1.linkObject.URL;
} else {
if (_local1.isSet(_local1.linkObject, "href")){
_local3 = _local1.linkObject.href;
} else {
if (_local1.isSet(_local1.linkObject, "HREF")){
_local3 = _local1.linkObject.HREF;
} else {
if (_local1.isSet(_local1.linkObject, "htmlText")){
_local5 = _local1.linkObject.htmlText.toLowerCase().indexOf("href=");
if (_local5 >= 0){
_local5 = (_local5 + 5);
_local7 = _local1.linkObject.htmlText.substr(_local5, 1);
if ((((_local7 == "\"")) || ((_local7 == "'")))){
_local5++;
_local6 = _local1.linkObject.htmlText.toLowerCase().indexOf(_local7, _local5);
if (_local6 >= 0){
--_local6;
if (_local6 > _local5){
_local3 = _local1.linkObject.htmlText.substr(_local5, ((_local6 - _local5) + 1));
};
};
};
};
};
};
};
};
};
};
if (((_local1.isSet(_local2)) && (((_local1.isSet(_local3)) || (_local1.isSet(_local4)))))){
_local2 = _local2.toLowerCase();
if (((!((_local2 == "d"))) && (!((_local2 == "e"))))){
_local2 = "o";
};
if (((_local1.isSet(_local3)) && (!(_local1.isSet(_local1.linkLeaveQueryString))))){
_local9 = _local3.indexOf("?");
if (_local9 >= 0){
_local3 = _local3.substr(0, _local9);
};
};
_local8 = (_local8 + ("&pe=lnk_" + escape(_local2)));
_local8 = (_local8 + (_local1.isSet(_local3)) ? ("&pev1=" + escape(_local3)) : "");
_local8 = (_local8 + (_local1.isSet(_local4)) ? ("&pev2=" + escape(_local4)) : "");
};
return (_local8);
}
private function _track(_arg1:Object, _arg2:String){
var _local3:Object;
var _local4:Boolean;
var _local5:Object;
var _local6:Date;
var _local7:Number;
var _local8:String;
var _local9:String;
var _local10:String;
var _local11:Number;
var _local12:String;
_local3 = this;
_local6 = new Date();
_local7 = Math.floor((Math.random() * 10000000000000));
_local8 = (("s" + (Math.floor((_local6.getTime() / 10800000)) % 10)) + _local7);
_local9 = ((((((((((((((("" + _local6.getDate()) + "/") + _local6.getMonth()) + "/") + _local6.getFullYear()) + " ") + _local6.getHours()) + ":") + _local6.getMinutes()) + ":") + _local6.getSeconds()) + " ") + _local6.getDay()) + " ") + _local6.getTimezoneOffset());
_local10 = ("t=" + escape(_local9));
if (_local3.isSet(_local3.flashLivePreview)){
return;
};
if (_local3.isSet(_local3.otherVariables)){
_local11 = 0;
while (_local11 < _local3.accountVarList.length) {
_local12 = _local3.accountVarList[_local11];
if (_local3.isSet(_local3.otherVariables[_local12])){
_local3[_local12] = _local3.otherVariables[_local12];
};
_local11++;
};
_local11 = 0;
while (_local11 < _local3.accountConfigList.length) {
_local12 = _local3.accountConfigList[_local11];
if (_local3.isSet(_local3.otherVariables[_local12])){
_local3[_local12] = _local3.otherVariables[_local12];
};
_local11++;
};
};
_local4 = _local3.bufferTrack(_arg1, _arg2);
if (!_local4){
if (_local3.isSet(_arg1)){
_local5 = new Object();
_local3.variableOverridesBuild(_local5, false);
_local3.variableOverridesApply(_arg1);
};
if (((_local3.isSet(_local3.usePlugins)) && (_local3.isSet(_local3.doPlugins)))){
_local3.doPlugins(_local3);
};
if (_local3.isSet(_local3.account)){
if (!_local3.isSet(_local3.pageURL)){
_local3.pageURL = _local3.getMovieURL();
};
if (((!(_local3.isSet(_local3.referrer))) && (!(_local3.isSet(_local3._1_referrer))))){
_local3.referrer = _local3.getMovieReferrer();
_local3._1_referrer = 1;
};
_local10 = (_local10 + _local3.queryStringAccountVariables());
_local10 = (_local10 + _local3.queryStringLinkTracking());
_local10 = (_local10 + _local3.queryStringClickMap());
_local10 = (_local10 + _local3.queryStringTechnology());
_local3.makeRequest(_local8, _local10, "", _arg2);
};
if (_local3.isSet(_arg1)){
_local3.variableOverridesApply(_local5);
};
};
_local3.referrer = undefined;
_local3.pe = undefined;
_local3.pev1 = undefined;
_local3.pev2 = undefined;
_local3.pev3 = undefined;
_local3.linkObject = undefined;
_local3.linkURL = undefined;
_local3.linkName = undefined;
_local3.linkType = undefined;
_local3.objectID = undefined;
if (((!(_local4)) && (_local3.isSet(_local3.account)))){
if (((!(_local3.isSet(_arg2))) && (!(_local3.isSet(_local3.trackCalled))))){
_local3.trackCalled = true;
_local3.flushBufferedRequests();
};
};
}
public function get trackOnLoad():Boolean{
return (this._trackOnLoad);
}
private function callJavaScript(_arg1:String){
var s:Object;
var e:Object;
var script = _arg1;
s = this;
try {
if (((((s.isSet(ExternalInterface)) && (s.isSet(ExternalInterface.available)))) && (s.isSet(ExternalInterface.call)))){
return (ExternalInterface.call(script));
};
} catch(e) {
};
return (null);
}
private function getSharedObject(_arg1:String){
var o:Object;
var encoding:Number;
var tryNum:Number;
var e:Object;
var key = _arg1;
o = null;
tryNum = 0;
while (((!(this.isSet(o))) && ((tryNum < 2)))) {
try {
encoding = SharedObject.defaultObjectEncoding;
SharedObject.defaultObjectEncoding = ObjectEncoding.AMF0;
o = SharedObject.getLocal(key, "/");
SharedObject.defaultObjectEncoding = encoding;
o.objectEncoding = ObjectEncoding.AMF0;
} catch(e) {
};
tryNum = (tryNum + 1);
};
return (o);
}
private function getVersion():String{
return (Capabilities.version);
}
private function makeRequest(_arg1:String, _arg2:String, _arg3:String, _arg4:String){
var _local5:Object;
var _local6:*;
var _local7:String;
var _local8:String;
var _local9:String;
var _local10:String;
var _local11:String;
var _local12:Number;
_local5 = this;
_local6 = _local5.getMovieURL();
_local7 = _local5.trackingServer;
_local8 = _local5.trackingServerBase;
_local9 = _local5.dc;
_local10 = "sc.";
if (!_local5.isSet(_arg3)){
if (_local5.isSet(_local7)){
if (((_local5.isSet(_local5.trackingServerSecure)) && (_local5.isSet(_local5.ssl)))){
_local7 = _local5.trackingServerSecure;
};
} else {
_local11 = _local5.visitorNamespace;
if (!_local5.isSet(_local11)){
_local11 = _local5.account;
_local12 = _local11.indexOf(",");
if (_local12 >= 0){
_local11 = _local11.substr(0, _local12);
};
_local11 = _local11.split("_").join("-");
};
if (!_local5.isSet(_local8)){
_local8 = "2o7.net";
};
if (_local5.isSet(_local9)){
_local9 = _local9.toLowerCase();
} else {
_local9 = "d1";
};
if (_local8 == "2o7.net"){
if (_local9 == "d1"){
_local9 = "112";
} else {
if (_local9 == "d2"){
_local9 = "122";
};
};
_local10 = "";
};
_local7 = (((((_local11 + ".") + _local9) + ".") + _local10) + _local8);
};
if (_local5.isSet(_local5.ssl)){
_arg3 = "https://";
} else {
_arg3 = "http://";
};
_arg3 = (_arg3 + (((((((((((((_local7 + "/b/ss/") + _local5.account) + "/") + (_local5.mobile) ? "5.0" : "0") + "/") + _local5.version) + "-AS") + _local5.flashASVersion) + "/") + _arg1) + "?AQB=1&ndh=1&") + _arg2) + "&AQE=1"));
if (_local5.isSet(_arg4)){
_local5.bufferRequest(_local5.account, _arg4, _arg3);
return;
};
};
if (((_local5.isSet(_local5.ssl)) && ((_arg3.toLowerCase().substr(0, 5) == "http:")))){
_arg3 = ("https:" + _arg3.substr(5));
};
if (((((((_local5.isSet(_local5.trackLocal)) || ((_local5.flashVersion < 8)))) || (!(_local5.isSet(_local6))))) || ((_local6.toLowerCase().substr(0, 4) == "http")))){
_local5.requestList.push(_arg3);
if (((!(_local5.isSet(_local5.delayTracking))) || (((_local5.isSet(_local5.delayTrackingStage)) && ((_local5.delayTrackingStage == 2)))))){
_local5.flushRequestList();
} else {
if (((_local5.isSet(_local5.delayTracking)) && (!(_local5.isSet(_local5.delayTrackingStage))))){
_local5.delayTrackingStage = 1;
_local5.delayTrackingInterval = _local5.setupInterval(_local5, "delayTrackingDone", _local5.delayTracking, null);
};
};
};
}
public function replace(_arg1:String, _arg2:String, _arg3:String):String{
if (this.isSet(_arg1)){
if (_arg1.indexOf(_arg2) >= 0){
return (_arg1.split(_arg2).join(_arg3));
};
};
return (_arg1);
}
public function get configURL():String{
return (this._configURL);
}
private function queryStringClickMap():String{
var _local1:Object;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:String;
var _local6:Number;
var _local7:String;
_local1 = this;
_local2 = "";
_local3 = _local1.pageName;
_local4 = 1;
_local5 = _local1.objectID;
_local6 = 1;
_local7 = "FLASH";
if (((((!(_local1.isSet(_local5))) && (_local1.isSet(_local1.linkObject)))) && (((_local1.isSet(_local1.linkObject, "name")) || (_local1.isSet(_local1.linkObject, "_name")))))){
_local5 = _local1.ClickMap.getObjectID(_local1.linkObject);
};
if (!_local1.isSet(_local3)){
_local3 = _local1.pageURL;
_local4 = 0;
};
if (((((((_local1.isSet(_local1.trackClickMap)) && (_local1.isSet(_local3)))) && (_local1.isSet(_local5)))) && (_local1.isSet(_local7)))){
_local2 = (_local2 + ("&pid=" + escape(_local3)));
_local2 = (_local2 + (_local1.isSet(_local4)) ? ("&pidt=" + escape(("" + _local4))) : "");
_local2 = (_local2 + ("&oid=" + escape(_local5.substr(0, 100))));
_local2 = (_local2 + (_local1.isSet(_local6)) ? ("&oidt=" + escape(("" + _local6))) : "");
_local2 = (_local2 + ("&ot=" + escape(_local7)));
};
return (_local2);
}
private function bufferTrackCheck(){
var _local1:Object;
var _local2:Number;
var _local3:Object;
_local1 = this;
if (((((((!(_local1.isSet(_local1.bufferTrackQueue))) || ((_local1.bufferTrackQueue.length <= 0)))) || (!(_local1.isSet(_local1.configXML))))) || (_local1.isSet(_local1.configXML.loaded)))){
clearInterval(_local1.bufferTrackInterval);
_local1.bufferTrackInterval = 0;
if (_local1.isSet(_local1.bufferTrackQueue)){
_local2 = 0;
while (_local2 < _local1.bufferTrackQueue.length) {
_local3 = _local1.bufferTrackQueue[_local2];
if (_local1.isSet(_local3)){
_local1.variableOverridesApply(_local3.setVariables);
_local1.track(_local3.variableOverrides, _local3.bufferedRequestID);
};
_local2++;
};
};
_local1.bufferTrackQueue = undefined;
};
}
private function queryStringTechnology():String{
var _local1:Object;
var _local2:String;
var _local3:Object;
_local1 = this;
_local2 = "";
_local3 = Capabilities;
if (((((_local1.isSet(_local3)) && (_local1.isSet(_local3.screenResolutionX)))) && (_local1.isSet(_local3.screenResolutionY)))){
_local2 = (_local2 + ((("&s=" + _local3.screenResolutionX) + "x") + _local3.screenResolutionY));
};
return (_local2);
}
public function isSet(_arg1, _arg2:String=null):Boolean{
var e:Object;
var val = _arg1;
var mbr = _arg2;
try {
if (mbr != null){
val = val[mbr];
};
return (((((((((((!((val == null))) && (!((val == undefined))))) && (!((("" + val) == "NaN"))))) && (!((val == false))))) && (!((val == ""))))) && (!((val == 0)))));
} catch(e) {
};
return (false);
}
public function flushBufferedRequests(){
var _local1:*;
_local1 = this;
if (_local1.isSet(_local1.account)){
_local1._flushBufferedRequests(_local1.account);
};
}
public function setInterface(_arg1:Object){
var _local2:Object;
_local2 = this;
if (_local2.isSet(_arg1)){
if (_local2.isSet(_arg1, "root")){
_local2.movie = _arg1.root;
} else {
if (_local2.isSet(_arg1, "_root")){
_local2.movie = _arg1._root;
} else {
_local2.movie = _arg1;
};
};
};
}
private function bufferTrack(_arg1:Object, _arg2:String){
var _local3:Object;
var _local4:Object;
var _local5:Object;
_local3 = this;
if (((_local3.isSet(_local3.configXML)) && (!(_local3.isSet(_local3.configXML.loaded))))){
if (!_local3.isSet(_local3.bufferTrackQueue)){
_local3.bufferTrackQueue = new Array();
};
_local5 = new Object();
_local5.setVariables = new Object();
_local3.variableOverridesBuild(_local5.setVariables, true);
if (_local3.isSet(_arg1)){
_local5.variableOverrides = new Object();
for (_local4 in _arg1) {
_local5.variableOverrides[_local4] = _arg1[_local4];
};
};
_local5.bufferedRequestID = _arg2;
_local3.bufferTrackQueue.push(_local5);
if (!_local3.isSet(_local3.bufferTrackInterval)){
_local3.bufferTrackInterval = _local3.setupInterval(_local3, "bufferTrackCheck", 100, null);
};
return (true);
};
return (false);
}
private function queryStringAccountVariables():String{
var _local1:Object;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:String;
var _local7:*;
var _local8:String;
var _local9:String;
var _local10:*;
var _local11:*;
var _local12:*;
_local1 = this;
_local2 = "";
_local10 = "";
_local11 = "";
_local12 = "";
if (((_local1.isSet(_local1.pe)) || (_local1.isSet(_local1.linkType)))){
_local10 = _local1.linkTrackVars;
_local11 = _local1.linkTrackEvents;
if (_local1.isSet(_local1.pe)){
_local12 = (_local1.pe.substr(0, 1).toUpperCase() + _local1.pe.substr(1));
if (_local1.isSet(_local1[_local12])){
_local10 = _local1[_local12].trackVars;
_local11 = _local1[_local12].trackEvents;
};
};
};
if (_local1.isSet(_local10)){
_local10 = (((("," + _local10) + ",") + _local1.requiredVarList.join(",")) + ",");
};
if (_local1.isSet(_local11)){
_local11 = (("," + _local11) + ",");
};
_local3 = 0;
while (_local3 < _local1.accountVarList.length) {
_local5 = _local1.accountVarList[_local3];
_local6 = _local1[_local5];
_local8 = _local5.substr(0, 4);
_local9 = _local5.substr(4);
if (((_local1.isSet(_local6)) && (((!(_local1.isSet(_local10))) || ((_local10.indexOf((("," + _local5) + ",")) >= 0)))))){
switch (_local5){
case "dynamicVariablePrefix":
_local5 = "D";
break;
case "visitorID":
_local5 = "vid";
break;
case "pageURL":
_local5 = "g";
break;
case "referrer":
_local5 = "r";
break;
case "vmk":
case "visitorMigrationKey":
_local5 = "vmt";
break;
case "visitorMigrationServer":
_local5 = "vmf";
if (((_local1.isSet(_local1.ssl)) && (_local1.isSet(_local1.visitorMigrationServerSecure)))){
_local6 = "";
};
break;
case "visitorMigrationServerSecure":
_local5 = "vmf";
if (((!(_local1.isSet(_local1.ssl))) && (_local1.isSet(_local1.visitorMigrationServer)))){
_local6 = "";
};
break;
case "charSet":
_local5 = "ce";
break;
case "visitorNamespace":
_local5 = "ns";
break;
case "cookieDomainPeriods":
_local5 = "cdp";
break;
case "cookieLifetime":
_local5 = "cl";
break;
case "currencyCode":
_local5 = "cc";
break;
case "channel":
_local5 = "ch";
break;
case "transactionID":
_local5 = "xact";
break;
case "campaign":
_local5 = "v0";
break;
case "events":
if (_local1.isSet(_local11)){
_local7 = _local6.split(",");
_local6 = "";
_local4 = 0;
while (_local4 < _local7.length) {
if (_local11.indexOf((("," + _local7[_local4]) + ",")) >= 0){
_local6 = (_local6 + ((_local1.isSet(_local6)) ? "," : "" + _local7[_local4]));
};
_local4++;
};
};
break;
default:
if (_local1.isNumber(_local9)){
if (_local8 == "prop"){
_local5 = ("c" + _local9);
} else {
if (_local8 == "eVar"){
_local5 = ("v" + _local9);
} else {
if (_local8 == "list"){
_local5 = ("l" + _local9);
} else {
if (_local8 == "hier"){
_local5 = ("h" + _local9);
_local6 = _local6.substr(0, 0xFF);
};
};
};
};
};
break;
};
if (_local1.isSet(_local6)){
_local2 = (_local2 + ((("&" + escape(_local5)) + "=") + ((_local5.substr(0, 3))!="pev") ? escape(_local6) : _local6));
};
};
_local3++;
};
return (_local2);
}
public function isNumber(_arg1):Boolean{
return (!(isNaN(parseInt(_arg1))));
}
private function doTrackOnLoad(){
var _local1:Object;
_local1 = this;
if (((!(_local1.isSet(_local1.account))) || (!(_local1.isSet(_local1.movie))))){
return;
};
clearInterval(_local1.trackOnLoadInterval);
if (((_local1._trackOnLoad) && (!(_local1.onLoadTracked)))){
_local1.onLoadTracked = true;
_local1.track();
};
}
public function flushBufferedRequest(_arg1:String, _arg2:String){
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:String;
_local3 = this;
_local4 = _local3.getBufferedRequests();
if (((((_local3.isSet(_local4)) && (_local3.isSet(_local4.data)))) && (_local3.isSet(_local4.data.list)))){
_local6 = 0;
while (_local6 < _local4.data.list.length) {
_local5 = _local4.data.list[_local6];
if ((((_local5.account == _arg1)) && ((_local5.id == _arg2)))){
_local7 = _local4.data.list[_local6].request;
_local4.data.list[_local6].account = "";
_local4.data.list[_local6].id = "";
_local4.data.list[_local6].request = "";
_local4.flush();
_local3.makeRequest("", "", _local7, "");
};
_local6++;
};
};
}
public function set trackOnLoad(_arg1:Boolean){
this._trackOnLoad = _arg1;
if (this._trackOnLoad){
this.trackOnLoadInterval = this.setupInterval(this, "doTrackOnLoad", 100, null);
};
}
public function variableOverridesApply(_arg1:Object){
var _local2:Object;
var _local3:Number;
var _local4:String;
var _local5:Array;
_local2 = this;
_local3 = 0;
while (_local3 < _local2.accountVarList.length) {
_local4 = _local2.accountVarList[_local3];
if (((_local2.isSet(_arg1[_local4])) || (_local2.isSet(_arg1[("!" + _local4)])))){
_local2[_local4] = _arg1[_local4];
};
_local3++;
};
_local3 = 0;
while (_local3 < _local2.accountConfigList.length) {
_local4 = _local2.accountConfigList[_local3];
if (((_local2.isSet(_arg1[_local4])) || (_local2.isSet(_arg1[("!" + _local4)])))){
if ((((((((((((((_local4 == "trackDownloadLinks")) || ((_local4 == "trackExternalLinks")))) || ((_local4 == "trackClickMap")))) || ((_local4 == "linkLeaveQueryString")))) || ((_local4 == "autoTrack")))) || ((_local4 == "trackLocal")))) || ((_local4 == "debugTracking")))){
if (typeof(_arg1[_local4]) == "string"){
if (_arg1[_local4].toLowerCase() == "true"){
_arg1[_local4] = true;
} else {
_arg1[_local4] = false;
};
} else {
_arg1[_local4] = _local2.isSet(_arg1[_local4]);
};
} else {
if (_local4 == "delayTracking"){
if (typeof(_arg1[_local4]) == "string"){
_arg1[_local4] = parseInt(_arg1[_local4]);
} else {
if (typeof(_arg1[_local4]) != "number"){
_arg1[_local4] = 0;
};
};
};
};
_local2[_local4] = _arg1[_local4];
};
_local3++;
};
for (_local4 in _arg1) {
if (_local4.indexOf(".") >= 0){
_local5 = _local4.split(".");
if (_local5.length == 2){
if (((!(_local2.isSet(_arg1[_local5[0]]))) || (!((typeof(_arg1[_local5[0]]) == "object"))))){
_arg1[_local5[0]] = new Object();
};
_arg1[_local4][_local5[1]] = _arg1[_local4];
_local4 = _local5[0];
} else {
_local4 = "";
};
};
};
for (_local4 in _arg1) {
if (typeof(_arg1[_local4]) == "object"){
if (_local4 == "config"){
_local2.variableOverridesApply(_arg1[_local4]);
} else {
if ((((((((_local4.substr(0, 1) == _local4.substr(0, 1).toUpperCase())) && (_local2.isSet(_local2[_local4])))) && ("boolean"))) && (_local2.isSet(_local2[_local4].variableOverridesApply)))){
_local2[_local4].variableOverridesApply(_arg1[_local4]);
};
};
};
};
}
public function get useExternalVariables():Boolean{
return (this._useExternalVariables);
}
public function set moduleMediaVariables(_arg1:Object){
this._moduleMediaVariables = _arg1;
this.modulesUpdate();
}
private function setVariableCallHandler(){
var _local1:Object;
var _local2:Object;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local8:Object;
var _local9:Number;
_local1 = this;
for (_local3 in _local1) {
if (_local3.substr(0, 5) == "_svc_"){
_local5 = _local3.split("_");
if (((_local1.isSet(_local5)) && ((_local5.length >= 4)))){
if ((((_local5[3] == "dot")) && ((_local5.length > 4)))){
_local5[2] = (_local5[2] + ("_dot_" + _local5[4]));
_local6 = 5;
while (_local6 < _local5.length) {
_local5[(_local6 - 2)] = _local5[_local6];
_local6++;
};
};
_local8 = null;
if (_local1.isSet(_local7)){
_local9 = 0;
while (_local9 < _local7.length) {
if (_local7[_local9].methodName == _local5[2]){
_local8 = _local7[_local9];
};
_local9++;
};
};
if (!_local1.isSet(_local8)){
_local7 = new Array();
_local8 = new Object();
_local8.methodName = _local5[2];
_local7[0] = _local8;
};
if (_local5[3] == "call"){
if (_local1.isSet(_local1[_local3])){
_local8.call = true;
};
_local1[_local3] = null;
} else {
if ((((((_local5[3] == "param")) && ((_local5.length > 4)))) && (_local1.isSet(_local5[4])))){
if (!_local1.isSet(_local8.paramList)){
_local8.paramList = new Array();
};
_local8.paramList[_local5[4]] = _local1[_local3];
};
};
};
};
};
if (((_local1.isSet(_local7)) && ((_local7.length > 0)))){
_local9 = 0;
while (_local9 < _local7.length) {
_local8 = _local7[_local9];
if (((_local1.isSet(_local8.methodName)) && (_local1.isSet(_local8.call)))){
_local5 = _local8.methodName.split("_dot_");
if (_local5.length > 1){
_local2 = _local1[_local5[0]];
_local4 = _local5[1];
} else {
_local2 = _local1;
_local4 = _local8.methodName;
};
if (_local1.isSet(_local2[_local4])){
if (((_local1.isSet(_local8.paramList)) && ((_local8.paramList.length > 0)))){
if (_local8.paramList.length == 1){
_local1[("_svc_result_" + _local8.methodName)] = _local2[_local4](_local8.paramList[0]);
} else {
if (_local8.paramList.length == 2){
_local1[("_svc_result_" + _local8.methodName)] = _local2[_local4](_local8.paramList[0], _local8.paramList[1]);
} else {
if (_local8.paramList.length == 3){
_local1[("_svc_result_" + _local8.methodName)] = _local2[_local4](_local8.paramList[0], _local8.paramList[1], _local8.paramList[2]);
};
};
};
} else {
_local1[(("_svc_" + _local8.methodName) + "_result")] = _local2[_local4]();
};
};
};
_local9++;
};
};
}
private function getMovieClipURL(_arg1:Object):String{
var _local2:Object;
_local2 = this;
if (_local2.isSet(_arg1)){
if ((((((_local2.flashASVersion > 2)) && (_local2.isSet(_arg1.loaderInfo)))) && (_local2.isSet(_arg1.loaderInfo.loaderURL)))){
return (_arg1.loaderInfo.loaderURL);
};
if (_local2.isSet(_arg1._url)){
return (_arg1._url);
};
};
return ("");
}
public function get movie():Object{
return (this._movie);
}
private function getBufferedRequests(){
var s:Object;
var bufferedRequests:Object;
s = this;
if (!s.isSet(s.disableBufferedRequests)){
bufferedRequests = s.getSharedObject("s_br");
};
if (!s.isSet(bufferedRequests)){
bufferedRequests = s.bufferedRequests;
if (!s.isSet(bufferedRequests)){
s.bufferedRequests = new Object();
s.bufferedRequests.flush = function (){
};
bufferedRequests = s.bufferedRequests;
};
};
return (bufferedRequests);
}
private function modulesInit(){
var _local1:Object;
_local1 = this;
_local1.ClickMap = new ActionSource_Module_ClickMap(_local1);
_local1.Media = new ActionSource_Module_Media(_local1);
_local1.modulesUpdate();
}
private function modulesUpdate(){
var _local1:Object;
var _local2:String;
_local1 = this;
if (_local1.isSet(_local1.Media)){
if (_local1.isSet(_local1._moduleMediaVariables)){
for (_local2 in _local1._moduleMediaVariables) {
if (_local1.isSet(_local1._moduleMediaVariables[_local2])){
if ((((_local2 == "trackWhilePlaying")) || ((_local2 == "autoTrack")))){
if (("" + _local1._moduleMediaVariables[_local2]).toLowerCase() == "true"){
_local1._moduleMediaVariables[_local2] = true;
} else {
_local1._moduleMediaVariables[_local2] = false;
};
};
_local1.Media[_local2] = _local1._moduleMediaVariables[_local2];
};
};
};
_local1.Media.autoTrack = _local1.Media.autoTrack;
};
}
public function track(_arg1:Object=null, _arg2:String=""){
this._track(_arg1, _arg2);
}
public function logDebug(_arg1:String){
trace(_arg1);
this.callJavaScript((("function s_logDebug(){var e;try{console.log(\"" + this.replace(this.replace(_arg1, "\n", "\\n"), "\"", "\\\"")) + "\");}catch(e){}}"));
}
private function initPre(){
this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
public function get moduleMediaVariables():Object{
return (this._moduleMediaVariables);
}
public function getMovieURL():String{
var _local1:Object;
var _local2:String;
_local1 = this;
_local2 = _local1.callJavaScript("function s_ActionSource_wl(){return window.location.href;}");
if (_local1.isSet(_local2)){
return (_local2);
};
if (_local1.isSet(_local1.movie)){
return (_local1.getMovieClipURL(_local1.movie));
};
return ("");
}
public function set configURL(_arg1:String){
var _local2:Object;
_local2 = this;
if (_arg1 != _local2._configURL){
_local2._configURL = _arg1;
if (_local2.isSet(_local2._configURL)){
if (!_local2.isSet(_local2.configXML)){
_local2.configXML = new ActionSource_XML(_local2);
_local2.configXML.onDataReady = "variableOverridesApply";
};
_local2.configXML.url = _local2._configURL;
};
};
}
private function onAddedToStage(_arg1:Event){
if ((((parent == null)) || (!((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent"))))){
this.visible = false;
this.movie = root;
} else {
this.flashLivePreview = true;
};
}
private function getMovieReferrer():String{
var _local1:Object;
_local1 = this;
return (_local1.callJavaScript((((((((((((((((((((((((("" + "function s_ActionSource_r(){") + "\tvar ") + "\t\tr = '',") + "\t\tw = window,") + "\t\te,") + "\t\tp,") + "\t\tl,") + "\t\te;") + "\tif ((w) && (w.document)) {") + "\t\tr = w.document.referrer;") + "\t\ttry {") + "\t\t\tp = w.parent;") + "\t\t\tl = w.location;") + "\t\t\twhile ((p) && (p.location) && (l) && (''+p.location != ''+l) && (w.location) && (''+p.location != ''+w.location) && (p.location.host == l.host)) {") + "\t\t\t\tw = p;") + "\t\t\t\tp = w.parent;") + "\t\t\t}") + "\t\t} catch (e) {}") + "\t\tif ((w) && (w.document)) {") + "\t\t\tr = w.document.referrer;") + "\t\t}") + "\t}") + "\treturn r;") + "}")));
}
private function initPost(){
}
public function trackLink(_arg1, _arg2:String, _arg3:String, _arg4:Object=null){
this._trackLink(_arg1, _arg2, _arg3, _arg4);
}
private function _flushBufferedRequests(_arg1:String){
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Number;
_local2 = this;
_local3 = _local2.getBufferedRequests();
if (((((_local2.isSet(_local3)) && (_local2.isSet(_local3.data)))) && (_local2.isSet(_local3.data.list)))){
_local5 = 0;
while (_local5 < _local3.data.list.length) {
_local4 = _local3.data.list[_local5];
if (_local4.account == _arg1){
_local2.flushBufferedRequest(_arg1, _local4.id);
};
_local5++;
};
};
}
private function delayTrackingDone(){
var _local1:Object;
_local1 = this;
clearInterval(_local1.delayTrackingInterval);
_local1.delayTrackingStage = 2;
_local1.flushRequestList();
}
}
}//package com.omniture
Section 2
//ActionSource_Module_ClickMap (com.omniture.ActionSource_Module_ClickMap)
package com.omniture {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.external.*;
public dynamic class ActionSource_Module_ClickMap {
private var s:Object;
private static var isExternalSet:Boolean = false;
public function ActionSource_Module_ClickMap(_arg1:Object){
var m:Object;
var e:Object;
var s = _arg1;
super();
m = this;
m.s = s;
m.s.addEventListener(Event.ADDED_TO_STAGE, m.onAddedToStage, false, 0, true);
if (((ExternalInterface.available) && (!(m.isExternalSet)))){
m.isExternalSet = true;
try {
ExternalInterface.addCallback("s_getDOMIndex", m.getDOMIndex);
ExternalInterface.addCallback("s_getTrackClickMap", m.getTrackClickMap);
ExternalInterface.addCallback("s_getAccount", m.getAccount);
ExternalInterface.addCallback("s_getPageName", m.getPageName);
ExternalInterface.addCallback("s_getPageURL", m.getPageURL);
ExternalInterface.addCallback("s_getMovieID", m.getMovieID);
ExternalInterface.addCallback("s_getVersion", m.getVersion);
ExternalInterface.addCallback("s_getCharSet", m.getCharSet);
ExternalInterface.addCallback("s_getSWFURL", m.getSWFURL);
} catch(e) {
};
};
}
public function getSWFURL(){
var _local1:Object;
_local1 = this;
if (_local1.s.isSet(s.movie)){
if (((_local1.s.isSet(_local1.s.movie.loaderInfo)) && (_local1.s.isSet(_local1.s.movie.loaderInfo.loaderURL)))){
return (_local1.s.movie.loaderInfo.loaderURL);
};
if (_local1.s.isSet(_local1.s.movie._url)){
return (_local1.s.movie._url);
};
};
return ("");
}
public function getVersion(){
var _local1:Object;
_local1 = this;
return (_local1.s.version);
}
private function parentLocalToGlobal(_arg1:DisplayObject, _arg2:Object){
var _local3:*;
_local3 = new Point(_arg2.x, _arg2.y);
_arg1.parent.localToGlobal(_local3);
_arg2.x = _local3.x;
_arg2.y = _local3.y;
}
private function getFullPath(_arg1:DisplayObject){
var _local2:String;
var _local3:String;
var _local4:Array;
_local4 = new Array();
do {
_local4.splice(0, 0, _arg1.name);
_arg1 = _arg1.parent;
} while (_arg1.parent != null);
_local2 = _local4.join(".");
_local3 = _local2.substr((_local2.length - 4), 4);
if ((((_local3 == ".frs")) || ((_local3 == ".fds")))){
_local2 = _local2.substr(0, (_local2.length - 4));
};
return (_local2);
}
public function getObjectID(_arg1:Object){
var _local2:Object;
var _local3:String;
var _local4:String;
_local2 = this;
_local3 = _local2.getMovieID();
_local4 = "";
_local4 = _local2.getFullPath(_arg1);
if (_local2.s.isSet(_local4)){
_local4 = (((_local2.s.isSet(_local3)) ? _local3 : "" + ":") + _local4);
};
return (_local4);
}
public function getMovieID(){
var _local1:Object;
var _local2:String;
var _local3:String;
var _local4:Number;
var _local5:Number;
_local1 = this;
_local2 = _local1.getSWFURL();
_local3 = s.movieID;
if (((!(_local1.s.isSet(_local3))) && (_local1.s.isSet(_local2)))){
_local4 = _local2.lastIndexOf("/");
_local5 = _local2.lastIndexOf(".");
if (_local4 >= 0){
_local4++;
} else {
_local4 = 0;
};
if (_local5 >= 0){
_local5 = (_local5 - _local4);
} else {
_local5 = _local2.length;
};
_local3 = _local2.substr(_local4, _local5);
};
if (!_local1.s.isSet(_local3)){
_local3 = "movieID undefined";
};
return (_local3);
}
public function getIndex(){
var _local1:Object;
var _local2:String;
_local1 = this;
if (_local1.s.isSet(_local1.s.movie)){
_local2 = (((_local1.s.movie.stage.stageWidth + ",") + _local1.s.movie.stage.stageHeight) + _local1.indexChildren(_local1.s.movie));
return (_local2);
};
return ("");
}
private function sendClickMapEvent(_arg1:Object){
var _local2:Object;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Number;
_local2 = this;
_local3 = _local2.s.getMovieURL();
_local4 = _local2.getMovieID();
if (_local2.s.isSet(_local2.s.trackClickMap)){
_local2.s.objectID = _local2.getObjectID(_arg1);
};
if (_local2.s.autoTrack){
_local5 = _local3;
_local6 = _local5.indexOf("?");
if (_local6 >= 0){
_local5 = _local5.substr(0, _local6);
};
if (_local5.length > (100 - 23)){
_local5 = _local5.substr(-((100 - 23)));
};
_local2.s.trackLink(_local3, "o", ("ActionSource.AutoTrack:" + _local5));
};
}
private function nodeShift(_arg1:DisplayObject, _arg2:Number, _arg3:Number){
_arg1.x = _arg2;
_arg1.y = _arg3;
}
private function parentGetBounds(_arg1:DisplayObject){
var _local2:*;
var _local3:*;
_local2 = _arg1.parent.getBounds(_arg1.parent);
_local3 = new Object();
_local3.xMin = _local2.x;
_local3.yMin = _local2.y;
_local3.xMax = (_local2.x + _local2.width);
_local3.yMax = (_local2.y + _local2.height);
return (_local3);
}
private function onAddedToStage(_arg1:Event):void{
var _local2:Object;
_local2 = this;
_local2.s.root.addEventListener(MouseEvent.CLICK, _local2.onMouseClick, true, 0, true);
}
private function getDOMID(_arg1:Object){
var _local2:Object;
var _local3:Object;
_local2 = this;
if (_local2.s.isSet(_arg1)){
_local3 = _local2.getGeom(_arg1);
return (((((((((_local2.getFullPath(_arg1) + ",") + _local3.x) + ",") + _local3.y) + ",") + _local3.w) + ",") + _local3.h));
};
return ("");
}
private function onMouseClick(_arg1:MouseEvent):void{
var m:Object;
var e:Object;
var event = _arg1;
m = this;
try {
m.sendClickMapEvent(InteractiveObject(event.target));
} catch(e) {
};
}
public function getPageURL(){
var _local1:Object;
_local1 = this;
return (_local1.s.pageURL);
}
public function getDOMIndex(){
var _local1:Object;
_local1 = this;
return (_local1.getIndex());
}
public function getTrackClickMap(){
var _local1:Object;
_local1 = this;
return (_local1.s.trackClickMap.toString());
}
private function indexChildren(_arg1:DisplayObjectContainer):String{
var _local2:Object;
var _local3:String;
var _local4:Number;
var _local5:DisplayObject;
_local2 = this;
_local3 = new String();
_local4 = 0;
while (_local4 < _arg1.numChildren) {
_local5 = _arg1.getChildAt(_local4);
if (_local2.s.isSet(_local5)){
_local3 = (_local3 + ("|" + _local2.getDOMID(_local5)));
if ((_local5 is DisplayObjectContainer)){
_local3 = (_local3 + _local2.indexChildren(DisplayObjectContainer(_local5)));
};
};
_local4++;
};
return (_local3);
}
private function nodePos(_arg1:DisplayObject){
var _local2:*;
_local2 = new Object();
_local2.x = _arg1.x;
_local2.y = _arg1.y;
return (_local2);
}
public function getCharSet(){
var _local1:Object;
_local1 = this;
return (_local1.s.charSet);
}
public function getAccount(){
var _local1:Object;
_local1 = this;
return (_local1.s.account);
}
private function getGeom(_arg1:Object){
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local7:Object;
var _local8:Object;
_local2 = this;
_local3 = new Object();
_local6 = _local2.parentGetBounds(_arg1);
_local4 = _local2.nodePos(_arg1);
_local5 = _local2.nodePos(_arg1);
_local2.nodeShift(_arg1, _local6.xMin, _local6.yMin);
_local7 = _local2.parentGetBounds(_arg1);
_local2.nodeShift(_arg1, _local6.xMax, _local6.yMax);
_local8 = _local2.parentGetBounds(_arg1);
_local2.nodeShift(_arg1, _local4.x, _local4.y);
_local4.x = (_local4.x + (_local7.xMin - _local6.xMin));
_local4.y = (_local4.y + (_local7.yMin - _local6.yMin));
_local5.x = (_local5.x + (_local8.xMax - _local6.xMax));
_local5.y = (_local5.y + (_local8.yMax - _local6.yMax));
_local2.parentLocalToGlobal(_arg1, _local4);
_local2.parentLocalToGlobal(_arg1, _local5);
_local3.x = Math.round(_local4.x);
_local3.y = Math.round(_local4.y);
_local3.w = Math.ceil((_local5.x - _local4.x));
_local3.h = Math.ceil((_local5.y - _local4.y));
return (_local3);
}
public function getPageName(){
var _local1:Object;
_local1 = this;
return (_local1.s.pageName);
}
}
}//package com.omniture
Section 3
//ActionSource_Module_Media (com.omniture.ActionSource_Module_Media)
package com.omniture {
import flash.utils.*;
public dynamic class ActionSource_Module_Media {
private var autoTrackDone:Boolean;// = false
public var playerName:String;
public var trackVars:String;
private var list:Object;
private var monitorList:Array;
public var trackWhilePlaying:Boolean;// = false
public var trackMilestones:String;// = ""
public var trackSeconds:Number;// = 0
private var autoTrackInterval:Number;
public var trackEvents:String;
private var _autoTrack:Boolean;// = false
private var s:Object;
public function ActionSource_Module_Media(_arg1:Object){
var _local2:Object;
trackWhilePlaying = false;
trackSeconds = 0;
trackMilestones = "";
_autoTrack = false;
autoTrackDone = false;
super();
_local2 = this;
_local2.s = _arg1;
_local2.monitorList = null;
}
public function listenerMedia_scrubbing(_arg1){
this.listenerMedia.scrubbing(_arg1);
}
public function stop(_arg1:String, _arg2:Number){
this.event(_arg1, 2, _arg2);
}
public function listenerBrightcove_seek(_arg1){
this.listenerBrightcove.seek(_arg1);
}
public function doAutoTrack(){
var _local1:Object;
_local1 = this;
if (((!(_local1.s.isSet(_local1.s.account))) || (!(_local1.s.isSet(_local1.s.movie))))){
return;
};
clearInterval(_local1.autoTrackInterval);
if (((_local1._autoTrack) && (!(_local1.autoTrackDone)))){
if (_local1.attach(_local1.s.movie)){
_local1.autoTrackDone = true;
} else {
_local1.autoTrackInterval = _local1.s.setupInterval(this, "doAutoTrack", 1000, null);
};
};
}
public function listenerMedia_click(_arg1){
this.listenerMedia.click(_arg1);
}
private function event(_arg1:String, _arg2:Number, _arg3:Number){
var _local4:Object;
var _local5:Object;
var _local6:Date;
var _local7:Number;
var _local8:Number;
var _local9:String;
var _local10:Array;
var _local11:Number;
var _local12:String;
var _local13:Boolean;
var _local14:String;
var _local15:String;
var _local16:String;
var _local17:String;
var _local18:String;
var _local19:Object;
_local4 = this;
_local6 = new Date();
_local7 = Math.floor((_local6.getTime() / 1000));
_local8 = _local4.trackSeconds;
_local9 = _local4.trackMilestones;
_local12 = "--**--";
_local13 = true;
_local14 = null;
_local15 = _local4.trackVars;
_local16 = _local4.trackEvents;
_local17 = "media";
_local19 = new Object();
_arg1 = _local4.cleanName(_arg1);
_local5 = (((((_local4.s.isSet(_arg1)) && (_local4.s.isSet(_local4.list)))) && (_local4.s.isSet(_local4.list[_arg1])))) ? _local4.list[_arg1] : null;
if (_local4.s.isSet(_local5)){
_local19.name = _arg1;
_local19.length = _local5.length;
_local19.playerName = _local5.playerName;
if (_local5.lastTrackOffset < 0){
_local19.event = "OPEN";
} else {
_local19.event = ((_arg2 == 1)) ? "PLAY" : ((_arg2 == 2)) ? "STOP" : ((_arg2 == 3)) ? "MONITOR" : "CLOSE";
};
_local19.openTime = new Date();
_local19.openTime.setTime((_local5.timestamp * 1000));
if ((((_arg2 > 2)) || (((!((_arg2 == _local5.lastEventType))) && (((!((_arg2 == 2))) || ((_local5.lastEventType == 1)))))))){
_local14 = ("Media." + _arg1);
_local18 = (((((("" + escape(_local5.name)) + _local12) + _local5.length) + _local12) + escape(_local5.playerName)) + _local12);
if (_local4.s.isSet(_arg2)){
if ((((_arg3 < 0)) && ((_local5.lastEventTimestamp > 0)))){
_arg3 = ((_local7 - _local5.lastEventTimestamp) + _local5.lastEventOffset);
_arg3 = ((_arg3 < _local5.length)) ? _arg3 : (_local5.length - 1);
};
_arg3 = Math.floor(_arg3);
if ((((_arg2 >= 2)) && ((_local5.lastEventOffset < _arg3)))){
_local5.timePlayed = (_local5.timePlayed + (_arg3 - _local5.lastEventOffset));
_local5.timePlayedSinseTrack = (_local5.timePlayedSinseTrack + (_arg3 - _local5.lastEventOffset));
};
if (_arg2 <= 2){
_local5.session = (_local5.session + (((_arg2 == 1)) ? "S" : "E" + _arg3));
_local5.lastEventType = _arg2;
} else {
if (_local5.lastEventType != 1){
_local4.event(_arg1, 1, _arg3);
};
};
_local5.lastEventTimestamp = _local7;
_local5.lastEventOffset = _arg3;
_local18 = (_local18 + ((((((("" + _local5.timePlayed) + _local12) + _local5.timestamp) + _local12) + (((_local4.s.isSet(_local4.trackWhilePlaying)) && ((_local5.lastTrackOffset >= 0)))) ? ("L" + _local5.lastTrackOffset) : "") + _local5.session) + ((_arg2)!=2) ? ((_local4.s.isSet(_local4.trackWhilePlaying)) ? "L" : "E" + _arg3) : ""));
if (_local4.s.isSet(_local4.trackWhilePlaying)){
_local14 = null;
_local17 = "m_o";
if (_arg2 != 4){
_local19.offset = _arg3;
_local19.percent = (((_local19.offset + 1) / _local19.length) * 100);
_local19.percent = ((_local19.percent > 100)) ? 100 : Math.floor(_local19.percent);
_local19.timePlayed = _local5.timePlayed;
if (_local4.s.isSet(_local4.monitor)){
_local4.monitor(_local4.s, _local19);
};
};
if (_local5.lastTrackOffset < 0){
_local17 = "m_s";
} else {
if (_arg2 == 4){
_local17 = "m_i";
} else {
_local13 = false;
_local16 = "None";
_local15 = _local16;
_local8 = (_local4.s.isSet(_local8)) ? parseInt(("" + _local8)) : 0;
_local10 = (_local4.s.isSet(_local9)) ? _local9.split(",") : null;
if (((_local4.s.isSet(_local8)) && ((_local5.timePlayedSinseTrack >= _local8)))){
_local13 = true;
} else {
if (_local4.s.isSet(_local10)){
if (_arg3 < _local5.lastTrackOffset){
_local5.lastTrackOffset = _arg3;
} else {
_local11 = 0;
while (_local11 < _local10.length) {
_local8 = (_local4.s.isSet(_local10[_local11])) ? parseInt(("" + _local10[_local11])) : 0;
if (((((_local4.s.isSet(_local8)) && ((((_local5.lastTrackOffset + 1) / _local5.length) < (_local8 / 100))))) && ((((_arg3 + 1) / _local5.length) >= (_local8 / 100))))){
_local13 = true;
_local11 = _local10.length;
};
_local11++;
};
};
};
};
};
};
};
} else {
_local4.event(_arg1, 2, -1);
if (_local4.s.isSet(_local4.trackWhilePlaying)){
_local19.offset = _local5.lastEventOffset;
_local19.percent = (((_local19.offset + 1) / _local19.length) * 100);
_local19.percent = ((_local19.percent > 100)) ? 100 : Math.floor(_local19.percent);
_local19.timePlayed = _local5.timePlayed;
if (_local4.s.isSet(_local4.monitor)){
_local4.monitor(_local4.s, _local19);
};
};
_local4.list[_arg1] = 0;
if (_local4.s.isSet(_local5.session)){
_local18 = (_local18 + (((((("" + _local5.timePlayed) + _local12) + _local5.timestamp) + _local12) + (((_local4.s.isSet(_local4.trackWhilePlaying)) && ((_local5.lastTrackOffset >= 0)))) ? ("L" + _local5.lastTrackOffset) : "") + _local5.session));
if (_local4.s.isSet(_local4.trackWhilePlaying)){
_local16 = "None";
_local15 = _local16;
_local17 = "m_o";
} else {
_local13 = false;
_local4.s.flushBufferedRequest(_local4.s.account, _local14);
};
} else {
_local13 = false;
};
_local14 = null;
};
if (_local13){
_local4.s.track({linkTrackVars:_local15, linkTrackEvents:_local16, pe:_local17, pev3:_local18}, _local14);
if (_local4.s.isSet(_local4.trackWhilePlaying)){
_local5.timePlayedSinseTrack = 0;
_local5.lastTrackOffset = _arg3;
_local5.session = "";
};
};
};
};
}
public function listenerMedia_complete(_arg1){
this.listenerMedia.complete(_arg1);
}
public function listenerFLVPlayback_complete(_arg1){
this.listenerFLVPlayback.complete(_arg1);
}
public function variableOverridesApply(_arg1:Object){
var _local2:Object;
var _local3:String;
_local2 = this;
for (_local3 in _arg1) {
if ((((_local3 == "autoTrack")) || ((_local3 == "trackWhilePlaying")))){
if (typeof(_arg1[_local3]) == "string"){
if (_arg1[_local3].toLowerCase() == "true"){
_arg1[_local3] = true;
} else {
_arg1[_local3] = false;
};
} else {
if (typeof(_arg1[_local3]) != "boolean"){
_arg1[_local3] = false;
};
};
} else {
if (_local3 == "trackSeconds"){
if (typeof(_arg1[_local3]) == "string"){
(_arg1[_local3] == parseInt(_arg1[_local3]));
} else {
if (typeof(_arg1[_local3]) != "number"){
(_arg1[_local3] == 0);
};
};
};
};
if ((((((((typeof(_arg1[_local3]) == "string")) || ((typeof(_arg1[_local3]) == "number")))) || ((typeof(_arg1[_local3]) == "boolean")))) && ((((((((((((((_local3 == "autoTrack")) || ((_local3 == "trackWhilePlaying")))) || ((_local3 == "trackSeconds")))) || ((_local3 == "trackMilestones")))) || ((_local3 == "playerName")))) || ((_local3 == "trackVars")))) || ((_local3 == "trackEvents")))))){
_local2[_local3] = _arg1[_local3];
};
};
}
private function startMonitor(_arg1:Object){
var m:Object;
var monitorNum:Number;
var nextMonitorNum:Number;
var monitor = _arg1;
m = this;
nextMonitorNum = 0;
if (m.s.isSet(m.monitorList)){
nextMonitorNum = -1;
monitorNum = 0;
while (monitorNum < m.monitorList.length) {
if (m.s.isSet(m.monitorList[monitorNum])){
if (((((((m.s.isSet(m.monitorList[monitorNum].node)) && (m.s.isSet(monitor)))) && (m.s.isSet(monitor.node)))) && ((m.monitorList[monitorNum].node == monitor.node)))){
return;
};
} else {
if (nextMonitorNum < 0){
nextMonitorNum = monitorNum;
};
};
monitorNum = (monitorNum + 1);
};
if (nextMonitorNum < 0){
nextMonitorNum = m.monitorList.length;
};
} else {
m.monitorList = new Array();
};
monitor.update = function (_arg1:Object){
if ((((((((((((_arg1.m == null)) || ((_arg1.m == undefined)))) || ((_arg1.m.s == null)))) || ((_arg1.m.s == undefined)))) || ((_arg1.node == null)))) || ((_arg1.node == undefined)))){
clearInterval(_arg1.interval);
_arg1.m.monitorList[_arg1.num] = null;
} else {
_arg1.monitor();
};
};
monitor.interval = m.s.setupInterval(monitor, "update", 5000, monitor);
monitor.num = nextMonitorNum;
m.monitorList[monitor.num] = monitor;
}
private function _open(_arg1:String, _arg2:Number, _arg3:String, _arg4:Object){
var _local5:Object;
var _local6:Object;
var _local7:Date;
var _local8:String;
var _local9:String;
_local5 = this;
_local6 = new Object();
_local7 = new Date();
_local8 = "";
_arg1 = _local5.cleanName(_arg1);
_arg2 = Math.floor(_arg2);
if (!_local5.s.isSet(_arg2)){
_arg2 = 1;
};
if (((_local5.s.isSet(_arg1)) && (_local5.s.isSet(_arg3)))){
if (!_local5.s.isSet(_local5.list)){
_local5.list = new Object();
};
if (_local5.s.isSet(_local5.list[_arg1])){
_local5.close(_arg1);
};
if (_local5.s.isSet(_arg4)){
_local8 = ("" + _arg4);
};
for (_local9 in _local5.list) {
if (((_local5.s.isSet(_local5.list[_local9])) && ((_local5.list[_local9].playerID == _local8)))){
_local5.close(_local5.list[_local9].name);
};
};
_local6.name = _arg1;
_local6.length = _arg2;
_local6.playerName = _local5.cleanName((_local5.s.isSet(_local5.playerName)) ? _local5.playerName : _arg3);
_local6.playerID = _local8;
_local6.timePlayed = 0;
_local6.timePlayedSinseTrack = 0;
_local6.timestamp = Math.floor((_local7.getTime() / 1000));
_local6.lastEventType = 0;
_local6.lastEventTimestamp = _local6.timestamp;
_local6.lastEventOffset = 0;
_local6.session = "";
_local6.lastTrackOffset = -1;
_local5.list[_arg1] = _local6;
};
}
private function autoEvent(_arg1:String, _arg2:Number, _arg3:String, _arg4:Number, _arg5:Number, _arg6:Object){
var _local7:Object;
_local7 = this;
_arg1 = _local7.cleanName(_arg1);
if (((((_local7.s.isSet(_arg1)) && (_local7.s.isSet(_arg2)))) && (_local7.s.isSet(_arg3)))){
if (((!(_local7.s.isSet(_local7.list))) || (!(_local7.s.isSet(_local7.list[_arg1]))))){
_local7.open(_arg1, _arg2, _arg3, _arg6);
};
_local7.event(_arg1, _arg4, _arg5);
};
}
public function play(_arg1:String, _arg2:Number){
var m:Object;
var media:Object;
var monitor:Object;
var name = _arg1;
var offset = _arg2;
m = this;
m.event(name, 1, offset);
monitor = new Object();
monitor.m = m;
monitor.node = m.cleanName(name);
monitor.monitor = function (){
var _local1:Object;
var _local2:Object;
var _local3:Object;
_local1 = this.m;
_local2 = this.node;
_local3 = (((((_local1.s.isSet(_local2)) && (_local1.s.isSet(_local1.list)))) && (_local1.s.isSet(_local1.list[_local2])))) ? _local1.list[_local2] : null;
if (_local1.s.isSet(_local3)){
if (_local3.lastEventType == 1){
_local1.event(_local3.name, 3, -1);
};
} else {
this.node = null;
};
};
m.startMonitor(monitor);
}
public function set autoTrack(_arg1:Boolean){
this._autoTrack = _arg1;
if (this._autoTrack){
this.autoTrackInterval = this.s.setupInterval(this, "doAutoTrack", 100, null);
};
}
public function listenerFLVPlayback_stateChange(_arg1){
this.listenerFLVPlayback.stateChange(_arg1);
}
public function listenerBrightcove_videoStart(_arg1){
this.listenerBrightcove.videoStart(_arg1);
}
public function listenerMedia_change(_arg1){
this.listenerMedia.change(_arg1);
}
private function attach(_arg1:Object):Boolean{
var m:Object;
var member:String;
var childNum:Number;
var player:Object;
var monitor:Object;
var attached:Boolean;
var subAttached:Boolean;
var node = _arg1;
m = this;
attached = false;
if (m.s.isSet(node)){
if (((m.s.isSet(node, "getModule")) || (m.s.isSet(node, "showBrightcoveMenu")))){
player = node;
if ((((m.s.flashASVersion > 2)) && (m.s.isSet(node, "getModule")))){
player = node.getModule("experience");
if (((((m.s.isSet(player)) && (m.s.isSet(player, "getReady")))) && (player.getReady()))){
player = node.getModule("videoPlayer");
} else {
player = undefined;
};
};
if (((s.isSet(player)) && (s.isSet(player, "addEventListener")))){
if (!m.s.isSet(m.listenerBrightcove)){
m.listenerBrightcove = new Object();
m.listenerBrightcove.m = m;
m.listenerBrightcove.playerName = "Brightcove";
if (m.s.flashASVersion > 2){
m.listenerBrightcove.playerName = (m.listenerBrightcove.playerName + " 3");
} else {
m.listenerBrightcove.playerName = (m.listenerBrightcove.playerName + " 2");
};
m.listenerBrightcove.handleEvent = function (_arg1:Object, _arg2:Number, _arg3:Number){
var _local4:Object;
var _local5:String;
var _local6:Number;
var _local7:Object;
_local4 = this.m;
if (((_local4.s.isSet(_local4.autoTrack)) && (_local4.s.isSet(_arg1)))){
if (_local4.s.flashASVersion > 2){
_local7 = _arg1.getCurrentVideo();
} else {
_local7 = _arg1.getCurrentTitle();
};
if (((_local4.s.isSet(_local7)) && (_local4.s.isSet(_local7.id)))){
_local5 = ((this.playerName + ":") + _local7.id);
_local6 = (_local7.length / 1000);
if (_arg3 < 0){
_arg3 = _arg1.getVideoPosition();
};
if (!_local4.s.isSet(_arg3)){
_arg3 = 0;
};
_local4.autoEvent(_local5, _local6, this.playerName, _arg2, _arg3, _arg1);
};
};
};
m.listenerBrightcove.videoProgress = (m.listenerBrightcove.videoStart = (m.listenerBrightcove.progress = (m.listenerBrightcove.play = function (_arg1){
if (((((((this.m.s.isSet(_arg1)) && (this.m.s.isSet(_arg1.target)))) && (this.m.s.isSet(_arg1.target.isPlaying)))) && (_arg1.target.isPlaying()))){
this.handleEvent(_arg1.target, 1, ((typeof(_arg1.position) == "number")) ? _arg1.position : -1);
};
})));
m.listenerBrightcove.videoStop = (m.listenerBrightcove.startBuffering = (m.listenerBrightcove.pause = (m.listenerBrightcove.buffering = (m.listenerBrightcove.scrubber = (m.listenerBrightcove.seek = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 2, -1);
};
})))));
m.listenerBrightcove.videoComplete = (m.listenerBrightcove.mediaComplete = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 0, -1);
};
});
};
if (m.s.flashASVersion > 2){
player.addEventListener("videoProgress", m.listenerBrightcove_videoProgress);
player.addEventListener("videoStart", m.listenerBrightcove_videoStart);
player.addEventListener("videoStop", m.listenerBrightcove_videoStop);
player.addEventListener("startBuffering", m.listenerBrightcove_startBuffering);
player.addEventListener("seek", m.listenerBrightcove_seek);
player.addEventListener("videoComplete", m.listenerBrightcove_videoComplete);
} else {
player.addEventListener("progress", m.listenerBrightcove, "progress");
player.addEventListener("play", m.listenerBrightcove, "play");
player.addEventListener("pause", m.listenerBrightcove, "pause");
player.addEventListener("buffering", m.listenerBrightcove, "buffering");
player.addEventListener("scrubber", m.listenerBrightcove, "scrubber");
player.addEventListener("seek", m.listenerBrightcove, "seek");
player.addEventListener("mediaComplete", m.listenerBrightcove, "mediaComplete");
};
monitor = new Object();
monitor.m = m;
monitor.node = player;
monitor.monitor = function (){
var _local1:Object;
var _local2:Object;
_local1 = this.m;
_local2 = this.node;
if (((_local1.s.isSet(_local2.isPlaying)) && (_local2.isPlaying()))){
this.m.listenerBrightcove.handleEvent(_local2, 3, -1);
};
};
m.startMonitor(monitor);
attached = true;
return (attached);
};
};
if (((((((((0) && (m.s.isSet(node, "flvVideo")))) && (m.s.isSet(node.flvVideo, "mBandwidthDetector")))) && (m.s.isSet(node.flvVideo.mBandwidthDetector, "mVideoPlayer")))) && (m.s.isSet(node.flvVideo.mBandwidthDetector.mVideoPlayer, "addEventListener")))){
node = node.flvVideo.mBandwidthDetector.mVideoPlayer;
if (!m.s.isSet(m.listenerMaven)){
m.listenerMaven = new Object();
m.listenerMaven.m = m;
m.listenerMaven.playerName = "Maven Networks";
m.listenerMaven.handleEvent = function (_arg1:Object, _arg2:Number){
var _local3:Object;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local3 = this.m;
if (((_local3.s.isSet(_local3.autoTrack)) && (_local3.s.isSet(_arg1)))){
if (_local3.s.flashASVersion > 2){
_local4 = _arg1.source;
} else {
_local4 = _arg1.contentPath;
};
_local5 = _arg1.totalTime;
_local6 = _arg1.playheadTime;
_local3.autoEvent(_local4, _local5, this.playerName, _arg2, _local6, _arg1);
};
};
m.listenerMaven.stateChange = function (_arg1){
var _local2:Object;
var _local3:Number;
var _local4:Object;
_local2 = this.m;
_local3 = -1;
if (((_local2.s.isSet(_arg1)) && (_local2.s.isSet(_arg1.target)))){
_local4 = _arg1.target;
if (_local2.s.isSet(_local4, "state")){
if (_local4.state == "playing"){
_local3 = 1;
} else {
if ((((((((((_local4.state == "stopped")) || ((_local4.state == "paused")))) || ((_local4.state == "buffering")))) || ((_local4.state == "rewinding")))) || ((_local4.state == "seeking")))){
_local3 = 2;
};
};
if (_local3 >= 0){
this.handleEvent(_arg1.target, _local3);
};
};
};
};
m.listenerMaven.complete = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 0);
};
};
};
if (m.s.flashASVersion > 2){
node.addEventListener("complete", m.listenerMaven_complete);
node.addEventListener("stateChange", m.listenerMaven_stateChange);
} else {
node.addEventListener("complete", m.listenerMaven);
node.addEventListener("stateChange", m.listenerMaven);
};
monitor = new Object();
monitor.m = m;
monitor.node = node;
monitor.monitor = function (){
var _local1:Object;
var _local2:Object;
_local1 = this.m;
_local2 = this.node;
if (((_local1.s.isSet(_local2.state)) && ((_local2.state == "playing")))){
this.m.listenerMaven.handleEvent(_local2, 3);
};
};
m.startMonitor(monitor);
attached = true;
return (attached);
};
if (((m.s.isSet(node, "addEventListener")) && (m.s.isSet(node, "isFLVCuePointEnabled")))){
if (!m.s.isSet(m.listenerFLVPlayback)){
m.listenerFLVPlayback = new Object();
m.listenerFLVPlayback.m = m;
m.listenerFLVPlayback.playerName = "Flash FLVPlayback";
m.listenerFLVPlayback.handleEvent = function (_arg1:Object, _arg2:Number){
var _local3:Object;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local3 = this.m;
if (((_local3.s.isSet(_local3.autoTrack)) && (_local3.s.isSet(_arg1)))){
if (_local3.s.flashASVersion > 2){
_local4 = _arg1.source;
} else {
_local4 = _arg1.contentPath;
};
_local5 = _arg1.totalTime;
_local6 = _arg1.playheadTime;
_local3.autoEvent(_local4, _local5, this.playerName, _arg2, _local6, _arg1);
};
};
m.listenerFLVPlayback.stateChange = function (_arg1){
var _local2:Object;
var _local3:Number;
var _local4:Object;
_local2 = this.m;
_local3 = -1;
if (((_local2.s.isSet(_arg1)) && (_local2.s.isSet(_arg1.target)))){
_local4 = _arg1.target;
if (_local2.s.isSet(_local4, "state")){
if (_local4.state == "playing"){
_local3 = 1;
} else {
if ((((((((((_local4.state == "stopped")) || ((_local4.state == "paused")))) || ((_local4.state == "buffering")))) || ((_local4.state == "rewinding")))) || ((_local4.state == "seeking")))){
_local3 = 2;
};
};
if (_local3 >= 0){
this.handleEvent(_arg1.target, _local3);
};
};
};
};
m.listenerFLVPlayback.complete = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 0);
};
};
};
if (m.s.flashASVersion > 2){
node.addEventListener("complete", m.listenerFLVPlayback_complete);
node.addEventListener("stateChange", m.listenerFLVPlayback_stateChange);
} else {
node.addEventListener("complete", m.listenerFLVPlayback);
node.addEventListener("stateChange", m.listenerFLVPlayback);
};
monitor = new Object();
monitor.m = m;
monitor.node = node;
monitor.monitor = function (){
var _local1:Object;
var _local2:Object;
_local1 = this.m;
_local2 = this.node;
if (((_local1.s.isSet(_local2.state)) && ((_local2.state == "playing")))){
this.m.listenerFLVPlayback.handleEvent(_local2, 3);
};
};
m.startMonitor(monitor);
attached = true;
return (attached);
};
if (((m.s.isSet(node, "addEventListener")) && (m.s.isSet(node, "addCuePoint")))){
if (!m.s.isSet(m.listenerMedia)){
m.listenerMedia = new Object();
m.listenerMedia.m = m;
m.listenerMedia.playerName = "Flash Media";
m.listenerMedia.handleEvent = function (_arg1:Object, _arg2:Number){
var _local3:Object;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local3 = this.m;
if (((_local3.s.isSet(_local3.autoTrack)) && (_local3.s.isSet(_arg1)))){
_local4 = _arg1.contentPath;
_local5 = _arg1.totalTime;
_local6 = _arg1.playheadTime;
_local3.autoEvent(_local4, _local5, this.playerName, _arg2, _local6, _arg1);
};
};
m.listenerMedia.complete = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 0);
};
};
m.listenerMedia.click = function (_arg1){
if (((this.m.s.isSet(_arg1)) && (this.m.s.isSet(_arg1.target)))){
this.handleEvent(_arg1.target, (this.m.s.isSet(_arg1.target.playing)) ? 1 : 2);
};
};
m.listenerMedia.change = function (_arg1){
if (((this.m.s.isSet(_arg1)) && (this.m.s.isSet(_arg1.target)))){
this.handleEvent(_arg1.target, (this.m.s.isSet(_arg1.target.playing)) ? 1 : 2);
};
};
m.listenerMedia.scrubbing = function (_arg1){
if (this.m.s.isSet(_arg1)){
this.handleEvent(_arg1.target, 2);
};
};
};
if (m.s.flashASVersion > 2){
node.addEventListener("complete", m.listenerMedia_complete);
node.addEventListener("click", m.listenerMedia_click);
node.addEventListener("change", m.listenerMedia_change);
node.addEventListener("scrubbing", m.listenerMedia_scrubbing);
} else {
node.addEventListener("complete", m.listenerMedia);
node.addEventListener("click", m.listenerMedia);
node.addEventListener("change", m.listenerMedia);
node.addEventListener("scrubbing", m.listenerMedia);
};
monitor = new Object();
monitor.m = m;
monitor.node = node;
monitor.monitor = function (){
var _local1:Object;
var _local2:Object;
_local1 = this.m;
_local2 = this.node;
if (_local1.s.isSet(_local2.playing)){
this.m.listenerMedia.handleEvent(_local2, 3);
};
};
m.startMonitor(monitor);
attached = true;
return (attached);
};
if (m.s.flashASVersion > 2){
if (((m.s.isSet(node, "numChildren")) && (m.s.isSet(node, "getChildAt")))){
childNum = 0;
while (childNum < node.numChildren) {
subAttached = m.attach(node.getChildAt(childNum));
if (m.s.isSet(subAttached)){
attached = subAttached;
};
childNum = (childNum + 1);
};
};
} else {
for (member in node) {
if (((((((m.s.isSet(node[member])) && (m.s.isSet(node[member]._name)))) && ((node[member]._name == member)))) && ((((("" + node) + ".") + member) == ("" + node[member]))))){
subAttached = m.attach(node[member]);
if (m.s.isSet(subAttached)){
attached = subAttached;
};
};
};
};
};
return (attached);
}
public function listenerBrightcove_videoStop(_arg1){
this.listenerBrightcove.videoStop(_arg1);
}
public function open(_arg1:String, _arg2:Number, _arg3:String, _arg4:Object=null){
this._open(_arg1, _arg2, _arg3, _arg4);
}
public function track(_arg1:String){
var _local2:Object;
_local2 = this;
if (_local2.s.isSet(_local2.trackWhilePlaying)){
_local2.event(_arg1, 4, -1);
};
}
public function get autoTrack():Boolean{
return (this._autoTrack);
}
public function listenerBrightcove_videoProgress(_arg1){
this.listenerBrightcove.videoProgress(_arg1);
}
private function cleanName(_arg1:String):String{
var _local2:Object;
_local2 = this;
return (_local2.s.replace(_local2.s.replace(_local2.s.replace(_arg1, "\n", ""), "\r", ""), "--**--", ""));
}
public function listenerBrightcove_startBuffering(_arg1){
this.listenerBrightcove.startBuffering(_arg1);
}
public function close(_arg1:String){
this.event(_arg1, 0, -1);
}
public function listenerBrightcove_videoComplete(_arg1){
this.listenerBrightcove.videoComplete(_arg1);
}
}
}//package com.omniture
Section 4
//ActionSource_XML (com.omniture.ActionSource_XML)
package com.omniture {
import flash.events.*;
import flash.net.*;
public dynamic class ActionSource_XML {
public var data:Object;
public var loaded:Boolean;// = true
public var onDataReady:String;// = ""
private var _url:String;
private var loader:URLLoader;
public function ActionSource_XML(_arg1:Object){
loaded = true;
onDataReady = "";
super();
this.s = _arg1;
this.loader = new URLLoader();
this.loader.addEventListener(Event.COMPLETE, this.onComplete);
}
private function handleNode(_arg1:XML, _arg2:Object){
var _local3:String;
var _local4:XMLList;
var _local5:Number;
_local3 = _arg1.name();
if (((this.s.isSet(_local3)) && ((_arg1.nodeKind() == "element")))){
_local4 = _arg1.children();
if (((this.s.isSet(_local4)) && ((_local4.length() > 0)))){
if (_local4[0].nodeKind() == "text"){
_arg2[_local3] = ("" + _local4[0]);
} else {
_arg2[_local3] = new Object();
_local5 = 0;
while (_local5 < _local4.length()) {
this.handleNode(_local4[_local5], _arg2[_local3]);
_local5++;
};
};
};
};
}
public function get url():String{
return (this._url);
}
private function loadXML(){
this.loaded = false;
this.loader.load(new URLRequest(this._url));
}
private function onComplete(_arg1:Event){
var _local2:Object;
var _local3:XML;
_local2 = XML.settings();
XML.ignoreWhitespace = true;
XML.ignoreProcessingInstructions = true;
XML.ignoreComments = true;
_local3 = new XML(this.loader.data);
this.data = new Object();
if ((((_local3.name() == "config")) && ((_local3.nodeKind() == "element")))){
this.handleNode(_local3, this.data);
};
XML.setSettings(_local2);
if (this.s.isSet(this.onDataReady)){
var _local4 = this.s;
_local4[onDataReady](this.data);
};
this.loaded = true;
}
public function set url(_arg1:String){
this._url = _arg1;
if (this.s.isSet(this._url)){
this.loadXML();
};
}
}
}//package com.omniture
Section 5
//ArtMain (debtgame.art.ArtMain)
package debtgame.art {
import flash.display.*;
import debtgame.view.*;
import flash.system.*;
public class ArtMain extends MovieClip {
public var mc:MovieClip;
public function ArtMain(){
Security.allowDomain("*");
}
public function newPlaxBackClip():PlaxBackClip{
return (new PlaxBackClip());
}
public function newPixPlatformClip():ItemPixPlatform{
return (new ItemPixPlatform());
}
public function newItemClip():ItemClip{
return (new ItemClip());
}
public function newTsunamiClip():tsunamiClip{
return (new tsunamiClip());
}
public function newPlaxMiddleClip():PlaxMiddleClip{
return (new PlaxMiddleClip());
}
public function newPlaxSFrontClip():PlaxSFrontClip{
return (new PlaxSFrontClip());
}
public function newGoalClip():GoalClip{
return (new GoalClip());
}
public function newPlaxFrontClip():PlaxFrontClip{
return (new PlaxFrontClip());
}
}
}//package debtgame.art
Section 6
//bollaClip (debtgame.art.bollaClip)
package debtgame.art {
import flash.display.*;
public class bollaClip extends MovieClip {
public function bollaClip(){
trace("bolla");
}
}
}//package debtgame.art
Section 7
//PlaxBackClip (debtgame.art.PlaxBackClip)
package debtgame.art {
import flash.display.*;
public class PlaxBackClip extends MovieClip {
}
}//package debtgame.art
Section 8
//PlaxFrontClip (debtgame.art.PlaxFrontClip)
package debtgame.art {
import flash.display.*;
public class PlaxFrontClip extends MovieClip {
}
}//package debtgame.art
Section 9
//PlaxMiddleClip (debtgame.art.PlaxMiddleClip)
package debtgame.art {
import flash.display.*;
public class PlaxMiddleClip extends MovieClip {
}
}//package debtgame.art
Section 10
//PlaxSFrontClip (debtgame.art.PlaxSFrontClip)
package debtgame.art {
import flash.display.*;
public class PlaxSFrontClip extends MovieClip {
public var mc:MovieClip;
}
}//package debtgame.art
Section 11
//SkyClip (debtgame.art.SkyClip)
package debtgame.art {
import flash.display.*;
public class SkyClip extends MovieClip {
}
}//package debtgame.art
Section 12
//tsunamiClip (debtgame.art.tsunamiClip)
package debtgame.art {
import flash.display.*;
public class tsunamiClip extends MovieClip {
public function tsunamiClip(){
trace("tsinama");
}
}
}//package debtgame.art
Section 13
//GameControl (debtgame.control.GameControl)
package debtgame.control {
import flash.events.*;
import debtgame.model.*;
import debtgame.view.*;
import halowitz.framework.math.*;
import debtgame.editor.*;
import flash.net.*;
import flash.utils.*;
public class GameControl {
public var game:Main;
private var lastTime:Number;
public var left:Boolean;// = false
private var input:GameInput;
public var right:Boolean;// = false
public var pan:Boolean;// = true
private var view:GameView;
private var model:GameModel;
public var paused:Boolean;// = true
private var tutSpeed:Number;// = 0
private var stepTime:Number;// = 0
private var updateTimer:Timer;
public static const ACTION_STOP_MOVE_LEFT:String = "-moveLeft";
public static const ACTION_STOP_JUMP:String = "-jump";
public static const ACTION_STOP_MOVE_RIGHT:String = "-moveRight";
public static const ACTION_START_MOVE_RIGHT:String = "+moveRight";
public static const ACTION_START_MOVE_LEFT:String = "+moveLeft";
public static const ACTION_START_JUMP:String = "+jump";
public function GameControl(_arg1:GameModel, _arg2:GameView, _arg3:GameInput, _arg4:Main){
this.model = _arg1;
this.game = _arg4;
this.view = _arg2;
this.input = _arg3;
Main.HAPPINESS = 15;
_arg3.setMapping(ACTION_START_JUMP, startJump);
_arg3.setMapping(ACTION_STOP_JUMP, stopJump);
_arg3.setMapping(ACTION_START_MOVE_LEFT, startMoveLeft);
_arg3.setMapping(ACTION_STOP_MOVE_LEFT, stopMoveLeft);
_arg3.setMapping(ACTION_START_MOVE_RIGHT, startMoveRight);
_arg3.setMapping(ACTION_STOP_MOVE_RIGHT, stopMoveRight);
updateTimer = new Timer(Main.CVARS.UPDATE_TICK, 0);
updateTimer.addEventListener(TimerEvent.TIMER, handleTick);
}
private function airTravel(_arg1:Object, _arg2:Number):void{
var _local7:Point2D;
_arg1.yVel = (_arg1.yVel - (Main.CVARS.GRAVITY * _arg2));
view.avatarClip.burbujas.visible = false;
var _local3:Number = (_arg1.x + _arg1.dist);
var _local4:Number = (_arg1.y + _arg1.yVel);
var _local5:Line2D = new Line2D(new Point2D(_arg1.x, _arg1.y), new Point2D(_local3, _local4));
var _local6:Platform = findPlat(_arg1.x, _local3, _arg1.y, _local4);
if (_local6 != null){
view.avatarClip.bur.visible = true;
_local7 = platHitTest(_local6, _local5);
if (_local7 != null){
_local5.p1 = _local7;
};
} else {
if (_arg1.yVel > 0){
view.avatarClip.shoulrotation = -30;
} else {
view.avatarClip.shoulrotation = 25;
};
};
_arg1.dist = (_local3 - _local5.p1.x);
_local3 = _local5.p1.x;
_local4 = _local5.p1.y;
_arg1.platform = _local6;
_arg1.x = _local3;
_arg1.y = _local4;
}
private function findPlat(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Platform{
var _local7:Platform;
var _local8:Number;
var _local9:Number;
var _local5:Number = _arg4;
var _local6:Platform;
for each (_local7 in model.platforms) {
if (_arg2 > _local7.line.p1.x){
continue;
} else {
if (_arg2 < _local7.line.p0.x){
continue;
};
};
_local8 = _local7.heightAt(_arg1);
_local9 = _local7.heightAt(_arg2);
if ((((((_arg3 > _local8)) && ((_arg4 < _local9)))) && ((_local9 > _local5)))){
_local5 = _local9;
_local6 = _local7;
};
};
return (_local6);
}
private function update(_arg1:Number):void{
stepTime = (stepTime + _arg1);
var _local2:Number = Main.CVARS.UPDATE_TICK;
while (stepTime > _local2) {
stepTime = (stepTime - _local2);
step(_local2);
};
}
private function stopMoveRight():void{
if (paused != true){
Main.SoundM.playSound("Noro", 1);
right = false;
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
if (left == true){
Main.SoundM.playSound("Bras", 1000);
} else {
if (right == true){
Main.SoundM.playSound("Fasts", 1000);
} else {
Main.SoundM.playSound("Nors", 1000);
};
};
};
}
private function step(_arg1:Number):void{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Point2D;
var _local6:Number;
var _local7:Number;
var _local8:Item;
var _local9:Number;
var _local10:Array;
var _local11:Object;
if (view.avatarClip.shoulrotation < view.avatarClip.rotation){
view.avatarClip.rotation = (view.avatarClip.rotation - (Math.sqrt(Math.pow((view.avatarClip.shoulrotation - view.avatarClip.rotation), 2)) / 10));
} else {
view.avatarClip.rotation = (view.avatarClip.rotation + (Math.sqrt(Math.pow((view.avatarClip.shoulrotation - view.avatarClip.rotation), 2)) / 20));
};
if (model.avatarPos.x > model.level.goal.x){
model.level.goal.x = (model.level.goal.x + 1000);
stopGame();
model.levelNum++;
view.pushSummaryScreen();
} else {
Main.interfaceScreen.updateMeter(model.avatarPos.x, model.level.goal.x);
};
model.avatarMovement = (model.avatarMovement + 4);
if (pan == false){
if ((((view.introScreen == null)) && ((game.tutorialScreen2 == null)))){
Main.interfaceScreen.b_pause.visible = true;
} else {
Main.interfaceScreen.b_pause.visible = false;
};
if (model.inputVel.x < 7){
_local7 = (((model.level.scrollSpeed + Math.max((-(model.level.scrollSpeed) + model.inputVel.x), (model.inputVel.x * 1))) + tutSpeed) * _arg1);
} else {
_local7 = (((model.level.scrollSpeed + Math.max((-(model.level.scrollSpeed) + model.inputVel.x), (model.inputVel.x * 1))) + tutSpeed) * _arg1);
};
model.stageOffset = (model.stageOffset + _local7);
model.water.move(_local7, 0);
input.checkInput();
_local2 = new Object();
_local2.x = model.avatarPos.x;
_local2.y = model.avatarPos.y;
_local2.xVel = ((model.level.scrollSpeed + tutSpeed) + model.inputVel.x);
_local2.yVel = model.avatarVel.y;
_local2.dist = (_local2.xVel * _arg1);
_local2.platform = model.avatarSurface;
do {
travel(_local2, _arg1);
} while (_local2.dist > 0);
_local3 = (model.stageOffset + 100);
_local4 = ((model.stageOffset + Main.CVARS.STAGE_WIDTH) - 200);
_local2.x = Math.max(_local3, _local2.x);
_local2.x = Math.min(_local4, _local2.x);
model.avatarPos.x = _local2.x;
model.avatarPos.y = _local2.y;
model.avatarVel.y = _local2.yVel;
model.avatarSurface = _local2.platform;
model.magnetPos.x = (model.avatarPos.x + Main.CVARS.ITEM_MAGNET.x);
model.magnetPos.y = (model.avatarPos.y + Main.CVARS.ITEM_MAGNET.y);
_local5 = new Point2D(model.magnetPos.x, model.magnetPos.y);
_local6 = (Main.CVARS.ITEM_MAGNET.radius * Main.CVARS.ITEM_MAGNET.radius);
if (model.tutorial != true){
if (((((view.mtsunami.hitTestPoint(view.avatarClip.x, view.avatarClip.y, true)) && ((view.itemTsunami.isActive == true)))) && ((view.itemTsunami.collected == false)))){
view.avatarClip.pig.gotoAndPlay("curious");
Main.SoundM.playSound("Tsu", 1);
view.itemTsunami.collected = true;
view.control.stopGame();
view.addTsunamiScreen();
};
for each (_local8 in model.level.items) {
if (_local8.collected){
} else {
_local9 = Point2D.distance2(_local8.pos, _local5);
if (_local9 <= _local6){
_local8.collected = true;
trace((("Collected '" + _local8.type) + "' item."));
_local10 = Main.CVARS.ITEM_EFFECTS[_local8.type];
for each (_local11 in _local10) {
model.values[_local11.target] = (model.values[_local11.target] + _local11.modifier);
};
if (_local8.type != "coin"){
view.avatarClip.pig.gotoAndPlay("upset");
Main.cashModel.spendingLevel.push({name:_local8.type, cost:Math.abs(Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier), hap:Math.abs(Main.CVARS.ITEM_EFFECTS[_local8.type][0].modifier)});
trace("Will Spend on this level:", _local8.type, Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier);
Main.SPEND_LEVEL = (Main.SPEND_LEVEL - Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier);
Main.HAPPINESS = (Main.HAPPINESS + Main.CVARS.ITEM_EFFECTS[_local8.type][0].modifier);
Main.NECESSITIES = (Main.NECESSITIES + Main.CVARS.ITEM_EFFECTS[_local8.type][2].necessities);
if (Main.CVARS.ITEM_EFFECTS[_local8.type][2].necessities != 0){
Main.SoundM.playSound("Nec", 1);
} else {
if (int(Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier) < 500){
Main.SoundM.playSound("Toc", 1);
} else {
Main.SoundM.playSound("Toc2", 1);
};
};
} else {
Main.SoundM.playSound("Coin", 1);
trace("is a coin for:", Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier);
Main.SAVING_LEVEL = (Main.SAVING_LEVEL + Main.CVARS.ITEM_EFFECTS[_local8.type][1].modifier);
};
Main.interfaceScreen.txt_cash.text = ("$" + Main.SAVING_LEVEL);
Main.interfaceScreen.txt_debt.text = ("$" + Main.SPEND_LEVEL);
Main.interfaceScreen.txt_happiness.text = (Main.HAPPINESS + "%");
Main.interfaceScreen.txt_necessities.text = ("" + Main.NECESSITIES);
if (Main.cashModel.getTotalAux() >= Main.cashModel.getTotalCreditAux()){
Main.interfaceScreen.txt_score.text = String(int(((Main.cashModel.getTotalAux() - Main.cashModel.getTotalCreditAux()) * Main.HAPPINESS)));
} else {
Main.interfaceScreen.txt_score.text = String(int(((Main.cashModel.getTotalAux() - Main.cashModel.getTotalCreditAux()) / Main.HAPPINESS)));
};
Main.SCORE = parseFloat(Main.interfaceScreen.txt_score.text);
trace("SAVINGS:", Main.SAVING_LEVEL);
trace("SPENDING:", Main.SPEND_LEVEL);
trace("HAPPINESS %:", Main.HAPPINESS);
Main.interfaceScreen.updateNec();
};
};
};
};
view.avatarClip.visible = true;
} else {
Main.interfaceScreen.b_pause.visible = false;
Main.interfaceScreen.updateNec();
if (model.stageOffset < (model.level.goal.x - 400)){
_local7 = 20;
view.avatarClip.visible = false;
model.stageOffset = (model.stageOffset + _local7);
model.avatarPos.x = (model.avatarPos.x + _local7);
} else {
trace("LO PONGO N TRUE");
view.canvas.visible = true;
view.pushIntroScreen();
model.avatarPos.x = 200;
pan = false;
view.removePreview();
model.stageOffset = 0;
};
};
view.update(_arg1);
if ((((model.levelNum == 0)) && ((model.tutorial == true)))){
stopGame();
};
}
private function stopJump():void{
}
private function platHitTest(_arg1:Platform, _arg2:Line2D):Point2D{
var _local3:Point2D = Line2D.intersection(_arg1.line, _arg2);
if (((((!((_local3 == null))) && ((_local3.x == _arg1.line.p1.x)))) && ((_local3.y == _arg1.line.p1.y)))){
return (null);
};
return (_local3);
}
private function startMoveRight():void{
if (paused != true){
if (right == false){
Main.SoundM.playSound("Fasto", 1);
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
Main.SoundM.playSound("Fasts", 1000);
};
right = true;
if (model.avatarSurface != null){
view.avatarClip.pig.gotoAndPlay("fierce");
model.inputVel.x = Main.CVARS.MOVE_SPEEDS[Math.max(0, 0)];
} else {
model.inputVel.x = Main.CVARS.AIR_SPEEDS[Math.max(0, 0)];
};
};
}
private function travel(_arg1:Object, _arg2:Number):void{
if (_arg1.platform == null){
airTravel(_arg1, _arg2);
view.avatarClip.pig.y = -113;
view.avatarClip.jet.y = -83;
view.avatarClip.burbujas.visible = false;
} else {
if (Math.abs((_arg1.platform.line.p0.x - _arg1.platform.line.p1.x)) < 800){
model.avatarMovement = 0;
};
landTravel(_arg1, _arg2);
view.avatarClip.burbujas.visible = true;
view.avatarClip.pig.y = (-113 + (Math.sin(((model.avatarMovement / 180) * Math.PI)) * 4));
view.avatarClip.jet.y = (-83 + (Math.sin(((model.avatarMovement / 180) * Math.PI)) * 4));
};
model.inputVel.x = (model.inputVel.x * 0.98);
}
public function stopGame():void{
Main.running = false;
updateTimer.stop();
paused = true;
}
private function findLeft(_arg1:Point2D):Platform{
var _local2:Platform;
for each (_local2 in model.platforms) {
if ((((_local2.line.p0.x == _arg1.x)) && ((_local2.line.p0.y == _arg1.y)))){
return (_local2);
};
};
return (null);
}
private function stopMoveLeft():void{
if (paused != true){
left = false;
Main.SoundM.playSound("Noro", 1);
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
if (left == true){
Main.SoundM.playSound("Bras", 1000);
} else {
if (right == true){
Main.SoundM.playSound("Fasts", 1000);
} else {
Main.SoundM.playSound("Nors", 1000);
};
};
};
}
private function startMoveLeft():void{
if (paused != true){
if (left == false){
Main.SoundM.playSound("Brao", 1);
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
Main.SoundM.playSound("Bras", 1000);
};
left = true;
if (model.inputVel.x > (-(model.level.scrollSpeed) * 0.9)){
model.inputVel.x = (model.inputVel.x - (Math.max(0, (Main.ENGINE_STAGE + 2)) / 300));
};
};
}
private function findRight(_arg1:Point2D):Platform{
var _local2:Platform;
for each (_local2 in model.platforms) {
if ((((_local2.line.p1.x == _arg1.x)) && ((_local2.line.p1.y == _arg1.y)))){
return (_local2);
};
};
return (null);
}
private function handleLoadXML(_arg1:Event):void{
var _local2:XML = new XML(_arg1.target.data);
model.level = Level.fromXML(_local2);
model.initLevel();
view.initLevel();
game.removeLoading();
startGame();
}
private function landTravel(_arg1:Object, _arg2:Number):void{
var _local3:Platform = _arg1.platform;
var _local4:Number = (_arg1.x + _arg1.dist);
var _local5:Number = _local3.heightAt(_local4);
var _local6:Platform = findPlat(_arg1.x, _local4, _arg1.y, _local5);
if (_local6 != null){
_local5 = _local6.heightAt(_local4);
_local3 = _local6;
_arg1.platform = _local3;
};
if (_local3.line.direction().y != 0){
view.avatarClip.shoulrotation = -15;
} else {
view.avatarClip.shoulrotation = 5;
};
if (_local4 > (_local3.line.p1.x + 60)){
_arg1.dist = ((_local4 - _local3.line.p1.x) - 60);
_arg1.yVel = _local3.slope();
_local4 = (_local3.line.p1.x + 60);
_local5 = _local3.line.p1.y;
if (_local3.line.direction().y != 0){
_local5 = (_local3.line.p1.y + 30);
trace("PEPEPEPE");
view.avatarClip.pig.gotoAndPlay("surprised");
_arg1.yVel = 5;
model.avatarVel.y = Main.CVARS.JUMP_SPEEDS[model.jumpLevel];
model.avatarPos.y = (model.avatarPos.y + 1);
model.avatarSurface = null;
_arg1.platform = null;
} else {
_arg1.platform = findLeft(new Point2D((_local4 - 60), _local5));
};
} else {
if (_local4 < (_local3.line.p0.x - 60)){
_arg1.dist = (_local4 - _local3.line.p0.x);
_arg1.yVel = -(_local3.slope());
_local4 = (_local3.line.p0.x - 60);
_local5 = _local3.line.p0.y;
_arg1.platform = findRight(new Point2D(_local4, _local5));
};
};
_arg1.x = _local4;
_arg1.y = _local5;
_arg1.dist = 0;
}
private function startJump():void{
if (model.avatarSurface != null){
if (Main.JUMP_STAGE != -1){
model.avatarVel.y = Main.CVARS.JUMP_SPEEDS[Math.max(0, Main.JUMP_STAGE)];
} else {
model.avatarVel.y = 5.8;
};
model.avatarPos.y = (model.avatarPos.y + 1);
model.avatarSurface = null;
};
}
public function startGame():void{
stepTime = 0;
Main.running = true;
lastTime = getTimer();
updateTimer.start();
paused = false;
}
private function handleTick(_arg1:TimerEvent):void{
var _local2:Number = getTimer();
var _local3:Number = (_local2 - lastTime);
lastTime = _local2;
update(_local3);
}
public function loadLevel(_arg1:Number):void{
var _local2:String = Main.CVARS.LEVELS[_arg1];
var _local3:URLLoader = new URLLoader();
_local3.addEventListener(Event.COMPLETE, handleLoadXML);
_local3.load(new URLRequest((Main.CVARS.URL_BASE + _local2)));
game.pushLoading();
if (model.tutorial == true){
view.avatarClip.visible = false;
Main.SoundM.stopSound("Idl");
Main.SoundM.playSound("Idl", 1000);
} else {
view.avatarClip.visible = true;
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
Main.SoundM.stopSound("Idl");
Main.SoundM.playSound("Idl", 1000);
};
Main.interfaceScreen.txt_needed.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities;
pan = true;
if (view.preview == null){
view.pushPreview();
};
if (_arg1 == 0){
Main.interfaceScreen.txt_happiness.text = (Main.HAPPINESS + "%");
};
view.canvas.visible = true;
Main.interfaceScreen.updateNec();
}
}
}//package debtgame.control
Section 14
//GameInput (debtgame.control.GameInput)
package debtgame.control {
import debtgame.view.*;
import flash.ui.*;
public class GameInput {
private var view:GameView;
private var rightPressed:Boolean;// = false
private var inputQueue:Array;
private var inputFunctions:Object;
private var leftPressed:Boolean;// = false
private var spacePressed:Boolean;// = false
public function GameInput(_arg1:GameView){
this.view = _arg1;
inputQueue = new Array();
inputFunctions = new Object();
}
public function setMapping(_arg1:String, _arg2:Function):void{
inputFunctions[_arg1] = _arg2;
}
public function onKeyDown(_arg1:Number):void{
if (_arg1 == Keyboard.LEFT){
if (!leftPressed){
leftPressed = true;
};
} else {
if (_arg1 == Keyboard.RIGHT){
if (!rightPressed){
rightPressed = true;
};
} else {
if (_arg1 == Keyboard.SPACE){
if (!spacePressed){
spacePressed = true;
inputQueue.push(GameControl.ACTION_START_JUMP);
};
};
};
};
}
public function checkInput():void{
var _local2:String;
var _local3:Function;
var _local1:Array = inputQueue;
inputQueue = new Array();
if (leftPressed){
inputQueue.push(GameControl.ACTION_START_MOVE_LEFT);
};
if (rightPressed){
inputQueue.push(GameControl.ACTION_START_MOVE_RIGHT);
};
for each (_local2 in _local1) {
_local3 = inputFunctions[_local2];
if (_local3 != null){
_local3();
};
};
}
public function onKeyUp(_arg1:Number):void{
if (_arg1 == Keyboard.LEFT){
if (leftPressed){
leftPressed = false;
inputQueue.push(GameControl.ACTION_STOP_MOVE_LEFT);
};
} else {
if (_arg1 == Keyboard.RIGHT){
if (rightPressed){
rightPressed = false;
inputQueue.push(GameControl.ACTION_STOP_MOVE_RIGHT);
};
} else {
if (_arg1 == Keyboard.SPACE){
if (spacePressed){
spacePressed = false;
inputQueue.push(GameControl.ACTION_STOP_JUMP);
};
};
};
};
}
}
}//package debtgame.control
Section 15
//Level (debtgame.editor.Level)
package debtgame.editor {
import debtgame.model.*;
import halowitz.framework.math.*;
public class Level {
public var platforms:Array;
public var stageHeight:Number;// = 440
public var gridSize:Number;// = 10
public var stageWidth:Number;// = 880
public var goal:Point2D;
public var items:Array;
public var scrollSpeed:Number;// = 0.1
public var waterHeight:Number;// = 10
public var platformsPix:Array;
public function Level(){
goal = new Point2D(10000, 32);
platformsPix = new Array();
platforms = new Array();
items = new Array();
super();
}
public function addItem(_arg1:Item):void{
items.push(_arg1);
}
public function removePlatformItem(_arg1:PlatformPix):void{
var _local2:Number = -1;
var _local3:Number = 0;
while (_local3 < platformsPix.length) {
if (platformsPix[_local3] == _arg1){
_local2 = _local3;
break;
};
_local3++;
};
if (_local2 >= 0){
platformsPix.splice(_local2, 1);
};
}
public function addPlatformPix(_arg1:PlatformPix):void{
platformsPix.push(_arg1);
}
public function removePlatform(_arg1:Platform):void{
var _local2:Number = -1;
var _local3:Number = 0;
while (_local3 < platforms.length) {
if (platforms[_local3] == _arg1){
_local2 = _local3;
break;
};
_local3++;
};
if (_local2 >= 0){
trace(_local2);
platforms.splice(_local2, 1);
};
}
public function removeItem(_arg1:Item):void{
var _local2:Number = -1;
var _local3:Number = 0;
while (_local3 < items.length) {
if (items[_local3] == _arg1){
_local2 = _local3;
break;
};
_local3++;
};
if (_local2 >= 0){
items.splice(_local2, 1);
};
}
public function addPlatform(_arg1:Platform):void{
platforms.push(_arg1);
}
public static function toXML(_arg1:Level):XML{
var _local4:Platform;
var _local5:Item;
var _local6:PlatformPix;
var _local2:XML = <level></level>
;
_local2.@stageWidth = _arg1.stageWidth;
_local2.@stageHeight = _arg1.stageHeight;
_local2.@gridSize = _arg1.gridSize;
_local2.@scrollSpeed = _arg1.scrollSpeed;
_local2.@waterHeight = _arg1.waterHeight;
_local2.goal = <goal></goal>
;
_local2.goal.@x = _arg1.goal.x;
_local2.goal.@y = _arg1.goal.y;
var _local3:Number = 0;
while (_local3 < _arg1.platforms.length) {
_local4 = _arg1.platforms[_local3];
_local2.plat[_local3] = <plat></plat>
;
_local2.plat[_local3].@x1 = _local4.line.p0.x;
_local2.plat[_local3].@y1 = _local4.line.p0.y;
_local2.plat[_local3].@x2 = _local4.line.p1.x;
_local2.plat[_local3].@y2 = _local4.line.p1.y;
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.items.length) {
_local5 = _arg1.items[_local3];
_local2.item[_local3] = <item></item>
;
_local2.item[_local3].@x = _local5.pos.x;
_local2.item[_local3].@y = _local5.pos.y;
_local2.item[_local3].@type = _local5.type;
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.platformsPix.length) {
_local6 = _arg1.platformsPix[_local3];
_local2.platPic[_local3] = <platPic></platPic>
;
_local2.platPic[_local3].@x = _local6.pos.x;
_local2.platPic[_local3].@y = _local6.pos.y;
_local2.platPic[_local3].@type = _local6.type;
_local3++;
};
return (_local2);
}
public static function fromXML(_arg1:XML):Level{
var _local7:XML;
var _local8:Point2D;
var _local9:Point2D;
var _local10:Line2D;
var _local11:Platform;
var _local12:XML;
var _local13:Item;
var _local14:XML;
var _local15:PlatformPix;
var _local2:Level = new (Level);
_local2.stageWidth = Number(_arg1.@stageWidth);
_local2.stageHeight = Number(_arg1.@stageHeight);
_local2.gridSize = Number(_arg1.@gridSize);
_local2.scrollSpeed = Number(_arg1.@scrollSpeed);
_local2.waterHeight = Number(_arg1.@waterHeight);
_local2.goal.x = _arg1.goal.@x;
_local2.goal.y = _arg1.goal.@y;
var _local3:Number = _arg1.plat.length();
var _local4:Number = 0;
while (_local4 < _local3) {
_local7 = _arg1.plat[_local4];
_local8 = new Point2D(_local7.@x1, _local7.@y1);
_local9 = new Point2D(_local7.@x2, _local7.@y2);
_local10 = new Line2D(_local8, _local9);
_local11 = new Platform(_local10);
_local2.addPlatform(_local11);
_local4++;
};
var _local5:Number = _arg1.item.length();
_local4 = 0;
while (_local4 < _local5) {
_local12 = _arg1.item[_local4];
_local13 = new Item(_local12.@type);
_local13.pos.x = _local12.@x;
_local13.pos.y = _local12.@y;
_local2.addItem(_local13);
_local4++;
};
var _local6:Number = _arg1.platPic.length();
_local4 = 0;
while (_local4 < _local6) {
_local14 = _arg1.platPic[_local4];
_local15 = new PlatformPix(_local14.@type);
_local15.pos.x = _local14.@x;
_local15.pos.y = _local14.@y;
_local2.addPlatformPix(_local15);
_local4++;
};
return (_local2);
}
}
}//package debtgame.editor
Section 16
//bolla (debtgame.model.bolla)
package debtgame.model {
import halowitz.framework.math.*;
public class bolla {
public var isActive:Boolean;// = false
public var pos:Point2D;
public var speed:int;
public var collected:Boolean;// = false
public var type:String;
public function bolla(_arg1:String=null){
this.type = _arg1;
pos = new Point2D();
speed = 1;
}
}
}//package debtgame.model
Section 17
//CashFlow (debtgame.model.CashFlow)
package debtgame.model {
public class CashFlow {
public var spendingDataCredit;
public var credit:Object;
public var spendingLevel:Array;
public var savings:Object;
public var spendingDataDebit;
public function CashFlow(){
savings = new Object();
credit = new Object();
spendingLevel = new Array();
spendingDataCredit = new Array();
spendingDataDebit = new Array();
savings.total = 0;
savings.prevBalance = 0;
savings.income = 0;
savings.purchases = 0;
savings.payments = 0;
savings.storepurchases = 0;
savings.last_prevBalance = 0;
savings.last_income = 0;
savings.last_total = 0;
savings.last_purchases = 0;
savings.last_interest = 0;
credit.last_purchases = 0;
credit.last_interest = 0;
savings.last_income;
savings.interest = 0;
getInterestRate();
getTotal();
credit.last_balance = 0;
credit.last_prevBalance = 0;
credit.last_interest = 0;
credit.last_purchases = 0;
credit.last_payments = 0;
credit.balance = 0;
credit.minimum = 0;
credit.prevBalance = 0;
credit.interest = 0;
getInterestRateCredit();
credit.purchases = 0;
credit.storepurchases = 0;
credit.payments = 0;
credit.limit = Main.CVARS.CREDIT_LIMIT;
getTotalCredit();
}
public function getTotalTemp():Number{
savings.interest = Math.round(((savings.prevBalance * savings.interestRate) / 100));
return ((((savings.prevBalance + savings.interest) + savings.income) - savings.purchases));
}
public function reinit(){
savings = new Object();
credit = new Object();
spendingLevel = new Array();
spendingDataCredit = new Array();
spendingDataDebit = new Array();
getInterestRate();
getInterestRateCredit();
}
public function getTotalCreditAux():Number{
return (0);
}
public function refreshData(){
}
public function getInterestRateCredit():Number{
credit.interestRate = 15;
return (credit.interestRate);
}
public function getTotal():Number{
savings.interest = Math.round(((savings.prevBalance * savings.interestRate) / 100));
savings.total = (((savings.prevBalance + savings.interest) + savings.income) - savings.purchases);
return (savings.total);
}
public function getTotalCredit():Number{
credit.interest = Math.round(((credit.prevBalance * credit.interestRate) / 100));
credit.balance = (((credit.prevBalance + credit.interest) + credit.purchases) - credit.payments);
return (credit.balance);
}
public function getInterestRate():Number{
savings.interestRate = Math.round((1 + (Math.random() * 9)));
return (savings.interestRate);
}
public function getTotalCreditTemp():Number{
credit.interest = Math.round(((credit.prevBalance * credit.interestRate) / 100));
return ((((credit.prevBalance + credit.interest) + credit.purchases) - credit.payments));
}
public function getTotalAux():Number{
return (0);
}
}
}//package debtgame.model
Section 18
//GameModel (debtgame.model.GameModel)
package debtgame.model {
import halowitz.framework.math.*;
import debtgame.editor.*;
import flash.geom.*;
public class GameModel {
public var magnetPos:Point;
public var avatarVel:Point;
public var levelNum:int;// = 0
public var avatarSurface:Platform;// = null
public var water:Platform;
public var airLevel:Number;// = 0
public var level:Level;
public var tutorial:Boolean;// = true
public var platforms:Array;
public var values:Object;
public var avatarMovement:int;// = 0
public var stageOffset:Number;// = 0
public var inputVel:Point;
public var bounds:Array;
public var moveLevel:Number;// = 0
public var avatarPos:Point;
public var jumpLevel:Number;// = 0
public function GameModel(){
var _local1:String;
avatarPos = new Point();
magnetPos = new Point();
avatarVel = new Point();
inputVel = new Point();
bounds = new Array();
platforms = new Array();
super();
values = new Object();
for each (_local1 in Main.CVARS.VALUES) {
values[_local1] = 0;
};
moveLevel = Main.CVARS.MOVE_LEVEL;
airLevel = Main.CVARS.AIR_LEVEL;
jumpLevel = Main.CVARS.JUMP_LEVEL;
}
public function initLevel():void{
var _local4:Item;
var _local5:String;
var _local6:Array;
var _local7:Number;
var _local8:String;
stageOffset = 0;
avatarPos = new Point();
avatarVel = new Point();
avatarSurface = null;
var _local1:Number = level.stageWidth;
var _local2:Number = level.waterHeight;
avatarPos.y = (_local2 + 1);
avatarPos.x = 200;
water = new Platform(new Line2D(new Point2D(-10, _local2), new Point2D((_local1 + 10), _local2)));
level.addPlatform(water);
platforms = level.platforms.slice();
var _local3:Object = Main.CVARS.ITEM_MAP;
for each (_local4 in level.items) {
_local5 = _local4.type;
_local6 = _local3[_local5];
_local7 = Math.floor((Math.random() * _local6.length));
_local8 = _local6[_local7];
_local4.type = _local8;
};
}
}
}//package debtgame.model
Section 19
//Item (debtgame.model.Item)
package debtgame.model {
import halowitz.framework.math.*;
public class Item {
public var pos:Point2D;
public var collected:Boolean;// = false
public var type:String;
public function Item(_arg1:String){
this.type = _arg1;
pos = new Point2D();
}
}
}//package debtgame.model
Section 20
//Platform (debtgame.model.Platform)
package debtgame.model {
import flash.display.*;
import halowitz.framework.math.*;
public class Platform extends MovieClip {
public var line:Line2D;
public function Platform(_arg1:Line2D){
this.line = _arg1;
render();
}
public function move(_arg1:Number, _arg2:Number):void{
line.p0.x = (line.p0.x + _arg1);
line.p0.y = (line.p0.y + _arg2);
line.p1.x = (line.p1.x + _arg1);
line.p1.y = (line.p1.y + _arg2);
render();
}
private function render():void{
graphics.clear();
graphics.lineStyle(1, 0);
}
public function heightAt(_arg1:Number):Number{
var _local2:Number = ((_arg1 - line.p0.x) / (line.p1.x - line.p0.x));
return (((_local2 * (line.p1.y - line.p0.y)) + line.p0.y));
}
public function slope():Number{
var _local1:Number = (line.p1.y - line.p0.y);
var _local2:Number = (line.p1.x - line.p0.x);
return ((_local1 / _local2));
}
override public function toString():String{
return (line.toString());
}
}
}//package debtgame.model
Section 21
//PlatformPix (debtgame.model.PlatformPix)
package debtgame.model {
import halowitz.framework.math.*;
public class PlatformPix {
public var pos:Point2D;
public var collected:Boolean;// = false
public var type:String;
public function PlatformPix(_arg1:String){
this.type = _arg1;
pos = new Point2D();
}
}
}//package debtgame.model
Section 22
//tsunami (debtgame.model.tsunami)
package debtgame.model {
import halowitz.framework.math.*;
public class tsunami {
public var isActive:Boolean;// = false
public var pos:Point2D;
public var speed:int;
public var collected:Boolean;// = false
public var type:String;
public function tsunami(_arg1:String=null){
this.type = _arg1;
pos = new Point2D();
speed = 1;
}
}
}//package debtgame.model
Section 23
//soundManager (debtgame.sound.soundManager)
package debtgame.sound {
import flash.events.*;
import flash.media.*;
public class soundManager {
public var sndFastsChannel:SoundChannel;
public var sndLev1Channel:SoundChannel;
private var sndBrao:brao;
public var sndCoinChannel:SoundChannel;
private var sndBras:bras;
public var sound:Sound;
public var sndToc2Channel:SoundChannel;
public var sndTsuChannel:SoundChannel;
private var sndIdl:idl;
private var sndCoin:coin;
public var sndCreChannel:SoundChannel;
private var sndToc:toc;
public var sndNecChannel:SoundChannel;
private var sndRol:rol;
private var sndFasto:fasto;
private var sndCre:cre;
private var sndFasts:fasts;
public var sndBrasChannel:SoundChannel;
public var sndCasChannel:SoundChannel;
public var sndTutChannel:SoundChannel;
private var sndCas:cas;
private var sndLev1:lev1;
public var sndNorsChannel:SoundChannel;
public var sndNoroChannel:SoundChannel;
public var sndLev3Channel:SoundChannel;
private var sndTsu:tsu;
private var sndNoro:noro;
private var sndNors:nors;
private var sndLev2:lev2;
private var sndLev3:lev3;
public var sndIdlChannel:SoundChannel;
public var transform1:SoundTransform;
public var sndGovChannel:SoundChannel;
private var sndNec:nec;
public var sndTocChannel:SoundChannel;
private var sndGov:gov;
public var myVolume;
public var arr:Array;
private var sndIntr:intr;
private var sndTut:tut;
private var sndToc2:toc2;
public var sndLev2Channel:SoundChannel;
public var sndIntrChannel:SoundChannel;
public var sndFastoChannel:SoundChannel;
public var sndBraoChannel:SoundChannel;
public var sndRolChannel:SoundChannel;
public function soundManager(){
sndCoin = new coin();
sndNec = new nec();
sndToc = new toc();
sndToc2 = new toc2();
sndTsu = new tsu();
sndRol = new rol();
sndCas = new cas();
sndCre = new cre();
sndIntr = new intr();
sndGov = new gov();
sndFasto = new fasto();
sndBrao = new brao();
sndNoro = new noro();
sndFasts = new fasts();
sndBras = new bras();
sndNors = new nors();
sndIdl = new idl();
arr = ["Coin", "Nec", "Toc", "Toc2", "Tsu", "Rol", "Cas", "Cre", "Intr", "Gov", "Fasto", "Brao", "Noro", "Fasts", "Bras", "Nors", "Idl", "Lev1", "Lev2", "Lev3", "Tut"];
sndLev1 = new lev1();
sndLev2 = new lev2();
sndLev3 = new lev3();
sndTut = new tut();
super();
this.myVolume = 1;
transform1 = new SoundTransform(myVolume, 0);
}
public function pauseAudio(){
var _local1:SoundTransform = new SoundTransform();
_local1.volume = 0;
SoundMixer.soundTransform = _local1;
}
public function playSound(_arg1, _arg2){
if (this[(("snd" + _arg1) + "Channel")] != null){
this[(("snd" + _arg1) + "Channel")] = null;
};
this[(("snd" + _arg1) + "Channel")] = this[("snd" + _arg1)].play(0, _arg2);
this[(("snd" + _arg1) + "Channel")].soundTransform = transform1;
}
public function unPauseALL(){
transform1 = new SoundTransform();
transform1.volume = 1;
SoundMixer.soundTransform = transform1;
}
public function unPauseAudio(){
transform1 = new SoundTransform();
transform1.volume = myVolume;
SoundMixer.soundTransform = transform1;
}
public function stopSound(_arg1){
if (this[(("snd" + _arg1) + "Channel")] != null){
this[(("snd" + _arg1) + "Channel")].stop();
};
}
public function pauseALL(){
transform1 = new SoundTransform();
transform1.volume = 0;
SoundMixer.soundTransform = transform1;
}
public function stopAll(){
SoundMixer.stopAll();
}
public function changeAudio(){
var _local1:int;
if (myVolume == 1){
transform1 = new SoundTransform();
transform1.volume = 0;
_local1 = 0;
while (_local1 < arr.length) {
if (this[(("snd" + arr[_local1]) + "Channel")] != null){
this[(("snd" + arr[_local1]) + "Channel")].soundTransform = transform1;
};
_local1++;
};
myVolume = 0;
} else {
transform1 = new SoundTransform();
transform1.volume = 1;
myVolume = 1;
_local1 = 0;
while (_local1 < arr.length) {
if (this[(("snd" + arr[_local1]) + "Channel")] != null){
this[(("snd" + arr[_local1]) + "Channel")].soundTransform = transform1;
};
_local1++;
};
};
}
}
}//package debtgame.sound
Section 24
//EmailValidator (debtgame.util.validator.EmailValidator)
package debtgame.util.validator {
public class EmailValidator {
public static const EMAIL_REGEX:RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
public function EmailValidator(){
throw (new Error("The EmailValidator class is not intended to be instantiated."));
}
public static function isValidEmail(_arg1:String):Boolean{
return (Boolean(_arg1.match(EMAIL_REGEX)));
}
public static function validate(_arg1:String, _arg2:Class=null, _arg3:String="Invalid e-mail address."):void{
if (isValidEmail(_arg1)){
return;
};
_arg2 = ((_arg2) || (Error));
throw (new _arg2(_arg3));
}
public static function isValidEmailList(_arg1:String, _arg2:String=","):Boolean{
var _local4:String;
var _local3:Array = _arg1.split(_arg2);
for each (_local4 in _local3) {
if (!isValidEmail(_local4.replace(/\s/, ""))){
return (false);
};
};
return (true);
}
}
}//package debtgame.util.validator
Section 25
//about (debtgame.view.about)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
public class about extends MovieClip {
public var btn_logos;
public var btn_Back:mybutton;
public var btn_logos2:SimpleButton;
public var b1;
public var b2:SimpleButton;
public var platform:Main;
public var btn_back;
public function about(_arg1){
this.platform = _arg1;
btn_Back.addEventListener(MouseEvent.CLICK, onCloseUpload);
btn_logos.addEventListener(MouseEvent.CLICK, onLogos);
b1.addEventListener(MouseEvent.CLICK, onB1);
b2.addEventListener(MouseEvent.CLICK, onB2);
btn_logos2.addEventListener(MouseEvent.CLICK, onLogos2);
btn_back.mouseEnabled = false;
}
private function onCloseUpload(_arg1:MouseEvent){
platform.removeAboutScreen();
}
public function onLogos(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.indebted.com/");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
public function onB1(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("mailto:press@indebted.com");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
public function onB2(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("mailto: support@indebted.com");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
public function onLogos2(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.persuasivegames.com/");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
}
}//package debtgame.view
Section 26
//airplane (debtgame.view.airplane)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class airplane extends MovieClip {
public var acc:Number;// = 7
public var gameView:GameView;
public var btn:SimpleButton;
public function airplane(_arg1:GameView){
addFrameScript(0, frame1);
this.gameView = _arg1;
btn.addEventListener(MouseEvent.CLICK, onClick);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event){
x = (x - acc);
if ((((x < 700)) && ((acc > 3)))){
acc = (acc * 0.98);
};
}
public function onClick(_arg1:MouseEvent){
var request:URLRequest;
var e = _arg1;
if (currentFrame == 1){
request = new URLRequest("http://www.indebted.com/photo-wall/");
};
if (currentFrame == 2){
request = new URLRequest("http://www.indebted.com/take-action/top-5-budgeting-tips-for-college-students/ ");
};
if (currentFrame == 3){
request = new URLRequest("http://www.indebted.com/get-informed/the-people/");
};
if (currentFrame == 4){
request = new URLRequest("http://www.indebted.com/take-action/life-or-debt-quiz/");
};
if (currentFrame == 5){
request = new URLRequest("http://www.pgpf.org/getinvolved/signupmtvu/");
};
if (currentFrame == 6){
request = new URLRequest("http://www.indebted.com/take-action/budget-calculator/");
};
if (currentFrame == 7){
request = new URLRequest("http://www.google.com");
};
try {
navigateToURL(request);
} catch(e:Error) {
};
}
function frame1(){
}
}
}//package debtgame.view
Section 27
//AvatarClip (debtgame.view.AvatarClip)
package debtgame.view {
import flash.display.*;
public class AvatarClip extends MovieClip {
public var color;
public var burbujas:MovieClip;
public var pig;
public var shoulrotation:Number;// = 0
public var jet;
public var bur;
}
}//package debtgame.view
Section 28
//colorClip (debtgame.view.colorClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
public class colorClip extends MovieClip {
public var b1;
public var b2;
public var b3;
public var b4:SimpleButton;
public var options:OptionsClip;
public function colorClip(_arg1:OptionsClip){
this.options = _arg1;
b1.addEventListener(MouseEvent.CLICK, onb1);
b2.addEventListener(MouseEvent.CLICK, onb2);
b3.addEventListener(MouseEvent.CLICK, onb3);
b4.addEventListener(MouseEvent.CLICK, onb4);
}
private function onb1(_arg1:MouseEvent){
options.setColor(1);
}
private function onb2(_arg1:MouseEvent){
options.setColor(2);
}
private function onb3(_arg1:MouseEvent){
options.setColor(3);
}
private function onb4(_arg1:MouseEvent){
options.setColor(4);
}
}
}//package debtgame.view
Section 29
//colorClip2 (debtgame.view.colorClip2)
package debtgame.view {
import flash.events.*;
import flash.display.*;
public class colorClip2 extends MovieClip {
public var b1;
public var b2;
public var b3;
public var b4:SimpleButton;
public var options:OptionsClip;
public function colorClip2(_arg1:OptionsClip){
this.options = _arg1;
b1.addEventListener(MouseEvent.CLICK, onb1);
b2.addEventListener(MouseEvent.CLICK, onb2);
b3.addEventListener(MouseEvent.CLICK, onb3);
b4.addEventListener(MouseEvent.CLICK, onb4);
}
private function onb1(_arg1:MouseEvent){
options.setColor2(1);
}
private function onb2(_arg1:MouseEvent){
options.setColor2(2);
}
private function onb3(_arg1:MouseEvent){
options.setColor2(3);
}
private function onb4(_arg1:MouseEvent){
options.setColor2(4);
}
}
}//package debtgame.view
Section 30
//colorClips (debtgame.view.colorClips)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class colorClips extends MovieClip {
public var pp:MovieClip;
public var last:int;
public var txt_hap:TextField;
public var mcColor;
public var id:int;
public var txt_cost;
public var mcBack;
public var options:OptionsClip;
public function colorClips(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
mcColor.gotoAndStop((_arg2 + 1));
txt_cost.mouseEnabled = false;
mcColor.mouseEnabled = false;
pp.mouseEnabled = false;
txt_hap.mouseEnabled = false;
pp.mouseChildren = false;
txt_hap.text = "+1";
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.ROLL_OVER, onOver);
addEventListener(MouseEvent.ROLL_OUT, onOut);
}
public function onOver(_arg1:MouseEvent){
last = options.view.avatarClip.jet.color.currentFrame;
options.view.avatarClip.jet.color.gotoAndStop((id + 1));
}
private function onClick(_arg1:MouseEvent){
options.selectColorStyle(id);
}
public function onOut(_arg1:MouseEvent){
options.view.avatarClip.jet.color.gotoAndStop(last);
}
}
}//package debtgame.view
Section 31
//contactar (debtgame.view.contactar)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class contactar extends MovieClip {
public var btnSend:mybutton;
public var email_txt;
public var mensaje_txt;
public var platform:OptionsClip;
public var error_txt:TextField;
public var youremail_txt;
public var name_txt;
public function contactar(_arg1=null){
name_txt.tabIndex = 0;
youremail_txt.tabIndex = 2;
email_txt.tabIndex = 3;
mensaje_txt.tabIndex = 4;
name_txt.addEventListener(MouseEvent.CLICK, onTextClick);
email_txt.addEventListener(MouseEvent.CLICK, onTextClick);
youremail_txt.addEventListener(MouseEvent.CLICK, onTextClick);
mensaje_txt.addEventListener(MouseEvent.CLICK, onTextClick);
trace("contacto");
this.platform = _arg1;
btnSend.addEventListener(MouseEvent.CLICK, onSend);
}
function onTextClick(_arg1:MouseEvent){
trace("PEGAR");
TextField(_arg1.target).setSelection(0, TextField(_arg1.target).text.length);
}
public function onSend(_arg1:MouseEvent){
var urls:String;
var variables:URLVariables;
var request:URLRequest;
var loader:URLLoader;
var e = _arg1;
error_txt.text = "";
var v:Boolean;
var a:Array = String(email_txt.text).split(",");
var i:int;
while (i < a.length) {
if (EmailValidator.isValidEmail(a[i]) != true){
v = false;
};
i = (i + 1);
};
if (EmailValidator.isValidEmail(youremail_txt.text) != true){
v = false;
};
if (((((v) && ((name_txt.text.length > 0)))) && ((mensaje_txt.text.length > 0)))){
urls = Main.CVARS.URL_CONTACT;
variables = new URLVariables();
variables.name = name_txt.text;
variables.email = youremail_txt.text;
variables.msg = mensaje_txt.text;
variables.friendemail = email_txt.text;
request = new URLRequest(urls);
request.data = variables;
loader = new URLLoader();
try {
loader.load(request);
} catch(e:Error) {
};
platform.view.pushMsgScreen("Email Sent!");
} else {
platform.view.pushMsgScreen("Wrong information.Check again.");
error_txt.text = "Wrong information.Check again.";
};
}
private function onCloseUpload(_arg1:MouseEvent){
platform.closeContact();
}
}
}//package debtgame.view
Section 32
//DecalsClip (debtgame.view.DecalsClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class DecalsClip extends MovieClip {
public var pp:MovieClip;
public var txt_kind;
public var txt_hap:TextField;
public var last:int;
public var avatar:AvatarClip;
public var id:int;
public var mc;
public var options:OptionsClip;
public var mcBack;
public var decal;
public var txt_cost;
public function DecalsClip(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
avatar = new AvatarClip();
avatar.scaleX = 0.4;
avatar.scaleY = 0.4;
avatar.x = 55;
avatar.y = 70;
avatar.mouseEnabled = false;
txt_hap.text = "+2";
pp.mouseEnabled = false;
txt_hap.mouseEnabled = false;
avatar.mouseChildren = false;
pp.mouseChildren = false;
txt_cost.mouseEnabled = false;
txt_kind.mouseEnabled = false;
avatar.jet.color.gotoAndStop(Main.COLOR);
avatar.jet.decal.gotoAndStop((_arg2 + 2));
mc.gotoAndStop((_arg2 + 1));
mc.mouseEnabled = false;
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.ROLL_OVER, onOver);
addEventListener(MouseEvent.ROLL_OUT, onOut);
}
public function onOver(_arg1:MouseEvent){
last = options.view.avatarClip.jet.decal.currentFrame;
options.view.avatarClip.jet.decal.gotoAndStop((id + 2));
}
private function onClick(_arg1:MouseEvent){
options.selectDecalStyle(id);
}
public function onOut(_arg1:MouseEvent){
options.view.avatarClip.jet.decal.gotoAndStop(last);
}
}
}//package debtgame.view
Section 33
//EngineClip (debtgame.view.EngineClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class EngineClip extends MovieClip {
public var pp:MovieClip;
public var txt_cost;
public var mcBack;
public var txt_hap:TextField;
public var txt_kind;
public var id:int;
public var mc;
public var options:OptionsClip;
public function EngineClip(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
mc.mouseEnabled = false;
txt_hap.text = "+4";
mc.gotoAndStop((_arg2 + 1));
txt_cost.mouseEnabled = false;
pp.mouseEnabled = false;
pp.mouseChildren = false;
txt_hap.mouseEnabled = false;
txt_kind.mouseEnabled = false;
addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
options.selectEngineStyle(id);
}
}
}//package debtgame.view
Section 34
//GameView (debtgame.view.GameView)
package debtgame.view {
import flash.display.*;
import debtgame.model.*;
import debtgame.control.*;
import debtgame.editor.*;
import debtgame.art.*;
import flash.geom.*;
public class GameView extends MovieClip {
public var pauseScreen:PauseClip;
public var payment:minpayment;
public var itemBolla:bolla;
public var mbolla:bollaClip;
public var model:GameModel;
private var background:Sprite;
public var tsunamiScreen:TsunamiScreen;
public var avatarClip:AvatarClip;
private var plaxFrontA:MovieClip;
private var plaxFrontB:MovieClip;
public var msgScreen:popup;
public var canvas:Sprite;
private var clipMask:Sprite;
public var control:GameControl;
public var mtsunami:tsunamiClip;
private var itemGfx:Array;
public var winScreen:WinClip;
private var tutorialScreen:TutorialClip;
private var level:Level;
public var submitClip:HighSubmit;
private var offset:Point;
private var plaxMiddleA:MovieClip;
private var plaxMiddleB:MovieClip;
public var optionsScreen:OptionsClip;
public var summaryScreen:SummaryClip;
private var plaxBackA:MovieClip;
private var plaxBackB:MovieClip;
private var platGfx:Array;
public var preview:levelpreview;
public var itemTsunami:tsunami;
public var Sweep:SweepClip;
private var plaxSFrontA:MovieClip;
private var plaxSFrontB:MovieClip;
public var loseScreen:LoseClip;
public var mcWF:MovieClip;
public var game:Main;
private var itemPlatformGfx:Array;
public var shouldPay:Boolean;// = false
public var introScreen:IntroClip;
public var life:mylife;
public function GameView(_arg1:GameModel, _arg2:Main){
offset = new Point();
super();
this.model = _arg1;
this.game = _arg2;
plaxFrontB;
clipMask = new Sprite();
background = new Sprite();
background.addChild(new SkyClip());
addChild(background);
plaxBackA = new PlaxBackClip();
addChild(plaxBackA);
plaxBackB = new PlaxBackClip();
addChild(plaxBackB);
plaxMiddleA = new PlaxMiddleClip();
addChild(plaxMiddleA);
plaxMiddleB = new PlaxMiddleClip();
addChild(plaxMiddleB);
plaxFrontA = new PlaxFrontClip();
addChild(plaxFrontA);
plaxFrontB = new PlaxFrontClip();
addChild(plaxFrontB);
plaxBackA.gotoAndStop((_arg1.levelNum + 1));
plaxBackB.gotoAndStop((_arg1.levelNum + 1));
plaxMiddleB.gotoAndStop((_arg1.levelNum + 1));
plaxMiddleA.gotoAndStop((_arg1.levelNum + 1));
MovieClip(background.getChildAt(0)).gotoAndStop((_arg1.levelNum + 1));
canvas = new Sprite();
addChild(canvas);
avatarClip = new AvatarClip();
plaxSFrontA = new PlaxSFrontClip();
addChild(plaxSFrontA);
plaxSFrontB = new PlaxSFrontClip();
addChild(plaxSFrontB);
}
public function removeTsunamiScreen(){
control.startGame();
removeChild(tsunamiScreen);
tsunamiScreen = null;
Main.SoundM.playSound("Nors", 1000);
}
public function removeTutorialScreen(){
Main.SoundM.stopSound("Tut");
game.removeTutorial();
if (model.levelNum == 0){
life = new mylife(this);
addChild(life);
Main.interfaceScreen.visible = false;
model.tutorial = false;
} else {
pushOptionsScreen();
};
}
public function addTsunamiScreen(){
tsunamiScreen = new TsunamiScreen(this);
addChild(tsunamiScreen);
trace("HEY HEY A TSUNAMI");
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
Main.SoundM.stopSound("Idl");
}
public function pushPaymentScreen(_arg1){
payment = new minpayment(this, _arg1);
addChild(payment);
if (optionsScreen != null){
if (getChildIndex(optionsScreen) > getChildIndex(payment)){
this.swapChildren(optionsScreen, payment);
};
};
}
public function pushTutorialScreen(){
if (preview != null){
preview.visible = false;
};
game.pushTutorial();
}
public function closeSubmit(){
removeChild(submitClip);
submitClip = null;
Sweep = new SweepClip(this);
addChild(Sweep);
}
public function removeMsgScreen(){
removeChild(msgScreen);
msgScreen = null;
}
public function removeWinScreen(){
removeChild(winScreen);
winScreen = null;
reinit();
}
public function pushMsgScreen(_arg1){
msgScreen = new popup(this, _arg1);
addChild(msgScreen);
}
public function pushPreview(){
preview = new levelpreview(this);
preview.x = 220;
preview.y = 120;
if (model.levelNum == 0){
preview.visible = false;
};
addChild(preview);
}
public function initLevel():void{
this.level = model.level;
Main.interfaceScreen.txt_level1.text = String(int((model.levelNum + 1)));
Main.interfaceScreen.txt_level2.text = String(int((model.levelNum + 1)));
Main.interfaceScreen.txt_cash.text = "$0";
Main.interfaceScreen.txt_debt.text = "$0";
if (level == null){
return;
};
var _local1:Number = level.stageWidth;
var _local2:Number = level.stageHeight;
background.graphics.clear();
background.graphics.beginFill(0xFFFFFF, 1);
background.graphics.drawRect(0, 0, _local1, _local2);
background.graphics.endFill();
clipMask.graphics.clear();
clipMask.graphics.beginFill(0xFFFFFF, 1);
clipMask.graphics.drawRect(0, 0, _local1, _local2);
clipMask.graphics.endFill();
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
canvas.addChild(clipMask);
canvas.mask = clipMask;
offset = new Point();
refreshGfx();
plaxBackA.gotoAndStop((model.levelNum + 1));
plaxBackB.gotoAndStop((model.levelNum + 1));
plaxMiddleB.gotoAndStop((model.levelNum + 1));
plaxMiddleA.gotoAndStop((model.levelNum + 1));
MovieClip(background.getChildAt(0)).gotoAndStop((model.levelNum + 1));
addChild(avatarClip);
avatarClip.jet.gotoAndStop((Main.SKI_STYLE + 1));
avatarClip.jet.color.gotoAndStop((Main.COLOR + 1));
avatarClip.jet.decal.gotoAndStop((Main.DECAL_STYLE[0] + 2));
trace("DECAL AT:", (Main.DECAL_STYLE[0] + 2));
swapChildren(avatarClip, plaxSFrontA);
swapChildren(avatarClip, plaxSFrontB);
this.game = game;
}
private function renderParallax():void{
var _local1:Number = 0;
_local1 = ((((offset.x * 0.25) + plaxBackA.width) % (plaxBackA.width * 2)) - plaxBackA.width);
plaxBackA.x = -(_local1);
plaxBackA.y = toScreenY(0, offset.y);
_local1 = (((offset.x * 0.25) % (plaxBackB.width * 2)) - plaxBackB.width);
plaxBackB.x = -(_local1);
plaxBackB.y = toScreenY(0, offset.y);
_local1 = ((((offset.x * 0.5) + plaxMiddleA.width) % (plaxMiddleA.width * 2)) - plaxMiddleA.width);
plaxMiddleA.x = -(_local1);
plaxMiddleA.y = toScreenY(0, offset.y);
_local1 = (((offset.x * 0.5) % (plaxMiddleB.width * 2)) - plaxMiddleB.width);
plaxMiddleB.x = -(_local1);
plaxMiddleB.y = toScreenY(0, offset.y);
_local1 = ((((offset.x * 0.75) + 880) % (880 * 2)) - 880);
plaxFrontA.x = -(_local1);
plaxFrontA.y = toScreenY(0, offset.y);
_local1 = (((offset.x * 0.75) % (880 * 2)) - 880);
plaxFrontB.x = -(_local1);
plaxFrontB.y = toScreenY(0, offset.y);
_local1 = ((((offset.x * 0.75) + 880) % (880 * 2)) - 880);
plaxSFrontA.x = -(_local1);
plaxSFrontA.y = toScreenY(0, offset.y);
_local1 = (((offset.x * 0.75) % (880 * 2)) - 880);
plaxSFrontB.x = -(_local1);
plaxSFrontB.y = toScreenY(0, offset.y);
}
public function removeOptionsScreen2(){
if (loseScreen != null){
loseScreen.removeShare();
};
if (winScreen != null){
winScreen.removeShare();
};
}
private function toScreenX(_arg1:Number, _arg2:Number):Number{
return ((_arg1 - _arg2));
}
private function toScreenY(_arg1:Number, _arg2:Number):Number{
return ((level.stageHeight - (_arg1 - _arg2)));
}
public function pushIntroScreen(){
introScreen = new IntroClip(this);
addChild(introScreen);
control.stopGame();
game.pushAvion(this);
}
public function removeLoseScreen(){
removeChild(loseScreen);
loseScreen = null;
reinit();
}
public function removeOptionsScreen(){
Main.interfaceScreen.visible = true;
removeChild(optionsScreen);
control.loadLevel(model.levelNum);
}
public function pushPauseScreen(){
if ((((tsunamiScreen == null)) && ((optionsScreen == null)))){
Main.interfaceScreen.visible = false;
Main.mp3.visible = false;
Main.mc_sound.visible = false;
control.stopGame();
Main.SoundM.pauseALL();
pauseScreen = new PauseClip(this);
addChild(pauseScreen);
};
}
public function removeSummaryScreen(){
var _local1:Boolean;
removeChild(summaryScreen);
game.removeAvion();
trace("balance", Main.cashModel.credit.balance, Main.cashModel.credit.prevBalance);
if (Main.cashModel.credit.balance > 7500){
Main.cashModel.getTotal();
Main.cashModel.getTotalCredit();
game.removeInterface();
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
if (Main.cashModel.savings.total >= Main.cashModel.credit.balance){
};
trace(Main.cashModel.savings.total, Main.cashModel.credit.balance);
if (game.isANEMBED == false){
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
} else {
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
};
pushLoseScreen(2);
_local1 = true;
};
if ((((Main.LAST_NECESSITIES < Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities)) && ((_local1 == false)))){
Main.cashModel.getTotal();
Main.cashModel.getTotalCredit();
game.removeInterface();
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
removeChild(avatarClip);
if (Main.cashModel.savings.total >= Main.cashModel.credit.balance){
};
trace(Main.cashModel.savings.total, Main.cashModel.credit.balance);
Main.SoundM.stopSound("Idl");
pushLoseScreen(1);
if (game.isANEMBED == false){
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
} else {
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
};
_local1 = true;
};
if (_local1 != true){
if (model.levelNum == 8){
game.removeInterface();
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
removeChild(avatarClip);
if (Main.cashModel.savings.total >= Main.cashModel.credit.balance){
};
trace(Main.cashModel.savings.total, Main.cashModel.credit.balance);
submitClip = new HighSubmit(this);
addChild(submitClip);
if (game.isANEMBED == false){
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
} else {
game.reporter.sendCall({prop39:"debtski_game_end", eVar5:"debtski_game", events:"debtski_end,event3"});
};
} else {
pushOptionsScreen();
};
};
}
public function pushLoseScreen(_arg1){
loseScreen = new LoseClip(this, _arg1);
addChild(loseScreen);
game.pauseMp3();
}
public function render():void{
var _local13:Platform;
var _local14:Sprite;
var _local15:Item;
var _local16:ItemClip;
var _local17:Rectangle;
var _local18:PlatformPix;
var _local19:ItemPixPlatform;
stage.focus = stage;
if (level == null){
return;
};
offset = new Point(model.stageOffset, Math.max(0, (model.avatarPos.y - (model.level.stageHeight / 2))));
avatarClip.x = toScreenX(model.avatarPos.x, offset.x);
avatarClip.y = toScreenY(model.avatarPos.y, offset.y);
var _local1:Number = 0;
var _local2:Number = level.stageWidth;
var _local3:Number = 0;
var _local4:Number = level.stageHeight;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8:Number = 0;
var _local9:Number = 0;
var _local10:Number = 0;
var _local11:Number = 0;
while (_local11 < level.platforms.length) {
_local13 = (level.platforms[_local11] as Platform);
_local14 = (platGfx[_local11] as Sprite);
_local14.visible = false;
_local5 = Math.min(_local13.line.p0.x, _local13.line.p1.x);
_local6 = Math.max(_local13.line.p0.y, _local13.line.p1.y);
_local14.x = toScreenX(_local5, offset.x);
_local14.y = toScreenY(_local6, offset.y);
_local7 = _local14.x;
_local8 = ((_local14.x + _local14.width) - 1);
_local9 = _local14.y;
_local10 = ((_local14.y + _local14.height) - 1);
if ((((((((_local7 > _local2)) || ((_local8 < _local1)))) || ((_local9 > _local4)))) || ((_local10 < _local3)))){
} else {
_local14.visible = true;
};
_local11++;
};
var _local12:Number = 0;
for (;_local12 < level.items.length;_local12++) {
_local15 = (level.items[_local12] as Item);
_local16 = (itemGfx[_local12] as ItemClip);
_local16.visible = false;
if ((((_local15.collected == true)) && (!((_local15.type == "coin"))))){
if (_local16.currentFrame > 5){
if (_local16.mc_hap.currentFrame == 1){
_local16.showAnis(Main.CVARS.ITEM_EFFECTS[_local15.type][0].modifier, Main.CVARS.ITEM_EFFECTS[_local15.type][1].modifier);
_local16.rotation = 0;
_local16.mc.visible = false;
};
if (_local16.mc_hap.currentFrame >= 22){
continue;
};
} else {
continue;
};
} else {
if ((((((_local15.collected == true)) && ((_local15.type == "coin")))) && ((_local16.mc.currentFrame == 1)))){
_local16.mc.play();
} else {
if ((((((((_local15.collected == true)) && ((_local15.type == "coin")))) && (!((_local16.mc.currentFrame == 1))))) && (!((_local16.mc.currentFrame == 10))))){
_local15.pos.x = (model.avatarPos.x + 20);
};
};
if ((((((_local15.collected == true)) && ((_local15.type == "coin")))) && ((_local16.mc.currentFrame == 10)))){
_local16.mc.stop();
continue;
};
};
_local5 = toScreenX(_local15.pos.x, offset.x);
_local6 = toScreenY(_local15.pos.y, offset.y);
_local16.x = _local5;
_local16.y = _local6;
if ((((((((_local16.currentFrame > 5)) && ((_local15.pos.y > 40)))) && ((model.avatarPos.x > (_local15.pos.x - 650))))) && (!((_local15.collected == true))))){
_local15.pos.y = (_local15.pos.y - 0.3);
_local16.rotation = (Math.sin(((_local16.y / 50) * Math.PI)) * 10);
};
_local17 = _local16.getBounds(_local16.parent);
_local7 = _local17.left;
_local8 = _local17.right;
_local9 = _local17.top;
_local10 = _local17.bottom;
if ((((((((_local7 > _local2)) || ((_local8 < _local1)))) || ((_local9 > _local4)))) || ((_local10 < _local3)))){
} else {
_local16.visible = true;
};
};
if (((((Math.random() * 10) > 8)) && ((plaxSFrontA.mc.currentFrame == 1)))){
plaxSFrontA.mc.play();
};
_local5 = toScreenX(itemTsunami.pos.x, offset.x);
_local6 = toScreenY(itemTsunami.pos.y, offset.y);
itemTsunami.pos.x = (itemTsunami.pos.x - itemTsunami.speed);
if (itemTsunami.isActive == false){
itemTsunami.pos.y = (-120 + (Math.sin(((itemTsunami.pos.x / 100) * Math.PI)) * 20));
} else {
if ((((itemTsunami.pos.y < 40)) && ((model.avatarPos.x > (itemTsunami.pos.x - 650))))){
itemTsunami.pos.y = (itemTsunami.pos.y + 5);
};
};
mtsunami.x = _local5;
mtsunami.y = _local6;
if (itemTsunami.collected == true){
itemTsunami.pos.y = -220;
mtsunami.visible = false;
};
_local5 = toScreenX(itemBolla.pos.x, offset.x);
_local6 = toScreenY(itemBolla.pos.y, offset.y);
mbolla.x = _local5;
mbolla.y = _local6;
_local12 = 0;
while (_local12 < level.platformsPix.length) {
_local18 = (level.platformsPix[_local12] as PlatformPix);
_local19 = (itemPlatformGfx[_local12] as ItemPixPlatform);
_local19.visible = false;
_local5 = toScreenX(_local18.pos.x, offset.x);
_local6 = toScreenY(_local18.pos.y, offset.y);
_local19.x = _local5;
_local19.y = _local6;
_local17 = _local19.getBounds(_local19.parent);
_local7 = _local17.left;
_local8 = _local17.right;
_local9 = _local17.top;
_local10 = _local17.bottom;
if ((((((((_local7 > _local2)) || ((_local8 < _local1)))) || ((_local9 > _local4)))) || ((_local10 < _local3)))){
} else {
_local19.visible = true;
};
_local12++;
};
renderParallax();
}
public function refreshGfx():void{
var _local4:Platform;
var _local5:PlatformClip;
var _local6:PlatformPix;
var _local7:ItemPixPlatform;
var _local8:Item;
var _local9:ItemClip;
while (canvas.numChildren > 0) {
canvas.removeChildAt(0);
};
canvas.addChild(clipMask);
platGfx = new Array();
var _local1:Number = 0;
while (_local1 < level.platforms.length) {
_local4 = (level.platforms[_local1] as Platform);
_local5 = new PlatformClip(_local4);
platGfx[_local1] = _local5;
_local5.visible = false;
canvas.addChild(_local5);
_local1++;
};
itemPlatformGfx = new Array();
var _local2:int;
while (_local2 < level.platformsPix.length) {
_local6 = (level.platformsPix[_local2] as PlatformPix);
_local7 = new ItemPixPlatform();
_local7.setType(_local6.type);
itemPlatformGfx[_local2] = _local7;
_local7.visible = false;
canvas.addChild(_local7);
_local2++;
};
itemGfx = new Array();
var _local3:Number = 0;
while (_local3 < level.items.length) {
_local8 = (level.items[_local3] as Item);
_local9 = new ItemClip();
_local9.setType(_local8.type);
trace(_local8.type);
if (_local9.currentFrame > 6){
};
itemGfx[_local3] = _local9;
_local9.visible = false;
canvas.addChild(_local9);
_local3++;
};
itemTsunami = new tsunami();
mtsunami = new tsunamiClip();
itemTsunami.pos.x = (1200 + (Math.random() * (model.level.goal.x - 1300)));
if (Math.random() > 0.5){
itemTsunami.pos.y = -120;
itemTsunami.isActive = true;
} else {
itemTsunami.pos.y = -120;
itemTsunami.isActive = false;
};
mtsunami.name = "mtsunami";
canvas.addChild(mtsunami);
itemBolla = new bolla();
mbolla = new bollaClip();
itemBolla.pos.x = (model.level.goal.x - 200);
itemBolla.pos.y = 80;
mbolla.name = "mbolla";
canvas.addChild(mbolla);
}
public function removeLife(){
removeChild(life);
life = null;
preview.visible = true;
Main.interfaceScreen.visible = true;
control.loadLevel(model.levelNum);
model.tutorial = false;
}
public function showGigya(){
}
public function removePreview(){
removeChild(preview);
preview = null;
}
public function reinit(){
if (clipMask != null){
};
if (background != null){
removeChild(background);
};
if (plaxBackA != null){
removeChild(plaxBackA);
};
if (plaxBackB != null){
removeChild(plaxBackB);
};
if (plaxMiddleA != null){
removeChild(plaxMiddleA);
};
if (plaxMiddleB != null){
removeChild(plaxMiddleB);
};
if (plaxFrontA != null){
removeChild(plaxFrontA);
};
if (plaxFrontB != null){
removeChild(plaxFrontB);
};
if (plaxSFrontA != null){
removeChild(plaxSFrontA);
};
if (plaxSFrontB != null){
removeChild(plaxSFrontB);
};
if (canvas != null){
removeChild(canvas);
};
model.levelNum = 0;
Main.cashModel.reinit();
game.gotoAndStop(1);
}
public function update(_arg1:Number):void{
render();
}
public function pushSummaryScreen(){
Main.SoundM.stopSound("Nors");
Main.SoundM.stopSound("Bras");
Main.SoundM.stopSound("Fasts");
Main.SoundM.stopSound("Idl");
Main.SoundM.playSound("Idl", 1000);
Main.interfaceScreen.visible = false;
control.stopGame();
summaryScreen = new SummaryClip(this);
addChild(summaryScreen);
game.pushAvion(this);
}
public function removeIntroScreen(){
removeChild(introScreen);
introScreen = null;
optionsScreen = null;
control.pan = false;
control.startGame();
Main.SoundM.stopSound("Idl");
Main.SoundM.playSound("Nors", 1000);
if (model.levelNum == 0){
if (Main.mp3 == null){
game.addMp3();
} else {
game.reStartMp3();
};
};
game.removeAvion();
}
public function pushOptionsScreen(){
Main.interfaceScreen.visible = false;
optionsScreen = new OptionsClip(this);
avatarClip.visible = true;
avatarClip.rotation = 10;
avatarClip.x = 730;
avatarClip.y = 330;
addChild(optionsScreen);
if (payment != null){
if (getChildIndex(optionsScreen) > getChildIndex(payment)){
this.swapChildren(optionsScreen, payment);
};
};
}
public function removePauseScreen(){
control.startGame();
Main.interfaceScreen.visible = true;
Main.mc_sound.visible = true;
Main.mp3.visible = true;
Main.SoundM.unPauseALL();
removeChild(pauseScreen);
pauseScreen = null;
}
public function closeSweep(){
removeChild(Sweep);
Sweep = null;
if (optionsScreen == null){
winScreen = new WinClip(this);
addChild(winScreen);
} else {
if ((((optionsScreen.p4.b1.visible == false)) && ((optionsScreen.p4.b_title4.visible == false)))){
Main.mcWF.visible = true;
};
};
}
public function removeTutorialScreen2(){
game.removeTutorial2();
}
public function changeMonth(){
Main.cashModel.getInterestRate();
Main.cashModel.savings.last_prevBalance = Main.cashModel.savings.prevBalance;
Main.cashModel.savings.last_interest = Main.cashModel.savings.interest;
Main.cashModel.savings.last_income = Main.cashModel.savings.income;
Main.cashModel.savings.last_purchases = Main.cashModel.savings.purchases;
Main.cashModel.savings.last_total = Main.cashModel.savings.total;
Main.cashModel.credit.last_prevBalance = Main.cashModel.credit.prevBalance;
Main.cashModel.credit.last_interest = Main.cashModel.credit.interest;
Main.cashModel.credit.last_payments = Main.cashModel.credit.payments;
Main.cashModel.credit.last_purchases = Main.cashModel.credit.purchases;
Main.cashModel.credit.last_balance = Main.cashModel.credit.balance;
Main.cashModel.savings.prevBalance = Main.cashModel.savings.total;
Main.cashModel.credit.prevBalance = (Main.cashModel.credit.prevBalance + ((Main.cashModel.credit.purchases + Main.cashModel.credit.interest) - Main.cashModel.credit.payments));
Main.cashModel.credit.payments = 0;
Main.cashModel.savings.payments = 0;
if (Main.SPEND_LEVEL > Main.SAVING_LEVEL){
Main.cashModel.credit.purchases = (Main.SPEND_LEVEL - Main.SAVING_LEVEL);
Main.cashModel.savings.income = Main.SAVING_LEVEL;
Main.cashModel.savings.purchases = Main.SAVING_LEVEL;
} else {
Main.cashModel.savings.income = Math.round(Main.SAVING_LEVEL);
Main.cashModel.savings.purchases = Main.SPEND_LEVEL;
Main.cashModel.credit.purchases = 0;
};
Main.cashModel.savings.interest = Math.round(((Main.cashModel.savings.prevBalance * Main.cashModel.savings.interestRate) / 100));
Main.cashModel.credit.interest = Math.round(((Main.cashModel.credit.prevBalance * Main.cashModel.credit.interestRate) / 100));
Main.cashModel.credit.balance = (((Main.cashModel.credit.prevBalance + Main.cashModel.credit.interest) + Main.cashModel.credit.purchases) - Main.cashModel.credit.payments);
Main.cashModel.savings.total = (((Main.cashModel.savings.prevBalance + Main.cashModel.savings.interest) + Main.cashModel.savings.income) - Main.cashModel.savings.purchases);
Main.cashModel.credit.minimum = (Math.round((Main.cashModel.credit.balance * 0.01)) + Main.cashModel.credit.interest);
}
public function removePaymentScreen(){
removeChild(payment);
payment = null;
}
public function pushSweep(){
Sweep = new SweepClip(this);
addChild(Sweep);
Main.mcWF.visible = false;
}
}
}//package debtgame.view
Section 35
//GoalClip (debtgame.view.GoalClip)
package debtgame.view {
import flash.display.*;
public class GoalClip extends MovieClip {
}
}//package debtgame.view
Section 36
//highscores (debtgame.view.highscores)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class highscores extends MovieClip {
public var n1;
public var n2;
public var n3;
public var n5;
public var n7;
public var n8;
public var n9;
public var n6;
public var n4;
public var n10;
public var s1;
public var s2;
public var s3;
public var s4;
public var s5;
public var btnBack:mybutton;
public var s7;
public var s8;
public var btn_back:SimpleButton;
public var s9;
public var s6;
public var platform:Main;
public var s10:TextField;
public function highscores(_arg1=null){
this.platform = _arg1;
btn_back.mouseEnabled = false;
var _local2:URLRequest = new URLRequest(Main.CVARS.URL_HIGHSCORES);
var _local3:URLLoader = new URLLoader(_local2);
btnBack.addEventListener(MouseEvent.CLICK, onCloseUpload);
_local3.addEventListener(Event.COMPLETE, completeHandler);
}
private function onCloseUpload(_arg1:MouseEvent){
platform.closeHighscores();
}
private function completeHandler(_arg1:Event):void{
var _local2:XML;
_local2 = new XML();
_local2.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
var _local3:int;
trace(_local2.child("score").length());
var _local4:int;
while (_local4 < _local2.child("score").length()) {
_local3 = (_local4 + 1);
if (_local3 <= 10){
this[("s" + _local3)].text = toMoney(int(_local2.child("score")[_local4].@score));
this[("n" + _local3)].text = ((_local3 + ". ") + String(_local2.child("score")[_local4].@nick));
};
_local4++;
};
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
}
}//package debtgame.view
Section 37
//HighSubmit (debtgame.view.HighSubmit)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
public class HighSubmit extends MovieClip {
public var score_txt:TextField;
public var btn_back:SimpleButton;
public var platform:GameView;
public var btn_submit:mybutton;
public var name_txt;
public function HighSubmit(_arg1=null){
score_txt.text = toMoney(Main.SCORE);
name_txt.addEventListener(MouseEvent.CLICK, onTextClick);
this.platform = _arg1;
btn_submit.addEventListener(MouseEvent.CLICK, onSend);
btn_back.mouseEnabled = false;
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function onSend(_arg1:MouseEvent){
var urls:String;
var variables:URLVariables;
var request:URLRequest;
var loader:URLLoader;
var e = _arg1;
if (name_txt.text.length > 2){
urls = Main.CVARS.URL_SUBMIT;
variables = new URLVariables();
variables.nick = name_txt.text;
variables.score = int(Main.SCORE);
request = new URLRequest(urls);
request.data = variables;
loader = new URLLoader();
try {
loader.load(request);
} catch(e:Error) {
};
platform.closeSubmit();
} else {
platform.pushMsgScreen("Please enter your name!");
};
}
function onTextClick(_arg1:MouseEvent){
trace("PEGAR");
TextField(_arg1.target).setSelection(0, TextField(_arg1.target).text.length);
}
}
}//package debtgame.view
Section 38
//InterfaceClip (debtgame.view.InterfaceClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class InterfaceClip extends MovieClip {
public var txt_debt;
public var n1;
public var n2;
public var n3;
public var n5;
public var n7;
public var n4;
public var n6;
public var n8;
public var txt_happiness;
public var b_tutor:mybutton;
public var txt_score;
public var txt_cash;
public var txt_necessities;
public var progressBar;
public var backBar;
public var txt_total;
public var hap_mc;
public var txt_cash2;
public var b_pause;
public var txt_level1;
public var txt_level2:TextField;
public var a1;
public var a2;
public var a3;
public var a4;
public var a5;
public var a6;
public var a7;
public var a8:MovieClip;
public var game:Main;
public var txt_needed;
public var txt_debt2;
public function InterfaceClip(_arg1){
this.game = _arg1;
updateNec();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
b_pause.addEventListener(MouseEvent.CLICK, onPause);
b_tutor.addEventListener(MouseEvent.CLICK, onTutor);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function onTutor(_arg1:MouseEvent){
game.pushTutorial2();
}
public function updateNec(){
txt_total.text = ("= $" + (Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities * 1000));
var _local1 = 1;
while (_local1 <= 8) {
if (Main.NECESSITIES < Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities){
this[("a" + _local1)].visible = false;
} else {
if (_local1 > Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities){
this[("a" + _local1)].visible = false;
} else {
this[("a" + _local1)].visible = true;
};
};
this[("n" + _local1)].visible = false;
this[("n" + _local1)].gotoAndStop(1);
if (_local1 <= Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities){
this[("n" + _local1)].visible = true;
txt_total.x = (this[("n" + _local1)].x + 70);
};
if (_local1 <= Main.NECESSITIES){
this[("n" + _local1)].gotoAndStop(2);
};
_local1++;
};
}
public function onEnterFrame(_arg1:Event){
if (Main.HAPPINESS > 100){
Main.HAPPINESS = 100;
};
if ((((((((game.tutorialScreen == null)) && ((game.view.tsunamiScreen == null)))) && ((game.tutorialScreen2 == null)))) && ((game.view.introScreen == null)))){
b_tutor.visible = true;
} else {
b_tutor.visible = false;
};
if (game.tutorialScreen2 != null){
b_pause.visible = false;
};
txt_cash2.text = ("$" + toMoney(txt_cash.text.split("$").join("")));
txt_debt2.text = ("$" + toMoney(txt_debt.text.split("$").join("")));
hap_mc.gotoAndStop((1 + Math.round((parseInt(txt_happiness.text) / 10))));
}
public function updateMeter(_arg1, _arg2){
progressBar.x = (backBar.x + (backBar.width * (_arg1 / _arg2)));
}
public function onPause(_arg1:MouseEvent){
game.newPause();
b_pause.visible = false;
}
}
}//package debtgame.view
Section 39
//IntroClip (debtgame.view.IntroClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class IntroClip extends MovieClip {
public var btngo:mybutton;
public var txt_lifeStyle:TextField;
public var txt_necessities;
public var txt_level;
public var gameView:GameView;
public function IntroClip(_arg1:GameView){
txt_level.text = (_arg1.model.levelNum + 1);
txt_necessities.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities;
txt_lifeStyle.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].kind;
this.gameView = _arg1;
btngo.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
gameView.removeIntroScreen();
}
public function onEnterFrame(_arg1:Event){
}
}
}//package debtgame.view
Section 40
//ItemClip (debtgame.view.ItemClip)
package debtgame.view {
import flash.display.*;
public class ItemClip extends MovieClip {
public var mc:MovieClip;
public var mc_sco;
public var mc_hap;
public function ItemClip(){
stop();
}
public function showAnis(_arg1, _arg2){
var _local3:int = _arg2;
var _local4:int = _arg1;
mc_hap.ani.cost.text = _local4;
mc_sco.ani.cost.text = ("" + _local3);
mc_hap.play();
mc_sco.play();
}
public function setType(_arg1:String):void{
gotoAndStop(_arg1);
}
}
}//package debtgame.view
Section 41
//ItemPixPlatform (debtgame.view.ItemPixPlatform)
package debtgame.view {
import flash.display.*;
public class ItemPixPlatform extends MovieClip {
public function ItemPixPlatform(){
stop();
}
public function setType(_arg1:String):void{
gotoAndStop(_arg1);
}
}
}//package debtgame.view
Section 42
//JetskiClip (debtgame.view.JetskiClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class JetskiClip extends MovieClip {
public var pp:MovieClip;
public var txt_cost;
public var mcBack;
public var last:int;
public var txt_hap:TextField;
public var txt_kind;
public var avatar:AvatarClip;
public var id:int;
public var mc;
public var options:OptionsClip;
public function JetskiClip(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
avatar = new AvatarClip();
avatar.scaleX = 0.4;
avatar.scaleY = 0.4;
pp.mouseEnabled = false;
pp.mouseChildren = false;
txt_hap.mouseEnabled = false;
avatar.x = 55;
avatar.y = 70;
txt_hap.text = "+3";
mc.gotoAndStop((_arg2 + 1));
mc.mouseEnabled = false;
avatar.mouseEnabled = false;
avatar.mouseChildren = false;
txt_cost.mouseEnabled = false;
txt_kind.mouseEnabled = false;
avatar.jet.gotoAndStop((_arg2 + 1));
avatar.jet.decal.gotoAndStop(1);
avatar.jet.color.gotoAndStop(Main.COLOR);
addEventListener(MouseEvent.CLICK, onClick);
addEventListener(MouseEvent.ROLL_OVER, onOver);
addEventListener(MouseEvent.ROLL_OUT, onOut);
}
private function onClick(_arg1:MouseEvent){
options.selectJetskiStyle(id);
}
public function onOver(_arg1:MouseEvent){
last = options.view.avatarClip.jet.currentFrame;
options.view.avatarClip.jet.gotoAndStop((id + 1));
}
public function onOut(_arg1:MouseEvent){
options.view.avatarClip.jet.gotoAndStop(last);
}
}
}//package debtgame.view
Section 43
//JumpClip (debtgame.view.JumpClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class JumpClip extends MovieClip {
public var pp:MovieClip;
public var txt_kind;
public var txt_hap:TextField;
public var id:int;
public var txt_cost;
public var mcBack;
public var options:OptionsClip;
public function JumpClip(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
txt_hap.text = "+4";
pp.mouseEnabled = false;
txt_hap.mouseEnabled = false;
txt_cost.mouseEnabled = false;
pp.mouseChildren = false;
txt_kind.mouseEnabled = false;
addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
options.selectJumpStyle(id);
}
}
}//package debtgame.view
Section 44
//levelpreview (debtgame.view.levelpreview)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class levelpreview extends MovieClip {
public var txt:TextField;
public var gameView:GameView;
public var ani:MovieClip;
public function levelpreview(_arg1:GameView){
this.gameView = _arg1;
ani.txt.text = (_arg1.model.levelNum + 1);
}
}
}//package debtgame.view
Section 45
//LifeStyleClip (debtgame.view.LifeStyleClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class LifeStyleClip extends MovieClip {
public var txt_kind:TextField;
public var mcBack:MovieClip;
public var txt_hap;
public var id:int;
public var txt_nec;
public var options:mylife;
public function LifeStyleClip(_arg1:mylife, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
var _local2:int = (id + 1);
Main.SoundM.playSound(("Lev" + _local2), 1);
options.selectLifeStyle(id);
}
}
}//package debtgame.view
Section 46
//LoseClip (debtgame.view.LoseClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class LoseClip extends MovieClip {
public var txt_score;
public var signo;
public var car;
public var txt_d;
public var txt_h:TextField;
public var btn_learn;
public var texto:MovieClip;
public var b:SimpleButton;
public var btn_go;
public var optionsScreen:OptionsClip2;
public var txt_s;
public var gameView:GameView;
public var btn_share:mybutton;
public function LoseClip(_arg1:GameView, _arg2){
Main.SoundM.playSound("Gov", 1);
texto.gotoAndStop(_arg2);
var _local3:int = (((Main.cashModel.savings.prevBalance + Main.cashModel.savings.interest) - Main.cashModel.savings.purchases) + Main.cashModel.savings.income);
var _local4:int = Main.cashModel.credit.balance;
if (_local3 >= _local4){
Main.SCORE = ((_local3 - _local4) * Main.HAPPINESS);
signo.gotoAndStop(1);
} else {
Main.SCORE = Math.round(((_local3 - _local4) / Main.HAPPINESS));
signo.gotoAndStop(2);
};
txt_d.text = ("$" + toMoney(_local4));
txt_s.text = ("$" + toMoney(_local3));
txt_h.text = String(Main.HAPPINESS);
txt_score.text = toMoney(Main.SCORE);
car.buttonMode = true;
car.useHandCursor = true;
this.gameView = _arg1;
btn_learn.addEventListener(MouseEvent.CLICK, onLearn);
car.addEventListener(MouseEvent.CLICK, onLearn);
btn_share.addEventListener(MouseEvent.CLICK, onShare);
btn_go.addEventListener(MouseEvent.CLICK, onClick);
}
public function onShare(_arg1:MouseEvent){
optionsScreen = new OptionsClip2(gameView);
addChild(optionsScreen);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function onLearn(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.indebted.com/roadmap/");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
private function onClick(_arg1:MouseEvent){
gameView.removeLoseScreen();
}
public function removeShare(){
removeChild(optionsScreen);
optionsScreen = null;
}
}
}//package debtgame.view
Section 47
//miniItem (debtgame.view.miniItem)
package debtgame.view {
import flash.display.*;
import flash.text.*;
public class miniItem extends MovieClip {
public var mc:MovieClip;
public var txt_hap:TextField;
public var theCost;
public function miniItem(){
stop();
}
public function setType(_arg1:String):void{
mc.gotoAndStop(_arg1);
}
}
}//package debtgame.view
Section 48
//minpayment (debtgame.view.minpayment)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class minpayment extends MovieClip {
public var btn_Back:mybutton;
public var txt_msg:TextField;
public var platform:GameView;
public var btn_back:SimpleButton;
public function minpayment(_arg1, _arg2){
txt_msg.text = _arg2;
this.platform = _arg1;
btn_Back.addEventListener(MouseEvent.CLICK, onCloseUpload);
btn_back.mouseEnabled = false;
}
private function onCloseUpload(_arg1:MouseEvent){
platform.removePaymentScreen();
}
}
}//package debtgame.view
Section 49
//mp3item (debtgame.view.mp3item)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class mp3item extends MovieClip {
private var d:Boolean;// = false
public var txt_desc;
private var l;
public var txt_desc2:TextField;
public var panel:mp3panel;
public var maska;
public var id:int;
public var maska2:MovieClip;
public function mp3item(_arg1, _arg2, _arg3){
this.panel = _arg1;
l = false;
d = false;
txt_desc.mouseEnabled = false;
txt_desc2.mouseEnabled = false;
this.id = _arg3;
txt_desc.text = _arg2;
txt_desc2.text = _arg2;
txt_desc.autoSize = TextFieldAutoSize.LEFT;
txt_desc2.autoSize = TextFieldAutoSize.LEFT;
txt_desc.text = _arg2;
while (txt_desc.width > (maska.width - 15)) {
txt_desc.text = (String(txt_desc.text).substring(0, (txt_desc.text.length - 5)) + " ...");
};
txt_desc2.text = _arg2;
txt_desc.mouseEnabled = false;
txt_desc2.mouseEnabled = false;
txt_desc.mask = maska;
txt_desc2.mask = maska2;
txt_desc2.x = ((txt_desc.x + txt_desc.width) + 100);
addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(_arg1:MouseEvent){
panel.player.loadMP3(panel.player.songs[id].file, id);
}
public function onEnterFrame(_arg1:Event){
if ((txt_desc.width + 8) > maska.width){
if (((txt_desc.x + txt_desc.width) + 8) > 0){
txt_desc.x = (txt_desc.x - 0.5);
} else {
txt_desc.x = ((txt_desc2.x + txt_desc2.width) + 100);
};
};
if ((txt_desc2.width + 8) > maska.width){
if (((txt_desc2.x + txt_desc2.width) + 8) > 0){
txt_desc2.x = (txt_desc2.x - 0.5);
} else {
txt_desc2.x = ((txt_desc.x + txt_desc.width) + 100);
};
};
}
}
}//package debtgame.view
Section 50
//mp3panel (debtgame.view.mp3panel)
package debtgame.view {
import flash.display.*;
public class mp3panel extends MovieClip {
public var player:mp3player;
public var item:mp3item;
public var itemArray:Array;
public function mp3panel(){
itemArray = new Array();
}
public function addMp3(_arg1, _arg2){
item = new mp3item(this, _arg1, _arg2);
item.y = (_arg2 * 25);
item.x = 3;
addChild(item);
}
}
}//package debtgame.view
Section 51
//mp3player (debtgame.view.mp3player)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.media.*;
public class mp3player extends MovieClip {
public var txt_desc;
public var channel:SoundChannel;
public var panel:mp3panel;
public var music:Sound;
public var b_next;
public var txt_desc2:TextField;
public var myXML:XML;
public var index:int;// = 0
public var b_pause:SimpleButton;
public var maska2:MovieClip;
private var d:Boolean;// = false
public var myLoader:URLLoader;
private var l;
public var back:MovieClip;
public var b_prev;
public var b_play;
public var maska;
public var songs:Array;
public function mp3player(){
txt_desc2.mask = maska2;
txt_desc.mask = maska;
panel.visible = false;
panel.player = this;
b_play.visible = false;
b_pause.visible = false;
txt_desc.mouseEnabled = false;
txt_desc2.mouseEnabled = false;
songs = new Array();
loadXML();
b_next.addEventListener(MouseEvent.CLICK, onNext);
b_prev.addEventListener(MouseEvent.CLICK, onPrev);
b_play.addEventListener(MouseEvent.CLICK, onPlay);
b_pause.addEventListener(MouseEvent.CLICK, onPause);
back.addEventListener(MouseEvent.CLICK, onClick);
back.buttonMode = true;
back.useHandCursor = true;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function onLoadCompleteVoice(_arg1:Event):void{
trace("GET READY!");
}
public function onPrev(_arg1:MouseEvent){
index--;
if (index < 0){
index = (songs.length - 1);
};
loadMP3(songs[index].file);
}
private function onEnterFrame(_arg1:Event){
txt_desc2.text = txt_desc.text;
if ((txt_desc.width + 8) > maska.width){
if (((txt_desc.x + txt_desc.width) + 8) > 0){
txt_desc.x = (txt_desc.x - 0.5);
} else {
txt_desc.x = ((txt_desc2.x + txt_desc2.width) + 100);
};
};
if ((txt_desc2.width + 8) > maska.width){
if (((txt_desc2.x + txt_desc2.width) + 8) > 0){
txt_desc2.x = (txt_desc2.x - 0.5);
} else {
txt_desc2.x = ((txt_desc.x + txt_desc.width) + 100);
};
};
}
function onPlay(_arg1:MouseEvent){
channel = null;
channel = music.play(0);
panel.visible = false;
b_play.visible = false;
b_pause.visible = true;
}
function onLoadComplete(_arg1:Event):void{
trace(songs[index].name);
playMusic();
b_pause.visible = true;
}
function onLoadProgress(_arg1:ProgressEvent):void{
var _local2:uint = Math.round((100 * (_arg1.bytesLoaded / _arg1.bytesTotal)));
trace((("The sound is " + _local2) + "% loaded."));
}
function onIOError(_arg1:IOErrorEvent){
trace(("The sound could not be loaded: " + _arg1.text));
}
public function loadMP3(_arg1, _arg2=null){
trace(_arg1);
b_play.visible = false;
b_pause.visible = false;
panel.visible = false;
if (channel != null){
channel.stop();
};
if (_arg2 != null){
index = _arg2;
};
txt_desc.text = "Loading";
txt_desc2.text = "Loading";
music = new Sound();
var _local3:URLRequest = new URLRequest((Main.CVARS.URL_BASE + _arg1));
trace((("REEEGG" + Main.CVARS.URL_BASE) + _arg1));
var _local4:SoundLoaderContext = new SoundLoaderContext(2000, false);
music.load(_local3, _local4);
b_pause.visible = true;
l = true;
d = false;
txt_desc.mouseEnabled = false;
txt_desc2.mouseEnabled = false;
txt_desc.text = songs[index].name;
txt_desc2.text = songs[index].name;
trace("NOMBRE", songs[index].name, songs[index].file, txt_desc.text);
txt_desc.autoSize = TextFieldAutoSize.LEFT;
txt_desc2.autoSize = TextFieldAutoSize.LEFT;
txt_desc.mouseEnabled = false;
txt_desc.mask = maska;
txt_desc2.mouseEnabled = false;
txt_desc2.mask = maska2;
trace(songs[index].name);
playMusic();
b_pause.visible = true;
txt_desc.x = 0;
txt_desc2.x = ((txt_desc.x + txt_desc.width) + 100);
}
function onPause(_arg1:MouseEvent){
channel.stop();
panel.visible = false;
b_play.visible = true;
b_pause.visible = false;
}
public function loadXML(){
myXML = new XML();
myXML.ignoreWhitespace = true;
var _local1 = (Main.CVARS.URL_BASE + "mp3.xml");
var _local2:URLRequest = new URLRequest(_local1);
myLoader = new URLLoader(_local2);
myLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
public function playMusic(){
if (channel != null){
channel = null;
};
channel = music.play(0);
music.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
if (index > 2){
channel.soundTransform = new SoundTransform(0.5);
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onClick(_arg1:MouseEvent){
if (panel.visible == true){
panel.visible = false;
} else {
panel.visible = true;
};
}
public function onNext(_arg1:MouseEvent){
index++;
if (index >= songs.length){
index = 0;
};
trace(index);
loadMP3(songs[index].file);
}
public function onPlaybackComplete(_arg1:Event){
trace("The sound has finished playing.");
index++;
if (index >= songs.length){
index = 0;
};
trace(index);
loadMP3(songs[index].file);
}
public function xmlLoaded(_arg1:Event){
var _local3:XML;
var _local2:* = XML(_arg1.target.data);
trace(_local2);
for each (_local3 in _local2.song) {
trace(_local3.@file);
songs.push({file:_local3.@file, name:_local3.@description});
panel.addMp3(_local3.@description, (songs.length - 1));
};
loadMP3(songs[index].file);
}
}
}//package debtgame.view
Section 52
//mybutton (debtgame.view.mybutton)
package debtgame.view {
import flash.events.*;
import flash.display.*;
public class mybutton extends MovieClip {
private var rewind:Boolean;// = false
public function mybutton(){
buttonMode = true;
useHandCursor = true;
stop();
addEventListener(MouseEvent.MOUSE_OVER, onRollOver);
addEventListener(MouseEvent.MOUSE_OUT, onRollOut);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function onRollOver(_arg1:MouseEvent){
Main.SoundM.playSound("Rol", 1);
rewind = false;
play();
}
function onRollOut(_arg1:MouseEvent){
rewind = true;
}
function onEnterFrame(_arg1:Event){
if (currentFrame == totalFrames){
stop();
};
if (rewind == true){
prevFrame();
};
}
}
}//package debtgame.view
Section 53
//mylife (debtgame.view.mylife)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
public class mylife extends MovieClip {
public var platform:GameView;
public var lifeStylePanel:LifeStyleClip;
public var lfArray:Array;
public function mylife(_arg1){
var _local2:*;
var _local3:Number;
super();
this.platform = _arg1;
_local2 = 215;
_local3 = 164;
lfArray = new Array();
var _local4:int;
while (_local4 < Main.CVARS.LIFE_STYLE.length) {
lifeStylePanel = new LifeStyleClip(this, _local4);
lifeStylePanel.txt_kind.text = Main.CVARS.LIFE_STYLE[_local4].kind;
lifeStylePanel.txt_nec.text = Main.CVARS.LIFE_STYLE[_local4].necessities;
lifeStylePanel.txt_hap.text = Main.CVARS.LIFE_STYLE[_local4].happiness;
lfArray.push(lifeStylePanel);
addChild(lifeStylePanel);
lifeStylePanel.x = _local2;
lifeStylePanel.y = _local3;
_local2 = (_local2 + 148);
_local4++;
};
lfArray[Main.LIFE_STYLE].mcBack.gotoAndStop(2);
}
public function selectLifeStyle(_arg1){
var _local2:int;
while (_local2 < Main.CVARS.LIFE_STYLE.length) {
lfArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
lfArray[_arg1].mcBack.gotoAndStop(2);
if (_arg1 == (Main.LIFE_STYLE + 1)){
Main.HAPPINESS = (Main.HAPPINESS + 5);
} else {
if (_arg1 == (Main.LIFE_STYLE + 2)){
Main.HAPPINESS = (Main.HAPPINESS + 10);
};
};
if (_arg1 == (Main.LIFE_STYLE - 1)){
Main.HAPPINESS = (Main.HAPPINESS - 5);
} else {
if (_arg1 == (Main.LIFE_STYLE - 2)){
Main.HAPPINESS = (Main.HAPPINESS - 10);
};
};
Main.LIFE_STYLE = _arg1;
trace(Main.LIFE_STYLE);
platform.removeLife();
}
}
}//package debtgame.view
Section 54
//NumericStepper2 (debtgame.view.NumericStepper2)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class NumericStepper2 extends MovieClip {
private var _down:Boolean;
private var delay:int;// = 0
private var _minimum:Number;
public var btnUp;
public var btnDown:SimpleButton;
private var _maximum;
public var txt_value:TextField;
private var _value:Number;
private var _up;
public function NumericStepper2(){
_value = 0;
_up = false;
_down = false;
btnUp.addEventListener(MouseEvent.CLICK, onUpClick);
btnDown.addEventListener(MouseEvent.CLICK, onDownClick);
btnUp.addEventListener(MouseEvent.MOUSE_OUT, onUpIsUp);
btnDown.addEventListener(MouseEvent.MOUSE_OUT, onDownIsUp);
btnUp.addEventListener(MouseEvent.MOUSE_DOWN, onUpIsDown);
btnDown.addEventListener(MouseEvent.MOUSE_DOWN, onDownIsDown);
btnUp.addEventListener(MouseEvent.MOUSE_UP, onUpIsUp);
btnDown.addEventListener(MouseEvent.MOUSE_UP, onDownIsUp);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
maximum = 10;
minimum = 0;
}
public function set maximum(_arg1:Number){
_maximum = _arg1;
}
public function get minimum():Number{
return (_minimum);
}
public function onUpClick(_arg1:MouseEvent){
_value++;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
}
public function set minimum(_arg1:Number){
_minimum = _arg1;
}
public function onUpIsUp(_arg1:MouseEvent){
_up = false;
delay = 0;
}
public function get maximum():Number{
return (_maximum);
}
public function onUpIsDown(_arg1:MouseEvent){
_up = true;
}
public function onDownClick(_arg1:MouseEvent){
_value--;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
}
public function set value(_arg1:Number){
_value = _arg1;
updateLabel();
}
private function updateLabel(){
txt_value.text = String(_value);
}
public function onDownIsDown(_arg1:MouseEvent){
_down = true;
}
public function get value():Number{
return (_value);
}
public function onDownIsUp(_arg1:MouseEvent){
_down = false;
delay = 0;
}
private function onEnterFrame(_arg1:Event){
if (((_up) && ((delay > 20)))){
btnUp.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
if (((_down) && ((delay > 20)))){
btnDown.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
if ((((delay <= 20)) && ((((_up == true)) || ((_down == true)))))){
delay++;
};
if (value > maximum){
value = maximum;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
};
if (value < minimum){
value = minimum;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
};
}
}
}//package debtgame.view
Section 55
//NumericStepperCustom (debtgame.view.NumericStepperCustom)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class NumericStepperCustom extends MovieClip {
private var _down:Boolean;
private var _minimum:Number;
public var btnUp;
public var btnDown:SimpleButton;
private var _maximum;
public var txt_value:TextField;
private var _value:Number;
private var _up;
public function NumericStepperCustom(){
_value = 0;
_up = false;
_down = false;
btnUp.addEventListener(MouseEvent.CLICK, onUpClick);
btnDown.addEventListener(MouseEvent.CLICK, onDownClick);
btnUp.addEventListener(MouseEvent.MOUSE_OUT, onUpIsUp);
btnDown.addEventListener(MouseEvent.MOUSE_OUT, onDownIsUp);
btnUp.addEventListener(MouseEvent.MOUSE_DOWN, onUpIsDown);
btnDown.addEventListener(MouseEvent.MOUSE_DOWN, onDownIsDown);
btnUp.addEventListener(MouseEvent.MOUSE_UP, onUpIsUp);
btnDown.addEventListener(MouseEvent.MOUSE_UP, onDownIsUp);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
maximum = 10;
minimum = 0;
}
public function set maximum(_arg1:Number){
_maximum = _arg1;
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function get minimum():Number{
return (_minimum);
}
public function onUpClick(_arg1:MouseEvent){
_value++;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
}
public function set minimum(_arg1:Number){
_minimum = _arg1;
}
public function onUpIsUp(_arg1:MouseEvent){
_up = false;
}
public function get maximum():Number{
return (_maximum);
}
public function onUpIsDown(_arg1:MouseEvent){
_up = true;
}
public function onDownClick(_arg1:MouseEvent){
_value--;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
}
public function set value(_arg1:Number){
_value = _arg1;
updateLabel();
}
private function updateLabel(){
txt_value.text = String(toMoney(_value));
}
public function onDownIsDown(_arg1:MouseEvent){
_down = true;
}
public function get value():Number{
return (_value);
}
public function onDownIsUp(_arg1:MouseEvent){
_down = false;
}
private function onEnterFrame(_arg1:Event){
var _local2:int;
while (_local2 < 10) {
if (_up){
btnUp.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
if (_down){
btnDown.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
if (value > maximum){
value = maximum;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
};
if (value < minimum){
value = minimum;
updateLabel();
dispatchEvent(new Event(Event.CHANGE));
};
_local2++;
};
}
}
}//package debtgame.view
Section 56
//OptionsClip (debtgame.view.OptionsClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class OptionsClip extends MovieClip {
public var txt_score;
public var payment:NumericStepperCustom;
public var b1;
public var b2;
public var b3;
public var b4;
public var b5:SimpleButton;
public var txt_totalSaving;
public var btn_swep:mybutton;
public var bar;
public var txt_paymentsCredit;
public var btn_prev;
public var btn_credit;
public var btn_share;
public var txt_embed:TextField;
public var contacto:contactar;
public var selectedJetski;
public var txt_d;
public var decalPanel:DecalsClip;
public var txt_income;
public var min_pay2;
public var colorPanel:colorClips;
public var txt_s;
public var ocult;
public var txt_interestCredit;
public var mc_hap;
public var jumpPanel:JumpClip;
public var txt_interestSaving;
public var mcpurchasessavings;
public var mc_hapiness;
public var credit_mc;
public var view:GameView;
public var activePanel:String;
public var col1;
public var col2;
public var btnPay;
public var col4;
public var mcpurchasescredit;
public var mcprevbalancecredit;
public var mcbar;
public var mcincome;
public var col5;
public var col6;
public var embedpanel;
public var col3;
public var colorsArray:Array;
public var jumpArray;
public var selectedEngine;
public var enginePanel:EngineClip;
public var lifeStylePanel:LifeStyleClip;
public var txt_balaneCredit;
public var btn_next;
public var lfArray;
public var mcbalancesaving;
public var selectedPig;
public var mcbalancecredit;
public var sweept;
public var jetskiPanel:JetskiClip;
public var mcsweep;
public var myColor:colorClip;
public var pigPanel:PigClip;
public var txt_savinggeneral;
public var txt_happiness2;
public var btn_cash;
public var btn_play:mybutton;
public var paydebt;
public var engineArray;
public var myHap:int;
public var b_title1;
public var b_title2;
public var b_title3;
public var b_title4;
public var mc1;
public var mc2;
public var mc3;
public var mc4;
public var jetskiArray;
public var txt_purchasesCredit;
public var txt_in2;
public var mc5;
public var selectedJump;
public var pigArray;
public var txt_balanceSaving;
public var txt_in1;
public var item_cost;
public var mcpaymentscredit;
public var firsttime:Boolean;// = true
public var txt_purchasesSaving;
public var btn_send;
public var gigya;
public var selectedColor:Number;// = -1
public var txt_balanceCredit;
public var myCost;
public var mcp;
public var mcBack;
public var btn_validate;
public var decalsArray;
public var txt_debtgeneral;
public var mcinterestcredit;
public var mcinterestsaving;
public var btn_cancel;
public var p1;
public var p2;
public var p3;
public var p4;
public var signito;
public var cost;
public var selectedDecal;
public var mcVeri;
public var ani;
public var mctotalsaving;
public var myColor2:colorClip2;
public var mc_sco:MovieClip;
public function OptionsClip(_arg1:GameView){
if (Main.sweepV == true){
btn_swep.visible = false;
sweept.visible = false;
mcsweep.visible = true;
} else {
sweept.visible = true;
btn_swep.visible = true;
mcsweep.visible = false;
};
sweept.mouseEnabled = false;
if (Main.cashModel.credit.interestRate < 30){
if (_arg1.shouldPay == true){
if ((((_arg1.loseScreen == null)) && ((_arg1.winScreen == null)))){
_arg1.pushPaymentScreen((((("" + Main.cashModel.credit.interestRate) + "% to ") + int((Main.cashModel.credit.interestRate + 2))) + "%"));
};
if (Main.cashModel.credit.interestRate < 30){
Main.cashModel.credit.interestRate = (Main.cashModel.credit.interestRate + 2);
Main.cashModel.credit.interest = (Main.cashModel.credit.interest + Math.round((Main.cashModel.credit.prevBalance * 0.02)));
};
};
};
p2.item_cost.text = "";
this.view = _arg1;
y = (y - 20);
x = (x - 130);
p1.b_title1.addEventListener(MouseEvent.CLICK, onTitleClick);
p2.b_title2.addEventListener(MouseEvent.CLICK, onTitleClick);
p3.b_title3.addEventListener(MouseEvent.CLICK, onTitleClick);
p4.b_title4.addEventListener(MouseEvent.CLICK, onTitleClick);
p2.b1.addEventListener(MouseEvent.CLICK, onUpgradeClick);
p2.b2.addEventListener(MouseEvent.CLICK, onUpgradeClick);
p2.b3.addEventListener(MouseEvent.CLICK, onUpgradeClick);
p2.b4.addEventListener(MouseEvent.CLICK, onUpgradeClick);
p2.b5.addEventListener(MouseEvent.CLICK, onUpgradeClick);
p2.b1.addEventListener(MouseEvent.MOUSE_OVER, onUpgradeOver);
p2.b2.addEventListener(MouseEvent.MOUSE_OVER, onUpgradeOver);
p2.b3.addEventListener(MouseEvent.MOUSE_OVER, onUpgradeOver);
p2.b4.addEventListener(MouseEvent.MOUSE_OVER, onUpgradeOver);
p2.b5.addEventListener(MouseEvent.MOUSE_OVER, onUpgradeOver);
p3.paydebt.addEventListener(MouseEvent.CLICK, onPayDebt);
p2.btn_cash.addEventListener(MouseEvent.CLICK, onCash);
p2.btn_credit.addEventListener(MouseEvent.CLICK, onCredit);
p4.embedpanel.mcVeri.btn_validate.addEventListener(MouseEvent.CLICK, onValidate);
p4.btn_share.addEventListener(MouseEvent.CLICK, onShare);
p4.btn_send.addEventListener(MouseEvent.CLICK, onSend);
btn_play.addEventListener(MouseEvent.CLICK, onPlay);
p4.b1.addEventListener(MouseEvent.CLICK, onp4b1);
p4.b2.addEventListener(MouseEvent.CLICK, onp4b2);
p4.b3.addEventListener(MouseEvent.CLICK, onp4b3);
btn_swep.addEventListener(MouseEvent.CLICK, onSweep);
setLifeStyleContent();
setJetDecalsContent();
setJetskiContent();
setEngineContent();
setJumpContent();
setColorsContent();
p4.embedpanel.txt_embed.addEventListener(MouseEvent.CLICK, onTextClick);
p4.embedpanel.txt_embed.text = (((((((("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\" width=\"880\" height=\"440\" id=\"widget\" align=\"middle\"><param name=\"play\" value=\"false\" /><param name=\"loop value=\"false\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\"" + Main.CVARS.URL_GAME) + "?id=") + Main.myID) + "\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#BBECFF\" /><embed src=\"") + Main.CVARS.URL_GAME) + "?id=") + Main.myID) + "\" quality=\"high\" bgcolor=\"#BBECFF\" width=\"880\" height=\"440\" name=\"player\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" /></object>");
activePanel = "mc1";
p3.mcp.payment.maximum = 10000;
p3.mcp.btn_cancel.addEventListener(MouseEvent.CLICK, onCancel);
p3.mcp.payment.addEventListener(Event.CHANGE, changeHandler);
p3.mcp.btnPay.addEventListener(MouseEvent.CLICK, onPay);
p2.mc2.btn_prev.addEventListener(MouseEvent.CLICK, onPrev);
p2.mc1.btn_next.addEventListener(MouseEvent.CLICK, onNext);
if (_arg1.model.levelNum != -1){
this.p3.b_title3.visible = false;
this.p1.ocult.visible = false;
setChildIndex(p3, (this.numChildren - 1));
} else {
this.p2.b_title2.enabled = false;
this.p3.b_title3.enabled = false;
this.p4.b_title4.enabled = false;
this.p2.b_title2.alpha = 0.5;
this.p3.b_title3.alpha = 0.5;
this.p4.b_title4.alpha = 0.5;
this.p2.b_title2.mouseEnabled = false;
this.p3.b_title3.mouseEnabled = false;
this.p4.b_title4.mouseEnabled = false;
this.p1.ocult.visible = true;
p3.credit_mc.visible = false;
this.p1.b_title1.visible = false;
setChildIndex(p1, (this.numChildren - 1));
};
p2.b5.visible = false;
updateBanking();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
_arg1.avatarClip.pig.y = -113;
_arg1.avatarClip.jet.y = -83;
p2.mc_hap.stop();
p2.mc_sco.stop();
p4.contacto.visible = false;
p4.embedpanel.visible = false;
p4.b1.visible = false;
p4.b2.visible = true;
p4.b3.visible = true;
p4.contacto.platform = this;
p3.mcp.visible = false;
if (((!((_arg1.loseScreen == null))) || (!((_arg1.winScreen == null))))){
p4.embedpanel.mcVeri.visible = false;
} else {
p4.embedpanel.mcVeri.visible = true;
};
p2.mc5.visible = true;
activePanel = "mc5";
}
public function onSend(_arg1:MouseEvent){
contacto = new contactar(this);
contacto.y = 20;
contacto.x = 130;
addChild(contacto);
}
public function onValidate(_arg1:MouseEvent){
var _local2:URLLoader;
var _local3:URLVariables;
var _local4:URLRequest;
if (view.msgScreen == null){
_local2 = new URLLoader();
_local3 = new URLVariables();
_local3.sid = Main.myID;
_local4 = new URLRequest(Main.CVARS.URL_VALIDATE);
_local4.data = _local3;
_local2.addEventListener(Event.COMPLETE, handleLoadID);
_local2.load(_local4);
};
}
public function selectJetskiStyle(_arg1){
var _local2:int;
if (_arg1 != Main.SKI_STYLE){
p2.item_cost.text = (("($" + jetskiArray[_arg1].txt_cost.text) + ")");
_local2 = 0;
while (_local2 < Main.CVARS.JET_STYLE.length) {
jetskiArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
jetskiArray[Main.SKI_STYLE].mcBack.gotoAndStop(3);
jetskiArray[_arg1].mcBack.gotoAndStop(2);
selectedJetski = _arg1;
};
}
public function setColor(_arg1){
var _local2:int;
while (_local2 < Main.CVARS.DECALS_STYLE.length) {
decalsArray[_local2].avatar.jet.color.gotoAndStop(_arg1);
_local2++;
};
_local2 = 0;
while (_local2 < Main.CVARS.JET_STYLE.length) {
jetskiArray[_local2].avatar.jet.color.gotoAndStop(_arg1);
_local2++;
};
Main.COLOR = _arg1;
}
public function selectDecalStyle(_arg1){
var _local2:int;
if (gotDecal(_arg1) == false){
p2.item_cost.text = (("($" + decalsArray[_arg1].txt_cost.text) + ")");
_local2 = 0;
while (_local2 < Main.CVARS.DECALS_STYLE.length) {
decalsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
if (Main.DECAL_STYLE[0] != null){
decalsArray[Main.DECAL_STYLE[0]].mcBack.gotoAndStop(3);
};
decalsArray[_arg1].mcBack.gotoAndStop(2);
selectedDecal = _arg1;
};
}
public function selectColorStyle(_arg1){
var _local2:int;
if (_arg1 != Main.COLOR){
_local2 = 0;
while (_local2 < Main.CVARS.COLOR_STYLE.length) {
colorsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
colorsArray[Main.COLOR].mcBack.gotoAndStop(3);
colorsArray[_arg1].mcBack.gotoAndStop(2);
selectedColor = _arg1;
};
}
public function setColor2(_arg1){
var _local2:int;
while (_local2 < Main.CVARS.DECALS_STYLE.length) {
decalsArray[_local2].avatar.jet.color.gotoAndStop(_arg1);
_local2++;
};
_local2 = 0;
while (_local2 < Main.CVARS.JET_STYLE.length) {
jetskiArray[_local2].avatar.jet.color.gotoAndStop(_arg1);
_local2++;
};
Main.COLOR = _arg1;
}
public function setJetskiContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
jetskiArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.JET_STYLE.length) {
jetskiPanel = new JetskiClip(this, _local3);
jetskiPanel.txt_kind.text = Main.CVARS.JET_STYLE[_local3].kind;
jetskiPanel.txt_cost.text = Main.CVARS.JET_STYLE[_local3].cost;
jetskiArray.push(jetskiPanel);
jetskiPanel.x = _local1;
jetskiPanel.y = _local2;
if (_local3 != 0){
_local1 = (_local1 + 113);
} else {
jetskiPanel.visible = false;
};
p2.mc2.addChild(jetskiPanel);
if (_local3 == 3){
_local1 = 5;
_local2 = (_local2 + 115);
};
_local3++;
};
_local3 = 2;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
jetskiArray[Main.SKI_STYLE].mcBack.gotoAndStop(3);
}
public function onPay(_arg1:MouseEvent){
if (p3.mcp.payment.value != 0){
Main.cashModel.credit.payments = (Main.cashModel.credit.payments + p3.mcp.payment.value);
Main.cashModel.spendingDataDebit.push({name:"Credit Card Payment", cost:p3.mcp.payment.value});
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + p3.mcp.payment.value);
if (p3.mcp.payment.value >= Main.cashModel.credit.minimum){
Main.cashModel.credit.minimum = (Main.cashModel.credit.minimum - p3.mcp.payment.value);
if (Main.cashModel.credit.minimum < 0){
Main.cashModel.credit.minimum = 0;
};
};
p3.mcp.payment.value = 0;
updateBanking();
} else {
view.pushMsgScreen("Not enough savings");
};
}
private function onUpgradeClick(_arg1:MouseEvent){
var _local2:int;
p2.item_cost.text = "";
var _local3:int;
while (_local3 <= 4) {
_local2 = (_local3 + 1);
p2[("mc" + _local2)].visible = false;
p2[("b" + _local2)].visible = true;
_local3++;
};
if (_arg1.currentTarget.enabled == true){
switch (_arg1.currentTarget.name){
case "b1":
p2.b1.visible = false;
p2.mc1.visible = true;
activePanel = "mc1";
break;
case "b2":
p2.b2.visible = false;
p2.mc2.visible = true;
activePanel = "mc2";
break;
case "b3":
p2.b3.visible = false;
p2.mc3.visible = true;
activePanel = "mc3";
break;
case "b4":
p2.b4.visible = false;
p2.mc4.visible = true;
activePanel = "mc4";
break;
case "b5":
p2.b5.visible = false;
p2.mc5.visible = true;
activePanel = "mc5";
break;
};
};
}
public function onSweep(_arg1:MouseEvent){
view.pushSweep();
}
public function selectLifeStyle(_arg1){
var _local2:int;
while (_local2 < Main.CVARS.LIFE_STYLE.length) {
lfArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
lfArray[_arg1].mcBack.gotoAndStop(2);
if (_arg1 == (Main.LIFE_STYLE + 1)){
Main.HAPPINESS = (Main.HAPPINESS + 5);
} else {
if (_arg1 == (Main.LIFE_STYLE + 2)){
Main.HAPPINESS = (Main.HAPPINESS + 10);
};
};
if (_arg1 == (Main.LIFE_STYLE - 1)){
Main.HAPPINESS = (Main.HAPPINESS - 5);
} else {
if (_arg1 == (Main.LIFE_STYLE - 2)){
Main.HAPPINESS = (Main.HAPPINESS - 10);
};
};
Main.LIFE_STYLE = _arg1;
Main.interfaceScreen.txt_happiness.text = (Main.HAPPINESS + "%");
Main.interfaceScreen.updateNec();
trace(Main.LIFE_STYLE);
}
public function onPayDebt(_arg1:MouseEvent){
p3.mcp.visible = true;
}
function gotDecal(_arg1){
var _local2:Boolean;
var _local3:int;
while (_local3 < Main.DECAL_STYLE.length) {
if (Main.DECAL_STYLE[_local3] == _arg1){
_local2 = true;
};
_local3++;
};
return (_local2);
}
public function selectJumpStyle(_arg1){
var _local2:int;
if (_arg1 == (Main.JUMP_STAGE + 1)){
_local2 = 0;
while (_local2 < Main.CVARS.AIR_SPEEDS.length) {
jumpArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
p2.item_cost.text = (("($" + jumpArray[_arg1].txt_cost.text) + ")");
if (Main.JUMP_STAGE != -1){
jumpArray[Main.JUMP_STAGE].mcBack.gotoAndStop(3);
};
jumpArray[_arg1].mcBack.gotoAndStop(2);
selectedJump = _arg1;
} else {
if (_arg1 <= (Main.JUMP_STAGE + 1)){
view.pushMsgScreen("You already got this");
} else {
view.pushMsgScreen("You need the previous stage");
};
};
}
public function setEngineContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
engineArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.MOVE_SPEEDS.length) {
enginePanel = new EngineClip(this, _local3);
enginePanel.txt_kind.text = Main.CVARS.UPGRADE_TEXT[_local3];
enginePanel.txt_cost.text = Main.CVARS.UPGRADE_COSTS[_local3];
engineArray.push(enginePanel);
p2.mc3.addChild(enginePanel);
enginePanel.x = _local1;
enginePanel.y = _local2;
_local1 = (_local1 + 113);
if (_local3 == 2){
_local1 = 5;
_local2 = (_local2 + 115);
};
_local3++;
};
_local3 = 2;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
_local3 = 0;
while (_local3 < Main.CVARS.MOVE_SPEEDS.length) {
if ((Main.ENGINE_STAGE + 1) < _local3){
engineArray[_local3].alpha = 0.5;
};
_local3++;
};
if (Main.ENGINE_STAGE != -1){
engineArray[Main.ENGINE_STAGE].mcBack.gotoAndStop(3);
};
}
public function setJumpContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
jumpArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.AIR_SPEEDS.length) {
jumpPanel = new JumpClip(this, _local3);
jumpPanel.txt_kind.text = Main.CVARS.UPGRADE_TEXT[_local3];
jumpPanel.txt_cost.text = Main.CVARS.UPGRADE_COSTS[_local3];
jumpArray.push(jumpPanel);
p2.mc4.addChild(jumpPanel);
jumpPanel.x = _local1;
jumpPanel.y = _local2;
_local1 = (_local1 + 113);
if (_local3 == 2){
_local1 = 5;
_local2 = (_local2 + 115);
};
_local3++;
};
_local3 = 1;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
_local3 = 0;
while (_local3 < Main.CVARS.AIR_SPEEDS.length) {
if ((Main.JUMP_STAGE + 1) < _local3){
jumpArray[_local3].alpha = 0.5;
};
_local3++;
};
if (Main.JUMP_STAGE != -1){
jumpArray[Main.JUMP_STAGE].mcBack.gotoAndStop(3);
};
}
public function onPrev(_arg1:MouseEvent){
p2.mc1.visible = true;
p2.mc2.visible = false;
activePanel = "mc1";
}
public function onEnterFrame(_arg1:Event){
p3.mcp.min_pay2.text = toMoney(int(p3.mcp.min_pay.text));
p3.mcp.mcbar.bar.width = p3.mcbar.bar.width;
p3.min_pay.text = p3.mcp.min_pay.text;
p3.mcp.txt_s.text = toMoney(Main.cashModel.savings.total);
p3.mcp.txt_d.text = toMoney(Main.cashModel.credit.balance);
mc_hapiness.gotoAndStop(Main.interfaceScreen.hap_mc.currentFrame);
txt_score.text = toMoney(Main.SCORE);
if (Main.cashModel.savings.total >= Main.cashModel.credit.balance){
Main.SCORE = int(((Main.cashModel.savings.total - Main.cashModel.credit.balance) * Main.HAPPINESS));
signito.gotoAndStop(1);
} else {
Main.SCORE = int(((Main.cashModel.savings.total - Main.cashModel.credit.balance) / Main.HAPPINESS));
signito.gotoAndStop(2);
};
txt_savinggeneral.text = ("$" + toMoney(int(removeComa(p3.mctotalsaving.txt_totalSaving.text))));
txt_debtgeneral.text = ("$" + toMoney(int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text))));
txt_happiness2.text = Main.interfaceScreen.txt_happiness.text;
if (view.payment == null){
if (int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) < Main.cashModel.savings.prevBalance){
p3.mcbalancesaving.txt_balanceSaving.text = toMoney((int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) + Math.min(50, distance(int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)), Main.cashModel.savings.prevBalance))));
};
if (int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) > Main.cashModel.savings.prevBalance){
p3.mcbalancesaving.txt_balanceSaving.text = toMoney((int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) - Math.min(50, distance(int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)), Main.cashModel.savings.prevBalance))));
};
if (int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) == Main.cashModel.savings.prevBalance){
if (int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) < Main.cashModel.savings.interest){
p3.mcinterestsaving.scaleX = 1.5;
p3.mcinterestsaving.scaleY = 1.5;
p3.mcinterestsaving.txt_interestSaving.text = toMoney((int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) + Math.min(50, distance(int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)), Main.cashModel.savings.interest))));
} else {
if (int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) > Main.cashModel.savings.interest){
p3.mcinterestsaving.scaleX = 1.5;
p3.mcinterestsaving.scaleY = 1.5;
p3.mcinterestsaving.txt_interestSaving.text = toMoney((int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) - Math.min(50, distance(int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)), Main.cashModel.savings.interest))));
} else {
p3.mcinterestsaving.scaleX = 1;
p3.mcinterestsaving.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) == Main.cashModel.savings.interest){
if (int(removeComa(p3.mcincome.txt_income.text)) < Main.cashModel.savings.income){
p3.mcincome.scaleX = 1.5;
p3.mcincome.scaleY = 1.5;
p3.mcincome.txt_income.text = toMoney((int(removeComa(p3.mcincome.txt_income.text)) + Math.min(50, distance(int(removeComa(p3.mcincome.txt_income.text)), Main.cashModel.savings.income))));
} else {
if (int(removeComa(p3.mcincome.txt_income.text)) > Main.cashModel.savings.income){
p3.mcincome.scaleX = 1.5;
p3.mcincome.scaleY = 1.5;
p3.mcincome.txt_income.text = toMoney((int(removeComa(p3.mcincome.txt_income.text)) - Math.min(50, distance(int(removeComa(p3.mcincome.txt_income.text)), Main.cashModel.savings.income))));
} else {
p3.mcincome.scaleX = 1;
p3.mcincome.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcincome.txt_income.text)) == Main.cashModel.savings.income){
if (int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) < Main.cashModel.savings.purchases){
p3.mcpurchasessavings.scaleX = 1.5;
p3.mcpurchasessavings.scaleY = 1.5;
p3.mcpurchasessavings.txt_purchasesSaving.text = toMoney((int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) + Math.min(50, distance(int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)), Main.cashModel.savings.purchases))));
} else {
if (int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) > Main.cashModel.savings.purchases){
p3.mcpurchasessavings.scaleX = 1.5;
p3.mcpurchasessavings.scaleY = 1.5;
p3.mcpurchasessavings.txt_purchasesSaving.text = toMoney((int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) - Math.min(50, distance(int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)), Main.cashModel.savings.purchases))));
} else {
p3.mcpurchasessavings.scaleX = 1;
p3.mcpurchasessavings.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) == Main.cashModel.savings.purchases){
if (int(removeComa(p3.mctotalsaving.txt_totalSaving.text)) < Main.cashModel.savings.total){
p3.mctotalsaving.scaleX = 1.5;
p3.mctotalsaving.scaleY = 1.5;
p3.mctotalsaving.txt_totalSaving.text = toMoney((int(removeComa(p3.mctotalsaving.txt_totalSaving.text)) + Math.min(50, distance(int(removeComa(p3.mctotalsaving.txt_totalSaving.text)), Main.cashModel.savings.total))));
} else {
if (int(removeComa(p3.mctotalsaving.txt_totalSaving.text)) > Main.cashModel.savings.total){
p3.mctotalsaving.scaleX = 1.5;
p3.mctotalsaving.scaleY = 1.5;
p3.mctotalsaving.txt_totalSaving.text = toMoney((int(removeComa(p3.mctotalsaving.txt_totalSaving.text)) - Math.min(50, distance(int(removeComa(p3.mctotalsaving.txt_totalSaving.text)), Main.cashModel.savings.total))));
} else {
p3.mctotalsaving.scaleX = 1;
p3.mctotalsaving.scaleY = 1;
};
};
};
if ((((((((int(removeComa(p3.mcpurchasessavings.txt_purchasesSaving.text)) == Main.cashModel.savings.purchases)) && ((int(removeComa(p3.mcincome.txt_income.text)) == Main.cashModel.savings.income)))) && ((int(removeComa(p3.mcinterestsaving.txt_interestSaving.text)) == Main.cashModel.savings.interest)))) && ((int(removeComa(p3.mcbalancesaving.txt_balanceSaving.text)) == Main.cashModel.savings.prevBalance)))){
if (int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)) < Main.cashModel.credit.prevBalance){
p3.mcprevbalancecredit.txt_prevbalanceCredit.text = toMoney((int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)) + Math.min(50, distance(int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)), Main.cashModel.credit.prevBalance))));
};
if (int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)) > Main.cashModel.credit.prevBalance){
p3.mcprevbalancecredit.txt_prevbalanceCredit.text = toMoney((int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)) - Math.min(50, distance(int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)), Main.cashModel.credit.prevBalance))));
};
if (int(removeComa(p3.mcprevbalancecredit.txt_prevbalanceCredit.text)) == Main.cashModel.credit.prevBalance){
if (int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)) < Main.cashModel.credit.interest){
p3.mcinterestcredit.scaleX = 1.5;
p3.mcinterestcredit.scaleY = 1.5;
p3.mcinterestcredit.txt_interestCredit.text = toMoney((int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)) + Math.min(50, distance(int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)), Main.cashModel.credit.interest))));
} else {
if (int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)) > Main.cashModel.credit.interest){
p3.mcinterestcredit.scaleX = 1.5;
p3.mcinterestcredit.scaleY = 1.5;
p3.mcinterestcredit.txt_interestCredit.text = toMoney((int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)) - Math.min(50, distance(int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)), Main.cashModel.credit.interest))));
} else {
p3.mcinterestcredit.scaleX = 1;
p3.mcinterestcredit.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcinterestcredit.txt_interestCredit.text)) == Main.cashModel.credit.interest){
if (int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)) < Main.cashModel.credit.payments){
p3.mcpaymentscredit.scaleX = 1.5;
p3.mcpaymentscredit.scaleY = 1.5;
p3.mcpaymentscredit.txt_paymentsCredit.text = toMoney((int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)) + Math.min(50, distance(int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)), Main.cashModel.credit.payments))));
} else {
if (int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)) > Main.cashModel.credit.payments){
p3.mcpaymentscredit.scaleX = 1.5;
p3.mcpaymentscredit.scaleY = 1.5;
p3.mcpaymentscredit.txt_paymentsCredit.text = toMoney((int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)) - Math.min(50, distance(int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)), Main.cashModel.credit.payments))));
} else {
p3.mcpaymentscredit.scaleX = 1;
p3.mcpaymentscredit.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcpaymentscredit.txt_paymentsCredit.text)) == Main.cashModel.credit.payments){
if (int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)) < Main.cashModel.credit.purchases){
p3.mcpurchasescredit.scaleX = 1.5;
p3.mcpurchasescredit.scaleY = 1.5;
p3.mcpurchasescredit.txt_purchasesCredit.text = toMoney((int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)) + Math.min(50, distance(int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)), Main.cashModel.credit.purchases))));
} else {
if (int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)) > Main.cashModel.credit.purchases){
p3.mcpurchasescredit.scaleX = 1.5;
p3.mcpurchasescredit.scaleY = 1.5;
p3.mcpurchasescredit.txt_purchasesCredit.text = toMoney((int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)) - Math.min(50, distance(int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)), Main.cashModel.credit.purchases))));
} else {
p3.mcpurchasescredit.scaleX = 1;
p3.mcpurchasescredit.scaleY = 1;
};
};
};
if (int(removeComa(p3.mcpurchasescredit.txt_purchasesCredit.text)) == Main.cashModel.credit.purchases){
if (int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)) < Main.cashModel.credit.balance){
p3.mcbalancecredit.scaleX = 1.5;
p3.mcbalancecredit.scaleY = 1.5;
p3.mcbalancecredit.txt_balanceCredit.text = toMoney((int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)) + Math.min(50, distance(int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)), Main.cashModel.credit.balance))));
} else {
if (int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)) > Main.cashModel.credit.balance){
p3.mcbalancecredit.scaleX = 1.5;
p3.mcbalancecredit.scaleY = 1.5;
p3.mcbalancecredit.txt_balanceCredit.text = toMoney((int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)) - Math.min(50, distance(int(removeComa(p3.mcbalancecredit.txt_balanceCredit.text)), Main.cashModel.credit.balance))));
} else {
p3.mcbalancecredit.scaleX = 1;
p3.mcbalancecredit.scaleY = 1;
};
};
};
};
};
}
private function handleLoadID(_arg1:Event):void{
var _local2:XML;
if (view.msgScreen == null){
_local2 = new XML(_arg1.target.data);
trace(_local2);
if (String(_local2) == "error"){
view.pushMsgScreen("Please load the website");
} else {
view.pushMsgScreen("You won $5000!");
Main.cashModel.savings.prevBalance = (Main.cashModel.savings.prevBalance + 5000);
};
};
}
public function showAnis(_arg1, _arg2){
Main.HAPPINESS = (Main.HAPPINESS + _arg1);
myCost = _arg2;
Main.interfaceScreen.txt_happiness.text = (Main.HAPPINESS + "%");
myHap = _arg1;
p2.mc_hap.ani.cost.text = myHap;
p2.mc_sco.ani.cost.text = ("-" + myCost);
p2.mc_hap.gotoAndPlay(2);
p2.mc_sco.gotoAndPlay(2);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function showError(_arg1){
trace(_arg1);
}
public function setPigContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
pigArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.PIG_STYLE.length) {
pigPanel = new PigClip(this, _local3);
pigPanel.txt_kind.text = Main.CVARS.PIG_STYLE[_local3].kind;
pigPanel.txt_cost.text = Main.CVARS.PIG_STYLE[_local3].cost;
pigArray.push(pigPanel);
p2.mc5.addChild(pigPanel);
pigPanel.x = _local1;
pigPanel.y = _local2;
_local1 = (_local1 + 148);
if (_local3 == 2){
_local1 = 5;
_local2 = (_local2 + 150);
};
_local3++;
};
_local3 = 2;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
pigArray[Main.PIG_STYLE].mcBack.gotoAndStop(2);
}
public function closeContact(){
removeChild(contacto);
contacto = null;
}
public function updateBanking(){
Main.cashModel.refreshData();
Main.cashModel.credit.balance = (((Main.cashModel.credit.prevBalance + Main.cashModel.credit.interest) + Main.cashModel.credit.purchases) - Main.cashModel.credit.payments);
Main.cashModel.savings.total = (((Main.cashModel.savings.prevBalance + Main.cashModel.savings.interest) - Main.cashModel.savings.purchases) + Main.cashModel.savings.income);
if (firsttime == true){
p3.mcbalancesaving.txt_balanceSaving.text = Main.cashModel.savings.last_prevBalance;
p3.mcinterestsaving.txt_interestSaving.text = Main.cashModel.savings.last_interest;
p3.mcincome.txt_income.text = Main.cashModel.savings.last_income;
p3.mcpurchasessavings.txt_purchasesSaving.text = Main.cashModel.savings.last_purchases;
p3.mctotalsaving.txt_totalSaving.text = Main.cashModel.savings.last_total;
p3.txt_in1.text = (("(" + Main.cashModel.savings.interestRate) + "%)");
p3.mcprevbalancecredit.txt_prevbalanceCredit.text = Main.cashModel.credit.last_prevBalance;
p3.mcinterestcredit.txt_interestCredit.text = Main.cashModel.credit.last_interest;
p3.mcpurchasescredit.txt_purchasesCredit.text = Main.cashModel.credit.last_purchases;
p3.mcpaymentscredit.txt_paymentsCredit.text = Main.cashModel.credit.last_payments;
p3.mcbalancecredit.txt_balanceCredit.text = Main.cashModel.credit.last_balance;
p3.txt_in2.text = (("(" + Main.cashModel.credit.interestRate) + "%)");
p3.mcp.min_pay.text = "0";
firsttime = false;
};
p3.mcp.min_pay.text = Main.cashModel.credit.minimum;
if (Main.cashModel.savings.total >= int(Main.cashModel.credit.minimum)){
p3.mcp.payment.value = int(p3.mcp.min_pay.text);
} else {
p3.mcp.payment.value = Math.round(Main.cashModel.savings.total);
};
p3.mcbar.bar.width = ((Main.cashModel.credit.balance * 137) / 7500);
}
public function setLifeStyleContent(){
}
public function onp4b2(_arg1:MouseEvent){
p4.gigya.visible = false;
Main.mcWF.visible = false;
p4.contacto.visible = true;
p4.embedpanel.visible = false;
p4.b1.visible = true;
p4.b2.visible = false;
p4.b3.visible = true;
}
public function onCancel(_arg1:MouseEvent){
p3.mcp.visible = false;
}
public function onp4b1(_arg1:MouseEvent){
p4.gigya.visible = true;
Main.mcWF.visible = true;
p4.contacto.visible = false;
p4.embedpanel.visible = false;
p4.b1.visible = false;
p4.b2.visible = true;
p4.b3.visible = true;
}
public function onp4b3(_arg1:MouseEvent){
p4.gigya.visible = false;
Main.mcWF.visible = false;
p4.contacto.visible = false;
p4.embedpanel.visible = true;
p4.b1.visible = true;
p4.b2.visible = true;
p4.b3.visible = false;
}
public function onShare(_arg1:MouseEvent){
view.game.gigya();
}
private function onTitleClick(_arg1:MouseEvent){
var _local2:int;
p3.credit_mc.visible = false;
var _local3:int;
while (_local3 <= 3) {
_local2 = (_local3 + 1);
this[("p" + _local2)][("b_title" + _local2)].visible = true;
_local3++;
};
Main.mcWF.visible = false;
switch (_arg1.currentTarget.name){
case "b_title1":
this.p1.b_title1.visible = false;
setChildIndex(p1, (this.numChildren - 1));
break;
case "b_title2":
this.p2.b_title2.visible = false;
setChildIndex(p2, (this.numChildren - 1));
p2.txt_totalSaving.text = ("" + p3.mctotalsaving.txt_totalSaving.text);
p2.txt_balanceCredit.text = ("" + p3.mcbalancecredit.txt_balanceCredit.text);
break;
case "b_title3":
this.p3.b_title3.visible = false;
p3.credit_mc.visible = true;
p3.mcp.visible = false;
p3.credit_mc.gotoAndPlay(1);
setChildIndex(p3, (this.numChildren - 1));
p3.mcp.payment.value = 0;
updateBanking();
break;
case "b_title4":
this.p4.b_title4.visible = false;
Main.mcWF.visibe = true;
view.game.gigya();
p4.gigya.visible = true;
Main.mcWF.visible = true;
p4.contacto.visible = false;
p4.embedpanel.visible = false;
p4.b1.visible = false;
p4.b2.visible = true;
p4.b3.visible = true;
setChildIndex(p4, (this.numChildren - 1));
break;
};
}
function onTextClick(_arg1:MouseEvent){
trace("PEGAR");
Main.validate = true;
TextField(_arg1.target).setSelection(0, TextField(_arg1.target).text.length);
}
public function onNext(_arg1:MouseEvent){
p2.mc1.visible = false;
p2.mc2.visible = true;
activePanel = "mc2";
}
function changeHandler(_arg1:Event):void{
if (p3.mcp.payment.value > Main.cashModel.savings.total){
p3.mcp.payment.value = Math.round(Main.cashModel.savings.total);
};
if (p3.mcp.payment.value > Main.cashModel.credit.balance){
p3.mcp.payment.value = Math.round(Main.cashModel.credit.balance);
};
}
public function setJetDecalsContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
decalsArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.DECALS_STYLE.length) {
trace(Main.CVARS.DECALS_STYLE[_local3], _local3);
decalPanel = new DecalsClip(this, _local3);
decalPanel.txt_kind.text = Main.CVARS.DECALS_STYLE[_local3].kind;
decalPanel.txt_cost.text = Main.CVARS.DECALS_STYLE[_local3].cost;
decalsArray.push(decalPanel);
p2.mc1.addChild(decalPanel);
decalPanel.x = _local1;
decalPanel.y = _local2;
_local1 = (_local1 + 112);
if (_local3 == 2){
_local1 = 5;
_local2 = (_local2 + 115);
};
_local3++;
};
_local3 = 2;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
if (Main.DECAL_STYLE[0] != null){
decalsArray[Main.DECAL_STYLE[0]].mcBack.gotoAndStop(3);
};
}
public function setColorsContent(){
var _local1:*;
var _local2:Number;
_local1 = 5;
_local2 = 0;
colorsArray = new Array();
var _local3:int;
while (_local3 < Main.CVARS.COLOR_STYLE.length) {
colorPanel = new colorClips(this, _local3);
colorPanel.txt_cost.text = Main.CVARS.COLOR_STYLE[_local3].cost;
colorsArray.push(colorPanel);
p2.mc5.addChild(colorPanel);
colorPanel.x = _local1;
colorPanel.y = _local2;
_local1 = (_local1 + 113);
if (_local3 == 2){
_local1 = 5;
_local2 = (_local2 + 75);
};
_local3++;
};
_local3 = 2;
while (_local3 <= 5) {
p2[("mc" + _local3)].visible = false;
_local3++;
};
if (Main.COLOR != -1){
colorsArray[Main.COLOR].mcBack.gotoAndStop(3);
};
}
public function removeComa(_arg1){
return (_arg1.split(",").join(""));
}
private function onUpgradeOver(_arg1:MouseEvent){
Main.SoundM.playSound("Rol", 1);
}
function onCash(_arg1:MouseEvent){
var _local2:int;
trace(activePanel);
if ((((activePanel == "mc1")) && (!((selectedDecal == null))))){
if (Main.cashModel.savings.total >= Number(decalsArray[selectedDecal].txt_cost.text)){
_local2 = 0;
while (_local2 < Main.CVARS.DECALS_STYLE.length) {
decalsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
view.model.values.happiness = (view.model.values.happiness + Main.CVARS.DECALS_STYLE[selectedDecal].happiness);
showAnis(Main.CVARS.DECALS_STYLE[selectedDecal].happiness, parseFloat(decalsArray[selectedDecal].txt_cost.text));
Main.SoundM.playSound("Cas", 1);
trace("Spending DEBIT:", Number(decalsArray[selectedDecal].txt_cost.text));
Main.DECAL_STYLE = new Array();
Main.DECAL_STYLE.push(selectedDecal);
view.avatarClip.jet.decal.gotoAndStop((selectedDecal + 2));
decalsArray[selectedDecal].mcBack.gotoAndStop(3);
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + Number(decalsArray[selectedDecal].txt_cost.text));
Main.cashModel.spendingDataDebit.push({name:decalsArray[selectedDecal].txt_kind.text, cost:parseFloat(decalsArray[selectedDecal].txt_cost.text)});
view.model.values.happiness = (view.model.values.happiness + Main.CVARS.DECALS_STYLE[selectedDecal].happiness);
selectedDecal = null;
} else {
view.pushMsgScreen("Not enough money");
};
};
if ((((activePanel == "mc2")) && (!((selectedJetski == -1))))){
if (Main.cashModel.savings.total >= Number(jetskiArray[selectedJetski].txt_cost.text)){
jetskiArray[Main.SKI_STYLE].mcBack.gotoAndStop(1);
trace("Spending DEBIT:", Number(jetskiArray[selectedJetski].txt_cost.text));
Main.SoundM.playSound("Cas", 1);
_local2 = 0;
while (_local2 < Main.CVARS.JET_STYLE.length) {
jetskiArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
view.model.values.happiness = (view.model.values.happiness + Main.CVARS.JET_STYLE[selectedJetski].happiness);
showAnis(Main.CVARS.JET_STYLE[selectedJetski].happiness, parseFloat(jetskiArray[selectedJetski].txt_cost.text));
Main.SKI_STYLE = selectedJetski;
view.avatarClip.jet.gotoAndStop((selectedJetski + 1));
view.avatarClip.jet.decal.gotoAndStop(1);
jetskiArray[selectedJetski].mcBack.gotoAndStop(3);
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + Number(jetskiArray[selectedJetski].txt_cost.text));
Main.cashModel.spendingDataDebit.push({name:jetskiArray[selectedJetski].txt_kind.text, cost:parseFloat(jetskiArray[selectedJetski].txt_cost.text)});
selectedJetski = -1;
Main.DECAL_STYLE = new Array();
} else {
view.pushMsgScreen("Not enough money");
};
};
if ((((activePanel == "mc3")) && (!((selectedEngine == null))))){
if (Main.cashModel.savings.total >= Number(engineArray[selectedEngine].txt_cost.text)){
_local2 = 0;
while (_local2 < Main.CVARS.MOVE_SPEEDS.length) {
engineArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
Main.SoundM.playSound("Cas", 1);
showAnis(1, parseFloat(engineArray[selectedEngine].txt_cost.text));
trace("Spending DEBIT:", Number(engineArray[selectedEngine].txt_cost.text));
Main.ENGINE_STAGE = selectedEngine;
engineArray[selectedEngine].mcBack.gotoAndStop(3);
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + Number(engineArray[selectedEngine].txt_cost.text));
Main.cashModel.spendingDataDebit.push({name:engineArray[selectedEngine].txt_kind.text, cost:parseFloat(engineArray[selectedEngine].txt_cost.text)});
selectedEngine = null;
_local2 = 0;
while (_local2 < Main.CVARS.MOVE_SPEEDS.length) {
engineArray[_local2].alpha = 1;
if ((Main.ENGINE_STAGE + 1) < _local2){
engineArray[_local2].alpha = 0.5;
};
_local2++;
};
} else {
view.pushMsgScreen("Not enough money");
};
};
if ((((activePanel == "mc4")) && (!((selectedJump == null))))){
if (Main.cashModel.savings.total >= Number(jumpArray[selectedJump].txt_cost.text)){
_local2 = 0;
while (_local2 < Main.CVARS.AIR_SPEEDS.length) {
jumpArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
Main.SoundM.playSound("Cas", 1);
showAnis(1, parseFloat(engineArray[selectedJump].txt_cost.text));
trace("Spending DEBIT:", Number(engineArray[selectedJump].txt_cost.text));
Main.JUMP_STAGE = selectedJump;
jumpArray[selectedJump].mcBack.gotoAndStop(3);
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + Number(jumpArray[selectedJump].txt_cost.text));
Main.cashModel.spendingDataDebit.push({name:jumpArray[selectedJump].txt_kind.text, cost:parseFloat(jumpArray[selectedJump].txt_cost.text)});
selectedJump = null;
_local2 = 0;
while (_local2 < Main.CVARS.AIR_SPEEDS.length) {
jumpArray[_local2].alpha = 1;
if ((Main.JUMP_STAGE + 1) < _local2){
jumpArray[_local2].alpha = 0.5;
};
_local2++;
};
} else {
view.pushMsgScreen("Not enough money");
};
};
if ((((activePanel == "mc5")) && (!((selectedColor == -1))))){
if (Main.cashModel.savings.total >= Number(colorsArray[selectedColor].txt_cost.text)){
colorsArray[Main.COLOR].mcBack.gotoAndStop(1);
trace("Spending DEBIT:", Number(colorsArray[selectedColor].txt_cost.text));
_local2 = 0;
while (_local2 < Main.CVARS.COLOR_STYLE.length) {
colorsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
Main.SoundM.playSound("Cas", 1);
showAnis(1, parseFloat(colorsArray[selectedColor].txt_cost.text));
view.avatarClip.jet.color.gotoAndStop((selectedColor + 1));
trace("Spending DEBIT:", Number(colorsArray[selectedColor].txt_cost.text));
Main.COLOR = selectedColor;
colorsArray[selectedColor].mcBack.gotoAndStop(3);
Main.cashModel.savings.purchases = (Main.cashModel.savings.purchases + Number(colorsArray[selectedColor].txt_cost.text));
Main.cashModel.spendingDataDebit.push({name:"color", cost:parseFloat(colorsArray[selectedColor].txt_cost.text)});
selectedColor = -1;
} else {
view.pushMsgScreen("Not enough money");
};
};
updateBanking();
p2.txt_totalSaving.text = ("" + p3.mctotalsaving.txt_totalSaving.text);
p2.txt_balanceCredit.text = ("" + p3.mcbalancecredit.txt_balanceCredit.text);
}
public function onPlay(_arg1:MouseEvent){
if (int(Main.cashModel.credit.payments) < int(p3.mcp.min_pay.text)){
view.shouldPay = true;
} else {
view.shouldPay = false;
};
Main.mcWF.visible = false;
view.removeOptionsScreen();
}
function onCredit(_arg1:MouseEvent){
var _local2:int;
if ((((activePanel == "mc1")) && (!((selectedDecal == null))))){
_local2 = 0;
while (_local2 < Main.CVARS.DECALS_STYLE.length) {
decalsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
view.model.values.happiness = (view.model.values.happiness + Main.CVARS.DECALS_STYLE[selectedDecal].happiness);
showAnis(Main.CVARS.DECALS_STYLE[selectedDecal].happiness, parseFloat(decalsArray[selectedDecal].txt_cost.text));
trace("Spending CREDIT:", Number(decalsArray[selectedDecal].txt_cost.text));
Main.DECAL_STYLE = new Array();
Main.DECAL_STYLE.push(selectedDecal);
view.avatarClip.jet.decal.gotoAndStop((selectedDecal + 2));
trace("DECAL", Main.DECAL_STYLE);
Main.SoundM.playSound("Cre", 1);
decalsArray[selectedDecal].mcBack.gotoAndStop(3);
Main.cashModel.credit.purchases = (Main.cashModel.credit.purchases + Number(decalsArray[selectedDecal].txt_cost.text));
Main.cashModel.spendingDataCredit.push({name:decalsArray[selectedDecal].txt_kind.text, cost:parseFloat(decalsArray[selectedDecal].txt_cost.text)});
selectedDecal = null;
};
if ((((activePanel == "mc2")) && (!((selectedJetski == -1))))){
view.model.values.happiness = (view.model.values.happiness + Main.CVARS.JET_STYLE[selectedJetski].happiness);
showAnis(Main.CVARS.JET_STYLE[selectedJetski].happiness, parseFloat(jetskiArray[selectedJetski].txt_cost.text));
Main.SoundM.playSound("Cre", 1);
_local2 = 0;
while (_local2 < Main.CVARS.JET_STYLE.length) {
jetskiArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
jetskiArray[Main.SKI_STYLE].mcBack.gotoAndStop(1);
trace("Spending CREDIT:", Number(jetskiArray[selectedJetski].txt_cost.text));
Main.SKI_STYLE = selectedJetski;
view.avatarClip.jet.gotoAndStop((selectedJetski + 1));
view.avatarClip.jet.decal.gotoAndStop(1);
jetskiArray[selectedJetski].mcBack.gotoAndStop(3);
Main.cashModel.credit.purchases = (Main.cashModel.credit.purchases + Number(jetskiArray[selectedJetski].txt_cost.text));
Main.cashModel.spendingDataCredit.push({name:jetskiArray[selectedJetski].txt_kind.text, cost:parseFloat(jetskiArray[selectedJetski].txt_cost.text)});
selectedJetski = -1;
Main.DECAL_STYLE = new Array();
};
if ((((activePanel == "mc3")) && (!((selectedEngine == null))))){
_local2 = 0;
while (_local2 < Main.CVARS.MOVE_SPEEDS.length) {
engineArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
showAnis(4, parseFloat(engineArray[selectedEngine].txt_cost.text));
Main.SoundM.playSound("Cre", 1);
trace("Spending DEBIT:", Number(engineArray[selectedEngine].txt_cost.text));
Main.ENGINE_STAGE = selectedEngine;
engineArray[selectedEngine].mcBack.gotoAndStop(3);
Main.cashModel.credit.purchases = (Main.cashModel.credit.purchases + Number(engineArray[selectedEngine].txt_cost.text));
Main.cashModel.spendingDataCredit.push({name:engineArray[selectedEngine].txt_kind.text, cost:parseFloat(engineArray[selectedEngine].txt_cost.text)});
selectedEngine = null;
_local2 = 0;
while (_local2 < Main.CVARS.MOVE_SPEEDS.length) {
engineArray[_local2].alpha = 1;
if ((Main.ENGINE_STAGE + 1) < _local2){
engineArray[_local2].alpha = 0.5;
};
_local2++;
};
};
if ((((activePanel == "mc4")) && (!((selectedJump == null))))){
_local2 = 0;
while (_local2 < Main.CVARS.AIR_SPEEDS.length) {
jumpArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
Main.SoundM.playSound("Cre", 1);
showAnis(4, parseFloat(jumpArray[selectedJump].txt_cost.text));
trace("Spending DEBIT:", Number(jumpArray[selectedJump].txt_cost.text));
Main.JUMP_STAGE = selectedJump;
jumpArray[selectedJump].mcBack.gotoAndStop(3);
Main.cashModel.credit.purchases = (Main.cashModel.credit.purchases + Number(jumpArray[selectedJump].txt_cost.text));
Main.cashModel.spendingDataCredit.push({name:jumpArray[selectedJump].txt_kind.text, cost:parseFloat(jumpArray[selectedJump].txt_cost.text)});
selectedJump = null;
_local2 = 0;
while (_local2 < Main.CVARS.AIR_SPEEDS.length) {
jumpArray[_local2].alpha = 1;
if ((Main.JUMP_STAGE + 1) < _local2){
jumpArray[_local2].alpha = 0.5;
};
_local2++;
};
};
if ((((activePanel == "mc5")) && (!((selectedColor == -1))))){
colorsArray[Main.COLOR].mcBack.gotoAndStop(1);
trace("Spending DEBIT:", Number(colorsArray[selectedColor].txt_cost.text));
Main.SoundM.playSound("Cre", 1);
_local2 = 0;
while (_local2 < Main.CVARS.COLOR_STYLE.length) {
colorsArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
showAnis(1, parseFloat(colorsArray[selectedColor].txt_cost.text));
view.avatarClip.jet.color.gotoAndStop((selectedColor + 1));
trace("Spending DEBIT:", Number(colorsArray[selectedColor].txt_cost.text));
Main.COLOR = selectedColor;
colorsArray[selectedColor].mcBack.gotoAndStop(3);
Main.cashModel.credit.purchases = (Main.cashModel.credit.purchases + Number(colorsArray[selectedColor].txt_cost.text));
Main.cashModel.spendingDataCredit.push({name:"color", cost:parseFloat(colorsArray[selectedColor].txt_cost.text)});
selectedColor = -1;
};
updateBanking();
p2.txt_totalSaving.text = ("" + p3.mctotalsaving.txt_totalSaving.text);
p2.txt_balanceCredit.text = ("" + p3.mcbalancecredit.txt_balanceCredit.text);
}
public function selectPigStyle(_arg1){
var _local2:int;
if (_arg1 != Main.PIG_STYLE){
_local2 = 0;
while (_local2 < Main.CVARS.PIG_STYLE.length) {
pigArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
pigArray[_arg1].mcBack.gotoAndStop(2);
selectedPig = _arg1;
};
}
function distance(_arg1, _arg2):int{
return (Math.sqrt(Math.pow((_arg1 - _arg2), 2)));
}
public function selectEngineStyle(_arg1){
var _local2:int;
if (_arg1 == (Main.ENGINE_STAGE + 1)){
_local2 = 0;
while (_local2 < Main.CVARS.MOVE_SPEEDS.length) {
engineArray[_local2].mcBack.gotoAndStop(1);
_local2++;
};
p2.item_cost.text = (("($" + engineArray[_arg1].txt_cost.text) + ")");
if (Main.ENGINE_STAGE != -1){
};
engineArray[_arg1].mcBack.gotoAndStop(2);
selectedEngine = _arg1;
} else {
if (_arg1 <= (Main.ENGINE_STAGE + 1)){
view.pushMsgScreen("You already got this");
} else {
view.pushMsgScreen("You need the previous stage");
};
};
}
}
}//package debtgame.view
Section 57
//OptionsClip2 (debtgame.view.OptionsClip2)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class OptionsClip2 extends OptionsClip {
public var btn_continue:mybutton;
public function OptionsClip2(_arg1:GameView){
super(_arg1);
this.p4.b_title4.visible = false;
setChildIndex(p4, (this.numChildren - 1));
Main.mcWF.visible = true;
btn_continue.addEventListener(MouseEvent.CLICK, onContinue);
}
override public function onShare(_arg1:MouseEvent){
view.game.gigya();
}
override public function onPlay(_arg1:MouseEvent){
if (int(Main.cashModel.credit.payments) < int(p3.mcp.min_pay.text)){
view.shouldPay = true;
} else {
view.shouldPay = false;
};
Main.mcWF.visible = false;
view.removeOptionsScreen();
}
override public function onEnterFrame(_arg1:Event){
}
public function onContinue(_arg1:MouseEvent){
Main.mcWF.visible = false;
view.removeOptionsScreen2();
}
override public function onSend(_arg1:MouseEvent){
contacto = new contactar(this);
contacto.y = 20;
contacto.x = 130;
addChild(contacto);
}
override public function closeContact(){
removeChild(contacto);
contacto = null;
}
private function handleLoadID(_arg1:Event):void{
var _local2:XML;
if (view.msgScreen == null){
_local2 = new XML(_arg1.target.data);
trace(_local2);
if (String(_local2) == "error"){
view.pushMsgScreen("Please load the website");
} else {
view.pushMsgScreen("You won $5000!");
Main.cashModel.savings.prevBalance = (Main.cashModel.savings.prevBalance + 5000);
};
};
}
override function onTextClick(_arg1:MouseEvent){
trace("PEGAR");
Main.validate = true;
TextField(_arg1.target).setSelection(0, TextField(_arg1.target).text.length);
}
private function onUpgradeClick(_arg1:MouseEvent){
var _local2:int;
p2.item_cost.text = "";
var _local3:int;
while (_local3 <= 4) {
_local2 = (_local3 + 1);
p2[("mc" + _local2)].visible = false;
p2[("b" + _local2)].visible = true;
_local3++;
};
if (_arg1.currentTarget.enabled == true){
switch (_arg1.currentTarget.name){
case "b1":
p2.b1.visible = false;
p2.mc1.visible = true;
activePanel = "mc1";
break;
case "b2":
p2.b2.visible = false;
p2.mc2.visible = true;
activePanel = "mc2";
break;
case "b3":
p2.b3.visible = false;
p2.mc3.visible = true;
activePanel = "mc3";
break;
case "b4":
p2.b4.visible = false;
p2.mc4.visible = true;
activePanel = "mc4";
break;
case "b5":
p2.b5.visible = false;
p2.mc5.visible = true;
activePanel = "mc5";
break;
};
};
}
private function onTitleClick(_arg1:MouseEvent){
var _local2:int;
p3.credit_mc.visible = false;
var _local3:int;
while (_local3 <= 3) {
_local2 = (_local3 + 1);
this[("p" + _local2)][("b_title" + _local2)].visible = true;
_local3++;
};
Main.mcWF.visible = false;
switch (_arg1.currentTarget.name){
case "b_title1":
this.p1.b_title1.visible = false;
setChildIndex(p1, (this.numChildren - 1));
break;
case "b_title2":
this.p2.b_title2.visible = false;
setChildIndex(p2, (this.numChildren - 1));
p2.txt_totalSaving.text = ("" + p3.txt_totalSaving.text);
p2.txt_balanceCredit.text = ("" + p3.txt_balanceCredit.text);
break;
case "b_title3":
this.p3.b_title3.visible = false;
p3.credit_mc.visible = true;
p3.mcp.visible = false;
p3.credit_mc.gotoAndPlay(1);
setChildIndex(p3, (this.numChildren - 1));
p3.payment.value = 0;
updateBanking();
break;
case "b_title4":
this.p4.b_title4.visible = false;
Main.mcWF.visibe = true;
view.game.gigya();
Main.mcWF.visible = true;
p4.contacto.visible = false;
p4.embedpanel.visible = false;
p4.b1.visible = false;
p4.b2.visible = true;
p4.b3.visible = true;
setChildIndex(p4, (this.numChildren - 1));
break;
};
}
private function onUpgradeOver(_arg1:MouseEvent){
Main.SoundM.playSound("Rol", 1);
}
override public function onp4b1(_arg1:MouseEvent){
p4.gigya.visible = true;
Main.mcWF.visible = true;
p4.contacto.visible = false;
p4.embedpanel.visible = false;
p4.b1.visible = false;
p4.b2.visible = true;
p4.b3.visible = true;
}
override public function onp4b3(_arg1:MouseEvent){
p4.gigya.visible = false;
Main.mcWF.visible = false;
p4.contacto.visible = false;
p4.embedpanel.visible = true;
p4.b1.visible = true;
p4.b2.visible = true;
p4.b3.visible = false;
}
override public function onValidate(_arg1:MouseEvent){
var _local2:URLLoader;
var _local3:URLVariables;
var _local4:URLRequest;
if (view.msgScreen == null){
_local2 = new URLLoader();
_local3 = new URLVariables();
_local3.sid = Main.myID;
_local4 = new URLRequest(Main.CVARS.URL_VALIDATE);
_local4.data = _local3;
_local2.addEventListener(Event.COMPLETE, handleLoadID);
_local2.load(_local4);
};
}
override public function onCancel(_arg1:MouseEvent){
p3.mcp.visible = false;
}
override public function onp4b2(_arg1:MouseEvent){
p4.gigya.visible = false;
Main.mcWF.visible = false;
p4.contacto.visible = true;
p4.embedpanel.visible = false;
p4.b1.visible = true;
p4.b2.visible = false;
p4.b3.visible = true;
}
override public function onPayDebt(_arg1:MouseEvent){
p3.mcp.visible = true;
}
}
}//package debtgame.view
Section 58
//PauseClip (debtgame.view.PauseClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class PauseClip extends MovieClip {
public var level;
public var gameView:GameView;
public var credit:TextField;
public var saving;
public var btn:mybutton;
public function PauseClip(_arg1:GameView){
this.gameView = _arg1;
level.text = (_arg1.model.levelNum + 1);
saving.text = String(toMoney(Main.SAVING_LEVEL));
credit.text = String(toMoney(Main.SPEND_LEVEL));
btn.addEventListener(MouseEvent.CLICK, onClick);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
private function onClick(_arg1:MouseEvent){
gameView.removePauseScreen();
}
}
}//package debtgame.view
Section 59
//PigClip (debtgame.view.PigClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class PigClip extends MovieClip {
public var txt_kind:TextField;
public var txt_cost;
public var id:int;
public var mcBack:MovieClip;
public var options:OptionsClip;
public function PigClip(_arg1:OptionsClip, _arg2){
this.id = _arg2;
mcBack.stop();
this.options = _arg1;
addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
options.selectPigStyle(id);
}
}
}//package debtgame.view
Section 60
//PlatformClip (debtgame.view.PlatformClip)
package debtgame.view {
import flash.display.*;
import debtgame.model.*;
public class PlatformClip extends Sprite {
public function PlatformClip(_arg1:Platform){
var _local2:Number = Math.min(_arg1.line.p0.x, _arg1.line.p1.x);
var _local3:Number = Math.max(_arg1.line.p0.y, _arg1.line.p1.y);
var _local4:Number = (_arg1.line.p1.y - _arg1.line.p0.y);
var _local5:Number = (_arg1.line.p0.x - _local2);
var _local6:Number = -((_arg1.line.p0.y - _local3));
var _local7:Number = (_arg1.line.p1.x - _local2);
var _local8:Number = -((_arg1.line.p1.y - _local3));
graphics.lineStyle(5, 0);
}
}
}//package debtgame.view
Section 61
//popup (debtgame.view.popup)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class popup extends MovieClip {
public var btn_Back:mybutton;
public var txt_msg:TextField;
public var platform:GameView;
public var btn_back:SimpleButton;
public function popup(_arg1, _arg2){
txt_msg.text = _arg2;
this.platform = _arg1;
btn_Back.addEventListener(MouseEvent.CLICK, onCloseUpload);
btn_back.mouseEnabled = false;
}
private function onCloseUpload(_arg1:MouseEvent){
platform.removeMsgScreen();
}
}
}//package debtgame.view
Section 62
//SummaryClip (debtgame.view.SummaryClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class SummaryClip extends MovieClip {
public var txt_score;
public var txt_lifeStyle;
public var mc_hapiness:MovieClip;
public var myArr;
public var mc;
public var txt_happiness;
public var txt_interest;
public var txt_happiness2;
public var txt_necessities;
public var txt_earned;
public var txt_total;
public var gameView:GameView;
public var txt_spent_detail:TextField;
public var txt_collected;
public var btn_play;
public var itemArr:Array;
public var signo:MovieClip;
public var txt_d;
public var mini:miniItem;
public var txt_h;
public var theCost:TextField;
public var txt_spent;
public var txt_s;
public var btn_details;
public var txt_lifeStyle2;
public var txt_last_happiness;
public var btn_back:mybutton;
public var txt_level;
public function SummaryClip(_arg1:GameView){
stop();
txt_lifeStyle2.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].kind;
this.gameView = _arg1;
_arg1.changeMonth();
itemArr = new Array();
addFrameScript(1, introFrame);
addFrameScript(0, mainFrame);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function mainFrame(){
itemArr = new Array();
txt_level.text = gameView.model.levelNum;
txt_necessities.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].necessities;
txt_collected.text = Main.NECESSITIES;
txt_lifeStyle.text = Main.CVARS.LIFE_STYLE[Main.LIFE_STYLE].kind;
txt_earned.text = ("$" + toMoney(Main.SAVING_LEVEL));
txt_interest.text = Main.cashModel.savings.interestRate;
txt_spent.text = ("$" + toMoney(Main.SPEND_LEVEL));
txt_happiness.text = Main.HAPPINESS;
if (Main.HAPPINESS >= Main.LAST_HAPPINESS){
txt_last_happiness.text = (("+" + (Main.HAPPINESS - Main.LAST_HAPPINESS)) + "%");
} else {
txt_last_happiness.text = ((Main.HAPPINESS - Main.LAST_HAPPINESS) + "%");
};
txt_total.text = Math.round((Main.SAVING_LEVEL + ((Main.SAVING_LEVEL * Main.cashModel.savings.interestRate) / 100)));
var _local1:int = (((Main.cashModel.savings.prevBalance + Main.cashModel.savings.interest) - Main.cashModel.savings.purchases) + Main.cashModel.savings.income);
var _local2:int = Main.cashModel.credit.balance;
if (_local1 >= _local2){
Main.SCORE = ((_local1 - _local2) * Main.HAPPINESS);
signo.gotoAndStop(1);
} else {
Main.SCORE = Math.round(((_local1 - _local2) / Main.HAPPINESS));
signo.gotoAndStop(2);
};
txt_d.text = String(_local2);
txt_s.text = String(_local1);
txt_h.text = String(Main.HAPPINESS);
txt_score.text = String(Main.SCORE);
myArr = Main.cashModel.spendingLevel;
btn_play.addEventListener(MouseEvent.CLICK, onClick);
btn_details.addEventListener(MouseEvent.CLICK, onDetailsClick);
txt_happiness2.text = (String(Main.HAPPINESS) + "%");
mc_hapiness.gotoAndStop(Main.interfaceScreen.hap_mc.currentFrame);
}
public function introFrame(){
var _local3:int;
btn_back.addEventListener(MouseEvent.CLICK, onBack);
var _local1 = 280;
var _local2 = 180;
var _local4:int;
var _local5:Boolean;
var _local6:int;
while (_local6 < myArr.length) {
if (myArr[_local6].name != "Tsunami"){
_local4 = (_local4 + myArr[_local6].cost);
_local5 = false;
_local3 = 0;
while (_local3 < itemArr.length) {
trace(("lavel" + itemArr[_local3].mc.currentLabel));
if (itemArr[_local3].mc.currentLabel == myArr[_local6].name){
itemArr[_local3].theCost.text = String((myArr[_local6].cost + Number(itemArr[_local3].theCost.text)));
if ((((((((myArr[_local6].name == "food")) || ((myArr[_local6].name == "housing")))) || ((myArr[_local6].name == "gas")))) || ((myArr[_local6].name == "bills")))){
itemArr[_local3].theCost.text = "1000";
itemArr[_local3].txt_hap.text = "0";
};
_local5 = true;
};
_local3++;
};
if ((((((((myArr[_local6].name == "food")) || ((myArr[_local6].name == "housing")))) || ((myArr[_local6].name == "gas")))) || ((myArr[_local6].name == "bills")))){
_local5 = false;
};
if (_local5 == false){
mini = new miniItem();
addChild(mini);
itemArr.push(mini);
mini.x = _local1;
mini.y = _local2;
_local1 = (_local1 + 50);
if (_local1 == 630){
_local2 = (_local2 + 70);
_local1 = 280;
};
trace(("miniinini" + myArr[_local6].name));
mini.setType(myArr[_local6].name);
if ((((((((myArr[_local6].name == "food")) || ((myArr[_local6].name == "housing")))) || ((myArr[_local6].name == "gas")))) || ((myArr[_local6].name == "bills")))){
mini.theCost.text = "1000";
mini.txt_hap.text = "0";
} else {
mini.theCost.text = myArr[_local6].cost;
mini.txt_hap.text = myArr[_local6].hap;
};
};
};
_local6++;
};
theCost.text = String(toMoney(_local4));
}
private function onDetailsClick(_arg1:MouseEvent){
gotoAndStop(2);
}
private function onClick(_arg1:MouseEvent){
Main.SPEND_LEVEL = 0;
Main.SAVING_LEVEL = 0;
Main.cashModel.spendingLevel = new Array();
Main.LAST_HAPPINESS = Main.HAPPINESS;
Main.LAST_NECESSITIES = Main.NECESSITIES;
Main.NECESSITIES = 0;
gameView.removeSummaryScreen();
}
private function onBack(_arg1:MouseEvent){
var _local2:int;
while (_local2 < itemArr.length) {
removeChild(itemArr[_local2]);
_local2++;
};
gotoAndStop(1);
}
}
}//package debtgame.view
Section 63
//SweepClip (debtgame.view.SweepClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import fl.controls.*;
import flash.text.*;
import flash.net.*;
import debtgame.util.validator.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class SweepClip extends MovieClip {
public var platform:GameView;
public var myYear:NumericStepper2;
public var email_txt;
public var myDay;
public var days:Array;
public var btn_submit:mybutton;
public var phone_txt:TextField;
public var btn_back:SimpleButton;
public var myMonth;
public var checkB:CheckBox;
public var name_txt;
public var btn_cancel;
public function SweepClip(_arg1=null){
this.tabEnabled = true;
name_txt.tabIndex = 1;
phone_txt.tabIndex = 3;
email_txt.tabIndex = 2;
checkB.tabIndex = 4;
btn_cancel.tabEnabled = true;
btn_submit.tabEnabled = true;
btn_cancel.tabIndex = 5;
btn_submit.tabIndex = 6;
days = new Array();
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
myMonth.maximum = 12;
myMonth.minimum = 1;
myMonth.value = 1;
myDay.maximum = days[(myMonth.value + 1)];
myDay.minimum = 1;
myYear.maximum = 2009;
myYear.minimum = 1920;
myDay.value = 1;
myMonth.value = 1;
myYear.value = 1980;
myMonth.addEventListener(Event.CHANGE, onMonth);
email_txt.addEventListener(MouseEvent.CLICK, onTextClick);
phone_txt.addEventListener(MouseEvent.CLICK, onTextClick);
name_txt.addEventListener(MouseEvent.CLICK, onTextClick);
this.platform = _arg1;
btn_cancel.addEventListener(MouseEvent.CLICK, onCloseUpload);
btn_submit.addEventListener(MouseEvent.CLICK, onSend);
btn_back.mouseEnabled = false;
__setProp_checkB_Symbol30copy2_Layer1_0();
}
function onTextClick(_arg1:MouseEvent){
trace("PEGAR");
TextField(_arg1.target).setSelection(0, TextField(_arg1.target).text.length);
}
public function onSend(_arg1:MouseEvent){
var urls:String;
var variables:URLVariables;
var Max:*;
var request:URLRequest;
var loader:URLLoader;
var e = _arg1;
var v:Boolean;
var a:Array = String(email_txt.text).split(",");
var i:int;
while (i < a.length) {
if (EmailValidator.isValidEmail(a[i]) != true){
};
i = (i + 1);
};
if (((((!((EmailValidator.isValidEmail(email_txt.text) == true))) || ((name_txt.text.length == 0)))) || ((checkB.selected == false)))){
v = false;
};
if (v){
urls = Main.CVARS.URL_SWEEP;
variables = new URLVariables();
variables.score = Main.SCORE;
variables.email = email_txt.text;
variables.birth = "10/10/2000";
variables.phone = phone_txt.text;
variables.name = name_txt.text;
Max = int;
if (Main.validate == false){
Max = 1;
} else {
Max = 10;
};
variables.max = Max;
Main.sweepV = true;
if (platform.optionsScreen != null){
platform.optionsScreen.btn_swep.visible = false;
platform.optionsScreen.sweept.visible = false;
};
request = new URLRequest(urls);
request.data = variables;
loader = new URLLoader();
try {
loader.load(request);
} catch(e:Error) {
};
if (platform.optionsScreen != null){
platform.pushMsgScreen("Thank you!");
};
platform.closeSweep();
} else {
platform.pushMsgScreen("Wrong information.Check again.");
};
}
function __setProp_checkB_Symbol30copy2_Layer1_0(){
try {
checkB["componentInspectorSetting"] = true;
} catch(e:Error) {
};
checkB.enabled = true;
checkB.label = "";
checkB.labelPlacement = "right";
checkB.selected = false;
checkB.visible = true;
try {
checkB["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function onCloseUpload(_arg1:MouseEvent){
platform.closeSweep();
}
public function onMonth(_arg1:Event){
myDay.maximum = days[(myMonth.value - 1)];
}
}
}//package debtgame.view
Section 64
//TsunamiScreen (debtgame.view.TsunamiScreen)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class TsunamiScreen extends MovieClip {
public var btnplay;
public var cost:int;
public var btncredit;
public var cost_txt:TextField;
public var problem;
public var btnsavings:mybutton;
public var txt_spent;
public var txt_earned:TextField;
public var gameView:GameView;
public var credit:NumericStepperCustom;
public var cash;
public function TsunamiScreen(_arg1:GameView){
var _local2:int = Math.round((Math.random() * (Main.CVARS.TSUNAMI_DATA.length - 1)));
trace("MMMM", Main.CVARS.TSUNAMI_DATA, Main.CVARS.TSUNAMI_DATA.length, _local2);
trace(Main.CVARS.TSUNAMI_DATA[_local2].kind);
cost = Main.CVARS.TSUNAMI_DATA[_local2].cost;
txt_earned.text = ("$" + toMoney(int((Main.cashModel.savings.total + Main.SAVING_LEVEL))));
txt_spent.text = ("$" + toMoney(Main.cashModel.credit.balance));
credit.maximum = cost;
if (Main.SAVING_LEVEL >= cost){
credit.minimum = Math.max((cost - Main.SAVING_LEVEL), 0);
} else {
credit.minimum = 0;
};
credit.value = cost;
cost_txt.text = ("$" + toMoney(cost));
problem.text = (((("You were just hit by a spending tsunami because " + Main.CVARS.TSUNAMI_DATA[_local2].kind) + "! The cost is $") + toMoney(cost)) + ".");
this.gameView = _arg1;
btnplay.addEventListener(MouseEvent.CLICK, onClick);
btncredit.addEventListener(MouseEvent.CLICK, onCredit);
btnsavings.addEventListener(MouseEvent.CLICK, onSavings);
cash.addEventListener(Event.CHANGE, changeHandler);
credit.addEventListener(Event.CHANGE, changeHandler2);
cash.maximum = cost;
cash.value = 0;
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
function changeHandler(_arg1:Event):void{
if (cash.value > Main.SAVING_LEVEL){
cash.value = Main.SAVING_LEVEL;
};
credit.value = (cost - cash.value);
}
private function onSavings(_arg1:MouseEvent){
if ((Main.cashModel.savings.total + Main.SAVING_LEVEL) >= cost){
Main.cashModel.spendingLevel.push({name:"Tsunami", cost:cost});
Main.SAVING_LEVEL = (Main.SAVING_LEVEL - cost);
Main.interfaceScreen.txt_cash.text = ("$" + Main.SAVING_LEVEL);
Main.interfaceScreen.txt_debt.text = ("$" + Main.SPEND_LEVEL);
gameView.removeTsunamiScreen();
} else {
gameView.pushMsgScreen("You don't have enough money");
};
}
private function onClick(_arg1:MouseEvent){
Main.cashModel.spendingLevel.push({name:"Tsunami", cost:cost});
Main.SAVING_LEVEL = (Main.SAVING_LEVEL - cash.value);
Main.SPEND_LEVEL = (Main.SPEND_LEVEL + int(credit.value));
Main.interfaceScreen.txt_cash.text = ("$" + Main.SAVING_LEVEL);
Main.interfaceScreen.txt_debt.text = ("$" + Main.SPEND_LEVEL);
gameView.removeTsunamiScreen();
}
private function onCredit(_arg1:MouseEvent){
Main.cashModel.spendingLevel.push({name:"Tsunami", cost:cost});
Main.SPEND_LEVEL = (Main.SPEND_LEVEL + cost);
Main.interfaceScreen.txt_cash.text = ("$" + Main.SAVING_LEVEL);
Main.interfaceScreen.txt_debt.text = ("$" + Main.SPEND_LEVEL);
gameView.removeTsunamiScreen();
}
function changeHandler2(_arg1:Event):void{
cash.value = Math.max((cost - credit.value), 0);
if (cash.value > Main.SAVING_LEVEL){
cash.value = Main.SAVING_LEVEL;
};
credit.value = (cost - cash.value);
}
}
}//package debtgame.view
Section 65
//TutorialClip (debtgame.view.TutorialClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
public class TutorialClip extends MovieClip {
public var texto:MovieClip;
public var btn_down:mybutton;
public var view:GameView;
public var btn_up;
public var btnNext:mybutton;
public var mc:MovieClip;
public var btn_play;
public function TutorialClip(_arg1:GameView){
Main.SoundM.playSound("Tut", 33);
Main.SoundM.stopSound("Idl");
texto.mouseEnabled = false;
mc.stop();
trace(Main.CVARS.LIFE_STYLE[3]);
this.view = _arg1;
btn_play.addEventListener(MouseEvent.CLICK, onClick);
btnNext.addEventListener(MouseEvent.CLICK, onNext);
btn_up.addEventListener(MouseEvent.CLICK, onNext);
btn_down.addEventListener(MouseEvent.CLICK, onPrev);
btn_down.visible = false;
}
private function onClick(_arg1:MouseEvent){
view.removeTutorialScreen();
}
private function onNext(_arg1:MouseEvent){
btn_down.visible = true;
btnNext.visible = false;
btn_up.visible = true;
texto.visible = false;
if ((mc.currentFrame + 1) == mc.totalFrames){
btn_up.visible = false;
texto.visible = false;
};
mc.nextFrame();
}
private function onPrev(_arg1:MouseEvent){
btn_up.visible = true;
btnNext.visible = false;
texto.visible = false;
if ((mc.currentFrame - 1) == 1){
btn_down.visible = false;
texto.visible = false;
};
mc.prevFrame();
}
}
}//package debtgame.view
Section 66
//TutorialClip2 (debtgame.view.TutorialClip2)
package debtgame.view {
import flash.events.*;
import flash.display.*;
public class TutorialClip2 extends MovieClip {
public var texto:MovieClip;
public var btn_down:mybutton;
public var view:GameView;
public var btn_up;
public var btnNext:mybutton;
public var mc:MovieClip;
public var btn_play;
public function TutorialClip2(_arg1:GameView){
Main.SoundM.playSound("Tut", 33);
Main.SoundM.stopSound("Idl");
texto.mouseEnabled = false;
mc.stop();
trace(Main.CVARS.LIFE_STYLE[3]);
this.view = _arg1;
btn_play.addEventListener(MouseEvent.CLICK, onClick);
btnNext.addEventListener(MouseEvent.CLICK, onNext);
btn_up.addEventListener(MouseEvent.CLICK, onNext);
btn_down.addEventListener(MouseEvent.CLICK, onPrev);
btn_down.visible = false;
}
private function onClick(_arg1:MouseEvent){
view.removeTutorialScreen2();
}
private function onNext(_arg1:MouseEvent){
btn_down.visible = true;
btnNext.visible = false;
btn_up.visible = true;
texto.visible = false;
if ((mc.currentFrame + 1) == mc.totalFrames){
btn_up.visible = false;
texto.visible = false;
};
mc.nextFrame();
}
private function onPrev(_arg1:MouseEvent){
btn_up.visible = true;
btnNext.visible = false;
texto.visible = false;
if ((mc.currentFrame - 1) == 1){
btn_down.visible = false;
texto.visible = false;
};
mc.prevFrame();
}
}
}//package debtgame.view
Section 67
//WinClip (debtgame.view.WinClip)
package debtgame.view {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class WinClip extends MovieClip {
public var txt_score;
public var con:MovieClip;
public var signo;
public var car;
public var txt_d;
public var txt_h:TextField;
public var btn_learn;
public var b:SimpleButton;
public var texto;
public var btn_go;
public var optionsScreen:OptionsClip2;
public var txt_s;
public var gameView:GameView;
public var btn_share:mybutton;
public var winmode;
public function WinClip(_arg1:GameView){
car.useHandCursor = true;
car.buttonMode = true;
car.useHandCursor = true;
con.gotoAndStop(1);
winmode.gotoAndStop(1);
var _local2:int = (((Main.cashModel.savings.prevBalance + Main.cashModel.savings.interest) - Main.cashModel.savings.purchases) + Main.cashModel.savings.income);
var _local3:int = Main.cashModel.credit.balance;
if (_local2 >= _local3){
Main.SCORE = ((_local2 - _local3) * Main.HAPPINESS);
signo.gotoAndStop(1);
} else {
Main.SCORE = ((_local2 - _local3) / Main.HAPPINESS);
signo.gotoAndStop(2);
winmode.gotoAndStop(2);
con.gotoAndStop(2);
};
if (Main.SCORE < 0){
texto.gotoAndStop(3);
} else {
texto.gotoAndStop(4);
};
txt_d.text = ("$" + toMoney(_local3));
txt_s.text = ("$" + toMoney(_local2));
txt_h.text = String(Main.HAPPINESS);
if (Main.SCORE >= 0){
txt_score.text = toMoney(int(Main.SCORE));
} else {
txt_score.text = ("-" + toMoney(Math.abs(int(Main.SCORE))));
trace("SCORE SHOULD BE", Math.abs(Main.SCORE), toMoney(Math.abs(Main.SCORE)));
};
this.gameView = _arg1;
btn_learn.addEventListener(MouseEvent.CLICK, onLearn);
car.addEventListener(MouseEvent.CLICK, onLearn);
btn_share.addEventListener(MouseEvent.CLICK, onShare);
btn_go.addEventListener(MouseEvent.CLICK, onClick);
}
public function onShare(_arg1:MouseEvent){
optionsScreen = new OptionsClip2(gameView);
addChild(optionsScreen);
}
function toMoney(_arg1){
var _local5:int;
var _local2 = (_arg1 < 0);
_arg1 = Math.abs(_arg1);
var _local3:String = String(_arg1);
var _local4 = "";
while (_local5 < _local3.length) {
if ((((_local5 > 0)) && (((_local5 % 3) == 0)))){
_local4 = ("," + _local4);
};
_local4 = (_local3.substr((-(_local5) - 1), 1) + _local4);
_local5++;
};
if (_local2){
_local4 = ("-" + _local4);
} else {
};
return (_local4);
}
public function onLearn(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.indebted.com/roadmap/");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
private function onClick(_arg1:MouseEvent){
gameView.removeWinScreen();
}
public function removeShare(){
removeChild(optionsScreen);
optionsScreen = null;
}
}
}//package debtgame.view
Section 68
//Arovbn_21 (DebtGameRC6_fla.Arovbn_21)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class Arovbn_21 extends MovieClip {
public function Arovbn_21(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
}
}
}//package DebtGameRC6_fla
Section 69
//bvhbvbn_28 (DebtGameRC6_fla.bvhbvbn_28)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class bvhbvbn_28 extends MovieClip {
public function bvhbvbn_28(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package DebtGameRC6_fla
Section 70
//color_256 (DebtGameRC6_fla.color_256)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class color_256 extends MovieClip {
public function color_256(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package DebtGameRC6_fla
Section 71
//cost_180 (DebtGameRC6_fla.cost_180)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class cost_180 extends MovieClip {
public var ani:MovieClip;
public function cost_180(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DebtGameRC6_fla
Section 72
//creditlimit_195 (DebtGameRC6_fla.creditlimit_195)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class creditlimit_195 extends MovieClip {
public function creditlimit_195(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package DebtGameRC6_fla
Section 73
//decal_259 (DebtGameRC6_fla.decal_259)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class decal_259 extends MovieClip {
public function decal_259(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DebtGameRC6_fla
Section 74
//happy_178 (DebtGameRC6_fla.happy_178)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class happy_178 extends MovieClip {
public var ani:MovieClip;
public function happy_178(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DebtGameRC6_fla
Section 75
//line1vbn_24 (DebtGameRC6_fla.line1vbn_24)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class line1vbn_24 extends MovieClip {
public function line1vbn_24(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package DebtGameRC6_fla
Section 76
//line2vbn_22 (DebtGameRC6_fla.line2vbn_22)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class line2vbn_22 extends MovieClip {
public function line2vbn_22(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package DebtGameRC6_fla
Section 77
//logo_animacionvbn_19 (DebtGameRC6_fla.logo_animacionvbn_19)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class logo_animacionvbn_19 extends MovieClip {
public function logo_animacionvbn_19(){
addFrameScript(54, frame55);
}
function frame55(){
stop();
}
}
}//package DebtGameRC6_fla
Section 78
//mc_cartel345_65 (DebtGameRC6_fla.mc_cartel345_65)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class mc_cartel345_65 extends MovieClip {
public var car:MovieClip;
public function mc_cartel345_65(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package DebtGameRC6_fla
Section 79
//mc_fondovbn_20 (DebtGameRC6_fla.mc_fondovbn_20)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class mc_fondovbn_20 extends MovieClip {
public function mc_fondovbn_20(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package DebtGameRC6_fla
Section 80
//mc_logos_intro_46 (DebtGameRC6_fla.mc_logos_intro_46)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class mc_logos_intro_46 extends MovieClip {
public function mc_logos_intro_46(){
addFrameScript(128, frame129);
}
function frame129(){
stop();
Main(parent).goFrame();
}
}
}//package DebtGameRC6_fla
Section 81
//mc_splashsdfsdfsdf_271 (DebtGameRC6_fla.mc_splashsdfsdfsdf_271)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class mc_splashsdfsdfsdf_271 extends MovieClip {
public function mc_splashsdfsdfsdf_271(){
addFrameScript(9, frame10);
}
function frame10(){
parent.visible = false;
}
}
}//package DebtGameRC6_fla
Section 82
//mc_tutowerwerwerrrr_212 (DebtGameRC6_fla.mc_tutowerwerwerrrr_212)
package DebtGameRC6_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.external.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class mc_tutowerwerwerrrr_212 extends MovieClip {
public var mc:MovieClip;
public function mc_tutowerwerwerrrr_212(){
addFrameScript(4, frame5, 5, frame6);
}
function frame5(){
stop();
}
function frame6(){
mc.mc_hap.gotoAndStop(5);
}
}
}//package DebtGameRC6_fla
Section 83
//pig_setup_260 (DebtGameRC6_fla.pig_setup_260)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class pig_setup_260 extends MovieClip {
public function pig_setup_260(){
addFrameScript(0, frame1, 18, frame19, 28, frame29, 38, frame39, 49, frame50);
}
function frame29(){
gotoAndStop("normal");
}
function frame19(){
gotoAndStop("normal");
}
function frame50(){
gotoAndStop("normal");
}
function frame39(){
gotoAndStop("normal");
}
function frame1(){
stop();
}
}
}//package DebtGameRC6_fla
Section 84
//Symbol1vbn_31 (DebtGameRC6_fla.Symbol1vbn_31)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class Symbol1vbn_31 extends MovieClip {
public function Symbol1vbn_31(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package DebtGameRC6_fla
Section 85
//Symbol2_255 (DebtGameRC6_fla.Symbol2_255)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class Symbol2_255 extends MovieClip {
public var color:MovieClip;
public var decal:MovieClip;
public function Symbol2_255(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package DebtGameRC6_fla
Section 86
//Symbol2vbn_26 (DebtGameRC6_fla.Symbol2vbn_26)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class Symbol2vbn_26 extends MovieClip {
public function Symbol2vbn_26(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package DebtGameRC6_fla
Section 87
//Symbol8_132 (DebtGameRC6_fla.Symbol8_132)
package DebtGameRC6_fla {
import flash.display.*;
public dynamic class Symbol8_132 extends MovieClip {
public function Symbol8_132(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package DebtGameRC6_fla
Section 88
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var pressTimer:Timer;
protected var _autoRepeat:Boolean;// = false
protected var _selected:Boolean;// = false
protected var background:DisplayObject;
private var unlockedMouseState:String;
protected var mouseState:String;
private var _mouseStateLocked:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
override public function get enabled():Boolean{
return (super.enabled);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
protected function drawBackground():void{
var _local1:String = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
var _local2:DisplayObject = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public function get selected():Boolean{
return (_selected);
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 89
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var _emphasized:Boolean;// = false
protected var emphasizedBorder:DisplayObject;
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
var _local1:Object = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 90
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 91
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override protected function drawBackground():void{
}
override public function get toggle():Boolean{
return (true);
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override protected function configUI():void{
super.configUI();
super.toggle = true;
var _local1:Shape = new Shape();
var _local2:Graphics = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
super.drawLayout();
var _local1:Number = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 92
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _toggle:Boolean;// = false
public var textField:TextField;
protected var mode:String;// = "center"
protected var _labelPlacement:String;// = "right"
protected var oldMouseState:String;
protected var _label:String;// = "Label"
protected var icon:DisplayObject;
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
override protected function drawLayout():void{
var _local7:Number;
var _local8:Number;
var _local1:Number = Number(getStyleValue("textPadding"));
var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
var _local3:Number = (textField.textWidth + 4);
var _local4:Number = (textField.textHeight + 4);
var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1);
var _local6:Number = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function get toggle():Boolean{
return (_toggle);
}
protected function setEmbedFont(){
var _local1:Object = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function drawIcon():void{
var _local1:DisplayObject = icon;
var _local2:String = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
var _local3:Object = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
protected function drawTextFormat():void{
var _local1:Object = UIComponent.getStyleDefinition();
var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public function get label():String{
return (_label);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 93
//NumericStepper (fl.controls.NumericStepper)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class NumericStepper extends UIComponent implements IFocusManagerComponent {
protected var downArrow:BaseButton;
protected var upArrow:BaseButton;
protected var _stepSize:Number;// = 1
protected var _minimum:Number;// = 0
protected var inputField:TextInput;
protected var _maximum:Number;// = 10
protected var _value:Number;// = 1
protected var _precision:Number;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TEXT_INPUT_STYLES:Object = {upSkin:"upSkin", disabledSkin:"disabledSkin", textPadding:"textPadding", textFormat:"textFormat", disabledTextFormat:"disabledTextFormat", embedFonts:"embedFonts"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"NumericStepperDownArrow_disabledSkin", downArrowDownSkin:"NumericStepperDownArrow_downSkin", downArrowOverSkin:"NumericStepperDownArrow_overSkin", downArrowUpSkin:"NumericStepperDownArrow_upSkin", upArrowDisabledSkin:"NumericStepperUpArrow_disabledSkin", upArrowDownSkin:"NumericStepperUpArrow_downSkin", upArrowOverSkin:"NumericStepperUpArrow_overSkin", upArrowUpSkin:"NumericStepperUpArrow_upSkin", upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRect:null, focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35, embedFonts:false};
public function NumericStepper(){
setStyles();
stepSize = _stepSize;
}
override public function set enabled(_arg1:Boolean):void{
if (_arg1 == enabled){
return;
};
super.enabled = _arg1;
upArrow.enabled = (downArrow.enabled = (inputField.enabled = _arg1));
}
public function get imeMode():String{
return (inputField.imeMode);
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
protected function inStep(_arg1:Number):Boolean{
return ((((_arg1 - _minimum) % _stepSize) == 0));
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
if (_arg1.eventPhase == 3){
setValue(Number(inputField.text));
};
super.focusOutHandler(_arg1);
}
override public function setFocus():void{
if (stage){
stage.focus = inputField.textField;
};
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
if (_value < _minimum){
setValue(_minimum, false);
};
}
protected function inRange(_arg1:Number):Boolean{
return ((((_arg1 >= _minimum)) && ((_arg1 <= _maximum))));
}
public function get minimum():Number{
return (_minimum);
}
public function get maximum():Number{
return (_maximum);
}
protected function setValue(_arg1:Number, _arg2:Boolean=true):void{
if (_arg1 == _value){
return;
};
var _local3:Number = _value;
_value = getValidValue(_arg1);
inputField.text = _value.toString();
if (_arg2){
dispatchEvent(new Event(Event.CHANGE, true));
};
}
protected function drawLayout():void{
var _local1:Number;
_local1 = (width - upArrow.width);
var _local2:Number = (height / 2);
inputField.setSize(_local1, height);
upArrow.height = _local2;
downArrow.height = Math.floor(_local2);
downArrow.move(_local1, _local2);
upArrow.move(_local1, 0);
downArrow.drawNow();
upArrow.drawNow();
inputField.drawNow();
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == inputField)) || (super.isOurFocus(_arg1))));
}
public function get previousValue():Number{
var _local1:Number = (_value - _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
public function get nextValue():Number{
var _local1:Number = (_value + _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
if (_value > _maximum){
setValue(_maximum, false);
};
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
validate();
}
protected function getPrecision():Number{
var _local1:String = _stepSize.toString();
if (_local1.indexOf(".") == -1){
return (0);
};
return (_local1.split(".").pop().length);
}
protected function getValidValue(_arg1:Number):Number{
if (isNaN(_arg1)){
return (_value);
};
var _local2:Number = Number((_stepSize * Math.round((_arg1 / _stepSize))).toFixed(_precision));
if (_local2 > maximum){
return (maximum);
};
if (_local2 < minimum){
return (minimum);
};
return (_local2);
}
public function get textField():TextInput{
return (inputField);
}
override protected function configUI():void{
super.configUI();
upArrow = new BaseButton();
copyStylesToChild(upArrow, UP_ARROW_STYLES);
upArrow.autoRepeat = true;
upArrow.setSize(21, 12);
upArrow.focusEnabled = false;
addChild(upArrow);
downArrow = new BaseButton();
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
downArrow.autoRepeat = true;
downArrow.setSize(21, 12);
downArrow.focusEnabled = false;
addChild(downArrow);
inputField = new TextInput();
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
inputField.restrict = "0-9\\-\\.\\,";
inputField.text = _value.toString();
inputField.setSize(21, 24);
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(FocusEvent.FOCUS_IN, passEvent);
inputField.addEventListener(FocusEvent.FOCUS_OUT, passEvent);
addChild(inputField);
inputField.addEventListener(Event.CHANGE, onTextChange, false, 0, true);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
}
public function set stepSize(_arg1:Number):void{
_stepSize = _arg1;
_precision = getPrecision();
setValue(_value);
}
public function set value(_arg1:Number):void{
setValue(_arg1, false);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
_arg1.stopImmediatePropagation();
var _local2:Number = Number(inputField.text);
switch (_arg1.keyCode){
case Keyboard.END:
setValue(maximum);
break;
case Keyboard.HOME:
setValue(minimum);
break;
case Keyboard.UP:
setValue(nextValue);
break;
case Keyboard.DOWN:
setValue(previousValue);
break;
case Keyboard.ENTER:
setValue(_local2);
break;
};
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
}
public function get stepSize():Number{
return (_stepSize);
}
public function get value():Number{
return (_value);
}
protected function stepperPressHandler(_arg1:ComponentEvent):void{
setValue(Number(inputField.text), false);
switch (_arg1.currentTarget){
case upArrow:
setValue(nextValue);
break;
case downArrow:
setValue(previousValue);
};
inputField.setFocus();
inputField.textField.setSelection(0, 0);
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
};
}
protected function onTextChange(_arg1:Event):void{
_arg1.stopImmediatePropagation();
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 94
//TextInput (fl.controls.TextInput)
package fl.controls {
import flash.events.*;
import flash.display.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var background:DisplayObject;
protected var _savedHTML:String;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
public function get imeMode():String{
return (_imeMode);
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
protected function setEmbedFont(){
var _local1:Object = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
protected function drawLayout():void{
var _local1:Number = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function get textWidth():Number{
return (textField.textWidth);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
override public function setFocus():void{
stage.focus = textField;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
protected function drawBackground():void{
var _local1:DisplayObject = background;
var _local2:String = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
public function get text():String{
return (textField.text);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function get restrict():String{
return (textField.restrict);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
}
public function get maxChars():int{
return (textField.maxChars);
}
public function set text(_arg1:String):void{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
protected function drawTextFormat():void{
var _local1:Object = UIComponent.getStyleDefinition();
var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
public function get length():int{
return (textField.length);
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
if (_arg1.target == this){
stage.focus = textField;
};
var _local2:IFocusManager = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get htmlText():String{
return (textField.htmlText);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 95
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 96
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 97
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.events.*;
import flash.display.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _x:Number;
protected var _enabled:Boolean;// = true
protected var callLaterMethods:Dictionary;
private var _mouseFocusEnabled:Boolean;// = true
private var tempText:TextField;
private var _focusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var invalidateFlag:Boolean;// = false
protected var _oldIMEMode:String;// = null
protected var _inspector:Boolean;// = false
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var invalidHash:Object;
protected var sharedStyles:Object;
protected var uiFocusRect:DisplayObject;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var _width:Number;
protected var instanceStyles:Object;
public var version:String;// = "3.0.0.16"
protected var isFocused:Boolean;// = false
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
private function callLaterDispatcher(_arg1:Event):void{
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
var _local2:Dictionary = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
protected function validate():void{
invalidHash = {};
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
override public function get height():Number{
return (_height);
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
override public function get scaleY():Number{
return ((height / startHeight));
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function configUI():void{
isLivePreview = checkLivePreview();
var _local1:Number = rotation;
rotation = 0;
var _local2:Number = super.width;
var _local3:Number = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
override public function get scaleX():Number{
return ((width / startWidth));
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var skin = _arg1;
var classDef:Object;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
override public function set visible(_arg1:Boolean):void{
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local5:Object;
var _local6:String;
var _local2:Object = {};
var _local3:uint = _args.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 98
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 99
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.events.*;
import flash.display.*;
import fl.controls.*;
import fl.core.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
var _local5:int = focusableCandidates.length;
var _local6:int = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
if (!hasFocusableObjects()){
return;
};
var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local3:TextField;
var _local4:SimpleButton;
var _local2:DisplayObjectContainer = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int = focusableCandidates.length;
var _local3:int;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local4:InteractiveObject;
var _local3:DisplayObject = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local5:int;
var _local6:String;
var _local7:String;
var _local3 = "";
var _local4 = "";
var _local8 = "0000";
var _local9:DisplayObject = DisplayObject(_arg1);
var _local10:DisplayObject = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var _local2:DisplayObject = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
var _local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
var _local4:int = getIndexOfFocusedObject(_local2);
var _local5:Boolean;
var _local6:int = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (_arg1.isDefaultPrevented()){
return;
};
var _local2:InteractiveObject = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local3:Button;
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
calculateCandidates = true;
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
var _local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
}
}//package fl.managers
Section 100
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function hideFocus():void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function setFocus(_arg1:InteractiveObject):void;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 101
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 102
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function get selected():Boolean;
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
}
}//package fl.managers
Section 103
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var classToInstancesDict:Dictionary;
private var globalStyles:Object;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToDefaultStylesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class = getClassDef(_arg1);
var _local4:Object = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class = getClassDef(_arg1);
var _local5:Object = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local5:String;
var _local2:StyleManager = getInstance();
var _local3:Class = getClassDef(_arg1);
var _local4:Object = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class = getClassDef(_arg1);
var _local4:Object = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local4:Object;
var _local5:UIComponent;
var _local3:Dictionary = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local3:Object;
var _local2:Dictionary = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
var inst:StyleManager = getInstance();
var classDef:Class = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
if (inst.classToStylesDict[classDef] == null){
inst.classToStylesDict[classDef] = {};
};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class = getClassDef(_arg1);
var _local4:StyleManager = getInstance();
var _local5:Object = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 104
//Line2D (halowitz.framework.math.Line2D)
package halowitz.framework.math {
public class Line2D {
public var p0:Point2D;
public var p1:Point2D;
public function Line2D(_arg1:Point2D, _arg2:Point2D){
this.p0 = _arg1.clone();
this.p1 = _arg2.clone();
}
public function toString():String{
return ((((("[" + p0) + "->") + p1) + "]"));
}
public function normal():Point2D{
return (new Point2D((p1.y - p0.y), -((p1.x - p0.x))));
}
public function direction():Point2D{
return (new Point2D((p1.x - p0.x), (p1.y - p0.y)));
}
public static function intersection(_arg1:Line2D, _arg2:Line2D):Point2D{
var _local3:Number = (((_arg2.p1.x - _arg2.p0.x) * (_arg1.p0.y - _arg2.p0.y)) - ((_arg2.p1.y - _arg2.p0.y) * (_arg1.p0.x - _arg2.p0.x)));
var _local4:Number = (((_arg1.p1.x - _arg1.p0.x) * (_arg1.p0.y - _arg2.p0.y)) - ((_arg1.p1.y - _arg1.p0.y) * (_arg1.p0.x - _arg2.p0.x)));
var _local5:Number = (((_arg2.p1.y - _arg2.p0.y) * (_arg1.p1.x - _arg1.p0.x)) - ((_arg2.p1.x - _arg2.p0.x) * (_arg1.p1.y - _arg1.p0.y)));
if (_local5 == 0){
return (null);
};
if ((((_local3 == 0)) && ((_local5 == 0)))){
return (new Point2D(NaN, NaN));
};
_local3 = (_local3 / _local5);
_local4 = (_local4 / _local5);
if ((((((((_local3 < 0)) || ((_local3 > 1)))) || ((_local4 < 0)))) || ((_local4 > 1)))){
return (null);
};
var _local6:Number = _local3;
return (new Point2D((_arg1.p0.x + (_local6 * (_arg1.p1.x - _arg1.p0.x))), (_arg1.p0.y + (_local6 * (_arg1.p1.y - _arg1.p0.y)))));
}
public static function halfPlane(_arg1:Line2D, _arg2:Point2D):Number{
var _local3:Point2D = Point2D.sub(_arg2, _arg1.p0);
var _local4:Point2D = _arg1.normal();
return (Point2D.dotProduct(_local3, _local4));
}
public static function closestPoint(_arg1:Line2D, _arg2:Point2D):Point2D{
var _local3:Number = ((_arg2.x - _arg1.p0.x) * (_arg1.p1.x - _arg1.p0.x));
var _local4:Number = ((_arg2.y - _arg1.p0.y) * (_arg1.p1.y - _arg1.p0.y));
var _local5:Number = (_local3 + _local4);
var _local6:Number = _arg1.direction().magnitude2();
var _local7:Number = (_local5 / _local6);
_local3 = (_arg1.p0.x + (_local7 * (_arg1.p1.x - _arg1.p0.x)));
_local4 = (_arg1.p0.y + (_local7 * (_arg1.p1.y - _arg1.p0.y)));
return (new Point2D(_local3, _local4));
}
}
}//package halowitz.framework.math
Section 105
//Point2D (halowitz.framework.math.Point2D)
package halowitz.framework.math {
public class Point2D {
public var x:Number;// = 0
public var y:Number;// = 0
public function Point2D(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function magnitude2():Number{
return (((x * x) + (y * y)));
}
public function magnitude():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function toString():String{
return ((((("(" + x) + ", ") + y) + ")"));
}
public function clone():Point2D{
return (new Point2D(x, y));
}
public static function sub(_arg1:Point2D, _arg2:Point2D):Point2D{
return (new Point2D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
public static function add(_arg1:Point2D, _arg2:Point2D):Point2D{
return (new Point2D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)));
}
public static function angle(_arg1:Point2D, _arg2:Point2D):Number{
return (Math.acos((dotProduct(_arg1, _arg2) / (_arg1.magnitude() * _arg2.magnitude()))));
}
public static function distance(_arg1:Point2D, _arg2:Point2D):Number{
return (Math.sqrt((((_arg2.x - _arg1.x) * (_arg2.x - _arg1.x)) + ((_arg2.y - _arg1.y) * (_arg2.y - _arg1.y)))));
}
public static function dotProduct(_arg1:Point2D, _arg2:Point2D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function distance2(_arg1:Point2D, _arg2:Point2D):Number{
return ((((_arg2.x - _arg1.x) * (_arg2.x - _arg1.x)) + ((_arg2.y - _arg1.y) * (_arg2.y - _arg1.y))));
}
}
}//package halowitz.framework.math
Section 106
//CvarParser (halowitz.framework.utils.CvarParser)
package halowitz.framework.utils {
public class CvarParser {
private static function createCVar(_arg1:XML):Object{
var _local2:Object;
var _local3:String = _arg1.@type;
var _local4:Object = _arg1.@value;
if (_local3 == "Number"){
_local2 = new Number(_local4);
} else {
if (_local3 == "Boolean"){
_local2 = new Boolean((_local4 == "true"));
} else {
if (_local3 == "String"){
_local2 = new String(_local4);
} else {
if (_local3 == "Array"){
_local2 = createCVarArray(_arg1);
} else {
if (_local3 == "Object"){
_local2 = createCVarObject(_arg1);
};
};
};
};
};
return (_local2);
}
private static function createCVarArray(_arg1:XML):Array{
var _local2:Array = new Array();
var _local3:* = _arg1.cvar.length();
var _local4:Number = 0;
while (_local4 < _local3) {
_local2[_local4] = createCVar(_arg1.cvar[_local4]);
_local4++;
};
return (_local2);
}
public static function parse(_arg1:XML):Object{
var _local5:String;
var _local2:Object = new Object();
var _local3:* = _arg1.cvar.length();
var _local4:Number = 0;
while (_local4 < _local3) {
_local5 = _arg1.cvar[_local4].@id;
_local2[_local5] = createCVar(_arg1.cvar[_local4]);
_local4++;
};
return (_local2);
}
private static function createCVarObject(_arg1:XML):Object{
var _local5:String;
var _local2:Object = new Object();
var _local3:* = _arg1.cvar.length();
var _local4:Number = 0;
while (_local4 < _local3) {
_local5 = _arg1.cvar[_local4].@id;
_local2[_local5] = createCVar(_arg1.cvar[_local4]);
_local4++;
};
return (_local2);
}
}
}//package halowitz.framework.utils
Section 107
//MochiBot (mochi.MochiBot)
package mochi {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package mochi
Section 108
//OmnitureReporter (omniture.OmnitureReporter)
package omniture {
import com.omniture.*;
public class OmnitureReporter {
protected var props:Array;
protected var actionSource:ActionSource;
public function OmnitureReporter(){
props = [];
super();
actionSource = new ActionSource();
actionSource.debugTracking = true;
}
protected function setValues(_arg1:Object):void{
var _local2:*;
for (_local2 in _arg1) {
actionSource[_local2] = _arg1[_local2];
props.push(_local2);
};
}
public function sendCall(_arg1:Object):void{
setValues(_arg1);
actionSource.track();
clearValues();
}
public function sendLinkEvent(_arg1:Object):void{
var _local2:Object = {};
if (isDefined(_arg1.linkURL)){
_local2.url = _arg1.linkURL;
delete _arg1.linkURL;
if (isDefined(_arg1.linkType)){
_local2.type = _arg1.linkType;
delete _arg1.linkType;
} else {
_local2.type = "o";
};
if (isDefined(_arg1.linkName)){
_local2.name = _arg1.linkName;
delete _arg1.linkName;
};
setValues(_arg1);
actionSource.trackLink(_local2.url, _local2.type, _local2.name);
clearValues();
};
}
public function setAccount(_arg1:String):void{
actionSource.account = _arg1;
}
protected function clearValues():void{
var _local1:Number = 0;
while (_local1 < props.length) {
actionSource[props[_local1]] = "";
_local1++;
};
props = [];
}
protected static function isDefined(_arg1:String):Boolean{
if (((((((("string" === "undefined")) || ((_arg1 === null)))) || ((_arg1 === "null")))) || ((_arg1.length === 0)))){
return (false);
};
return (true);
}
}
}//package omniture
Section 109
//brao (brao)
package {
import flash.media.*;
public dynamic class brao extends Sound {
}
}//package
Section 110
//bras (bras)
package {
import flash.media.*;
public dynamic class bras extends Sound {
}
}//package
Section 111
//btn_details (btn_details)
package {
import debtgame.view.*;
public dynamic class btn_details extends mybutton {
}
}//package
Section 112
//btn_next (btn_next)
package {
import debtgame.view.*;
public dynamic class btn_next extends mybutton {
}
}//package
Section 113
//btn_nextcopy (btn_nextcopy)
package {
import debtgame.view.*;
public dynamic class btn_nextcopy extends mybutton {
}
}//package
Section 114
//btn_nextcopy2 (btn_nextcopy2)
package {
import debtgame.view.*;
public dynamic class btn_nextcopy2 extends mybutton {
}
}//package
Section 115
//btn_nextcopy3 (btn_nextcopy3)
package {
import debtgame.view.*;
public dynamic class btn_nextcopy3 extends mybutton {
}
}//package
Section 116
//btn_sendtofriend (btn_sendtofriend)
package {
import debtgame.view.*;
public dynamic class btn_sendtofriend extends mybutton {
}
}//package
Section 117
//btncash (btncash)
package {
import debtgame.view.*;
public dynamic class btncash extends mybutton {
}
}//package
Section 118
//btncredit (btncredit)
package {
import debtgame.view.*;
public dynamic class btncredit extends mybutton {
}
}//package
Section 119
//btnHigh (btnHigh)
package {
import debtgame.view.*;
public dynamic class btnHigh extends mybutton {
}
}//package
Section 120
//btnOk (btnOk)
package {
import debtgame.view.*;
public dynamic class btnOk extends mybutton {
}
}//package
Section 121
//btnpay (btnpay)
package {
import debtgame.view.*;
public dynamic class btnpay extends mybutton {
}
}//package
Section 122
//btnPlay (btnPlay)
package {
import debtgame.view.*;
public dynamic class btnPlay extends mybutton {
}
}//package
Section 123
//cas (cas)
package {
import flash.media.*;
public dynamic class cas extends Sound {
}
}//package
Section 124
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 125
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 126
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 127
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 128
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 129
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 130
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 131
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 132
//coin (coin)
package {
import flash.media.*;
public dynamic class coin extends Sound {
}
}//package
Section 133
//cre (cre)
package {
import flash.media.*;
public dynamic class cre extends Sound {
}
}//package
Section 134
//fasto (fasto)
package {
import flash.media.*;
public dynamic class fasto extends Sound {
}
}//package
Section 135
//fasts (fasts)
package {
import flash.media.*;
public dynamic class fasts extends Sound {
}
}//package
Section 136
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 137
//gov (gov)
package {
import flash.media.*;
public dynamic class gov extends Sound {
}
}//package
Section 138
//idl (idl)
package {
import flash.media.*;
public dynamic class idl extends Sound {
}
}//package
Section 139
//intr (intr)
package {
import flash.media.*;
public dynamic class intr extends Sound {
}
}//package
Section 140
//lev1 (lev1)
package {
import flash.media.*;
public dynamic class lev1 extends Sound {
}
}//package
Section 141
//lev2 (lev2)
package {
import flash.media.*;
public dynamic class lev2 extends Sound {
}
}//package
Section 142
//lev3 (lev3)
package {
import flash.media.*;
public dynamic class lev3 extends Sound {
}
}//package
Section 143
//loading (loading)
package {
import flash.display.*;
public dynamic class loading extends MovieClip {
}
}//package
Section 144
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import debtgame.model.*;
import debtgame.view.*;
import debtgame.control.*;
import mochi.*;
import debtgame.art.*;
import flash.net.*;
import debtgame.sound.*;
import omniture.*;
import halowitz.framework.utils.*;
import flash.system.*;
public class Main extends MovieClip {
private var lib:ArtMain;
public var tutorialScreen2:TutorialClip2;// = null
public var loaded:Boolean;// = false
public var myHighscores:highscores;
public var btn_logos:SimpleButton;
public var embedStr:String;
public var view:GameView;
public var mcAbout:about;
public var model:GameModel;
public var btn_play:mybutton;
public var avion:airplane;
public var loadingScreen:loading;
private var input:GameInput;
public var isANEMBED:Boolean;// = false
private var control:GameControl;
public var baseURL:String;// = ""
public var reporter:OmnitureReporter;
public var btn_scores:mybutton;
public var backlink:MovieClip;
public var btn_about:mybutton;
public var tutorialScreen:TutorialClip;
public var shouldOcult:Boolean;// = true
public var pressedPlay:Boolean;// = false
public static var PIG_STYLE:int = 0;
public static var SKI_STYLE:int = 0;
public static var COLOR:int = 0;
public static var interfaceScreen:InterfaceClip;
public static var LIFE_STYLE:int = 1;
public static var NECESSITIES:int = 0;
public static var HAPPINESS:int = 15;
public static var JUMP_STAGE:int = -1;
public static var SAVING_LEVEL:int = 0;
public static var ENGINE_STAGE:int = -1;
public static var SPEND_LEVEL:int = 0;
public static var LAST_HAPPINESS:int = 0;
public static var myID:String;
public static var LAST_NECESSITIES:int = 0;
public static var mc_sound:mcsound;
public static var DECAL_STYLE:Array;
public static var CVARS:Object = new Object();
public static var mp3:mp3player;
public static var sweepV:Boolean = false;
public static var SCORE:Number = 0;
public static var mcWF:MovieClip;
public static var cashModel:CashFlow;
public static var SoundM:soundManager;
public static var validate:Boolean = false;
public static var running:Boolean;
public function Main(){
MochiBot.track(this, "68996b4d");
running = false;
reporter = new OmnitureReporter();
reporter.setAccount("mtvu");
this.tabEnabled = false;
SoundM = new soundManager();
stop();
DECAL_STYLE = new Array();
Security.allowDomain("*");
Security.allowInsecureDomain("*");
stop();
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
addFrameScript(1, introFrame);
addFrameScript(0, zeroFrame);
var _local1:Object = LoaderInfo(this.root.loaderInfo).parameters;
if (((!((_local1.id == undefined))) && (!((_local1.id == null))))){
shouldOcult = false;
trace(_local1.id, "kwkwkw");
isANEMBED = true;
reporter.sendCall({prop39:"debtski_game_embed", eVar5:"debtski_game", events:"debtski_embed,event4"});
embedStr = _local1.id;
};
}
public function reStartMp3(){
mp3.visible = true;
mp3.loadMP3(mp3.panel.player.songs[0].file, 0);
}
public function removeTutorial(){
removeChild(tutorialScreen);
tutorialScreen = null;
}
public function changeAudio(){
SoundM.changeAudio();
}
public function onLogos(_arg1:MouseEvent){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.debtski.com/");
try {
navigateToURL(request);
} catch(e:Error) {
};
}
public function gigya(){
var ModuleID:String;
var cfg:Object;
var ldr:Loader;
var url:String;
var urlReq:URLRequest;
if (getChildByName("mcWF") != null){
getChildByName("mcWF").visible = true;
return;
};
if (mcWF == null){
trace("GIGTAAAA");
Security.allowDomain("cdn.gigya.com");
Security.allowInsecureDomain("cdn.gigya.com");
mcWF = new mcW();
addChild(mcWF).name = "mcWF";
mcWF.x = 220;
mcWF.y = 125;
ModuleID = "PostModule1";
cfg = {};
cfg["width"] = "280";
cfg["height"] = "220";
cfg["showCloseButton"] = "false";
cfg["widgetTitle"] = "Debt Ski";
cfg["partner"] = "422143";
cfg["UIConfig"] = "<config><display showEmail=\"false\" useTransitions=\"true\" showBookmark=\"true\" codeBoxHeight=\"20\" showCodeBox=\"false\" showCloseButton=\"false\" networksWithCodeBox=\"\" networksToShow=\"myspace, facebook, bebo, wordpress, friendster, yahoo, orkut, tagged, blogger, hi5, livespaces, piczo, freewebs, livejournal, igoogle, netvibes, blackplanet, myyearbook, vox, typepad, xanga, multiply, pageflakes, migente, ameba, livedoor, eons\"></display><body><background frame-color=\"#FC7A7A\" background-color=\"#FC7A7A\" gradient-color-begin=\"#FC7A7A\" gradient-color-end=\"#FC7A7A\" corner-roundness=\"13;13;13;13\"></background><controls color=\"#FFFFFF\" corner-roundness=\"4;4;4;4\" gradient-color-begin=\"#EAEAEA\" gradient-color-end=\"#F4F4F4\" bold=\"false\"><snbuttons iconsOnly=\"true\" type=\"textUnder\" frame-color=\"#D5D5D5\" over-frame-color=\"#60BFFF\" color=\"#808080\" gradient-color-begin=\"#FFFFFF\" gradient-color-end=\"d4d6d7\" size=\"10\" bold=\"false\" down-frame-color=\"#60BFFF\" down-gradient-color-begin=\"#6DDADA\" over-gradient-color-end=\"#6DDADA\" down-gradient-color-end=\"#F4F4F4\" over-color=\"#52A4DA\" down-color=\"#52A4DA\" over-bold=\"false\"><more frame-color=\"#A4DBFF\" over-frame-color=\"#A4DBFF\" color=\"#FFFFFF\" gradient-color-begin=\"#F4F4F4\" gradient-color-end=\"#BBE4FF\" over-gradient-color-begin=\"#A4DBFF\" over-gradient-color-end=\"#F4F4F4\"></more><previous frame-color=\"#BBE4FF\" over-frame-color=\"#A4DBFF\" color=\"#FFFFFF\" gradient-color-begin=\"#FFFFFF\" gradient-color-end=\"#FFFFFF\" over-gradient-color-begin=\"#A4DBFF\" over-gradient-color-end=\"#F4F4F4\"></previous></snbuttons><textboxes frame-color=\"#CACACA\" color=\"#757575\" gradient-color-begin=\"#ffffff\" bold=\"false\"><codeboxes color=\"#757575\" frame-color=\"#DFDFDF\" background-color=\"#FFFFFF\" gradient-color-begin=\"#ffffff\" gradient-color-end=\"#FFFFFF\" size=\"10\"></codeboxes><inputs frame-color=\"#CACACA\" color=\"#757575\" gradient-color-begin=\"#F4F4F4\" gradient-color-end=\"#ffffff\"></inputs><dropdowns list-item-over-color=\"#52A4DA\" frame-color=\"#CACACA\"></dropdowns></textboxes><buttons frame-color=\"#F4F4F4\" gradient-color-end=\"#F4F4F4\" color=\"#202020\" bold=\"false\" over-gradient-color-begin=\"#F4F4F4\" down-gradient-color-begin=\"#F4F4F4\" over-gradient-color-end=\"#FFFFFF\" down-gradient-color-end=\"#ffffff\"><post-buttons frame-color=\"#F4F4F4\" gradient-color-end=\"#F4F4F4\"></post-buttons></buttons><listboxes frame-color=\"#CACACA\" corner-roundness=\"4;4;4;4\" gradient-color-begin=\"#F4F4F4\" gradient-color-end=\"#FFFFFF\"></listboxes><checkboxes checkmark-color=\"#00B600\" frame-color=\"#D5D5D5\" corner-roundness=\"3;3;3;3\" gradient-color-begin=\"#F4F4F4\" gradient-color-end=\"#FFFFFF\"></checkboxes><servicemarker gradient-color-begin=\"#FF4949\" gradient-color-end=\"#910000\"></servicemarker><tooltips color=\"#6D5128\" gradient-color-begin=\"#FFFFFF\" gradient-color-end=\"#FFE4BB\" size=\"10\" frame-color=\"#FFDBA4\"></tooltips></controls><texts color=\"#F4F4F4\"><headers color=\"#FC7A7A\"></headers><messages color=\"#FFFFFF\"></messages><links color=\"#FFFFFF\" underline=\"false\" size=\"13\" bold=\"false\" over-color=\"#FFFFFF\" down-color=\"#353535\" down-bold=\"false\"></links></texts></body></config>";
cfg["bookmarkURL"] = "http://www.indebted.com/the-game/debtski";
cfg["defaultContent"] = (((((((("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\" width=\"550\" height=\"275\" id=\"widget\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"play\" value=\"false\" /><param name=\"loop value=\"false\" />\t<param name=\"allowFullScreen\" value=\"false\" />\t<param name=\"movie\" value=\"" + CVARS.URL_GAME) + "?id=") + myID) + "\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#BBECFF\" />\t<embed src=\"") + CVARS.URL_GAME) + "?id=") + myID) + "\" quality=\"high\" bgcolor=\"#BBECFF\" loop=\"false\" play=\"false\" width=\"550\" height=\"275\" name=\"player\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />\t</object>");
trace("PEPE", myID);
cfg["onClose"] = function (_arg1:Object):void{
mcWF.visible = false;
var _local2 = ldr.content;
_local2["INIT"]();
};
cfg["onLoad"] = function (_arg1:Object):void{
var _local2 = ldr.content;
_local2["INIT"]();
gotoAndStop(3);
init();
};
ldr = new Loader();
url = ("http://cdn.gigya.com/WildFire/swf/wildfireInAS3.swf?ModuleID=" + ModuleID);
urlReq = new URLRequest(url);
mcWF[ModuleID] = cfg;
ldr.load(urlReq);
mcWF.addChild(ldr);
} else {
mcWF.visible = true;
};
}
private function handleKeyUp(_arg1:KeyboardEvent):void{
input.onKeyUp(_arg1.keyCode);
trace("INPUT");
}
public function removeInterface(){
mp3.channel.stop();
mp3.visible = false;
removeChild(interfaceScreen);
interfaceScreen = null;
removeChild(mc_sound);
mc_sound = null;
}
function windowActive(_arg1:Event):void{
trace("ACTIVE");
}
public function pushTutorial(){
tutorialScreen = new TutorialClip(view);
addChild(tutorialScreen);
}
public function pushTutorial2(){
control.stopGame();
tutorialScreen2 = new TutorialClip2(view);
addChild(tutorialScreen2);
}
private function onPlayClick(_arg1:MouseEvent){
trace("PLAY");
if (pressedPlay == false){
if (isANEMBED == false){
trace("REPORT ALGO");
reporter.sendCall({prop39:"debtski_game_play", eVar5:"debtski_game", events:"debtski_play,event1"});
} else {
trace("REPORT ALGO");
reporter.sendCall({prop39:"debtski_game_play", eVar5:"debtski_game", events:"debtski_play,event1"});
};
pressedPlay = true;
} else {
if (isANEMBED == false){
reporter.sendCall({prop39:"debtski_game_replay", eVar5:"debtski_game", events:"debtski_replay,event2"});
} else {
reporter.sendCall({prop39:"debtski_game_replay", eVar5:"debtski_game", events:"debtski_replay,event2"});
};
};
SoundM.stopSound("Intr");
stage.addEventListener(Event.DEACTIVATE, windowNotActive);
stage.addEventListener(Event.ACTIVATE, windowActive);
if (mcWF == null){
pushLoading();
gigya();
} else {
gotoAndStop(3);
init();
};
mcWF.visible = false;
}
private function onScoresClick(_arg1:MouseEvent){
myHighscores = new highscores(this);
addChild(myHighscores);
}
public function pauseMp3(){
}
private function loadID():void{
var _local1:URLLoader = new URLLoader();
_local1.addEventListener(Event.COMPLETE, handleLoadID);
_local1.load(new URLRequest(CVARS.URL_ID));
}
public function removeAvion(){
removeChild(avion);
avion = null;
}
private function init():void{
cashModel = new CashFlow();
model = new GameModel();
view = new GameView(model, this);
input = new GameInput(view);
control = new GameControl(model, view, input, this);
view.control = control;
addChild(view);
swapChildren(mcWF, view);
if (mp3 != null){
setChildIndex(mp3, (numChildren - 1));
};
interfaceScreen = new InterfaceClip(this);
mc_sound = new mcsound();
addChild(mc_sound);
mc_sound.addEventListener(MouseEvent.CLICK, onSound);
mc_sound.x = 891;
mc_sound.y = 432;
addChild(interfaceScreen);
view.pushTutorialScreen();
control.loadLevel(0);
}
private function handleLoadXML(_arg1:Event):void{
var _local2:XML = new XML(_arg1.target.data);
CVARS = CvarParser.parse(_local2);
if (embedStr != null){
validate(embedStr);
};
trace(embedStr);
loadLibrary();
trace("SLS");
}
public function zeroFrame(){
trace("FRAME ZERO");
DECAL_STYLE = new Array();
LIFE_STYLE = 1;
NECESSITIES = 0;
LAST_NECESSITIES = 0;
PIG_STYLE = 0;
SKI_STYLE = 0;
JUMP_STAGE = -1;
ENGINE_STAGE = -1;
SPEND_LEVEL = 0;
SAVING_LEVEL = 0;
HAPPINESS = 0;
COLOR = 0;
LAST_HAPPINESS = 0;
SCORE = 0;
if (loaded){
gotoAndStop(2);
};
}
private function handleLoadLibrary(_arg1:Event):void{
lib = (_arg1.currentTarget.content as ArtMain);
loadID();
}
public function addMp3(){
if (mp3 == null){
mp3 = new mp3player();
mp3.x = 646;
mp3.y = 404;
addChild(mp3);
};
}
public function removeAboutScreen(){
removeChild(mcAbout);
mcAbout = null;
}
public function newPause(){
if (view.pauseScreen == null){
view.pushPauseScreen();
} else {
view.removePauseScreen();
};
}
function windowNotActive(_arg1:Event):void{
trace("NOT ACTIVE");
if (((running) && (!((control.pan == true))))){
newPause();
};
}
public function pushAvion(_arg1:GameView){
var _local2:int;
avion = new airplane(_arg1);
avion.x = 840;
if (model.levelNum <= 5){
_local2 = (1 + Math.round((Math.random() * (avion.totalFrames - 2))));
} else {
if (model.levelNum == 6){
_local2 = 6;
} else {
_local2 = 7;
};
};
avion.gotoAndStop(_local2);
addChild(avion);
}
private function validate(_arg1){
var sid = _arg1;
var request:URLRequest = new URLRequest(Main.CVARS.URL_EMBED);
var variables:URLLoader = new URLLoader();
var vars:URLVariables = new URLVariables();
vars.sid = sid;
request.data = vars;
try {
variables.load(request);
trace("WILL LOAD");
} catch(error:Error) {
trace(("Unable to load URL: " + error));
};
}
public function onC(_arg1:Event){
trace("EXENT");
}
public function removeLoading(){
removeChild(loadingScreen);
loadingScreen = null;
}
private function handleLoadID(_arg1:Event):void{
var _local2:XML = new XML(_arg1.target.data);
trace("LALAL", _local2);
myID = _local2;
trace(myID);
splash();
}
private function loadXML():void{
var _local1:URLLoader = new URLLoader();
_local1.addEventListener(Event.COMPLETE, handleLoadXML);
trace("BASE", Main.CVARS.URL_BASE);
_local1.load(new URLRequest("http://www.indebted.com/the-game/debtski/cvars.xml"));
}
private function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 80){
if (view.pauseScreen == null){
};
};
input.onKeyDown(_arg1.keyCode);
}
private function getSession(){
}
public function closeHighscores(){
removeChild(myHighscores);
myHighscores = null;
}
public function goFrame(){
gotoAndStop(2);
trace("GO FRAME");
}
private function splash(){
gotoAndStop(2);
}
public function pushLoading(){
if (loadingScreen == null){
loadingScreen = new loading();
addChild(loadingScreen);
};
}
public function removeTutorial2(){
control.startGame();
removeChild(tutorialScreen2);
tutorialScreen2 = null;
}
public function onAbout(_arg1:MouseEvent){
mcAbout = new about(this);
addChild(mcAbout);
}
public function onSound(_arg1:MouseEvent){
if (mc_sound.currentFrame == 1){
mc_sound.gotoAndStop(2);
} else {
mc_sound.gotoAndStop(1);
};
changeAudio();
}
function introFrame(){
SoundM.playSound("Intr", 40);
loaded = true;
btn_scores.addEventListener(MouseEvent.CLICK, onScoresClick);
btn_play.addEventListener(MouseEvent.CLICK, onPlayClick);
backlink.btn_logos.addEventListener(MouseEvent.CLICK, onLogos);
btn_about.addEventListener(MouseEvent.CLICK, onAbout);
if (shouldOcult == true){
backlink.visible = false;
};
}
private function loaderComplete(_arg1:Event){
var _local2:* = this.loaderInfo.parameters;
loadXML();
}
private function loadLibrary():void{
var _local1:Loader = new Loader();
var _local2:URLRequest = new URLRequest((Main.CVARS.URL_BASE + "DebtArt3.swf"));
var _local3:LoaderContext = new LoaderContext();
_local3.checkPolicyFile = true;
_local3.securityDomain = SecurityDomain.currentDomain;
_local1.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadLibrary);
_local1.load(_local2, _local3);
}
}
}//package
Section 145
//mcsound (mcsound)
package {
import flash.display.*;
public dynamic class mcsound extends MovieClip {
public function mcsound(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 146
//mcW (mcW)
package {
import flash.display.*;
public dynamic class mcW extends MovieClip {
}
}//package
Section 147
//mmm (mmm)
package {
import debtgame.view.*;
public dynamic class mmm extends mybutton {
}
}//package
Section 148
//nec (nec)
package {
import flash.media.*;
public dynamic class nec extends Sound {
}
}//package
Section 149
//noro (noro)
package {
import flash.media.*;
public dynamic class noro extends Sound {
}
}//package
Section 150
//nors (nors)
package {
import flash.media.*;
public dynamic class nors extends Sound {
}
}//package
Section 151
//NumericStepperDownArrow_disabledSkin (NumericStepperDownArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_disabledSkin extends MovieClip {
}
}//package
Section 152
//NumericStepperDownArrow_downSkin (NumericStepperDownArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_downSkin extends MovieClip {
}
}//package
Section 153
//NumericStepperDownArrow_overSkin (NumericStepperDownArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_overSkin extends MovieClip {
}
}//package
Section 154
//NumericStepperDownArrow_upSkin (NumericStepperDownArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_upSkin extends MovieClip {
}
}//package
Section 155
//NumericStepperUpArrow_disabledSkin (NumericStepperUpArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_disabledSkin extends MovieClip {
}
}//package
Section 156
//NumericStepperUpArrow_downSkin (NumericStepperUpArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_downSkin extends MovieClip {
}
}//package
Section 157
//NumericStepperUpArrow_overSkin (NumericStepperUpArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_overSkin extends MovieClip {
}
}//package
Section 158
//NumericStepperUpArrow_upSkin (NumericStepperUpArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_upSkin extends MovieClip {
}
}//package
Section 159
//rol (rol)
package {
import flash.media.*;
public dynamic class rol extends Sound {
}
}//package
Section 160
//SOUNDcopy2 (SOUNDcopy2)
package {
import debtgame.view.*;
public dynamic class SOUNDcopy2 extends mybutton {
}
}//package
Section 161
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 162
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 163
//toc (toc)
package {
import flash.media.*;
public dynamic class toc extends Sound {
}
}//package
Section 164
//toc2 (toc2)
package {
import flash.media.*;
public dynamic class toc2 extends Sound {
}
}//package
Section 165
//tsu (tsu)
package {
import flash.media.*;
public dynamic class tsu extends Sound {
}
}//package
Section 166
//tut (tut)
package {
import flash.media.*;
public dynamic class tut extends Sound {
}
}//package