home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / beach_difference.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2008-09-23  |  11.0 KB  |  298 lines

  1. if(true)
  2. {
  3.    if(true)
  4.    {
  5.       ┬º┬ºpush(false);
  6.    }
  7.    if(!┬º┬ºpop())
  8.    {
  9.       if(true)
  10.       {
  11.          if(true)
  12.          {
  13.             addr29:
  14.             ┬º┬ºpush(false);
  15.          }
  16.          if(!┬º┬ºpop())
  17.          {
  18.             var obj_game = new Array();
  19.             obj_game._host = "g2w";
  20.             obj_game._gameName = "beach_difference";
  21.             obj_game._gameTitle = "Beach Difference";
  22.             obj_game._g2wGameId = "1127";
  23.             obj_game._partnerGameId = "beachdifference";
  24.             obj_game._gstatus = "gameover";
  25.             obj_game._googleText = "Beach Difference";
  26.             obj_game._gameStageW = 800;
  27.             obj_game._gameStageH = 600;
  28.             obj_game._gameScoreOrder = "desc";
  29.             obj_game._gameResolution = Stage.width + "x" + Stage.height;
  30.             obj_game.g2wBot = "";
  31.             obj_game.g2wBotId = 10301;
  32.             obj_game.inviziads = "http://s1.inviziads.com/lookup.html/g=" + obj_game._g2wGameId + "&h=" + obj_game._host + "&v=4_0";
  33.             var obj_partner = new Array();
  34.             obj_partner.partner_name = "g2w";
  35.             obj_partner.partner_id = 1;
  36.             obj_partner.invalid_txt = "Invalid Nickname!";
  37.             obj_partner.show_submit = false;
  38.             obj_partner.submitURL = "/submit_score.asp";
  39.             obj_partner.top10URL = "/get_top_scorer.asp";
  40.             obj_partner.lblsubmit = "Enter your Games2win Nickname below";
  41.             obj_partner.show_g2w_slate = true;
  42.             obj_partner.show_register = true;
  43.             obj_partner.text_register = "Create Nickname";
  44.             obj_partner.url_register = "http://www.games2win.com/register.asp";
  45.             obj_partner.clickthru = "http://www.games2win.com/";
  46.             obj_partner._allowclick = true;
  47.             _validateHost = function(mcpath)
  48.             {
  49.                var _loc2_ = mcpath;
  50.                _loc2_.overlay_btn.useHandCursor = false;
  51.                if(_root.obj_game._gstatus == "gameover")
  52.                {
  53.                   _initGameOver(_loc2_);
  54.                }
  55.                else if(_root.checkhost())
  56.                {
  57.                   _initLoginPanel(_loc2_);
  58.                }
  59.                else
  60.                {
  61.                   _initAlientHost(_loc2_);
  62.                }
  63.             };
  64.             _initGameOver = function(mcpath)
  65.             {
  66.                var _loc2_ = mcpath;
  67.                _loc2_.gotoAndStop("g2w_gameover");
  68.                _loc2_.panel_btn.playagain_btn.onRelease = function()
  69.                {
  70.                   _root.g2w_playagain();
  71.                };
  72.                _loc2_.panel_btn.skiplvl_btn.onRelease = function()
  73.                {
  74.                   _root.g2w_skiplevel();
  75.                };
  76.             };
  77.             _initLoginPanel = function(mcpath)
  78.             {
  79.                var mc = mcpath;
  80.                mc.gotoAndStop("g2w_login");
  81.                Selection.setFocus("username_txt");
  82.                mc.username_txt.onSetFocus = function()
  83.                {
  84.                   if(this.text == obj_partner.invalid_txt)
  85.                   {
  86.                      this.text = "";
  87.                   }
  88.                };
  89.                mc.playagain_btn.onRelease = function()
  90.                {
  91.                   _root.g2w_playagain(true);
  92.                };
  93.                mc.nickname_btn.onRelease = function()
  94.                {
  95.                   getURL(_root.obj_partner.url_register,"_blank");
  96.                };
  97.                mc.submit_btn.onRelease = function()
  98.                {
  99.                   _root._scoreSubmit(mc);
  100.                };
  101.             };
  102.             _initAlientHost = function(mcpath)
  103.             {
  104.                var _loc2_ = mcpath;
  105.                _loc2_.gotoAndStop("g2w_alienhost");
  106.                _loc2_.playagain_btn.onRelease = function()
  107.                {
  108.                   trace("CALLING : _root.g2w_playagain()");
  109.                   _root.g2w_playagain(true);
  110.                };
  111.             };
  112.             _scoreSubmit = function(mcpath)
  113.             {
  114.                var mc = mcpath;
  115.                myname = _root.partner_uname;
  116.                myscore = _root.partner_score;
  117.                mygameid = _root.obj_game._g2wGameId;
  118.                myname = myname.trim();
  119.                if(myname.length == 0 or myname == obj_partner.invalid_txt or myname == undefined)
  120.                {
  121.                   _root.partner_uname = obj_partner.invalid_txt;
  122.                }
  123.                else
  124.                {
  125.                   mc.gotoAndStop("g2w_status");
  126.                   mc.tryagain_btn._visible = false;
  127.                   _root.send_lv = new LoadVars();
  128.                   _root.send_lv.onLoad = function(success)
  129.                   {
  130.                      if(success)
  131.                      {
  132.                         if(_root.send_lv.isreg == 0)
  133.                         {
  134.                            mc.status_txt.text = obj_partner.invalid_txt;
  135.                            mc.tryagain_btn._visible = true;
  136.                            mc.tryagain_btn.onRelease = function()
  137.                            {
  138.                               _initLoginPanel(mc);
  139.                            };
  140.                         }
  141.                         else if(_root.send_lv.isreg == 1)
  142.                         {
  143.                            mc.status_txt.text = "";
  144.                            _root._getTop10(mc);
  145.                         }
  146.                      }
  147.                      else
  148.                      {
  149.                         mc.status_txt.text = "Error in Connection...!";
  150.                         mc.tryagain_btn._visible = true;
  151.                         mc.tryagain_btn.onRelease = function()
  152.                         {
  153.                            _initLoginPanel(mc);
  154.                         };
  155.                      }
  156.                   };
  157.                   _root.send_lv.nickname = myname;
  158.                   _root.send_lv.points = myscore;
  159.                   _root.send_lv.gameid = mygameid;
  160.                   _root.send_lv.sendAndLoad(obj_partner.submitURL,_root.send_lv,"POST");
  161.                   mc.status_txt.text = "Connecting to Server...";
  162.                }
  163.             };
  164.             c_fail = 0;
  165.             _getTop10 = function(mcpath)
  166.             {
  167.                var mc = mcpath;
  168.                _root.send_lv = new XML();
  169.                _root.rst_lv = new XML();
  170.                mc.gotoAndStop("g2w_status");
  171.                _root.rst_lv.onLoad = function(success)
  172.                {
  173.                   if(success)
  174.                   {
  175.                      var _loc3_ = new it.sephiroth.XML2Object();
  176.                      mc.status_txt.text = "";
  177.                      var _loc4_ = _loc3_.parseXML(this);
  178.                      _initTop10(mc,_loc4_);
  179.                   }
  180.                   else
  181.                   {
  182.                      _root.c_fail = _root.c_fail + 1;
  183.                      if(_root.c_fail >= 3)
  184.                      {
  185.                         mc.status_txt.text = "Error!";
  186.                         tryagain_btn._visible = true;
  187.                         mc.tryagain_btn.onRelease = function()
  188.                         {
  189.                            _initLoginPanel(mc);
  190.                         };
  191.                      }
  192.                      else
  193.                      {
  194.                         _root.send_lv.sendAndLoad(url,_root.rst_lv,"POST");
  195.                      }
  196.                   }
  197.                };
  198.                var url = obj_partner.top10URL + "?game_id=" + _root.obj_game._g2wGameId + "&order=" + obj_game._gameScoreOrder + "&timspam" + getTimer();
  199.                mc.status_txt.text = "Connecting to Server...";
  200.                _root.send_lv.sendAndLoad(url,_root.rst_lv,"POST");
  201.             };
  202.             _initTop10 = function(mcpath, list)
  203.             {
  204.                var _loc3_ = mcpath;
  205.                _loc3_.gotoAndStop("g2w_top10");
  206.                if(list.top_score.status.data == 0 or list.top_score.user[0].score.data == 0)
  207.                {
  208.                   _top10_lbl._visible = false;
  209.                   var _loc2_ = 0;
  210.                   while(_loc2_ < 10)
  211.                   {
  212.                      _loc3_["row" + _loc2_]._visible = false;
  213.                      _loc2_ = _loc2_ + 1;
  214.                   }
  215.                }
  216.                else
  217.                {
  218.                   _noscore_mc._visible = false;
  219.                   _loc2_ = 0;
  220.                   while(_loc2_ < 10)
  221.                   {
  222.                      if(list.top_score.user[_loc2_] == undefined or list.top_score.user[_loc2_].score.data == 0)
  223.                      {
  224.                         _loc3_["row" + _loc2_].txtrollno.text = "";
  225.                         _loc3_["row" + _loc2_].txtusername.text = "";
  226.                         _loc3_["row" + _loc2_].txtscore.text = "";
  227.                      }
  228.                      else
  229.                      {
  230.                         _loc3_["row" + _loc2_].txtrollno.text = _loc2_ + 1;
  231.                         _loc3_["row" + _loc2_].txtusername.text = list.top_score.user[_loc2_].nick_name.data;
  232.                         _loc3_["row" + _loc2_].txtscore.text = list.top_score.user[_loc2_].score.data;
  233.                      }
  234.                      _loc2_ = _loc2_ + 1;
  235.                   }
  236.                }
  237.                _loc3_.playagain_btn.onRelease = function()
  238.                {
  239.                   _root.g2w_playagain(true);
  240.                };
  241.             };
  242.             var g2w_menu = new ContextMenu();
  243.             g2w_menu.hideBuiltInItems();
  244.             g2w_menu.customItems.push(new ContextMenuItem("Games2win.com",itemHandler));
  245.             itemHandler = function(obj, item)
  246.             {
  247.                getURL(obj_partner.clickthru,"_blank");
  248.             };
  249.             this.menu = g2w_menu;
  250.             checkhost = function()
  251.             {
  252.                trace("CALL CHECKHOST");
  253.                swfurl = this._url;
  254.                if(swfurl.indexOf("games2win.com") == -1)
  255.                {
  256.                   return false;
  257.                }
  258.                return true;
  259.             };
  260.             _trackClickThru = function(mc)
  261.             {
  262.                if(obj_partner._allowclick)
  263.                {
  264.                   mc.hit_area.onRelease = function()
  265.                   {
  266.                      getURL(obj_partner.clickthru,"_blank");
  267.                   };
  268.                }
  269.                else
  270.                {
  271.                   mc.hit_area.useHandCursor = false;
  272.                }
  273.             };
  274.             String.prototype.trim = function()
  275.             {
  276.                var _loc3_ = 0;
  277.                var _loc2_ = this.length;
  278.                white = new Object();
  279.                white._32 = 1;
  280.                while(white["_" + ord(this.charAt(_loc2_ = _loc2_ - 1))])
  281.                {
  282.                }
  283.                do
  284.                {
  285.                   _loc3_;
  286.                }
  287.                while(white["_" + ord(this.charAt(_loc3_++))]);
  288.                
  289.                return this.slice(_loc3_ - 1,_loc2_ + 1);
  290.             };
  291.          }
  292.       }
  293.       ┬º┬ºgoto(addr1077);
  294.    }
  295.    ┬º┬ºgoto(addr29);
  296. }
  297. addr1077:
  298.