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
Wrap
Text File
|
2001-02-01
|
8KB
|
207 lines
function SwitchTab(whichTab, whichMenuText, whichVarText, numItems, theLastButton, whichFrame, scrollCount, selectScrollCount)
{
if(whichTab != currentTab)
{
if(whichTab == 2 | whichTab == 4)
{
loadMovieNum("Data/PCGvideo.swf",2,"GET");
}
if(whichTab == 3)
{
loadMovieNum("Data/Filesvideo.swf",2,"GET");
}
screenflag2 = 0;
currentTab = whichTab;
num_Items = numItems;
setProperty("itemBar" + lastButton, _alpha, 10);
var i = 1;
while(scrollMax >= i)
{
setProperty("itemBar" + i, _X, theBarX);
i += 1;
}
if(Number(numItems) < scrollMax)
{
var i = Number(numItems) + 1;
var k = scrollMax;
while(k >= i)
{
setProperty("itemBar" + i, _X, eval("itembar+i+"._x) - 3000);
i += 1;
}
}
if(scrollcount == selectScrollCount)
{
setProperty("ItemBar" + theLastButton, _alpha, 20);
}
lastButton = theLastButton;
gotoAndPlay(whichFrame);
}
}
function selectItem(theBoxNum, theItemNum, theLastButton, theCurrentItem, whichFrame, scrollCount, selectScrollCount, theBoxVar)
{
if((theLastButton != theBoxNum | scrollcount != eval(selectScrollCount)) & Number(theItemNum) != 0)
{
screenflag2 = 1;
if(_level5.soundFlagValue)
{
buttSound.start();
}
setProperty("itemBar" + (theBoxNum + maxScroll * scrollCount), _alpha, 20);
if(scrollCount == eval(selectScrollCount))
{
setProperty("itemBar" + theLastButton, _alpha, 10);
}
set(theBoxVar,theBoxNum);
lastButton = theBoxNum;
set(theCurrentItem,theItemNum);
set(selectScrollCount,scrollCount);
gotoAndPlay(whichFrame);
}
}
function scrollListDown(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
{
if(top_Item < numItems - scrollMax)
{
var theNewTop = Number(top_Item + scrollMax);
setProperty("itemBar" + lastButton, _alpha, 10);
if(currentTab != 4)
{
set(whichVar + 1,eval(whichItem + (top_Item + scrollMax)));
set(whichVar + 2,eval(whichItem + (top_Item + (scrollMax + 1))));
set(whichVar + 3,eval(whichItem + (top_Item + (scrollMax + 2))));
set(whichVar + 4,eval(whichItem + (top_Item + (scrollMax + 3))));
set(whichVar + 5,eval(whichItem + (top_Item + (scrollMax + 4))));
set(whichVar + 6,eval(whichItem + (top_Item + (scrollMax + 5))));
set(whichVar + 7,eval(whichItem + (top_Item + (scrollMax + 6))));
set(whichVar + 8,eval(whichItem + (top_Item + (scrollMax + 7))));
set(whichVar + 9,eval(whichItem + (top_Item + (scrollMax + 8))));
}
else
{
set(whichVar + 1,eval(whichItem + (top_Item - 1 + scrollMax)));
set(whichVar + 2,eval(whichItem + (top_Item - 1 + (scrollMax + 1))));
set(whichVar + 3,eval(whichItem + (top_Item - 1 + (scrollMax + 2))));
set(whichVar + 4,eval(whichItem + (top_Item - 1 + (scrollMax + 3))));
set(whichVar + 5,eval(whichItem + (top_Item - 1 + (scrollMax + 4))));
set(whichVar + 6,eval(whichItem + (top_Item - 1 + (scrollMax + 5))));
set(whichVar + 7,eval(whichItem + (top_Item - 1 + (scrollMax + 6))));
set(whichVar + 8,eval(whichItem + (top_Item - 1 + (scrollMax + 7))));
set(whichVar + 9,eval(whichItem + (top_Item - 1 + (scrollMax + 8))));
}
set(top_ItemName,theNewTop);
set(scrollCountName,scrollCount + 1);
var tempScroll = Number(scrollCount + 1);
if(tempScroll == selectedScroll)
{
setProperty("itemBar" + lastButton, _alpha, 20);
}
set(whichItemNum + 1,theNewTop);
set(whichItemNum + 2,theNewTop + 1);
set(whichItemNum + 3,theNewTop + 2);
set(whichItemNum + 4,theNewTop + 3);
set(whichItemNum + 5,theNewTop + 4);
set(whichItemNum + 6,theNewTop + 5);
set(whichItemNum + 7,theNewTop + 6);
set(whichItemNum + 8,theNewTop + 7);
set(whichItemNum + 9,theNewTop + 8);
}
}
function scrollListUp(whichVar, whichItem, whichItemNum, numItems, top_Item, top_ItemName, scrollCount, scrollCountName, selectedScroll)
{
if(1 < top_Item)
{
var theNewTop = Number(top_Item - scrollMax);
setProperty("itemBar" + lastButton, _alpha, 10);
if(currentTab != 4)
{
set(whichVar + 1,eval(whichItem + (top_Item - scrollMax)));
set(whichVar + 2,eval(whichItem + (top_Item - (scrollMax - 1))));
set(whichVar + 3,eval(whichItem + (top_Item - (scrollMax - 2))));
set(whichVar + 4,eval(whichItem + (top_Item - (scrollMax - 3))));
set(whichVar + 5,eval(whichItem + (top_Item - (scrollMax - 4))));
set(whichVar + 6,eval(whichItem + (top_Item - (scrollMax - 5))));
set(whichVar + 7,eval(whichItem + (top_Item - (scrollMax - 6))));
set(whichVar + 8,eval(whichItem + (top_Item - (scrollMax - 7))));
set(whichVar + 9,eval(whichItem + (top_Item - (scrollMax - 8))));
}
else
{
set(whichVar + 1,eval(whichItem + (top_Item - 1 - scrollMax)));
set(whichVar + 2,eval(whichItem + (top_Item - 1 - (scrollMax - 1))));
set(whichVar + 3,eval(whichItem + (top_Item - 1 - (scrollMax - 2))));
set(whichVar + 4,eval(whichItem + (top_Item - 1 - (scrollMax - 3))));
set(whichVar + 5,eval(whichItem + (top_Item - 1 - (scrollMax - 4))));
set(whichVar + 6,eval(whichItem + (top_Item - 1 - (scrollMax - 5))));
set(whichVar + 7,eval(whichItem + (top_Item - 1 - (scrollMax - 6))));
set(whichVar + 8,eval(whichItem + (top_Item - 1 - (scrollMax - 7))));
set(whichVar + 9,eval(whichItem + (top_Item - 1 - (scrollMax - 8))));
}
set(top_ItemName,theNewTop);
set(scrollCountName,scrollCount - 1);
var tempScroll = Number(scrollCount - 1);
if(tempScroll == selectedScroll)
{
setProperty("itemBar" + lastButton, _alpha, 20);
}
set(whichItemNum + 1,theNewTop);
set(whichItemNum + 2,theNewTop + 1);
set(whichItemNum + 3,theNewTop + 2);
set(whichItemNum + 4,theNewTop + 3);
set(whichItemNum + 5,theNewTop + 4);
set(whichItemNum + 6,theNewTop + 5);
set(whichItemNum + 7,theNewTop + 6);
set(whichItemNum + 8,theNewTop + 7);
set(whichItemNum + 9,theNewTop + 8);
}
}
loadVariables("Data/demodata.txt","");
loadVariables("Data/extrasdata.txt","");
loadVariables("Data/filesdata.txt","");
loadVariables("Data/databasedata.txt","");
startTime = getTimer();
buttSound = new Sound(_level1);
buttSound.attachSound("myButtonSound");
arGamesDBMain = new Array();
arGamesDBIndex = new Array();
arGamesIndexSlice = new Array();
loadSysTimeOut = 10000;
thisprocessor = "";
num_Demos = 0;
num_Extras = 0;
num_Files = 0;
num_Games = 0;
num_Items = 0;
scrollMax = 9;
lastButton = 1;
currentTab = 1;
screenflag1 = 0;
screenflag2 = 0;
theCurrentDemo = 1;
theLastDemo = 1;
theCurrentGame = 1;
theLastGame = 1;
theCurrentExtra = 1;
theLastExtra = 1;
theCurrentFile = 1;
theLastFile = 1;
topDemo = 1;
topExtra = 1;
topFile = 1;
topDB = 1;
EasterEggIsOn = false;
topItem = 1;
clearItem = 0;
currentDemoCount = 0;
currentExtraCount = 0;
currentFileCount = 0;
currentGameCount = 0;
demoCount = 0;
extraCount = 0;
fileCount = 0;
dbCount = 0;
lastDemoBox = 1;
lastExtraBox = 1;
lastFileBox = 1;
lastGameBox = 1;