home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003: The Beautiful Scenery / enter-parhaat-2003.iso / files / frendz.exe / frendz.dcr / Scripts_8_b_Buttons.ls < prev    next >
Encoding:
Text File  |  2002-12-31  |  6.1 KB  |  188 lines

  1. property pSpriteNum, pbuttonList, pbuttonUp, pbuttonDown, pButtonUpSpanish, pButtonDownSpanish, pAction, pSoundOver, pSoundDown, pSoundOverOn, pSoundDownOn, pTicks
  2. global gPlay, key1, gNewBanner, gPlayAgain, ground, gNetID, gCheckPing, gClickOnOnce, gRadio, isShockwave, isMac, gCookiePath, gCheckLegalCookie, gKewlboxFolder, gOnline, gMacSound, gIntroPlayed
  3.  
  4. on getPropertyDescriptionList me
  5.   pbuttonList = [:]
  6.   addProp(pbuttonList, #pbuttonUp, [#comment: "Button Up State: ", #format: #bitmap, #default: EMPTY])
  7.   addProp(pbuttonList, #pbuttonDown, [#comment: "Button Down State: ", #format: #bitmap, #default: EMPTY])
  8.   addProp(pbuttonList, #pButtonUpSpanish, [#comment: "Button Up Spanish State: ", #format: #bitmap, #default: EMPTY])
  9.   addProp(pbuttonList, #pButtonDownSpanish, [#comment: "Button Down Spanish State: ", #format: #bitmap, #default: EMPTY])
  10.   addProp(pbuttonList, #pAction, [#comment: "Button Action: ", #format: #string, #default: EMPTY])
  11.   addProp(pbuttonList, #pSoundOver, [#comment: "Button RollOver Sound File: ", #format: #sound, #default: EMPTY])
  12.   addProp(pbuttonList, #pSoundOverOn, [#comment: "Button RollOver Sound On/Off", #format: #boolean, #default: 1])
  13.   addProp(pbuttonList, #pSoundDown, [#comment: "Button Down Sound File: ", #format: #sound, #default: EMPTY])
  14.   addProp(pbuttonList, #pSoundDownOn, [#comment: "Button Down Sound On/Off", #format: #boolean, #default: 1])
  15.   return pbuttonList
  16. end
  17.  
  18. on beginSprite me
  19.   pSpriteNum = me.spriteNum
  20.   pTicks = 0
  21.   gNetID = 0
  22.   gCheckPing = 0
  23. end
  24.  
  25. on mouseEnter me
  26.   sprite(the currentSpriteNum).cursor = 280
  27.   set the member of sprite the currentSpriteNum to member(pbuttonDown)
  28.   if pSoundOverOn = 1 then
  29.     puppetSound(2, pSoundOver)
  30.   end if
  31. end
  32.  
  33. on mouseLeave me
  34.   set the member of sprite the currentSpriteNum to member(pbuttonUp)
  35.   if pAction = "End Game" then
  36.     sprite(the currentSpriteNum).cursor = 280
  37.   else
  38.     sprite(the currentSpriteNum).cursor = -1
  39.   end if
  40. end
  41.  
  42. on mouseUp me
  43.   case pAction of
  44.     "Play":
  45.       if gPlay = 1 then
  46.         setScore(0)
  47.         put getScore() into member "t_TotalScore"
  48.         put EMPTY into member "t_MessageWindow"
  49.         go("SetUp")
  50.       else
  51.         gPlay = 1
  52.         if gCheckLegalCookie = "1" then
  53.           setScore(0)
  54.           put getScore() into member "t_TotalScore"
  55.           put EMPTY into member "t_MessageWindow"
  56.           go("SetUp")
  57.         else
  58.           go("Legal")
  59.         end if
  60.       end if
  61.       if pSoundDownOn = 1 then
  62.         puppetSound(3, pSoundDown)
  63.       end if
  64.     "Play Again":
  65.       if gPlay = 1 then
  66.         setScore(0)
  67.         put getScore() into member "t_TotalScore"
  68.         gPlayAgain = 1
  69.         gRadio = 0
  70.         put EMPTY into member "t_MessageWindow"
  71.         put "1" into member "t_Level"
  72.         go("SetUp")
  73.       else
  74.         gPlay = 1
  75.         if gCheckLegalCookie = "1" then
  76.           setScore(0)
  77.           put getScore() into member "t_TotalScore"
  78.           gPlayAgain = 1
  79.           gRadio = 0
  80.           put EMPTY into member "t_MessageWindow"
  81.           put "1" into member "t_Level"
  82.         else
  83.           go("Legal")
  84.         end if
  85.       end if
  86.       set the soundLevel to gMacSound
  87.       sound(8).play(member("goofy"))
  88.       if pSoundDownOn = 1 then
  89.         puppetSound(3, pSoundDown)
  90.       end if
  91.     "Rules":
  92.       go("Rules")
  93.       if pSoundDownOn = 1 then
  94.         puppetSound(3, pSoundDown)
  95.       end if
  96.     "Quit":
  97.       ping2()
  98.       sound(8).fadeOut()
  99.       go("End")
  100.       if pSoundDownOn = 1 then
  101.         puppetSound(3, pSoundDown)
  102.       end if
  103.     "Submit Email":
  104.       submitEmail()
  105.       if pSoundDownOn = 1 then
  106.         puppetSound(3, pSoundDown)
  107.       end if
  108.     "Send Score":
  109.       postScore()
  110.       if pSoundDownOn = 1 then
  111.         puppetSound(3, pSoundDown)
  112.       end if
  113.     "Ok":
  114.       go("Main")
  115.       if pSoundDownOn = 1 then
  116.         puppetSound(3, pSoundDown)
  117.       end if
  118.     "Backpage":
  119.       key1 = random(999999)
  120.       sound(8).stop()
  121.       put EMPTY into member "t_MessageWindow"
  122.       go("Backpage")
  123.       if pSoundDownOn = 1 then
  124.         puppetSound(2, pSoundDown)
  125.       end if
  126.     "Web":
  127.       bdWebCommunicate("http://www.kewlbox.com", 1)
  128.       if pSoundDownOn = 1 then
  129.         puppetSound(2, pSoundDown)
  130.       end if
  131.     "Approve":
  132.       if gPlay = 1 then
  133.         go("SetUp")
  134.       else
  135.         go("Main")
  136.       end if
  137.       if pSoundDownOn = 1 then
  138.         puppetSound(3, pSoundDown)
  139.       end if
  140.     "Disapprove":
  141.       sound(8).stop()
  142.       gPlay = 0
  143.       go("Backpage")
  144.       if pSoundDownOn = 1 then
  145.         puppetSound(3, pSoundDown)
  146.       end if
  147.     "English":
  148.     "Spanish":
  149.     "YesShortcut":
  150.       fxObj = xtra("FileXtra3").new()
  151.       gameName = the movieName
  152.       gamepath = the moviePath
  153.       if isMac = 1 then
  154.         desktop = fxObj.fx_FolderGetSpecialPath("kDesktopFolderType")
  155.         fxObj.fx_LinkCreate(gamepath & gameName, desktop)
  156.         fxObj.fx_FileRename(desktop & gameName & " alias", desktop & gameName)
  157.       else
  158.         desktop = fxObj.fx_FolderGetSpecialPath("CSIDL_DESKTOPDIRECTORY")
  159.         programs = fxObj.fx_FolderGetSpecialPath("CSIDL_COMMON_PROGRAMS")
  160.         fxObj.fx_LinkCreate(gamepath & gameName, desktop)
  161.         fxObj.fx_FileRename(desktop & "Shortcut to " & gameName & ".lnk", desktop & gameName & ".lnk")
  162.         if gKewlboxFolder = 0 then
  163.           fxObj.fx_FolderCreate(programs & "Kewlbox Games")
  164.         end if
  165.         fxObj.fx_LinkCreate(gamepath & gameName, programs & "Kewlbox Games")
  166.         fxObj.fx_FileRename(programs & "Kewlbox Games\" & "Shortcut to " & gameName & ".lnk", programs & "Kewlbox Games\" & gameName & ".lnk")
  167.       end if
  168.       fxObj = 0
  169.       member("f_gameCookie").item[1] = 1
  170.       if isMac = 1 then
  171.         saveText(member("f_gameCookie").text, gCookiePath & the movieName && "Preferences", 0, 0)
  172.       else
  173.         saveText(member("f_gameCookie").text, gCookiePath & the movieName & ".txt", 0, 0)
  174.       end if
  175.       go("Main")
  176.       if pSoundDownOn = 1 then
  177.         puppetSound(3, pSoundDown)
  178.       end if
  179.     "NoShortcut":
  180.       go("Main")
  181.       if pSoundDownOn = 1 then
  182.         puppetSound(3, pSoundDown)
  183.       end if
  184.   end case
  185.   xxxxx = the currentSpriteNum
  186.   sprite(the currentSpriteNum).cursor = -1
  187. end
  188.