home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global DBfact, TBfact, gDb, gTB, gSoundLevel, gThumbPuppet, gBrowser
- clearGlobals()
- new(script "BrowserClass", "htmlsource")
- openXLib(the pathName & "xtras:FileIOXtraFat")
- set gOSDir to getOSDirectory()
- put gOSDir & "Preferences:" into field "OSPath"
- put gOSDir & "Preferences:Browser" into field "ThePath"
- loadBrowser()
- setVolumePos()
- if the optionDown = 1 then
- go("import")
- end if
- set the text of field "catsort" to "Free Stuff"
- put the locH of sprite 18
- put the locV of sprite 18
- puppetSprite(20, 1)
- set the moveableSprite of sprite 20 to 1
- set the constraint of sprite 20 to 19
- puppetSprite(22, 1)
- set the moveableSprite of sprite 22 to 1
- set the constraint of sprite 22 to 21
- puppetSprite(23, 1)
- end
-
- on resetThumb thumbname
- puppetSprite(castspritea(thumbname), 1)
- set the locV of sprite castspritea(thumbname) to 182
- updateStage()
- puppetSprite(castspritea(thumbname), 0)
- end
-
- on scrollthumb minscroll, maxscroll, scrollfield, maxval
- set spritenum to the clickOn
- set thumb to the memberNum of sprite spritenum
- puppetSprite(spritenum, 1)
- updateStage()
- set curv to the mouseV
- set delta to curv - the locV of sprite spritenum
- if stringp(scrollfield) then
- set curlineheight to the textHeight of member scrollfield
- set lineCount to the lineCount of member scrollfield
- set totalheight to curlineheight * lineCount
- set pageHeight to the pageHeight of member scrollfield
- set remainder to totalheight - pageHeight + 1
- if not voidp(maxval) then
- set callback to replace(string(maxval), "'", QUOTE)
- set callback to replace(callback, ";", RETURN)
- else
- set callback to #null
- end if
- else
- if symbolp(scrollfield) then
- set callback to replace(scrollfield, "'", QUOTE)
- set callback to replace(callback, ";", RETURN)
- end if
- end if
- repeat while the mouseDown
- if totalheight <= pageHeight then
- exit repeat
- end if
- set curv to min(max(the mouseV - delta, minscroll), maxscroll)
- set target to (curv - minscroll) * remainder / (maxscroll - minscroll)
- set the locV of sprite spritenum to curv
- updateStage()
- if stringp(scrollfield) then
- set the scrollTop of member scrollfield to curlineheight * integer((curv - minscroll) * remainder / ((maxscroll - minscroll) * curlineheight))
- end if
- if callback <> #null then
- do(callback && target)
- end if
- end repeat
- set the memberNum of sprite spritenum to thumb
- updateStage()
- end
-
- on scroll direction, minscroll, maxscroll, scrollfield, thumbsymbol
- set scrollfield to string(scrollfield)
- set thumb to castspritea(string(thumbsymbol))
- set curlineheight to the textHeight of member scrollfield
- set lineCount to the lineCount of member scrollfield
- set totalheight to curlineheight * lineCount
- set pageHeight to the pageHeight of member scrollfield
- set remainder to totalheight - pageHeight
- if totalheight <= pageHeight then
- exit
- end if
- repeat while the mouseDown
- set oldpos to the scrollTop of member scrollfield
- set pos to min(max(oldpos + (curlineheight * direction), 0), remainder)
- set the scrollTop of member scrollfield to pos
- set the locV of sprite thumb to minscroll + (pos * (maxscroll - minscroll) / remainder)
- updateStage()
- if not soundBusy(2) then
- puppetSound(2, 0)
- puppetSound(2, "Teletype A")
- end if
- end repeat
- puppetSound(2, 0)
- puppetSprite(thumb, 1)
- end
-
- on replace basetext, oldtext, newtext
- set buffer to EMPTY
- set pos to offset(oldtext, basetext)
- repeat while pos > 0
- if pos > 1 then
- set buffer to buffer & char 1 to pos - 1 of basetext & newtext
- delete char 1 to pos + length(oldtext) - 1 of basetext
- else
- set buffer to buffer & newtext
- delete char 1 to length(oldtext) of basetext
- end if
- set pos to offset(oldtext, basetext)
- end repeat
- set buffer to buffer & basetext
- return buffer
- end
-
- on squawkBox
- set x to 0
- set x to random(5)
- set volSet to the volume of sound 1
- set the volume of sound 1 to 40
- puppetSound(1, 0)
- puppetSound(1, "vox" & x)
- repeat while soundBusy(1)
- set the visible of sprite 3 to 1
- updateStage()
- end repeat
- set the visible of sprite 3 to 0
- set the volume of sound 1 to volSet
- end
-
- on setVolumePos
- case the soundLevel of
- 0:
- set the locH of sprite 18 to 514
- 1:
- set the locH of sprite 18 to 524
- 2:
- set the locH of sprite 18 to 538
- 3:
- set the locH of sprite 18 to 552
- 4:
- set the locH of sprite 18 to 566
- 5:
- set the locH of sprite 18 to 580
- 6:
- set the locH of sprite 18 to 593
- 7:
- set the locH of sprite 18 to 606
- end case
- end
-
- on setvolume
- if the locH of sprite 18 <= 514 then
- set the soundLevel to 0
- end if
- if the locH of sprite 18 > 514 then
- set the soundLevel to 1
- end if
- if the locH of sprite 18 > 524 then
- set the soundLevel to 2
- end if
- if the locH of sprite 18 > 538 then
- set the soundLevel to 3
- end if
- if the locH of sprite 18 > 552 then
- set the soundLevel to 4
- end if
- if the locH of sprite 18 > 566 then
- set the soundLevel to 5
- end if
- if the locH of sprite 18 > 580 then
- set the soundLevel to 6
- end if
- if the locH of sprite 18 > 593 then
- set the soundLevel to 7
- end if
- end
-