home *** CD-ROM | disk | FTP | other *** search
- function fnShowHints()
- {
- fnClearMessage();
- Hints_mc._visible = 1;
- Hints_mc.fade.gotoAndPlay(2);
- }
- function fnHideHints()
- {
- Hints_mc._visible = 0;
- }
- function fnToggleControls(state)
- {
- arwLeft_btn._visible = state;
- arwRight_btn._visible = state;
- }
- function fnChangeCursor(item)
- {
- if(myCursor != null)
- {
- sfx_mc.gotoAndPlay("AddInv");
- }
- else if(item != null)
- {
- sfx_mc.gotoAndPlay("Pickup");
- }
- stopDrag();
- var i = 0;
- while(i < crsArry.length)
- {
- eval("Crs_" + crsArry[i])._y = -500;
- if(crsArry[i] != item and eval(crsArry[i] + "Inv") == true)
- {
- eval("Inv_mc.Inv" + crsArry[i] + "_mc")._visible = 1;
- }
- else
- {
- eval("Inv_mc.Inv" + crsArry[i] + "_mc")._visible = 0;
- }
- i++;
- }
- myCursor = item;
- if(item != null)
- {
- startDrag("Crs_" + item,1);
- }
- if(item == "tile")
- {
- Crs_Tile.gotoAndStop(invTileNum);
- }
- }
- function fnAddToInv(myitem)
- {
- if(eval(myitem + "Inv") != true)
- {
- eval("Inv_mc.Inv" + myitem + "_mc")._visible = 1;
- set(myitem + "Inv",true);
- sfx_mc.gotoAndPlay("AddInv");
- }
- else if(myitem == "tile")
- {
- eval("Inv_mc.Inv" + myitem + "_mc")._visible = 1;
- set(myitem + "Inv",true);
- sfx_mc.gotoAndPlay("AddInv");
- }
- }
- function fnRemoveInv(whichItem)
- {
- eval("Inv_mc.Inv" + whichItem + "_mc")._visible = 0;
- set(whichItem + "Inv",false);
- if(myCursor == whichItem)
- {
- fnChangeCursor();
- }
- }
- function fnChangeRoom(dir)
- {
- AudioWalking_MC.play();
- if(roomanimating != true and inPopup != true)
- {
- fnClearMessage();
- var xTarg;
- var xOff = SLIDERES;
- switch(currentRoom)
- {
- case 1:
- xOff = - SLIDERES;
- xTarg = CENTERX;
- currentRoom = 2;
- break;
- case 2:
- if(dir == "right")
- {
- xOff = - SLIDERES;
- xTarg = RIGHTX;
- currentRoom = 3;
- }
- else
- {
- xTarg = LEFTX;
- currentRoom = 1;
- }
- break;
- case 3:
- xTarg = CENTERX;
- currentRoom = 2;
- }
- Fader_mc.gotoAndPlay("Dissolve");
- }
- }
- function fnShowNewRoom()
- {
- if(currentRoom == 1)
- {
- arwLeft_btn._visible = 0;
- arwRight_btn._visible = 1;
- Rooms_mc._x = LEFTX;
- }
- else if(currentRoom == 2)
- {
- arwLeft_btn._visible = 1;
- arwRight_btn._visible = 1;
- Rooms_mc._x = CENTERX;
- }
- else
- {
- arwLeft_btn._visible = 1;
- arwRight_btn._visible = 0;
- Rooms_mc._x = RIGHTX;
- }
- }
- function fnMessage(textLabel)
- {
- AudioMessage_MC.play();
- Msg_mc._visible = 1;
- Msg_mc.gotoAndStop(textLabel);
- }
- function fnClearMessage()
- {
- Msg_mc._visible = 0;
- }
- _global.gPuzzleRoot = this;
- var CENTERX = -2;
- var LEFTX = 499;
- var RIGHTX = -502;
- var SLIDERES = 15;
- var SLIDERATE = 25;
- var roomanimating = false;
- var currentRoom = 2;
- var myCursor = null;
- var inPopup = false;
- crsArry = new Array();
- var level = 1;
- var eMin;
- var eSec;
- Array.prototype.searchArray = function(searchElement)
- {
- var i = 0;
- while(i < this.length)
- {
- if(this[i] == searchElement)
- {
- return i;
- }
- i++;
- }
- return null;
- };
- Array.prototype.copy = function()
- {
- newArray = new Array();
- count = 0;
- while(count < this.length)
- {
- newArray[count] = this[count];
- count++;
- }
- return newArray;
- };
-