home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / kidoz.as < prev    next >
Encoding:
Text File  |  2009-05-06  |  43.3 KB  |  1,260 lines

  1. package
  2. {
  3.    import com.flex.*;
  4.    import com.tools.Browser.SiteViewer;
  5.    import com.ui.AppBackground;
  6.    import com.ui.AppMainMenu;
  7.    import com.ui.AppTopMenu;
  8.    import com.ui.ToolsManager;
  9.    import com.util.*;
  10.    import flash.accessibility.*;
  11.    import flash.data.*;
  12.    import flash.debugger.*;
  13.    import flash.desktop.*;
  14.    import flash.display.*;
  15.    import flash.errors.*;
  16.    import flash.events.*;
  17.    import flash.external.*;
  18.    import flash.filesystem.*;
  19.    import flash.filters.*;
  20.    import flash.geom.*;
  21.    import flash.html.*;
  22.    import flash.html.script.*;
  23.    import flash.media.*;
  24.    import flash.net.*;
  25.    import flash.printing.*;
  26.    import flash.profiler.*;
  27.    import flash.system.*;
  28.    import flash.text.*;
  29.    import flash.ui.*;
  30.    import flash.utils.*;
  31.    import flash.xml.*;
  32.    import gs.TweenMax;
  33.    import mx.binding.*;
  34.    import mx.containers.Canvas;
  35.    import mx.containers.HBox;
  36.    import mx.controls.TextArea;
  37.    import mx.core.UIComponentDescriptor;
  38.    import mx.core.WindowedApplication;
  39.    import mx.core.mx_internal;
  40.    import mx.events.FlexEvent;
  41.    import mx.events.PropertyChangeEvent;
  42.    import mx.events.ResizeEvent;
  43.    import mx.managers.PopUpManager;
  44.    import mx.resources.*;
  45.    import mx.rpc.events.FaultEvent;
  46.    import mx.rpc.events.ResultEvent;
  47.    import mx.rpc.soap.mxml.Operation;
  48.    import mx.rpc.soap.mxml.WebService;
  49.    import mx.styles.*;
  50.    
  51.    use namespace mx_internal;
  52.    
  53.    public class kidoz extends WindowedApplication
  54.    {
  55.       mx_internal static var _kidoz_StylesInit_done:Boolean = false;
  56.       
  57.       private var _552310138locationUrl:TextArea;
  58.       
  59.       private var _embed__font_Arial_Unicode_MS_medium_normal_403044905:Class;
  60.       
  61.       private var _embed_css_png_leftArrow_up_png_1201750067:Class;
  62.       
  63.       private var _embed_css_png_btn_down_png_307255565:Class;
  64.       
  65.       public var topLeft:TopLeft;
  66.       
  67.       public var updateProgress:int;
  68.       
  69.       public var userInfo:Object;
  70.       
  71.       private var _1411084428appTop:Canvas;
  72.       
  73.       public var appWidth:int;
  74.       
  75.       public var usageTimer:UsageTimer;
  76.       
  77.       private var _379923513siteViewer:SiteViewer;
  78.       
  79.       private var _645375758currentErrorMsg:String;
  80.       
  81.       private var _1140090796topMenu:AppTopMenu;
  82.       
  83.       private var _embed__font_Arial_Unicode_MS_bold_normal_1139689196:Class;
  84.       
  85.       private var _embed_css_png_btn_up_png_723172121:Class;
  86.       
  87.       private var favoritesAlert:FavoritesAlert;
  88.       
  89.       private var _embed_css_png_leftArrow_over_png_1290443763:Class;
  90.       
  91.       public var loggedIn:Boolean;
  92.       
  93.       private var _93027910appBg:AppBackground;
  94.       
  95.       private var _embed_css_png_small_btn_over_png_1466500185:Class;
  96.       
  97.       private var parentalControl:ParentalControl;
  98.       
  99.       public var favorites:FavoritesManager;
  100.       
  101.       private var _embed_css_png_btn_exit_up_png_1137972161:Class;
  102.       
  103.       private var _732490988appMenuHolder:Canvas;
  104.       
  105.       public var parentsLoginOpen:Boolean;
  106.       
  107.       private var _embed_css_png_small_btn_down_png_1544154083:Class;
  108.       
  109.       private var _816631278viewer:Canvas;
  110.       
  111.       public var parentsLoginUrl:String;
  112.       
  113.       private var regForm:RegForm;
  114.       
  115.       private var testTime:Number;
  116.       
  117.       private var loadingAlert:LoadingAlert;
  118.       
  119.       public var loadingAlertOn:Boolean;
  120.       
  121.       private var _1643539006userInfoXML:XML;
  122.       
  123.       public var _settingsUrl:String = "http://kidoz.net/air/settings_standard.xml";
  124.       
  125.       private var _embed_css_png_btn_exit_over_png_805226735:Class;
  126.       
  127.       private var _embed_css_png_rightArrow_over_png_796846993:Class;
  128.       
  129.       public var appHeight:int;
  130.       
  131.       private var _embed_css_png_btn_exit_down_png_677240895:Class;
  132.       
  133.       private var _embed_css_png_rightArrow_up_png_1813949471:Class;
  134.       
  135.       public var logger:Logger;
  136.       
  137.       private var _embed_css_png_leftArrow_down_png_120521785:Class;
  138.       
  139.       private var _embed_css_png_btn_over_png_363930871:Class;
  140.       
  141.       private var _93027878appBG:Canvas;
  142.       
  143.       private var _1870114760topLeftHolder:HBox;
  144.       
  145.       private var _1014488750toolsManager:ToolsManager;
  146.       
  147.       private var _embed_css_png_rightArrow_down_png_440985553:Class;
  148.       
  149.       private var _642554749systemInfo:Object;
  150.       
  151.       private var parentsLogin:ParentsLogin;
  152.       
  153.       private var _3804ws:WebService;
  154.       
  155.       private var _embed_css_png_small_btn_up_png_530801655:Class;
  156.       
  157.       private var cursorID:Number = 0;
  158.       
  159.       private var _embed_css_png_btn_disable_png_2387183:Class;
  160.       
  161.       private var _documentDescriptor_:UIComponentDescriptor;
  162.       
  163.       public var appMainMenu:AppMainMenu;
  164.       
  165.       public var _referral:String = "KIDOZ";
  166.       
  167.       public function kidoz()
  168.       {
  169.          this._documentDescriptor_ = new UIComponentDescriptor({
  170.             "type":WindowedApplication,
  171.             "propertiesFactory":function():Object
  172.             {
  173.                return {"childDescriptors":[new UIComponentDescriptor({
  174.                   "type":Canvas,
  175.                   "id":"appBG",
  176.                   "events":{"resize":"__appBG_resize"},
  177.                   "propertiesFactory":function():Object
  178.                   {
  179.                      return {
  180.                         "percentWidth":100,
  181.                         "percentHeight":100,
  182.                         "x":0,
  183.                         "y":0,
  184.                         "verticalScrollPolicy":"off",
  185.                         "horizontalScrollPolicy":"off",
  186.                         "childDescriptors":[new UIComponentDescriptor({
  187.                            "type":AppBackground,
  188.                            "id":"appBg",
  189.                            "events":{"creationComplete":"__appBg_creationComplete"}
  190.                         })]
  191.                      };
  192.                   }
  193.                }),new UIComponentDescriptor({
  194.                   "type":Canvas,
  195.                   "id":"appTop",
  196.                   "stylesFactory":function():void
  197.                   {
  198.                      this.top = "0";
  199.                   },
  200.                   "propertiesFactory":function():Object
  201.                   {
  202.                      return {
  203.                         "percentWidth":100,
  204.                         "height":100,
  205.                         "x":0,
  206.                         "verticalScrollPolicy":"off",
  207.                         "horizontalScrollPolicy":"off",
  208.                         "childDescriptors":[new UIComponentDescriptor({
  209.                            "type":AppTopMenu,
  210.                            "id":"topMenu",
  211.                            "events":{"creationComplete":"__topMenu_creationComplete"}
  212.                         })]
  213.                      };
  214.                   }
  215.                }),new UIComponentDescriptor({
  216.                   "type":ToolsManager,
  217.                   "id":"toolsManager",
  218.                   "propertiesFactory":function():Object
  219.                   {
  220.                      return {
  221.                         "x":0,
  222.                         "y":0
  223.                      };
  224.                   }
  225.                }),new UIComponentDescriptor({
  226.                   "type":Canvas,
  227.                   "id":"appMenuHolder",
  228.                   "stylesFactory":function():void
  229.                   {
  230.                      this.bottom = "0";
  231.                   },
  232.                   "propertiesFactory":function():Object
  233.                   {
  234.                      return {
  235.                         "percentWidth":100,
  236.                         "height":180,
  237.                         "x":0,
  238.                         "verticalScrollPolicy":"off",
  239.                         "horizontalScrollPolicy":"off"
  240.                      };
  241.                   }
  242.                }),new UIComponentDescriptor({
  243.                   "type":HBox,
  244.                   "id":"topLeftHolder",
  245.                   "propertiesFactory":function():Object
  246.                   {
  247.                      return {
  248.                         "y":15,
  249.                         "x":10
  250.                      };
  251.                   }
  252.                }),new UIComponentDescriptor({
  253.                   "type":Canvas,
  254.                   "id":"viewer",
  255.                   "stylesFactory":function():void
  256.                   {
  257.                      this.top = "0";
  258.                   },
  259.                   "propertiesFactory":function():Object
  260.                   {
  261.                      return {
  262.                         "percentWidth":100,
  263.                         "percentHeight":100,
  264.                         "x":0,
  265.                         "verticalScrollPolicy":"off",
  266.                         "horizontalScrollPolicy":"off",
  267.                         "childDescriptors":[new UIComponentDescriptor({
  268.                            "type":SiteViewer,
  269.                            "id":"siteViewer",
  270.                            "events":{"creationComplete":"__siteViewer_creationComplete"}
  271.                         }),new UIComponentDescriptor({
  272.                            "type":TextArea,
  273.                            "id":"locationUrl",
  274.                            "effects":["showEffect","hideEffect"],
  275.                            "stylesFactory":function():void
  276.                            {
  277.                               this.textAlign = "center";
  278.                               this.horizontalCenter = "0";
  279.                               this.color = 5417446;
  280.                               this.cornerRadius = 13;
  281.                               this.borderColor = 12246260;
  282.                               this.backgroundColor = 15792894;
  283.                               this.paddingTop = 5;
  284.                               this.showEffect = "fade";
  285.                               this.hideEffect = "fade";
  286.                            },
  287.                            "propertiesFactory":function():Object
  288.                            {
  289.                               return {
  290.                                  "visible":false,
  291.                                  "width":520,
  292.                                  "y":17,
  293.                                  "height":30,
  294.                                  "editable":false
  295.                               };
  296.                            }
  297.                         })]
  298.                      };
  299.                   }
  300.                })]};
  301.             }
  302.          });
  303.          this._642554749systemInfo = new Object();
  304.          this.userInfo = new Object();
  305.          this._embed__font_Arial_Unicode_MS_bold_normal_1139689196 = kidoz__embed__font_Arial_Unicode_MS_bold_normal_1139689196;
  306.          this._embed__font_Arial_Unicode_MS_medium_normal_403044905 = kidoz__embed__font_Arial_Unicode_MS_medium_normal_403044905;
  307.          this._embed_css_png_btn_disable_png_2387183 = kidoz__embed_css_png_btn_disable_png_2387183;
  308.          this._embed_css_png_btn_down_png_307255565 = kidoz__embed_css_png_btn_down_png_307255565;
  309.          this._embed_css_png_btn_exit_down_png_677240895 = kidoz__embed_css_png_btn_exit_down_png_677240895;
  310.          this._embed_css_png_btn_exit_over_png_805226735 = kidoz__embed_css_png_btn_exit_over_png_805226735;
  311.          this._embed_css_png_btn_exit_up_png_1137972161 = kidoz__embed_css_png_btn_exit_up_png_1137972161;
  312.          this._embed_css_png_btn_over_png_363930871 = kidoz__embed_css_png_btn_over_png_363930871;
  313.          this._embed_css_png_btn_up_png_723172121 = kidoz__embed_css_png_btn_up_png_723172121;
  314.          this._embed_css_png_leftArrow_down_png_120521785 = kidoz__embed_css_png_leftArrow_down_png_120521785;
  315.          this._embed_css_png_leftArrow_over_png_1290443763 = kidoz__embed_css_png_leftArrow_over_png_1290443763;
  316.          this._embed_css_png_leftArrow_up_png_1201750067 = kidoz__embed_css_png_leftArrow_up_png_1201750067;
  317.          this._embed_css_png_rightArrow_down_png_440985553 = kidoz__embed_css_png_rightArrow_down_png_440985553;
  318.          this._embed_css_png_rightArrow_over_png_796846993 = kidoz__embed_css_png_rightArrow_over_png_796846993;
  319.          this._embed_css_png_rightArrow_up_png_1813949471 = kidoz__embed_css_png_rightArrow_up_png_1813949471;
  320.          this._embed_css_png_small_btn_down_png_1544154083 = kidoz__embed_css_png_small_btn_down_png_1544154083;
  321.          this._embed_css_png_small_btn_over_png_1466500185 = kidoz__embed_css_png_small_btn_over_png_1466500185;
  322.          this._embed_css_png_small_btn_up_png_530801655 = kidoz__embed_css_png_small_btn_up_png_530801655;
  323.          super();
  324.          mx_internal::_document = this;
  325.          if(!this.styleDeclaration)
  326.          {
  327.             this.styleDeclaration = new CSSStyleDeclaration();
  328.          }
  329.          this.styleDeclaration.defaultFactory = function():void
  330.          {
  331.             this.showFlexChrome = false;
  332.             this.modalTransparency = 0.8;
  333.             this.modalTransparencyColor = 682660;
  334.             this.modalTransparencyDuration = 200;
  335.             this.modalTransparencyBlur = 0;
  336.          };
  337.          mx_internal::_kidoz_StylesInit();
  338.          this.layout = "absolute";
  339.          this.percentWidth = 100;
  340.          this.percentHeight = 100;
  341.          this.verticalScrollPolicy = "off";
  342.          this.horizontalScrollPolicy = "off";
  343.          this._kidoz_WebService1_i();
  344.          this.addEventListener("creationComplete",this.___kidoz_WindowedApplication1_creationComplete);
  345.       }
  346.       
  347.       public function ___kidoz_WindowedApplication1_creationComplete(param1:FlexEvent) : void
  348.       {
  349.          this.init();
  350.       }
  351.       
  352.       private function localize() : void
  353.       {
  354.          var _loc4_:Object = null;
  355.          var _loc1_:String = this.userInfoXML.USERINFO.@kidMainLang;
  356.          var _loc2_:localesList = new localesList();
  357.          var _loc3_:String = "";
  358.          for each(_loc4_ in _loc2_.list)
  359.          {
  360.             if(_loc4_.data == _loc1_)
  361.             {
  362.                _loc3_ = _loc1_;
  363.                break;
  364.             }
  365.          }
  366.          if(_loc3_ == "")
  367.          {
  368.             _loc3_ = "en";
  369.          }
  370.          trace("main user language=" + _loc1_ + "\n set application interface to:" + _loc3_);
  371.          resourceManager.localeChain = [_loc3_];
  372.          this.topMenu.localize();
  373.          var _loc5_:SharedObject = SharedObject.getLocal("kidozData");
  374.          _loc5_.data.locale = _loc3_;
  375.       }
  376.       
  377.       public function showError(param1:String) : void
  378.       {
  379.          trace(">>> ERROR: " + param1);
  380.          this.currentErrorMsg = param1;
  381.          this.hideLoadingAlert();
  382.          var _loc2_:ErrorAlert = new ErrorAlert();
  383.          PopUpManager.addPopUp(_loc2_,this,true);
  384.       }
  385.       
  386.       private function _kidoz_WebService1_i() : WebService
  387.       {
  388.          var _loc1_:WebService = new WebService();
  389.          this.ws = _loc1_;
  390.          _loc1_.operations = {
  391.             "UserLogin":this._kidoz_Operation1_c(),
  392.             "GetSitesList":this._kidoz_Operation2_c()
  393.          };
  394.          _loc1_.addEventListener("fault",this.__ws_fault);
  395.          _loc1_.initialized(this,"ws");
  396.          return _loc1_;
  397.       }
  398.       
  399.       public function restart() : void
  400.       {
  401.          this.appMainMenu.dactivate();
  402.          this.topLeftHolder.removeChild(this.topLeft);
  403.          this.appMenuHolder.removeChild(this.appMainMenu);
  404.          this.toolsManager.reset();
  405.          this.login();
  406.       }
  407.       
  408.       public function init() : void
  409.       {
  410.          Stage["displayState"] = "fullScreen";
  411.          this.testTime = getTimer();
  412.          this.getCurrentAppVersion();
  413.          this.setAppWindow();
  414.          var _loc1_:InternetConnectionMonitor = new InternetConnectionMonitor();
  415.          var _loc2_:SharedObject = SharedObject.getLocal("kidozData");
  416.          trace("locale: " + _loc2_.data.locale);
  417.          if(_loc2_.data.locale)
  418.          {
  419.             resourceManager.localeChain = [_loc2_.data.locale];
  420.          }
  421.          else
  422.          {
  423.             resourceManager.localeChain = ["en"];
  424.             _loc2_.data.locale = "en";
  425.          }
  426.          this.topMenu.localize();
  427.       }
  428.       
  429.       public function set appMenuHolder(param1:Canvas) : void
  430.       {
  431.          var _loc2_:Object = this._732490988appMenuHolder;
  432.          if(_loc2_ !== param1)
  433.          {
  434.             this._732490988appMenuHolder = param1;
  435.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"appMenuHolder",_loc2_,param1));
  436.          }
  437.       }
  438.       
  439.       public function __appBg_creationComplete(param1:FlexEvent) : void
  440.       {
  441.          this.appBg.init();
  442.       }
  443.       
  444.       private function _kidoz_Operation1_c() : Operation
  445.       {
  446.          var _loc1_:Operation = new Operation();
  447.          _loc1_.name = "UserLogin";
  448.          _loc1_.resultFormat = "object";
  449.          _loc1_.addEventListener("result",this.___kidoz_Operation1_result);
  450.          _loc1_.addEventListener("fault",this.___kidoz_Operation1_fault);
  451.          return _loc1_;
  452.       }
  453.       
  454.       public function set systemInfo(param1:Object) : void
  455.       {
  456.          var _loc2_:Object = this._642554749systemInfo;
  457.          if(_loc2_ !== param1)
  458.          {
  459.             this._642554749systemInfo = param1;
  460.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"systemInfo",_loc2_,param1));
  461.          }
  462.       }
  463.       
  464.       public function showLoadingAlert() : void
  465.       {
  466.          if(!this.loadingAlertOn)
  467.          {
  468.             this.loadingAlert = new LoadingAlert();
  469.             PopUpManager.addPopUp(this.loadingAlert,this,false);
  470.             this.loadingAlertOn = true;
  471.          }
  472.       }
  473.       
  474.       [Bindable(event="propertyChange")]
  475.       public function get currentErrorMsg() : String
  476.       {
  477.          return this._645375758currentErrorMsg;
  478.       }
  479.       
  480.       private function getCurrentAppVersion() : void
  481.       {
  482.          var _loc1_:XML = NativeApplication.nativeApplication.applicationDescriptor;
  483.          var _loc2_:Namespace = _loc1_.namespaceDeclarations()[0];
  484.          this.systemInfo.currentVersion = _loc1_._loc2_::version;
  485.       }
  486.       
  487.       public function hideFavoritesAlert() : void
  488.       {
  489.          PopUpManager.removePopUp(this.favoritesAlert);
  490.       }
  491.       
  492.       [Bindable(event="propertyChange")]
  493.       public function get viewer() : Canvas
  494.       {
  495.          return this._816631278viewer;
  496.       }
  497.       
  498.       [Bindable(event="propertyChange")]
  499.       public function get appBG() : Canvas
  500.       {
  501.          return this._93027878appBG;
  502.       }
  503.       
  504.       public function getAppSettings() : void
  505.       {
  506.          this.showLoadingAlert();
  507.          var _loc1_:SettingsLoader = new SettingsLoader();
  508.       }
  509.       
  510.       private function setAppWindow() : void
  511.       {
  512.          this.nativeWindow.alwaysInFront = true;
  513.          this.nativeWindow.x = 0;
  514.          this.nativeWindow.y = 0;
  515.          this.appWidth = Capabilities.screenResolutionX;
  516.          this.appHeight = Capabilities.screenResolutionY;
  517.          this.nativeWindow.width = this.appWidth;
  518.          this.nativeWindow.height = this.appHeight;
  519.       }
  520.       
  521.       public function set currentErrorMsg(param1:String) : void
  522.       {
  523.          var _loc2_:Object = this._645375758currentErrorMsg;
  524.          if(_loc2_ !== param1)
  525.          {
  526.             this._645375758currentErrorMsg = param1;
  527.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"currentErrorMsg",_loc2_,param1));
  528.          }
  529.       }
  530.       
  531.       [Bindable(event="propertyChange")]
  532.       public function get siteViewer() : SiteViewer
  533.       {
  534.          return this._379923513siteViewer;
  535.       }
  536.       
  537.       public function ___kidoz_Operation2_result(param1:ResultEvent) : void
  538.       {
  539.          this.onLoginResult(param1);
  540.       }
  541.       
  542.       public function closeParentsZone() : void
  543.       {
  544.          this.removeChild(this.parentalControl);
  545.          this.restart();
  546.       }
  547.       
  548.       public function closeParentsLogin() : void
  549.       {
  550.          this.parentsLogin.timer.stop();
  551.          this.parentsLoginOpen = false;
  552.          this.removeChild(this.parentsLogin);
  553.       }
  554.       
  555.       public function ___kidoz_Operation2_fault(param1:FaultEvent) : void
  556.       {
  557.          this.showError(param1.fault.faultString);
  558.       }
  559.       
  560.       [Bindable(event="propertyChange")]
  561.       public function get appBg() : AppBackground
  562.       {
  563.          return this._93027910appBg;
  564.       }
  565.       
  566.       [Bindable(event="propertyChange")]
  567.       public function get toolsManager() : ToolsManager
  568.       {
  569.          return this._1014488750toolsManager;
  570.       }
  571.       
  572.       public function set appBG(param1:Canvas) : void
  573.       {
  574.          var _loc2_:Object = this._93027878appBG;
  575.          if(_loc2_ !== param1)
  576.          {
  577.             this._93027878appBG = param1;
  578.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"appBG",_loc2_,param1));
  579.          }
  580.       }
  581.       
  582.       public function ___kidoz_Operation1_result(param1:ResultEvent) : void
  583.       {
  584.          this.onLoginResult(param1);
  585.       }
  586.       
  587.       public function showTestTimer() : void
  588.       {
  589.          trace("time: " + (getTimer() - this.testTime));
  590.       }
  591.       
  592.       public function openParentsLogin() : void
  593.       {
  594.          this.parentsLogin = new ParentsLogin();
  595.          this.parentsLogin.x = this.topLeft.getParentlLinkX();
  596.          this.parentsLogin.y = 40;
  597.          this.addChild(this.parentsLogin);
  598.          this.parentsLoginOpen = true;
  599.       }
  600.       
  601.       [Bindable(event="propertyChange")]
  602.       public function get topMenu() : AppTopMenu
  603.       {
  604.          return this._1140090796topMenu;
  605.       }
  606.       
  607.       public function set viewer(param1:Canvas) : void
  608.       {
  609.          var _loc2_:Object = this._816631278viewer;
  610.          if(_loc2_ !== param1)
  611.          {
  612.             this._816631278viewer = param1;
  613.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"viewer",_loc2_,param1));
  614.          }
  615.       }
  616.       
  617.       public function openTimeAlert() : void
  618.       {
  619.          var _loc1_:TimeAlert = new TimeAlert();
  620.          PopUpManager.addPopUp(_loc1_,this,true);
  621.       }
  622.       
  623.       mx_internal function _kidoz_StylesInit() : void
  624.       {
  625.          var style:CSSStyleDeclaration = null;
  626.          var effects:Array = null;
  627.          if(mx_internal::_kidoz_StylesInit_done)
  628.          {
  629.             return;
  630.          }
  631.          mx_internal::_kidoz_StylesInit_done = true;
  632.          style = StyleManager.getStyleDeclaration(".policy");
  633.          if(!style)
  634.          {
  635.             style = new CSSStyleDeclaration();
  636.             StyleManager.setStyleDeclaration(".policy",style,false);
  637.          }
  638.          if(style.factory == null)
  639.          {
  640.             style.factory = function():void
  641.             {
  642.                this.color = 26265;
  643.                this.backgroundAlpha = 0.5;
  644.                this.fontSize = 11;
  645.             };
  646.          }
  647.          style = StyleManager.getStyleDeclaration(".btn");
  648.          if(!style)
  649.          {
  650.             style = new CSSStyleDeclaration();
  651.             StyleManager.setStyleDeclaration(".btn",style,false);
  652.          }
  653.          if(style.factory == null)
  654.          {
  655.             style.factory = function():void
  656.             {
  657.                this.borderColor = 738694;
  658.                this.paddingLeft = 20;
  659.                this.textRollOverColor = 16777215;
  660.                this.fontSize = 20;
  661.                this.paddingBottom = 7;
  662.                this.themeColor = 1429225;
  663.                this.fontFamily = "Arial Unicode MS";
  664.                this.paddingTop = 7;
  665.                this.color = 16777215;
  666.                this.fillAlphas = [1,1];
  667.                this.cornerRadius = 12;
  668.                this.paddingRight = 20;
  669.                this.fillColors = [756670,13158,756670,822];
  670.                this.textSelectedColor = 735323;
  671.             };
  672.          }
  673.          style = StyleManager.getStyleDeclaration(".smallBtn");
  674.          if(!style)
  675.          {
  676.             style = new CSSStyleDeclaration();
  677.             StyleManager.setStyleDeclaration(".smallBtn",style,false);
  678.          }
  679.          if(style.factory == null)
  680.          {
  681.             style.factory = function():void
  682.             {
  683.                this.color = 16777215;
  684.                this.textRollOverColor = 16777215;
  685.                this.upSkin = _embed_css_png_small_btn_up_png_530801655;
  686.                this.fontSize = 12;
  687.                this.downSkin = _embed_css_png_small_btn_down_png_1544154083;
  688.                this.overSkin = _embed_css_png_small_btn_over_png_1466500185;
  689.                this.textSelectedColor = 16777215;
  690.                this.fontFamily = "Arial Unicode MS";
  691.             };
  692.          }
  693.          style = StyleManager.getStyleDeclaration(".rightArrow");
  694.          if(!style)
  695.          {
  696.             style = new CSSStyleDeclaration();
  697.             StyleManager.setStyleDeclaration(".rightArrow",style,false);
  698.          }
  699.          if(style.factory == null)
  700.          {
  701.             style.factory = function():void
  702.             {
  703.                this.upSkin = _embed_css_png_rightArrow_up_png_1813949471;
  704.                this.downSkin = _embed_css_png_rightArrow_down_png_440985553;
  705.                this.overSkin = _embed_css_png_rightArrow_over_png_796846993;
  706.             };
  707.          }
  708.          style = StyleManager.getStyleDeclaration(".checkBox");
  709.          if(!style)
  710.          {
  711.             style = new CSSStyleDeclaration();
  712.             StyleManager.setStyleDeclaration(".checkBox",style,false);
  713.          }
  714.          if(style.factory == null)
  715.          {
  716.             style.factory = function():void
  717.             {
  718.                this.fillAlphas = [1,1,1,1];
  719.                this.fillColors = [16777215,13557995];
  720.             };
  721.          }
  722.          style = StyleManager.getStyleDeclaration(".title");
  723.          if(!style)
  724.          {
  725.             style = new CSSStyleDeclaration();
  726.             StyleManager.setStyleDeclaration(".title",style,false);
  727.          }
  728.          if(style.factory == null)
  729.          {
  730.             style.factory = function():void
  731.             {
  732.                this.paddingTop = 20;
  733.                this.color = 80986;
  734.                this.fontWeight = "bold";
  735.                this.fontSize = 26;
  736.                this.fontFamily = "Arial Unicode MS";
  737.             };
  738.          }
  739.          style = StyleManager.getStyleDeclaration(".linkBtn");
  740.          if(!style)
  741.          {
  742.             style = new CSSStyleDeclaration();
  743.             StyleManager.setStyleDeclaration(".linkBtn",style,false);
  744.          }
  745.          if(style.factory == null)
  746.          {
  747.             style.factory = function():void
  748.             {
  749.                this.selectionColor = 12180008;
  750.                this.color = 14700;
  751.                this.rollOverColor = 12180008;
  752.                this.fontSize = 14;
  753.                this.themeColor = 12180008;
  754.                this.fontFamily = "Arial Unicode MS";
  755.             };
  756.          }
  757.          style = StyleManager.getStyleDeclaration(".subTitle");
  758.          if(!style)
  759.          {
  760.             style = new CSSStyleDeclaration();
  761.             StyleManager.setStyleDeclaration(".subTitle",style,false);
  762.          }
  763.          if(style.factory == null)
  764.          {
  765.             style.factory = function():void
  766.             {
  767.                this.paddingTop = -10;
  768.                this.color = 80986;
  769.                this.fontWeight = "bold";
  770.                this.fontSize = 16;
  771.                this.fontFamily = "Arial Unicode MS";
  772.             };
  773.          }
  774.          style = StyleManager.getStyleDeclaration(".inputBox");
  775.          if(!style)
  776.          {
  777.             style = new CSSStyleDeclaration();
  778.             StyleManager.setStyleDeclaration(".inputBox",style,false);
  779.          }
  780.          if(style.factory == null)
  781.          {
  782.             style.factory = function():void
  783.             {
  784.                this.borderColor = 8883818;
  785.                this.paddingLeft = 5;
  786.                this.width = 306;
  787.                this.fontWeight = "bold";
  788.                this.fontSize = 18;
  789.                this.paddingBottom = 3;
  790.                this.borderStyle = "solid";
  791.                this.focusThickness = 5;
  792.                this.themeColor = 16776960;
  793.                this.fontFamily = "Arial Unicode MS";
  794.                this.paddingTop = 3;
  795.                this.color = 26265;
  796.                this.cornerRadius = 10;
  797.                this.height = 36;
  798.                this.borderThickness = 1;
  799.                this.backgroundColor = 16777215;
  800.             };
  801.          }
  802.          style = StyleManager.getStyleDeclaration(".exitBtn");
  803.          if(!style)
  804.          {
  805.             style = new CSSStyleDeclaration();
  806.             StyleManager.setStyleDeclaration(".exitBtn",style,false);
  807.          }
  808.          if(style.factory == null)
  809.          {
  810.             style.factory = function():void
  811.             {
  812.                this.color = 16777215;
  813.                this.upSkin = _embed_css_png_btn_exit_up_png_1137972161;
  814.                this.fontSize = 10;
  815.                this.downSkin = _embed_css_png_btn_exit_down_png_677240895;
  816.                this.overSkin = _embed_css_png_btn_exit_over_png_805226735;
  817.                this.textSelectedColor = 16777215;
  818.                this.fontFamily = "Arial Unicode MS";
  819.             };
  820.          }
  821.          style = StyleManager.getStyleDeclaration(".txt");
  822.          if(!style)
  823.          {
  824.             style = new CSSStyleDeclaration();
  825.             StyleManager.setStyleDeclaration(".txt",style,false);
  826.          }
  827.          if(style.factory == null)
  828.          {
  829.             style.factory = function():void
  830.             {
  831.                this.color = 80986;
  832.                this.fontSize = 14;
  833.                this.fontFamily = "Arial Unicode MS";
  834.             };
  835.          }
  836.          style = StyleManager.getStyleDeclaration(".txt12");
  837.          if(!style)
  838.          {
  839.             style = new CSSStyleDeclaration();
  840.             StyleManager.setStyleDeclaration(".txt12",style,false);
  841.          }
  842.          if(style.factory == null)
  843.          {
  844.             style.factory = function():void
  845.             {
  846.                this.color = 80986;
  847.                this.fontSize = 12;
  848.                this.fontFamily = "Arial Unicode MS";
  849.             };
  850.          }
  851.          style = StyleManager.getStyleDeclaration(".selectBox");
  852.          if(!style)
  853.          {
  854.             style = new CSSStyleDeclaration();
  855.             StyleManager.setStyleDeclaration(".selectBox",style,false);
  856.          }
  857.          if(style.factory == null)
  858.          {
  859.             style.factory = function():void
  860.             {
  861.                this.borderColor = 8883818;
  862.                this.paddingLeft = 7;
  863.                this.leading = 3;
  864.                this.fontSize = 16;
  865.                this.backgroundAlpha = 0;
  866.                this.paddingBottom = 1;
  867.                this.borderStyle = "solid";
  868.                this.focusThickness = 5;
  869.                this.themeColor = 13557995;
  870.                this.fontFamily = "Arial Unicode MS";
  871.                this.paddingTop = 3;
  872.                this.fillAlphas = [1,1,1,1];
  873.                this.color = 26265;
  874.                this.cornerRadius = 10;
  875.                this.fillColors = [16777215,13557995];
  876.                this.borderThickness = 1;
  877.                this.dropdownStyleName = "comboBoxDropdown";
  878.                this.backgroundColor = 16777215;
  879.             };
  880.          }
  881.          style = StyleManager.getStyleDeclaration(".btnReg");
  882.          if(!style)
  883.          {
  884.             style = new CSSStyleDeclaration();
  885.             StyleManager.setStyleDeclaration(".btnReg",style,false);
  886.          }
  887.          if(style.factory == null)
  888.          {
  889.             style.factory = function():void
  890.             {
  891.                this.color = 16777215;
  892.                this.textRollOverColor = 16777215;
  893.                this.upSkin = _embed_css_png_btn_up_png_723172121;
  894.                this.fontSize = 16;
  895.                this.downSkin = _embed_css_png_btn_down_png_307255565;
  896.                this.overSkin = _embed_css_png_btn_over_png_363930871;
  897.                this.disabledSkin = _embed_css_png_btn_disable_png_2387183;
  898.                this.textSelectedColor = 16777215;
  899.                this.fontFamily = "Arial Unicode MS";
  900.             };
  901.          }
  902.          style = StyleManager.getStyleDeclaration(".leftArrow");
  903.          if(!style)
  904.          {
  905.             style = new CSSStyleDeclaration();
  906.             StyleManager.setStyleDeclaration(".leftArrow",style,false);
  907.          }
  908.          if(style.factory == null)
  909.          {
  910.             style.factory = function():void
  911.             {
  912.                this.upSkin = _embed_css_png_leftArrow_up_png_1201750067;
  913.                this.downSkin = _embed_css_png_leftArrow_down_png_120521785;
  914.                this.overSkin = _embed_css_png_leftArrow_over_png_1290443763;
  915.             };
  916.          }
  917.          style = StyleManager.getStyleDeclaration(".selectBoxLang");
  918.          if(!style)
  919.          {
  920.             style = new CSSStyleDeclaration();
  921.             StyleManager.setStyleDeclaration(".selectBoxLang",style,false);
  922.          }
  923.          if(style.factory == null)
  924.          {
  925.             style.factory = function():void
  926.             {
  927.                this.borderColor = 8883818;
  928.                this.paddingLeft = 7;
  929.                this.width = 240;
  930.                this.leading = 3;
  931.                this.fontSize = 12;
  932.                this.backgroundAlpha = 0;
  933.                this.paddingBottom = 1;
  934.                this.borderStyle = "solid";
  935.                this.focusThickness = 5;
  936.                this.themeColor = 13557995;
  937.                this.fontFamily = "Arial Unicode MS";
  938.                this.paddingTop = 3;
  939.                this.fillAlphas = [1,1,1,1];
  940.                this.color = 26265;
  941.                this.cornerRadius = 10;
  942.                this.fillColors = [16777215,13557995];
  943.                this.borderThickness = 1;
  944.                this.dropdownStyleName = "comboBoxDropdown";
  945.                this.backgroundColor = 16777215;
  946.             };
  947.          }
  948.          style = StyleManager.getStyleDeclaration(".inputTitle");
  949.          if(!style)
  950.          {
  951.             style = new CSSStyleDeclaration();
  952.             StyleManager.setStyleDeclaration(".inputTitle",style,false);
  953.          }
  954.          if(style.factory == null)
  955.          {
  956.             style.factory = function():void
  957.             {
  958.                this.paddingTop = 10;
  959.                this.paddingLeft = 10;
  960.                this.color = 26265;
  961.                this.fontSize = 14;
  962.                this.fontFamily = "Arial Unicode MS";
  963.             };
  964.          }
  965.          StyleManager.mx_internal::initProtoChainRoots();
  966.       }
  967.       
  968.       public function login() : void
  969.       {
  970.          var _loc1_:SharedObject = SharedObject.getLocal("kidozData");
  971.          trace(">>> start login");
  972.          this.showLoadingAlert();
  973.          var _loc2_:SharedObject = SharedObject.getLocal("kidozData");
  974.          this.ws.loadWSDL(this.systemInfo.webServiceUrl);
  975.          this.ws.UserLogin(_loc2_.data.parentEmail,_loc2_.data.parentPassword,_loc2_.data.locale);
  976.       }
  977.       
  978.       [Bindable(event="propertyChange")]
  979.       public function get userInfoXML() : XML
  980.       {
  981.          return this._1643539006userInfoXML;
  982.       }
  983.       
  984.       public function set siteViewer(param1:SiteViewer) : void
  985.       {
  986.          var _loc2_:Object = this._379923513siteViewer;
  987.          if(_loc2_ !== param1)
  988.          {
  989.             this._379923513siteViewer = param1;
  990.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"siteViewer",_loc2_,param1));
  991.          }
  992.       }
  993.       
  994.       [Bindable(event="propertyChange")]
  995.       public function get appTop() : Canvas
  996.       {
  997.          return this._1411084428appTop;
  998.       }
  999.       
  1000.       [Bindable(event="propertyChange")]
  1001.       public function get locationUrl() : TextArea
  1002.       {
  1003.          return this._552310138locationUrl;
  1004.       }
  1005.       
  1006.       private function relocateItems() : void
  1007.       {
  1008.          this.appBg.setItemPosition();
  1009.          this.topMenu.setItemPosition();
  1010.          if(this.appMainMenu)
  1011.          {
  1012.             this.appMainMenu.setItemPosition();
  1013.          }
  1014.          if(this.getChildByName("regForm") != null)
  1015.          {
  1016.             this.regForm.setItemPosition();
  1017.          }
  1018.          this.toolsManager.setItemPosition();
  1019.       }
  1020.       
  1021.       public function set userInfoXML(param1:XML) : void
  1022.       {
  1023.          var _loc2_:Object = this._1643539006userInfoXML;
  1024.          if(_loc2_ !== param1)
  1025.          {
  1026.             this._1643539006userInfoXML = param1;
  1027.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"userInfoXML",_loc2_,param1));
  1028.          }
  1029.       }
  1030.       
  1031.       [Bindable(event="propertyChange")]
  1032.       public function get systemInfo() : Object
  1033.       {
  1034.          return this._642554749systemInfo;
  1035.       }
  1036.       
  1037.       override public function initialize() : void
  1038.       {
  1039.          mx_internal::setDocumentDescriptor(this._documentDescriptor_);
  1040.          super.initialize();
  1041.       }
  1042.       
  1043.       public function set appBg(param1:AppBackground) : void
  1044.       {
  1045.          var _loc2_:Object = this._93027910appBg;
  1046.          if(_loc2_ !== param1)
  1047.          {
  1048.             this._93027910appBg = param1;
  1049.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"appBg",_loc2_,param1));
  1050.          }
  1051.       }
  1052.       
  1053.       private function onLoginResult(param1:ResultEvent) : void
  1054.       {
  1055.          trace(param1.result);
  1056.          var _loc2_:XML = new XML(param1.result.toString());
  1057.          if(_loc2_.@success == "true")
  1058.          {
  1059.             trace(">>> user loged in");
  1060.             this.userInfoXML = _loc2_;
  1061.             this.localize();
  1062.             this.appMainMenu = new AppMainMenu();
  1063.             this.appMenuHolder.addChild(this.appMainMenu);
  1064.             this.topLeft = new TopLeft();
  1065.             this.topLeft.alpha = 0;
  1066.             this.topLeftHolder.addChild(this.topLeft);
  1067.             TweenMax.to(this.topLeft,1,{"alpha":1});
  1068.             this.toolsManager.openBrowserTool();
  1069.             this.showTestTimer();
  1070.             if(!this.loggedIn)
  1071.             {
  1072.                this.usageTimer = new UsageTimer();
  1073.                this.loggedIn = true;
  1074.             }
  1075.          }
  1076.          else
  1077.          {
  1078.             this.showError(_loc2_.@errorMessage);
  1079.             this.regForm = new RegForm();
  1080.             this.regForm.currentState = "login";
  1081.             this.appBG.addChild(this.regForm);
  1082.          }
  1083.       }
  1084.       
  1085.       public function __siteViewer_creationComplete(param1:FlexEvent) : void
  1086.       {
  1087.          this.siteViewer.init();
  1088.       }
  1089.       
  1090.       public function __topMenu_creationComplete(param1:FlexEvent) : void
  1091.       {
  1092.          this.topMenu.init();
  1093.       }
  1094.       
  1095.       public function set toolsManager(param1:ToolsManager) : void
  1096.       {
  1097.          var _loc2_:Object = this._1014488750toolsManager;
  1098.          if(_loc2_ !== param1)
  1099.          {
  1100.             this._1014488750toolsManager = param1;
  1101.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"toolsManager",_loc2_,param1));
  1102.          }
  1103.       }
  1104.       
  1105.       public function showFavoritesAlert() : void
  1106.       {
  1107.          this.favoritesAlert = new FavoritesAlert();
  1108.          PopUpManager.addPopUp(this.favoritesAlert,this,false);
  1109.       }
  1110.       
  1111.       public function openParentsZone() : void
  1112.       {
  1113.          this.toolsManager.activateTool("Clear");
  1114.          this.parentalControl = new ParentalControl();
  1115.          this.addChild(this.parentalControl);
  1116.       }
  1117.       
  1118.       public function set topMenu(param1:AppTopMenu) : void
  1119.       {
  1120.          var _loc2_:Object = this._1140090796topMenu;
  1121.          if(_loc2_ !== param1)
  1122.          {
  1123.             this._1140090796topMenu = param1;
  1124.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"topMenu",_loc2_,param1));
  1125.          }
  1126.       }
  1127.       
  1128.       public function set ws(param1:WebService) : void
  1129.       {
  1130.          var _loc2_:Object = this._3804ws;
  1131.          if(_loc2_ !== param1)
  1132.          {
  1133.             this._3804ws = param1;
  1134.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"ws",_loc2_,param1));
  1135.          }
  1136.       }
  1137.       
  1138.       public function showUpdatingAlert() : void
  1139.       {
  1140.          var _loc1_:UpdatingAlert = new UpdatingAlert();
  1141.          PopUpManager.addPopUp(_loc1_,this,false);
  1142.       }
  1143.       
  1144.       public function set topLeftHolder(param1:HBox) : void
  1145.       {
  1146.          var _loc2_:Object = this._1870114760topLeftHolder;
  1147.          if(_loc2_ !== param1)
  1148.          {
  1149.             this._1870114760topLeftHolder = param1;
  1150.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"topLeftHolder",_loc2_,param1));
  1151.          }
  1152.       }
  1153.       
  1154.       public function onSettingsLoaded() : void
  1155.       {
  1156.          trace(">>> settings loaded");
  1157.          this.logger = new Logger();
  1158.          this.favorites = new FavoritesManager();
  1159.          this.getLocalData();
  1160.       }
  1161.       
  1162.       public function __appBG_resize(param1:ResizeEvent) : void
  1163.       {
  1164.          this.relocateItems();
  1165.       }
  1166.       
  1167.       [Bindable(event="propertyChange")]
  1168.       public function get topLeftHolder() : HBox
  1169.       {
  1170.          return this._1870114760topLeftHolder;
  1171.       }
  1172.       
  1173.       public function closeRegistration() : void
  1174.       {
  1175.          this.login();
  1176.          this.appBG.removeChild(this.regForm);
  1177.       }
  1178.       
  1179.       private function _kidoz_Operation2_c() : Operation
  1180.       {
  1181.          var _loc1_:Operation = new Operation();
  1182.          _loc1_.name = "GetSitesList";
  1183.          _loc1_.resultFormat = "object";
  1184.          _loc1_.addEventListener("result",this.___kidoz_Operation2_result);
  1185.          _loc1_.addEventListener("fault",this.___kidoz_Operation2_fault);
  1186.          return _loc1_;
  1187.       }
  1188.       
  1189.       public function __ws_fault(param1:FaultEvent) : void
  1190.       {
  1191.          this.showError(param1.fault.faultDetail);
  1192.       }
  1193.       
  1194.       [Bindable(event="propertyChange")]
  1195.       public function get ws() : WebService
  1196.       {
  1197.          return this._3804ws;
  1198.       }
  1199.       
  1200.       public function set appTop(param1:Canvas) : void
  1201.       {
  1202.          var _loc2_:Object = this._1411084428appTop;
  1203.          if(_loc2_ !== param1)
  1204.          {
  1205.             this._1411084428appTop = param1;
  1206.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"appTop",_loc2_,param1));
  1207.          }
  1208.       }
  1209.       
  1210.       public function hideLoadingAlert() : void
  1211.       {
  1212.          this.loadingAlertOn = false;
  1213.          PopUpManager.removePopUp(this.loadingAlert);
  1214.       }
  1215.       
  1216.       [Bindable(event="propertyChange")]
  1217.       public function get appMenuHolder() : Canvas
  1218.       {
  1219.          return this._732490988appMenuHolder;
  1220.       }
  1221.       
  1222.       public function ___kidoz_Operation1_fault(param1:FaultEvent) : void
  1223.       {
  1224.          this.showError(param1.fault.faultString);
  1225.       }
  1226.       
  1227.       public function set locationUrl(param1:TextArea) : void
  1228.       {
  1229.          var _loc2_:Object = this._552310138locationUrl;
  1230.          if(_loc2_ !== param1)
  1231.          {
  1232.             this._552310138locationUrl = param1;
  1233.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"locationUrl",_loc2_,param1));
  1234.          }
  1235.       }
  1236.       
  1237.       public function getLocalData() : void
  1238.       {
  1239.          var _loc1_:SharedObject = SharedObject.getLocal("kidozData");
  1240.          if(_loc1_.data.parentEmail != null && _loc1_.data.parentPassword != null)
  1241.          {
  1242.             this.login();
  1243.          }
  1244.          else if(_loc1_.data.email != null)
  1245.          {
  1246.             this.hideLoadingAlert();
  1247.             this.regForm = new RegForm();
  1248.             this.appBG.addChild(this.regForm);
  1249.          }
  1250.          else
  1251.          {
  1252.             this.hideLoadingAlert();
  1253.             this.regForm = new RegForm();
  1254.             this.appBG.addChild(this.regForm);
  1255.          }
  1256.       }
  1257.    }
  1258. }
  1259.  
  1260.