home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Stickerpedia Stickerbook
/
Stickerbook.iso
/
pc
/
DATA
/
main.dxr
/
00001_Script_1
next >
Wrap
Text File
|
2003-03-24
|
5KB
|
215 lines
--\
main
global gPasswordDinos
global gPasswordAnimals
global gPasswordOceans
global gCastLibs
global gWhichCD
global gDontReact
global gImageList
global oMarvin
global gPathDelim
global gCurImagePath
global gCurImageName
global gImportMember
global gImageMode
on prepareMovie
cleartextMembers
gImportMember = member ("placeholder", "Internal")
end
on stopMovie
cleartextMembers
end
on cleartextMembers
member("password").text = ""
member("imageID").text = ""
end
on checkPassword
retVal = "error"
gDontReact = 1
if (member("password").text = gPasswordDinos ) then
gWhichCD = "dinos"
gDontReact = 0
retVal = "ok"
else if (member("password").text = gPasswordAnimals ) then
gWhichCD = "animals"
gDontReact = 0
retVal = "ok"
else if (member("password").text = gPasswordOceans ) then
gWhichCD = "oceans"
gDontReact = 0
retVal = "ok"
else if (member("password").text = "goilheimer" ) then
retVal = "goilheimer"
gDontReact = 0
else
gDontReact = 1
end if
if retVal = "ok" then
setPreferences
end if
return retVal
end
on wrongPassword
sendallSprites #showPWalert
member("password").text = ""
gDontReact = 1
end
on wrongimageID
sendallSprites #showImageAlert
member("imageID").text = ""
gDontReact = 1
end
on checkImage
retVal = "error"
imageName = eliminateSpaces (oMarvin, (member("imageID").text))
numberOfChars = imageName.length
-- take apart into its constituent parts:
theLetter = imageName.char[1]
if not ("aod" contains theLetter) then
theLetter = gWhichCD.char[1]
theNumber = chars(imageName, 1, numberOfChars)
else
if theLetter <> gWhichCD.char[1] then
return retVal
exit
end if
theNumber = chars(imageName, 2, numberOfChars)
end if
if gImageMode = #looseOnCD then
--try several options, in case input has been nitwittish
differentNameOptions = [(theLetter & theNumber & ".jpg"), (theLetter & theNumber & ".JPG"), ((switchCapitalLowerCase (oMarvin,theLetter)) & theNumber & ".jpg"), ((switchCapitalLowerCase (oMarvin,theLetter)) & theNumber & ".JPG")]
repeat with n in differentNameOptions
if getOne(gImageList, n) then
retVal = n
exit repeat
end if
end repeat
else if gImageMode = #inCast then
differentNameOptions = [(theLetter & theNumber), ((switchCapitalLowerCase (oMarvin,theLetter)) & theNumber)]
repeat with n in differentNameOptions
if getOne(gImageList, n) then
retVal = n
exit repeat
end if
end repeat
end if
member("imageID").text = ""
put "retVal" && retVal
return retVal
end
on showImage imageName
gCurImageName = imageName
if gImageMode = #looseOnCD then
gCurImagePath = the pathname & "images" & gPathDelim & gWhichCD & gPathDelim
importFileInto member("placeholder"), (gCurImagePath & gCurImageName)
gImportMember.name = "placeholder"
else
sendAllSprites #setSelectedImage(gCurImageName)
end if
member("gCurImage").text = imageName
member("imageID").text = imageName
sendAllSprites #showImage
end
on copyImage
set theDestination = baGetFolder( "c:\", "Please select a destination for the image,", 1, gWhichCD, -1, 0 )
-- put (theDestination & gCurImageName)
if (theDestination <> "") and (theDestination <> VOID) then
baCopyFile((gCurImagePath&gCurImageName), (theDestination & gCurImageName), "IfNewer")
end if
end
on printImage
if gImageMode = #looseOnCD then
print gImportMember
else
print member(gCurImageName, "images")
end if
end
on switchImage direction
theNumber = gCurImageName
theLetter = theNumber.char[1]
delete theNumber.char[1]
theNumber = integer(theNumber)
if not integerP(theNumber) then exit
newImageIname = theLetter & string(theNumber + direction)
put "newImageIname" && newImageIname
imageNameAfterThat = theLetter & string(theNumber + (direction*2))
if getOne(gImageList, newImageIname) then
if not getOne(gImageList, imageNameAfterThat) then
sendAllSprites #lastImage, direction
else
sendAllSprites #notLastImage, direction
end if
showImage newImageIname
else
exit
end if
end