Advertisement
SonofUgly

Warstock actionscript

Jan 1st, 2014
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Action script...
  2.  
  3. // [Initial MovieClip Action of sprite 91]
  4. #initclip 2
  5. class com.rockstargames.gtav.web.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM extends com.rockstargames.ui.core.BaseWebsite
  6. {
  7.     var _name, IS_SITE_DYNAMIC, browser, CONTENT, PAGE_NAMES, CAN_STORE_PAGE, defaultButtonOnColour, defaultButtonOffColour, itemLabels, prices, ranks, seats, displayArray, itemNumber, intervalId, mcScope, dataTextScope, dataProviderUI;
  8.     function WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM()
  9.     {
  10.         super();
  11.         _name = "WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM";
  12.         IS_SITE_DYNAMIC = 0;
  13.         browser = _level0.TIMELINE;
  14.         browser.DebugTextContent = true;
  15.         if (browser.player == 1)
  16.         {
  17.             isMP = true;
  18.         }
  19.         else
  20.         {
  21.             isMP = false;
  22.         } // end else if
  23.         CONTENT.localisationTF.autoSize = true;
  24.         PAGE_NAMES = new Array();
  25.         PAGE_NAMES[1] = "PAGE1";
  26.         PAGE_NAMES[2] = "SEARCH";
  27.         PAGE_NAMES[3] = "DETAILS1";
  28.         PAGE_NAMES[4] = "DETAILS2";
  29.         PAGE_NAMES[5] = "DETAILS3";
  30.         PAGE_NAMES[6] = "DETAILS4";
  31.         PAGE_NAMES[7] = "DETAILS5";
  32.         PAGE_NAMES[8] = "DETAILS6";
  33.         PAGE_NAMES[9] = "DETAILS7";
  34.         PAGE_NAMES[10] = "DETAILS8";
  35.         PAGE_NAMES[11] = "DETAILS9";
  36.         PAGE_NAMES[12] = "PURCHASE";
  37.         PAGE_NAMES[13] = "PURCHASE_D_FAILED";
  38.         PAGE_NAMES[14] = "PURCHASE_D_ERROR";
  39.         PAGE_NAMES[15] = "PURCHASE_D_CONFIRM";
  40.         PAGE_NAMES[16] = "INVENTORY";
  41.         PAGE_NAMES[17] = "DETAILS15";
  42.         PAGE_NAMES[18] = "DETAILS16";
  43.         PAGE_NAMES[19] = "DETAILS17";
  44.         PAGE_NAMES[20] = "DETAILS18";
  45.         PAGE_NAMES[21] = "DETAILS19";
  46.         PAGE_NAMES[22] = "DETAILS20";
  47.         PAGE_NAMES[23] = "DETAILS21";
  48.         PAGE_NAMES[24] = "DETAILS22";
  49.         PAGE_NAMES[25] = "DETAILS23";
  50.         PAGE_NAMES[26] = "DETAILS24";
  51.         PAGE_NAMES[27] = "DETAILS25";
  52.         PAGE_NAMES[28] = "DETAILS26";
  53.         CAN_STORE_PAGE = new Array();
  54.         CAN_STORE_PAGE[1] = true;
  55.         CAN_STORE_PAGE[2] = false;
  56.         CAN_STORE_PAGE[3] = true;
  57.         CAN_STORE_PAGE[4] = false;
  58.         CAN_STORE_PAGE[5] = true;
  59.         CAN_STORE_PAGE[6] = false;
  60.         CAN_STORE_PAGE[7] = true;
  61.         CAN_STORE_PAGE[8] = true;
  62.         CAN_STORE_PAGE[9] = false;
  63.         CAN_STORE_PAGE[10] = true;
  64.         CAN_STORE_PAGE[11] = false;
  65.         CAN_STORE_PAGE[12] = false;
  66.         CAN_STORE_PAGE[13] = false;
  67.         CAN_STORE_PAGE[14] = false;
  68.         CAN_STORE_PAGE[15] = false;
  69.         CAN_STORE_PAGE[16] = true;
  70.         CAN_STORE_PAGE[17] = true;
  71.         CAN_STORE_PAGE[18] = true;
  72.         CAN_STORE_PAGE[19] = true;
  73.         CAN_STORE_PAGE[20] = true;
  74.         CAN_STORE_PAGE[21] = true;
  75.         CAN_STORE_PAGE[22] = true;
  76.         CAN_STORE_PAGE[23] = true;
  77.         CAN_STORE_PAGE[24] = true;
  78.         CAN_STORE_PAGE[25] = true;
  79.         CAN_STORE_PAGE[26] = true;
  80.         CAN_STORE_PAGE[27] = true;
  81.         CAN_STORE_PAGE[28] = true;
  82.         defaultButtonOnColour = 16777215;
  83.         defaultButtonOffColour = 16777215;
  84.         itemLabels = new Array();
  85.         itemLabels = ["RHINO", "", "BARRACKS", "", "CARGOBOB", "BUZZARD", "", "CRUSADER", "", "", "", "", "", "", "AIRBUS", "JOURNEY", "FIRETRUK", "COACH", "BUS", "BOXVILLE", "TOURBUS", "MULE", "PBUS", "RIOT", "RENTBUS", "DUMP"];
  86.         prices = new Array();
  87.         prices = [-1, 0, -1, 0, -1, -1, 0, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  88.         ranks = new Array();
  89.         ranks = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  90.         seats = new Array();
  91.         seats = ["01", "", "10", "", "10", "02", "", "04", "", "", "", "", "", "", "16", "06", "08", "10", "16", "06", "10", "06", "11", "08", "10", "01"];
  92.         displayArray = new Array();
  93.         if (isMP == false)
  94.         {
  95.             displayArray = [1, 3, 5, 6, 8];
  96.         }
  97.         else
  98.         {
  99.             displayArray = [1, 3, 6, 8, 15, 16, 18, 19, 22, 25, 26];
  100.         } // end else if
  101.     } // End of the function
  102.     function READY()
  103.     {
  104.     } // End of the function
  105.     function SET_PRICES(slotID, price)
  106.     {
  107.         prices[slotID - 3] = price;
  108.     } // End of the function
  109.     function SET_RANKS(slotID, rank, current)
  110.     {
  111.         ranks[slotID - 3] = rank;
  112.         if (current != undefined)
  113.         {
  114.             currentRank = current;
  115.         } // end if
  116.     } // End of the function
  117.     function goToAnchor(AnchorLink)
  118.     {
  119.         var _loc2 = new Array();
  120.         _loc2 = AnchorLink.split("_");
  121.         itemNumber = parseInt(_loc2[1]);
  122.         browser.GO_TO_WEBPAGE("WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_DETAILS" + itemNumber);
  123.     } // End of the function
  124.     function POPULATE_TEXT(pageName, searchArgs, newPage)
  125.     {
  126.         CONTENT._y = 0;
  127.         switch (pageName)
  128.         {
  129.             case "DETAILS2":
  130.             case "DETAILS4":
  131.             case "DETAILS7":
  132.             case "DETAILS9":
  133.             {
  134.                 browser.GO_TO_WEBPAGE("PAGE1");
  135.                 break;
  136.             }
  137.             case "PAGE1":
  138.             {
  139.                 clearInterval(intervalId);
  140.                 mcScope = CONTENT.PAGE1;
  141.                 dataTextScope = new Array();
  142.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  143.                 this.set_localised_text(5, mcScope.header, "CANDC_PG1_HEADER");
  144.                 this.set_localised_text(6, mcScope.body1, "CANDC_PG1_BODY1");
  145.                 this.set_localised_text(7, mcScope.body2, "CANDC_PG1_BODY2");
  146.                 this.set_localised_text(8, mcScope.descriptionTF, "CANDC_RHINO");
  147.                 var _loc13 = 1185;
  148.                 var _loc6 = 258.500000;
  149.                 var _loc8 = 364;
  150.                 var _loc4 = 9;
  151.                 var _loc2;
  152.                 var _loc12;
  153.                 if (newPage == false)
  154.                 {
  155.                     for (var _loc5 = 0; _loc5 < displayArray.length; ++_loc5)
  156.                     {
  157.                         var _loc3 = displayArray[_loc5];
  158.                         _loc2 = "item_" + _loc3;
  159.                         if (prices[_loc3 - 1] != -1)
  160.                         {
  161.                             if (mcScope[_loc2] != undefined)
  162.                             {
  163.                                 mcScope[_loc2].removeMovieClip();
  164.                             } // end if
  165.                             _loc12 = mcScope.attachMovie("car_box", _loc2, mcScope.getNextHighestDepth(), {_x: _loc6, _y: _loc8, _alpha: 0});
  166.                             var _loc7 = itemLabels[_loc3 - 1];
  167.                             mcScope[_loc2].itemImages.gotoAndStop(_loc7);
  168.                             this.set_localised_text(_loc4, mcScope[_loc2].btnTxt, _loc7, true);
  169.                             dataTextScope[_loc4] = undefined;
  170.                             if (prices[_loc3 - 1] == 0)
  171.                             {
  172.                                 mcScope[_loc2].itemImages.outOfStock._alpha = 100;
  173.                                 this.set_localised_text(-1, mcScope[_loc2].itemImages.outOfStock.outOfStockTF, "WEB_OUTOFSTOCK", false);
  174.                                 mcScope[_loc2].priceTF.text = "";
  175.                             }
  176.                             else if (prices[_loc3 - 1] > 0 || isNaN(prices[_loc3 - 1]))
  177.                             {
  178.                                 mcScope[_loc2].itemImages.outOfStock._alpha = 0;
  179.                                 this.set_price_text(mcScope[_loc2].priceTF, prices[_loc3 - 1]);
  180.                                 dataTextScope[_loc4] = mcScope[_loc2].btnTxt;
  181.                             } // end else if
  182.                             if (isMP == true)
  183.                             {
  184.                                 if (ranks[_loc3 - 1] > currentRank)
  185.                                 {
  186.                                     mcScope[_loc2].MPrank.rankTF.text = ranks[_loc3 - 1];
  187.                                     mcScope[_loc2].MPrank._alpha = 100;
  188.                                     dataTextScope[_loc4] = undefined;
  189.                                 }
  190.                                 else
  191.                                 {
  192.                                     mcScope[_loc2].MPrank._alpha = 0;
  193.                                 } // end else if
  194.                                 if (seats[_loc3 - 1] != "")
  195.                                 {
  196.                                     mcScope[_loc2].MPseats.seatsTF.text = seats[_loc3 - 1];
  197.                                     mcScope[_loc2].MPseats._alpha = 100;
  198.                                 }
  199.                                 else
  200.                                 {
  201.                                     mcScope[_loc2].MPseats._alpha = 0;
  202.                                 } // end if
  203.                             } // end else if
  204.                             mcScope[_loc2]._alpha = 100;
  205.                             ++_loc4;
  206.                             _loc13 = _loc8;
  207.                             _loc6 = _loc6 + 385;
  208.                             if (_loc6 > 643.500000)
  209.                             {
  210.                                 _loc6 = 258.500000;
  211.                                 _loc8 = _loc8 + 242;
  212.                             } // end if
  213.                         } // end if
  214.                     } // end of for
  215.                     if (_loc12._x == 258.500000)
  216.                     {
  217.                         _loc12._x = 451;
  218.                     } // end if
  219.                 } // end if
  220.                 mcScope.bgBlack._height = _loc13 + 124;
  221.                 mcScope.bgWhite._height = mcScope.bgBlack._height - 14;
  222.                 var _loc15;
  223.                 _loc15 = mcScope.bgBlack._y + mcScope.bgBlack._height + 40;
  224.                 CONTENT.BOUNDING_BOX._height = _loc15;
  225.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  226.                 com.rockstargames.ui.game.GameInterface.call("SET_TEXT_WITH_TRANSLATION", com.rockstargames.ui.game.GameInterface.GENERIC_TYPE, "CANDC_TOOLBAR", CONTENT.localisationTF);
  227.                 browser.SET_TITLEBAR_TEXT(CONTENT.localisationTF.text, 14474460);
  228.                 break;
  229.             }
  230.             case "SEARCH":
  231.             {
  232.                 browser.GO_TO_WEBPAGE("PAGE1");
  233.                 break;
  234.             }
  235.             case "DETAILS1":
  236.             case "DETAILS3":
  237.             case "DETAILS5":
  238.             case "DETAILS6":
  239.             case "DETAILS8":
  240.             case "DETAILS9":
  241.             case "DETAILS15":
  242.             case "DETAILS16":
  243.             case "DETAILS17":
  244.             case "DETAILS18":
  245.             case "DETAILS19":
  246.             case "DETAILS20":
  247.             case "DETAILS21":
  248.             case "DETAILS22":
  249.             case "DETAILS23":
  250.             case "DETAILS24":
  251.             case "DETAILS25":
  252.             case "DETAILS26":
  253.             {
  254.                 clearInterval(intervalId);
  255.                 mcScope = CONTENT.DETAILS;
  256.                 var _loc14 = pageName.split("DETAILS");
  257.                 itemNumber = parseInt(_loc14[1]);
  258.                 dataTextScope = new Array();
  259.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  260.                 dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
  261.                 this.set_localised_text(5, mcScope.body, "CANDC_" + itemLabels[itemNumber - 1]);
  262.                 this.set_localised_text(6, mcScope.nameTF, itemLabels[itemNumber - 1]);
  263.                 if (prices[itemNumber - 1] > 0)
  264.                 {
  265.                     this.set_price_text(mcScope.priceTF, prices[itemNumber - 1]);
  266.                 }
  267.                 else
  268.                 {
  269.                     mcScope.priceTF.text = "";
  270.                 } // end else if
  271.                 this.set_localised_text(8, mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE.btnTxt, "CANDC_BUYNOW");
  272.                 mcScope.itemImages.gotoAndStop(itemNumber);
  273.                 if (isMP == true)
  274.                 {
  275.                     if (seats[itemNumber - 1] != "")
  276.                     {
  277.                         mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
  278.                         mcScope.MPseats._alpha = 100;
  279.                     }
  280.                     else
  281.                     {
  282.                         mcScope.MPseats._alpha = 0;
  283.                     } // end if
  284.                 } // end else if
  285.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  286.                 mcScope.priceTF._x = mcScope.nameTF._x + mcScope.nameTF.textWidth + 10;
  287.                 CONTENT.BOUNDING_BOX._height = 700;
  288.                 break;
  289.             }
  290.             case "PURCHASE":
  291.             {
  292.                 clearInterval(intervalId);
  293.                 mcScope = CONTENT.PURCHASE;
  294.                 mcScope.body1._alpha = 0;
  295.                 mcScope.body2._alpha = 0;
  296.                 dataTextScope = new Array();
  297.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  298.                 dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
  299.                 this.set_localised_text(5, mcScope.body1, "CANDC_PURCHASED");
  300.                 this.set_localised_text(6, mcScope.body2, "CANDC_DISCLAIMER");
  301.                 mcScope.itemImages.gotoAndStop(itemNumber);
  302.                 if (isMP == true)
  303.                 {
  304.                     if (seats[itemNumber - 1] != "")
  305.                     {
  306.                         mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
  307.                         mcScope.MPseats._alpha = 100;
  308.                     }
  309.                     else
  310.                     {
  311.                         mcScope.MPseats._alpha = 0;
  312.                     } // end if
  313.                 } // end else if
  314.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  315.                 intervalId = setInterval(this, "displayPurchasedText", 1500);
  316.                 CONTENT.BOUNDING_BOX._height = 700;
  317.                 break;
  318.             }
  319.             case "PURCHASE_D_FAILED":
  320.             {
  321.                 clearInterval(intervalId);
  322.                 mcScope = CONTENT.PURCHASE_D_FAILED;
  323.                 dataTextScope = new Array();
  324.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  325.                 dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
  326.                 this.set_localised_text(5, mcScope.body1, "CANDC_FAILED");
  327.                 mcScope.body1.autoSize = "center";
  328.                 mcScope.itemImages.gotoAndStop(itemNumber);
  329.                 if (isMP == true)
  330.                 {
  331.                     if (seats[itemNumber - 1] != "")
  332.                     {
  333.                         mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
  334.                         mcScope.MPseats._alpha = 100;
  335.                     }
  336.                     else
  337.                     {
  338.                         mcScope.MPseats._alpha = 0;
  339.                     } // end if
  340.                 } // end else if
  341.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  342.                 CONTENT.BOUNDING_BOX._height = 700;
  343.                 break;
  344.             }
  345.             case "PURCHASE_D_ERROR":
  346.             {
  347.                 mcScope = CONTENT.PURCHASE_D_ERROR;
  348.                 dataTextScope = new Array();
  349.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  350.                 dataTextScope[1] = mcScope.soldTF;
  351.                 if (dataProviderUI[1][0] != undefined)
  352.                 {
  353.                     dataTextScope[1].text = dataProviderUI[1][0];
  354.                 } // end if
  355.                 mcScope.soldTF.autoSize = "center";
  356.                 mcScope.body.multiline = true;
  357.                 dataTextScope[2] = mcScope.body1;
  358.                 if (dataProviderUI[2][0] != undefined)
  359.                 {
  360.                     dataTextScope[2].text = dataProviderUI[2][0];
  361.                 } // end if
  362.                 mcScope.body1.autoSize = "center";
  363.                 dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
  364.                 mcScope.itemImages.gotoAndStop(itemNumber);
  365.                 if (isMP == true)
  366.                 {
  367.                     if (seats[itemNumber - 1] != "")
  368.                     {
  369.                         mcScope.MPseats.seatsTF.text = seats[itemNumber - 1];
  370.                         mcScope.MPseats._alpha = 100;
  371.                     }
  372.                     else
  373.                     {
  374.                         mcScope.MPseats._alpha = 0;
  375.                     } // end if
  376.                 } // end else if
  377.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  378.                 CONTENT.BOUNDING_BOX._height = 700;
  379.                 break;
  380.             }
  381.             case "PURCHASE_D_CONFIRM":
  382.             {
  383.                 mcScope = CONTENT.PURCHASE_D_CONFIRM;
  384.                 dataTextScope = new Array();
  385.                 dataTextScope[0] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM.btnTxt;
  386.                 mcScope.body.multiline = true;
  387.                 mcScope.body.wordWrap = true;
  388.                 if (dataProviderUI[1] != undefined)
  389.                 {
  390.                     mcScope.body.htmlText = dataProviderUI[1];
  391.                 } // end if
  392.                 dataTextScope[2] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE.btnTxt;
  393.                 if (dataProviderUI[2] != undefined)
  394.                 {
  395.                     dataTextScope[2].htmlText = dataProviderUI[2];
  396.                 } // end if
  397.                 dataTextScope[3] = mcScope.WWW_WARSTOCK_D_CACHE_D_AND_D_CARRY_COM_S_PURCHASE_D_FAILED.btnTxt;
  398.                 if (dataProviderUI[3] != undefined)
  399.                 {
  400.                     dataTextScope[3].htmlText = dataProviderUI[3];
  401.                 } // end if
  402.                 dataTextScope[1] = mcScope.WWW_RIGHTEOUSSLAUGHTER7_COM.btnTxt;
  403.                 browser.SET_PAGE_BUTTONS(dataTextScope);
  404.                 CONTENT.BOUNDING_BOX._height = 700;
  405.                 break;
  406.             }
  407.         } // End of switch
  408.         browser.SET_DATA_SLOT_EMPTY();
  409.     } // End of the function
  410.     function displayPurchasedText()
  411.     {
  412.         clearInterval(intervalId);
  413.         mcScope.body1._alpha = 100;
  414.         mcScope.body2._alpha = 100;
  415.     } // End of the function
  416.     function set_localised_text(slotID, TF, TextLabel, setDataSlot)
  417.     {
  418.         dataTextScope[slotID] = TF;
  419.         com.rockstargames.ui.game.GameInterface.call("SET_TEXT_WITH_TRANSLATION", com.rockstargames.ui.game.GameInterface.GENERIC_TYPE, TextLabel, CONTENT.localisationTF);
  420.         var _loc2 = CONTENT.localisationTF.htmlText;
  421.         TF.htmlText = _loc2;
  422.         if (setDataSlot)
  423.         {
  424.             browser.SET_DATA_SLOT(slotID, _loc2);
  425.         } // end if
  426.     } // End of the function
  427.     function set_price_text(TF, price)
  428.     {
  429.         if (isNaN(price))
  430.         {
  431.             TF.htmlText = price;
  432.         }
  433.         else
  434.         {
  435.             var _loc3;
  436.             var _loc2 = price.toString();
  437.             var _loc5 = _loc2.length;
  438.             if (_loc5 > 3)
  439.             {
  440.                 var _loc4 = "";
  441.                 var _loc1 = _loc2.slice(0, -3);
  442.                 var _loc7 = "," + _loc2.slice(-3);
  443.                 if (_loc1.length > 3)
  444.                 {
  445.                     _loc4 = _loc1.slice(0, -3) + ",";
  446.                     _loc1 = _loc1.slice(-3);
  447.                 } // end if
  448.                 _loc3 = _loc4 + _loc1 + _loc7;
  449.             }
  450.             else
  451.             {
  452.                 _loc3 = _loc2;
  453.             } // end else if
  454.             TF.text = "$" + _loc3;
  455.         } // end else if
  456.     } // End of the function
  457.     var currentRank = 0;
  458.     var isMP = false;
  459. } // End of Class
  460. #endinitclip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement