home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 7.1 / 2001-04_-_Disc_7.1.iso / Data / Items.swf / scripts / frame_1 / DoAction.as
Text File  |  2001-02-01  |  8KB  |  207 lines

  1. function SwitchTab(whichTab, whichMenuText, whichVarText, numItems, theLastButton, whichFrame, scrollCount, selectScrollCount)
  2. {
  3.    if(whichTab != currentTab)
  4.    {
  5.       if(whichTab == 2 | whichTab == 4)
  6.       {
  7.          loadMovieNum("Data/PCGvideo.swf",2,"GET");
  8.       }
  9.       if(whichTab == 3)
  10.       {
  11.          loadMovieNum("Data/Filesvideo.swf",2,"GET");
  12.       }
  13.       screenflag2 = 0;
  14.       currentTab = whichTab;
  15.       num_Items = numItems;
  16.       setProperty("itemBar" + lastButton, _alpha, 10);
  17.       var i = 1;
  18.       while(scrollMax >= i)
  19.       {
  20.          setProperty("itemBar" + i, _X, theBarX);
  21.          i += 1;
  22.       }
  23.       if(Number(numItems) < scrollMax)
  24.       {
  25.          var i = Number(numItems) + 1;
  26.          var k = scrollMax;
  27.          while(k >= i)
  28.          {
  29.             setProperty("itemBar" + i, _X, eval("itembar+i+"._x) - 3000);
  30.             i += 1;
  31.          }
  32.       }
  33.       if(scrollcount == selectScrollCount)
  34.       {
  35.          setProperty("ItemBar" + theLastButton, _alpha, 20);
  36.       }
  37.       lastButton = theLastButton;
  38.       gotoAndPlay(whichFrame);
  39.    }
  40. }
  41. function selectItem(theBoxNum, theItemNum, theLastButton, theCurrentItem, whichFrame, scrollCount, selectScrollCount, theBoxVar)
  42. {
  43.    if((theLastButton != theBoxNum | scrollcount != eval(selectScrollCount)) & Number(theItemNum) != 0)
  44.    {
  45.       screenflag2 = 1;
  46.       if(_level5.soundFlagValue)
  47.       {
  48.          buttSound.start();
  49.       }
  50.       setProperty("itemBar" + (theBoxNum + maxScroll * scrollCount), _alpha, 20);
  51.       if(scrollCount == eval(selectScrollCount))
  52.       {
  53.          setProperty("itemBar" + theLastButton, _alpha, 10);
  54.       }
  55.       set(theBoxVar,theBoxNum);
  56.       lastButton = theBoxNum;
  57.       set(theCurrentItem,theItemNum);
  58.       set(selectScrollCount,scrollCount);
  59.       gotoAndPlay(whichFrame);
  60.    }
  61. }
  62. function scrollListDown(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
  63. {
  64.    if(top_Item < numItems - scrollMax)
  65.    {
  66.       var theNewTop = Number(top_Item + scrollMax);
  67.       setProperty("itemBar" + lastButton, _alpha, 10);
  68.       if(currentTab != 4)
  69.       {
  70.          set(whichVar + 1,eval(whichItem + (top_Item + scrollMax)));
  71.          set(whichVar + 2,eval(whichItem + (top_Item + (scrollMax + 1))));
  72.          set(whichVar + 3,eval(whichItem + (top_Item + (scrollMax + 2))));
  73.          set(whichVar + 4,eval(whichItem + (top_Item + (scrollMax + 3))));
  74.          set(whichVar + 5,eval(whichItem + (top_Item + (scrollMax + 4))));
  75.          set(whichVar + 6,eval(whichItem + (top_Item + (scrollMax + 5))));
  76.          set(whichVar + 7,eval(whichItem + (top_Item + (scrollMax + 6))));
  77.          set(whichVar + 8,eval(whichItem + (top_Item + (scrollMax + 7))));
  78.          set(whichVar + 9,eval(whichItem + (top_Item + (scrollMax + 8))));
  79.       }
  80.       else
  81.       {
  82.          set(whichVar + 1,eval(whichItem + (top_Item - 1 + scrollMax)));
  83.          set(whichVar + 2,eval(whichItem + (top_Item - 1 + (scrollMax + 1))));
  84.          set(whichVar + 3,eval(whichItem + (top_Item - 1 + (scrollMax + 2))));
  85.          set(whichVar + 4,eval(whichItem + (top_Item - 1 + (scrollMax + 3))));
  86.          set(whichVar + 5,eval(whichItem + (top_Item - 1 + (scrollMax + 4))));
  87.          set(whichVar + 6,eval(whichItem + (top_Item - 1 + (scrollMax + 5))));
  88.          set(whichVar + 7,eval(whichItem + (top_Item - 1 + (scrollMax + 6))));
  89.          set(whichVar + 8,eval(whichItem + (top_Item - 1 + (scrollMax + 7))));
  90.          set(whichVar + 9,eval(whichItem + (top_Item - 1 + (scrollMax + 8))));
  91.       }
  92.       set(top_ItemName,theNewTop);
  93.       set(scrollCountName,scrollCount + 1);
  94.       var tempScroll = Number(scrollCount + 1);
  95.       if(tempScroll == selectedScroll)
  96.       {
  97.          setProperty("itemBar" + lastButton, _alpha, 20);
  98.       }
  99.       set(whichItemNum + 1,theNewTop);
  100.       set(whichItemNum + 2,theNewTop + 1);
  101.       set(whichItemNum + 3,theNewTop + 2);
  102.       set(whichItemNum + 4,theNewTop + 3);
  103.       set(whichItemNum + 5,theNewTop + 4);
  104.       set(whichItemNum + 6,theNewTop + 5);
  105.       set(whichItemNum + 7,theNewTop + 6);
  106.       set(whichItemNum + 8,theNewTop + 7);
  107.       set(whichItemNum + 9,theNewTop + 8);
  108.    }
  109. }
  110. function scrollListUp(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
  111. {
  112.    if(1 < top_Item)
  113.    {
  114.       var theNewTop = Number(top_Item - scrollMax);
  115.       setProperty("itemBar" + lastButton, _alpha, 10);
  116.       if(currentTab != 4)
  117.       {
  118.          set(whichVar + 1,eval(whichItem + (top_Item - scrollMax)));
  119.          set(whichVar + 2,eval(whichItem + (top_Item - (scrollMax - 1))));
  120.          set(whichVar + 3,eval(whichItem + (top_Item - (scrollMax - 2))));
  121.          set(whichVar + 4,eval(whichItem + (top_Item - (scrollMax - 3))));
  122.          set(whichVar + 5,eval(whichItem + (top_Item - (scrollMax - 4))));
  123.          set(whichVar + 6,eval(whichItem + (top_Item - (scrollMax - 5))));
  124.          set(whichVar + 7,eval(whichItem + (top_Item - (scrollMax - 6))));
  125.          set(whichVar + 8,eval(whichItem + (top_Item - (scrollMax - 7))));
  126.          set(whichVar + 9,eval(whichItem + (top_Item - (scrollMax - 8))));
  127.       }
  128.       else
  129.       {
  130.          set(whichVar + 1,eval(whichItem + (top_Item - 1 - scrollMax)));
  131.          set(whichVar + 2,eval(whichItem + (top_Item - 1 - (scrollMax - 1))));
  132.          set(whichVar + 3,eval(whichItem + (top_Item - 1 - (scrollMax - 2))));
  133.          set(whichVar + 4,eval(whichItem + (top_Item - 1 - (scrollMax - 3))));
  134.          set(whichVar + 5,eval(whichItem + (top_Item - 1 - (scrollMax - 4))));
  135.          set(whichVar + 6,eval(whichItem + (top_Item - 1 - (scrollMax - 5))));
  136.          set(whichVar + 7,eval(whichItem + (top_Item - 1 - (scrollMax - 6))));
  137.          set(whichVar + 8,eval(whichItem + (top_Item - 1 - (scrollMax - 7))));
  138.          set(whichVar + 9,eval(whichItem + (top_Item - 1 - (scrollMax - 8))));
  139.       }
  140.       set(top_ItemName,theNewTop);
  141.       set(scrollCountName,scrollCount - 1);
  142.       var tempScroll = Number(scrollCount - 1);
  143.       if(tempScroll == selectedScroll)
  144.       {
  145.          setProperty("itemBar" + lastButton, _alpha, 20);
  146.       }
  147.       set(whichItemNum + 1,theNewTop);
  148.       set(whichItemNum + 2,theNewTop + 1);
  149.       set(whichItemNum + 3,theNewTop + 2);
  150.       set(whichItemNum + 4,theNewTop + 3);
  151.       set(whichItemNum + 5,theNewTop + 4);
  152.       set(whichItemNum + 6,theNewTop + 5);
  153.       set(whichItemNum + 7,theNewTop + 6);
  154.       set(whichItemNum + 8,theNewTop + 7);
  155.       set(whichItemNum + 9,theNewTop + 8);
  156.    }
  157. }
  158. loadVariables("Data/demodata.txt","");
  159. loadVariables("Data/extrasdata.txt","");
  160. loadVariables("Data/filesdata.txt","");
  161. loadVariables("Data/databasedata.txt","");
  162. startTime = getTimer();
  163. buttSound = new Sound(_level1);
  164. buttSound.attachSound("myButtonSound");
  165. arGamesDBMain = new Array();
  166. arGamesDBIndex = new Array();
  167. arGamesIndexSlice = new Array();
  168. loadSysTimeOut = 10000;
  169. thisprocessor = "";
  170. num_Demos = 0;
  171. num_Extras = 0;
  172. num_Files = 0;
  173. num_Games = 0;
  174. num_Items = 0;
  175. scrollMax = 9;
  176. lastButton = 1;
  177. currentTab = 1;
  178. screenflag1 = 0;
  179. screenflag2 = 0;
  180. theCurrentDemo = 1;
  181. theLastDemo = 1;
  182. theCurrentGame = 1;
  183. theLastGame = 1;
  184. theCurrentExtra = 1;
  185. theLastExtra = 1;
  186. theCurrentFile = 1;
  187. theLastFile = 1;
  188. topDemo = 1;
  189. topExtra = 1;
  190. topFile = 1;
  191. topDB = 1;
  192. EasterEggIsOn = false;
  193. topItem = 1;
  194. clearItem = 0;
  195. currentDemoCount = 0;
  196. currentExtraCount = 0;
  197. currentFileCount = 0;
  198. currentGameCount = 0;
  199. demoCount = 0;
  200. extraCount = 0;
  201. fileCount = 0;
  202. dbCount = 0;
  203. lastDemoBox = 1;
  204. lastExtraBox = 1;
  205. lastFileBox = 1;
  206. lastGameBox = 1;
  207.