home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 7.29 / 2003-06_-_Disc_7.29.iso / Data / items.pcg / scripts / frame_1 / DoAction.as
Text File  |  2003-04-16  |  12KB  |  348 lines

  1. function SwitchTab(whichTab, whichMenuText, whichVarText, numItems, theLastButton, whichFrame, scrollCount, selectScrollCount)
  2. {
  3.    if(whichTab != currentTab)
  4.    {
  5.       EasterEggIsOn = false;
  6.       screenflag2 = 0;
  7.       startingTab = true;
  8.       currentTab = whichTab;
  9.       num_Items = numItems;
  10.       setProperty("itemBar" + lastButton, _alpha, 10);
  11.       if(scrollcount == selectScrollCount)
  12.       {
  13.          setProperty("ItemBar" + theLastButton, _alpha, 30);
  14.       }
  15.       _level4.gotoAndStop(2);
  16.       lastButton = theLastButton;
  17.       if(whichTab == 2)
  18.       {
  19.          if(currentExtraMode == 0)
  20.          {
  21.             gotoAndPlay(whichFrame);
  22.          }
  23.          else
  24.          {
  25.             gotoAndPlay(9);
  26.          }
  27.       }
  28.       else
  29.       {
  30.          gotoAndPlay(whichFrame);
  31.       }
  32.    }
  33. }
  34. function selectItem(theBoxNum, theItemNum, theLastButton, theCurrentItem, whichFrame, scrollCount, selectScrollCount, theBoxVar)
  35. {
  36.    if(currentTab == 1)
  37.    {
  38.       theItemsNumber = num_Demos;
  39.    }
  40.    if(currentTab == 2)
  41.    {
  42.       theItemsNumber = num_Extras;
  43.    }
  44.    if(currentTab == 3)
  45.    {
  46.       theItemsNumber = num_Files;
  47.    }
  48.    if(currentTab == 4)
  49.    {
  50.       theItemsNumber = num_Games;
  51.    }
  52.    if((theLastButton != theBoxNum | scrollcount != eval(selectScrollCount)) & Number(theItemNum) != 0 & theItemsNumber >= Number(theItemNum))
  53.    {
  54.       EasterEggIsOn = false;
  55.       screenflag2 = 1;
  56.       if(_level5.soundFlagValue)
  57.       {
  58.          buttSound.start();
  59.       }
  60.       _level4.gotoAndStop(2);
  61.       setProperty("itemBar" + (theBoxNum + maxScroll * scrollCount), _alpha, 30);
  62.       if(scrollCount == eval(selectScrollCount))
  63.       {
  64.          setProperty("itemBar" + theLastButton, _alpha, 10);
  65.       }
  66.       set(theBoxVar,theBoxNum);
  67.       lastButton = theBoxNum;
  68.       set(theCurrentItem,theItemNum);
  69.       set(selectScrollCount,scrollCount);
  70.       if(currentTab == 2)
  71.       {
  72.          if(eval("extratype" + theItemNum) == "All Images are 1024x768")
  73.          {
  74.             gotoAndPlay(9);
  75.             currentExtraMode = 1;
  76.          }
  77.          else
  78.          {
  79.             gotoAndPlay(whichFrame);
  80.             currentExtraMode = 0;
  81.          }
  82.       }
  83.       else
  84.       {
  85.          gotoAndPlay(whichFrame);
  86.       }
  87.    }
  88. }
  89. function scrollListDown(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
  90. {
  91.    if(numItems - scrollMax >= top_Item)
  92.    {
  93.       var theNewTop = Number(top_Item + scrollMax);
  94.       setProperty("itemBar" + lastButton, _alpha, 10);
  95.       if(currentTab != 4)
  96.       {
  97.          set(whichVar + 1,eval(whichItem + (top_Item + scrollMax)));
  98.          set(whichVar + 2,eval(whichItem + (top_Item + (scrollMax + 1))));
  99.          set(whichVar + 3,eval(whichItem + (top_Item + (scrollMax + 2))));
  100.          set(whichVar + 4,eval(whichItem + (top_Item + (scrollMax + 3))));
  101.          set(whichVar + 5,eval(whichItem + (top_Item + (scrollMax + 4))));
  102.          set(whichVar + 6,eval(whichItem + (top_Item + (scrollMax + 5))));
  103.          set(whichVar + 7,eval(whichItem + (top_Item + (scrollMax + 6))));
  104.          set(whichVar + 8,eval(whichItem + (top_Item + (scrollMax + 7))));
  105.          set(whichVar + 9,eval(whichItem + (top_Item + (scrollMax + 8))));
  106.       }
  107.       else
  108.       {
  109.          set(whichVar + 1,eval(whichItem + (top_Item - 1 + scrollMax)));
  110.          set(whichVar + 2,eval(whichItem + (top_Item - 1 + (scrollMax + 1))));
  111.          set(whichVar + 3,eval(whichItem + (top_Item - 1 + (scrollMax + 2))));
  112.          set(whichVar + 4,eval(whichItem + (top_Item - 1 + (scrollMax + 3))));
  113.          set(whichVar + 5,eval(whichItem + (top_Item - 1 + (scrollMax + 4))));
  114.          set(whichVar + 6,eval(whichItem + (top_Item - 1 + (scrollMax + 5))));
  115.          set(whichVar + 7,eval(whichItem + (top_Item - 1 + (scrollMax + 6))));
  116.          set(whichVar + 8,eval(whichItem + (top_Item - 1 + (scrollMax + 7))));
  117.          set(whichVar + 9,eval(whichItem + (top_Item - 1 + (scrollMax + 8))));
  118.       }
  119.       set(top_ItemName,theNewTop);
  120.       set(scrollCountName,scrollCount + 1);
  121.       if(currentTab == 1)
  122.       {
  123.          theBox1._y = 224 + 160 * (scrollCount / int(numItems / scrollMax + 1));
  124.          DemoBox_y = theBox1._y;
  125.       }
  126.       if(currentTab == 2)
  127.       {
  128.          theBox2._y = 224 + 160 * (scrollCount / int(numItems / scrollMax + 1));
  129.          ExtraBox_y = theBox2._y;
  130.       }
  131.       if(currentTab == 3)
  132.       {
  133.          theBox3._y = 224 + 160 * (scrollCount / int(numItems / scrollMax + 1));
  134.          FileBox_y = theBox3._y;
  135.       }
  136.       if(currentTab == 4)
  137.       {
  138.          theBox._y = 224 + 160 * (scrollCount / int(numItems / scrollMax + 1));
  139.          GameBox_y = theBox._y;
  140.       }
  141.       var tempScroll = Number(scrollCount + 1);
  142.       if(currentTab != 4)
  143.       {
  144.          if(tempScroll == eval(selectedScroll))
  145.          {
  146.             setProperty("itemBar" + lastButton, _alpha, 30);
  147.          }
  148.       }
  149.       else if(tempScroll == selectedScroll)
  150.       {
  151.          setProperty("itemBar" + lastButton, _alpha, 30);
  152.       }
  153.       set(whichItemNum + 1,theNewTop);
  154.       set(whichItemNum + 2,theNewTop + 1);
  155.       set(whichItemNum + 3,theNewTop + 2);
  156.       set(whichItemNum + 4,theNewTop + 3);
  157.       set(whichItemNum + 5,theNewTop + 4);
  158.       set(whichItemNum + 6,theNewTop + 5);
  159.       set(whichItemNum + 7,theNewTop + 6);
  160.       set(whichItemNum + 8,theNewTop + 7);
  161.       set(whichItemNum + 9,theNewTop + 8);
  162.    }
  163. }
  164. function scrollListUp(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
  165. {
  166.    if(1 < top_Item)
  167.    {
  168.       var theNewTop = Number(top_Item - scrollMax);
  169.       setProperty("itemBar" + lastButton, _alpha, 10);
  170.       if(currentTab != 4)
  171.       {
  172.          set(whichVar + 1,eval(whichItem + (top_Item - scrollMax)));
  173.          set(whichVar + 2,eval(whichItem + (top_Item - (scrollMax - 1))));
  174.          set(whichVar + 3,eval(whichItem + (top_Item - (scrollMax - 2))));
  175.          set(whichVar + 4,eval(whichItem + (top_Item - (scrollMax - 3))));
  176.          set(whichVar + 5,eval(whichItem + (top_Item - (scrollMax - 4))));
  177.          set(whichVar + 6,eval(whichItem + (top_Item - (scrollMax - 5))));
  178.          set(whichVar + 7,eval(whichItem + (top_Item - (scrollMax - 6))));
  179.          set(whichVar + 8,eval(whichItem + (top_Item - (scrollMax - 7))));
  180.          set(whichVar + 9,eval(whichItem + (top_Item - (scrollMax - 8))));
  181.       }
  182.       else
  183.       {
  184.          set(whichVar + 1,eval(whichItem + (top_Item - 1 - scrollMax)));
  185.          set(whichVar + 2,eval(whichItem + (top_Item - 1 - (scrollMax - 1))));
  186.          set(whichVar + 3,eval(whichItem + (top_Item - 1 - (scrollMax - 2))));
  187.          set(whichVar + 4,eval(whichItem + (top_Item - 1 - (scrollMax - 3))));
  188.          set(whichVar + 5,eval(whichItem + (top_Item - 1 - (scrollMax - 4))));
  189.          set(whichVar + 6,eval(whichItem + (top_Item - 1 - (scrollMax - 5))));
  190.          set(whichVar + 7,eval(whichItem + (top_Item - 1 - (scrollMax - 6))));
  191.          set(whichVar + 8,eval(whichItem + (top_Item - 1 - (scrollMax - 7))));
  192.          set(whichVar + 9,eval(whichItem + (top_Item - 1 - (scrollMax - 8))));
  193.       }
  194.       set(top_ItemName,theNewTop);
  195.       set(scrollCountName,scrollCount - 1);
  196.       if(currentTab == 1)
  197.       {
  198.          theBox1._y = 224 + 160 * ((scrollCount - 2) / int(numItems / scrollMax + 1));
  199.          DemoBox_y = theBox1._y;
  200.       }
  201.       if(currentTab == 2)
  202.       {
  203.          theBox2._y = 224 + 160 * ((scrollCount - 2) / int(numItems / scrollMax + 1));
  204.          ExtraBox_y = theBox2._y;
  205.       }
  206.       if(currentTab == 3)
  207.       {
  208.          theBox3._y = 224 + 160 * ((scrollCount - 2) / int(numItems / scrollMax + 1));
  209.          FileBox_y = theBox3._y;
  210.       }
  211.       if(currentTab == 4)
  212.       {
  213.          theBox._y = 224 + 160 * ((scrollCount - 2) / int(numItems / scrollMax + 1));
  214.          GameBox_y = theBox._y;
  215.       }
  216.       var tempScroll = Number(scrollCount - 1);
  217.       if(currentTab != 4)
  218.       {
  219.          if(tempScroll == eval(selectedScroll))
  220.          {
  221.             setProperty("itemBar" + lastButton, _alpha, 30);
  222.          }
  223.       }
  224.       else if(tempScroll == selectedScroll)
  225.       {
  226.          setProperty("itemBar" + lastButton, _alpha, 30);
  227.       }
  228.       set(whichItemNum + 1,theNewTop);
  229.       set(whichItemNum + 2,theNewTop + 1);
  230.       set(whichItemNum + 3,theNewTop + 2);
  231.       set(whichItemNum + 4,theNewTop + 3);
  232.       set(whichItemNum + 5,theNewTop + 4);
  233.       set(whichItemNum + 6,theNewTop + 5);
  234.       set(whichItemNum + 7,theNewTop + 6);
  235.       set(whichItemNum + 8,theNewTop + 7);
  236.       set(whichItemNum + 9,theNewTop + 8);
  237.    }
  238. }
  239. function scrollListBox(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll, Box_y, Box_yName)
  240. {
  241.    var theNewTop = (scrollCount + 1) * scrollMax - 8;
  242.    if(currentTab == 4)
  243.    {
  244.       set(whichVar + 1,eval(whichItem + (theNewTop - 1)));
  245.       set(whichVar + 2,eval(whichItem + theNewTop));
  246.       set(whichVar + 3,eval(whichItem + (theNewTop + 1)));
  247.       set(whichVar + 4,eval(whichItem + (theNewTop + 2)));
  248.       set(whichVar + 5,eval(whichItem + (theNewTop + 3)));
  249.       set(whichVar + 6,eval(whichItem + (theNewTop + 4)));
  250.       set(whichVar + 7,eval(whichItem + (theNewTop + 5)));
  251.       set(whichVar + 8,eval(whichItem + (theNewTop + 6)));
  252.       set(whichVar + 9,eval(whichItem + (theNewTop + 7)));
  253.    }
  254.    else
  255.    {
  256.       set(whichVar + 1,eval(whichItem + theNewTop));
  257.       set(whichVar + 2,eval(whichItem + (theNewTop + 1)));
  258.       set(whichVar + 3,eval(whichItem + (theNewTop + 2)));
  259.       set(whichVar + 4,eval(whichItem + (theNewTop + 3)));
  260.       set(whichVar + 5,eval(whichItem + (theNewTop + 4)));
  261.       set(whichVar + 6,eval(whichItem + (theNewTop + 5)));
  262.       set(whichVar + 7,eval(whichItem + (theNewTop + 6)));
  263.       set(whichVar + 8,eval(whichItem + (theNewTop + 7)));
  264.       set(whichVar + 9,eval(whichItem + (theNewTop + 8)));
  265.    }
  266.    setProperty("itemBar" + lastButton, _alpha, 10);
  267.    set(Box_yName,Box_y);
  268.    if(selectedScroll != 0)
  269.    {
  270.       if(scrollCount == selectedScroll - 1)
  271.       {
  272.          setProperty("itemBar" + lastButton, _alpha, 30);
  273.       }
  274.    }
  275.    else if(scrollCount == selectedScroll)
  276.    {
  277.       setProperty("itemBar" + lastButton, _alpha, 30);
  278.    }
  279.    set(top_ItemName,theNewTop);
  280.    set(scrollCountName,scrollCount + 1);
  281.    set(whichItemNum + 1,theNewTop);
  282.    set(whichItemNum + 2,theNewTop + 1);
  283.    set(whichItemNum + 3,theNewTop + 2);
  284.    set(whichItemNum + 4,theNewTop + 3);
  285.    set(whichItemNum + 5,theNewTop + 4);
  286.    set(whichItemNum + 6,theNewTop + 5);
  287.    set(whichItemNum + 7,theNewTop + 6);
  288.    set(whichItemNum + 8,theNewTop + 7);
  289.    set(whichItemNum + 9,theNewTop + 8);
  290. }
  291. loadVariables("Data/gamesdata.txt","");
  292. loadVariables("Data/appsdata.txt","");
  293. loadVariables("Data/utilitiesdata.txt","");
  294. loadVariables("Data/extrasdata.txt","");
  295. loadMovieNum("Data/Help.pcg",7,"GET");
  296. startTime = getTimer();
  297. startingTab = true;
  298. buttSound = new Sound(_level1);
  299. buttSound.attachSound("myButtonSound");
  300. arGamesDBMain = new Array();
  301. arGamesDBIndex = new Array();
  302. arGamesIndexSlice = new Array();
  303. loadSysTimeOut = 10000;
  304. searchstr = "";
  305. thisprocessor = "";
  306. num_Demos = 0;
  307. num_Extras = 0;
  308. num_Files = 0;
  309. num_Games = 0;
  310. num_Items = 0;
  311. scrollMax = 9;
  312. lastButton = 1;
  313. currentExtraMode = 0;
  314. currentTab = 1;
  315. screenflag1 = 0;
  316. screenflag2 = 0;
  317. theCurrentDemo = 1;
  318. theLastDemo = 1;
  319. theCurrentGame = 1;
  320. theLastGame = 1;
  321. theCurrentExtra = 1;
  322. theLastExtra = 1;
  323. theCurrentFile = 1;
  324. theLastFile = 1;
  325. topDemo = 1;
  326. topExtra = 1;
  327. topFile = 1;
  328. topDB = 1;
  329. EasterEggIsOn = false;
  330. topItem = 1;
  331. clearItem = 0;
  332. currentDemoCount = 1;
  333. currentExtraCount = 1;
  334. currentFileCount = 1;
  335. currentGameCount = 1;
  336. demoCount = 1;
  337. extraCount = 1;
  338. fileCount = 1;
  339. dbCount = 1;
  340. lastDemoBox = 1;
  341. lastExtraBox = 1;
  342. lastFileBox = 1;
  343. lastGameBox = 1;
  344. DemoBox_y = 224;
  345. ExtraBox_y = 224;
  346. FileBox_y = 224;
  347. GameBox_y = 224;
  348.