set gpointer to [the number of member "pointer", the number of member "pointer.mask"]
if the machineType = 256 then
openXLib(the pathName & "xtras\V12Dbe")
openXLib(the pathName & "xtras\V12Table")
openXLib(the pathName & "XTRAS\FileIO")
else
openXLib(the pathName & "xtras:V12Dbe")
openXLib(the pathName & "xtras:V12Table")
openXLib(the pathName & "XTRAS:FileIOXtraFat")
end if
set DBfact to xtra("V12Dbe")
set TBfact to xtra("V12Table")
set the visible of sprite 2 to 0
puppetSprite(5, 1)
set videosprite to 26
set imagesprite to 22
put EMPTY into field "zlist"
put EMPTY into field "zspecial"
put "All Demos" into field "fld"
loadBrowser()
if the optionDown = 1 then
go("choice")
else
nothing()
end if
end
on idle
set the visible of sprite 14 to rollOver(14)
set the visible of sprite 15 to rollOver(15)
set the visible of sprite 16 to rollOver(16)
set the visible of sprite 17 to rollOver(17)
set the visible of sprite 21 to rollOver(21)
end
on stopMovie
global gTB, gDb
set gTB to 0
set gDb to 0
end
on loadBrowser
global myFile
set gOSDir to getOSDirectory()
put gOSDir & "\" into field "OSPath"
put gOSDir & "\BROWSER.TXT" into field "ThePath"
set DaPath to field "ThePath"
if objectp(myFile) then
set myFile to 0
end if
set myFile to new(xtra("fileio"))
openFile(myFile, DaPath, 1)
set TheWeb to readLine(myFile)
put TheWeb into field "browserSelect"
closeFile(myFile)
set myFile to 0
end
on scrollthumb minscroll, maxscroll, scrollfield
set spritenum to the clickOn
set thumb to the memberNum of sprite spritenum
set thumbdown to the number of member (the name of member thumb & "Down")
puppetSprite(spritenum, 1)
set the memberNum of sprite spritenum to thumbdown
updateStage()
set curv to the mouseV
set delta to curv - the locV of sprite spritenum
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
repeat while the mouseDown
if totalheight <= pageHeight then
exit repeat
end if
set curv to min(max(the mouseV - delta, minscroll), maxscroll)
set the locV of sprite spritenum to curv
updateStage()
set the scrollTop of member scrollfield to curlineheight * integer((curv - minscroll) * remainder / ((maxscroll - minscroll) * curlineheight))
if not soundBusy(2) then
puppetSound(2, 0)
puppetSound(2, "Teletype A")
end if
end repeat
puppetSound(2, 0)
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 showInstall
set spritenum to castspritea("Install")
puppetSound(2, 0)
puppetSound(2, "blooip")
puppetSprite(spritenum, 1)
repeat with index = -8 to 8
set pos to index * 40
set the locH of sprite spritenum to pos
updateStage()
end repeat
end
on hideInstall
set spritenum to castspritea("Install")
if the locH of sprite spritenum <> 320 then
exit
end if
puppetSound(2, 0)
puppetSound(2, "pioolb")
puppetSprite(spritenum, 1)
repeat with index = 8 down to -8
set pos to index * 40
set the locH of sprite spritenum to pos
updateStage()
end repeat
end
on doPopMenu spritenum, h, v
set the visible of sprite spritenum to 1
set the locH of sprite spritenum to h
set the locV of sprite spritenum to v
updateStage()
set cNum to the castNum of sprite spritenum
set lastSelection to 0
set len to the number of lines in field cNum
repeat while the stillDown
set mc to the mouseLine
if (0 < mc) and (mc <= len) and rollOver(spritenum) then
if mc <> lastSelection then
set lastSelection to mc
hilite line mc of field cNum
updateStage()
end if
next repeat
end if
if mc <> lastSelection then
set lastSelection to -1
hilite line len + 1 of field cNum
updateStage()
end if
end repeat
set the visible of sprite spritenum to 0
set the visible of sprite 47 to 0
updateStage()
if line lastSelection of field cNum <> EMPTY then
return lastSelection
else
return -1
end if
end
on TrackClick
set spritenum to the clickOn
set offCast to the castNum of sprite spritenum
set onCast to offCast + 1
set the castNum of sprite spritenum to onCast
updateStage()
repeat while the mouseDown
if rollOver(spritenum) then
set the castNum of sprite spritenum to onCast
else
set the castNum of sprite spritenum to offCast
end if
updateStage()
end repeat
set the castNum of sprite spritenum to offCast
updateStage()
return rollOver(spritenum)
end
on buttonClick whichSprite
puppetSprite(whichSprite, 1)
set the locV of sprite whichSprite to the locV of sprite whichSprite + 1
set the locH of sprite whichSprite to the locH of sprite whichSprite + 1
updateStage()
end
on importFiles whichCastLib
alert("Please choose the text file list of the files to import. Please make sure that the files are located in the same directory as the list. Also, make sure that they are saved with the correct palette.")
set x to FileIO(mnew, "?read", EMPTY)
if objectp(x) then
set the text of field "newFileName" to x(mFileName)
x(mdispose)
else
set the text of field "newFileName" to EMPTY
end if
set i to the last item in field "newFileName"
importFileInto(member "the list" of castLib "internal", the text of field "newFilename")
if the text of field "newFilename" > EMPTY then
set the itemDelimiter to "."
delete char -30002 of i
set the text of field "files2import" to the text of member i
else
exit
end if
set the name of member i of castLib "internal" to "the list"
set x to 1
set y to the number of lines in field "files2import"
put y
delete char -30002 of field "newFileName"
repeat while x <= y
set name to line x of field "files2import"
put "Importing " & "'" & name & "'" into field "progress"
set thePath to the text of field "newfilename" & "\" & name
updateStage()
importFileInto(member x of castLib whichCastLib, thePath)