home *** CD-ROM | disk | FTP | other *** search
- if(true)
- {
- if(true)
- {
- §§push(false);
- }
- if(!§§pop())
- {
- if(true)
- {
- if(true)
- {
- addr29:
- §§push(false);
- }
- if(!§§pop())
- {
- var obj_game = new Array();
- obj_game._host = "g2w";
- obj_game._gameName = "beach_difference";
- obj_game._gameTitle = "Beach Difference";
- obj_game._g2wGameId = "1127";
- obj_game._partnerGameId = "beachdifference";
- obj_game._gstatus = "gameover";
- obj_game._googleText = "Beach Difference";
- obj_game._gameStageW = 800;
- obj_game._gameStageH = 600;
- obj_game._gameScoreOrder = "desc";
- obj_game._gameResolution = Stage.width + "x" + Stage.height;
- obj_game.g2wBot = "";
- obj_game.g2wBotId = 10301;
- obj_game.inviziads = "http://s1.inviziads.com/lookup.html/g=" + obj_game._g2wGameId + "&h=" + obj_game._host + "&v=4_0";
- var obj_partner = new Array();
- obj_partner.partner_name = "g2w";
- obj_partner.partner_id = 1;
- obj_partner.invalid_txt = "Invalid Nickname!";
- obj_partner.show_submit = false;
- obj_partner.submitURL = "/submit_score.asp";
- obj_partner.top10URL = "/get_top_scorer.asp";
- obj_partner.lblsubmit = "Enter your Games2win Nickname below";
- obj_partner.show_g2w_slate = true;
- obj_partner.show_register = true;
- obj_partner.text_register = "Create Nickname";
- obj_partner.url_register = "http://www.games2win.com/register.asp";
- obj_partner.clickthru = "http://www.games2win.com/";
- obj_partner._allowclick = true;
- _validateHost = function(mcpath)
- {
- var _loc2_ = mcpath;
- _loc2_.overlay_btn.useHandCursor = false;
- if(_root.obj_game._gstatus == "gameover")
- {
- _initGameOver(_loc2_);
- }
- else if(_root.checkhost())
- {
- _initLoginPanel(_loc2_);
- }
- else
- {
- _initAlientHost(_loc2_);
- }
- };
- _initGameOver = function(mcpath)
- {
- var _loc2_ = mcpath;
- _loc2_.gotoAndStop("g2w_gameover");
- _loc2_.panel_btn.playagain_btn.onRelease = function()
- {
- _root.g2w_playagain();
- };
- _loc2_.panel_btn.skiplvl_btn.onRelease = function()
- {
- _root.g2w_skiplevel();
- };
- };
- _initLoginPanel = function(mcpath)
- {
- var mc = mcpath;
- mc.gotoAndStop("g2w_login");
- Selection.setFocus("username_txt");
- mc.username_txt.onSetFocus = function()
- {
- if(this.text == obj_partner.invalid_txt)
- {
- this.text = "";
- }
- };
- mc.playagain_btn.onRelease = function()
- {
- _root.g2w_playagain(true);
- };
- mc.nickname_btn.onRelease = function()
- {
- getURL(_root.obj_partner.url_register,"_blank");
- };
- mc.submit_btn.onRelease = function()
- {
- _root._scoreSubmit(mc);
- };
- };
- _initAlientHost = function(mcpath)
- {
- var _loc2_ = mcpath;
- _loc2_.gotoAndStop("g2w_alienhost");
- _loc2_.playagain_btn.onRelease = function()
- {
- trace("CALLING : _root.g2w_playagain()");
- _root.g2w_playagain(true);
- };
- };
- _scoreSubmit = function(mcpath)
- {
- var mc = mcpath;
- myname = _root.partner_uname;
- myscore = _root.partner_score;
- mygameid = _root.obj_game._g2wGameId;
- myname = myname.trim();
- if(myname.length == 0 or myname == obj_partner.invalid_txt or myname == undefined)
- {
- _root.partner_uname = obj_partner.invalid_txt;
- }
- else
- {
- mc.gotoAndStop("g2w_status");
- mc.tryagain_btn._visible = false;
- _root.send_lv = new LoadVars();
- _root.send_lv.onLoad = function(success)
- {
- if(success)
- {
- if(_root.send_lv.isreg == 0)
- {
- mc.status_txt.text = obj_partner.invalid_txt;
- mc.tryagain_btn._visible = true;
- mc.tryagain_btn.onRelease = function()
- {
- _initLoginPanel(mc);
- };
- }
- else if(_root.send_lv.isreg == 1)
- {
- mc.status_txt.text = "";
- _root._getTop10(mc);
- }
- }
- else
- {
- mc.status_txt.text = "Error in Connection...!";
- mc.tryagain_btn._visible = true;
- mc.tryagain_btn.onRelease = function()
- {
- _initLoginPanel(mc);
- };
- }
- };
- _root.send_lv.nickname = myname;
- _root.send_lv.points = myscore;
- _root.send_lv.gameid = mygameid;
- _root.send_lv.sendAndLoad(obj_partner.submitURL,_root.send_lv,"POST");
- mc.status_txt.text = "Connecting to Server...";
- }
- };
- c_fail = 0;
- _getTop10 = function(mcpath)
- {
- var mc = mcpath;
- _root.send_lv = new XML();
- _root.rst_lv = new XML();
- mc.gotoAndStop("g2w_status");
- _root.rst_lv.onLoad = function(success)
- {
- if(success)
- {
- var _loc3_ = new it.sephiroth.XML2Object();
- mc.status_txt.text = "";
- var _loc4_ = _loc3_.parseXML(this);
- _initTop10(mc,_loc4_);
- }
- else
- {
- _root.c_fail = _root.c_fail + 1;
- if(_root.c_fail >= 3)
- {
- mc.status_txt.text = "Error!";
- tryagain_btn._visible = true;
- mc.tryagain_btn.onRelease = function()
- {
- _initLoginPanel(mc);
- };
- }
- else
- {
- _root.send_lv.sendAndLoad(url,_root.rst_lv,"POST");
- }
- }
- };
- var url = obj_partner.top10URL + "?game_id=" + _root.obj_game._g2wGameId + "&order=" + obj_game._gameScoreOrder + "&timspam" + getTimer();
- mc.status_txt.text = "Connecting to Server...";
- _root.send_lv.sendAndLoad(url,_root.rst_lv,"POST");
- };
- _initTop10 = function(mcpath, list)
- {
- var _loc3_ = mcpath;
- _loc3_.gotoAndStop("g2w_top10");
- if(list.top_score.status.data == 0 or list.top_score.user[0].score.data == 0)
- {
- _top10_lbl._visible = false;
- var _loc2_ = 0;
- while(_loc2_ < 10)
- {
- _loc3_["row" + _loc2_]._visible = false;
- _loc2_ = _loc2_ + 1;
- }
- }
- else
- {
- _noscore_mc._visible = false;
- _loc2_ = 0;
- while(_loc2_ < 10)
- {
- if(list.top_score.user[_loc2_] == undefined or list.top_score.user[_loc2_].score.data == 0)
- {
- _loc3_["row" + _loc2_].txtrollno.text = "";
- _loc3_["row" + _loc2_].txtusername.text = "";
- _loc3_["row" + _loc2_].txtscore.text = "";
- }
- else
- {
- _loc3_["row" + _loc2_].txtrollno.text = _loc2_ + 1;
- _loc3_["row" + _loc2_].txtusername.text = list.top_score.user[_loc2_].nick_name.data;
- _loc3_["row" + _loc2_].txtscore.text = list.top_score.user[_loc2_].score.data;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- _loc3_.playagain_btn.onRelease = function()
- {
- _root.g2w_playagain(true);
- };
- };
- var g2w_menu = new ContextMenu();
- g2w_menu.hideBuiltInItems();
- g2w_menu.customItems.push(new ContextMenuItem("Games2win.com",itemHandler));
- itemHandler = function(obj, item)
- {
- getURL(obj_partner.clickthru,"_blank");
- };
- this.menu = g2w_menu;
- checkhost = function()
- {
- trace("CALL CHECKHOST");
- swfurl = this._url;
- if(swfurl.indexOf("games2win.com") == -1)
- {
- return false;
- }
- return true;
- };
- _trackClickThru = function(mc)
- {
- if(obj_partner._allowclick)
- {
- mc.hit_area.onRelease = function()
- {
- getURL(obj_partner.clickthru,"_blank");
- };
- }
- else
- {
- mc.hit_area.useHandCursor = false;
- }
- };
- String.prototype.trim = function()
- {
- var _loc3_ = 0;
- var _loc2_ = this.length;
- white = new Object();
- white._32 = 1;
- while(white["_" + ord(this.charAt(_loc2_ = _loc2_ - 1))])
- {
- }
- do
- {
- _loc3_;
- }
- while(white["_" + ord(this.charAt(_loc3_++))]);
-
- return this.slice(_loc3_ - 1,_loc2_ + 1);
- };
- }
- }
- §§goto(addr1077);
- }
- §§goto(addr29);
- }
- addr1077:
-