home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Greatest Childrens Stories Ever Told
/
Greatest_Stories.iso
/
movies
/
pinochio
/
shared.dir
/
01010_Script_1010
< prev
next >
Wrap
Text File
|
1994-11-07
|
2KB
|
91 lines
--update 10/12/94 ch2/tales
-- button script
on doButton whichSprite,WHICHSCRIPT,keys
global keysprite,keyscript,oldcast,keyoldcastname
-- store original sprite information
set oldCast=the castNum of sprite whichSprite
set oldCastName=the name of cast oldCast
if oldcastname contains "depressed" then
-- set the castNum of sprite whichSprite=oldCastName
updatestage
beep 2
exit
else
set newCastName=oldCastName& ", depressed"
end if
set newCast=the number of cast newCastName
set the castNum of sprite whichSprite=newCast
updateStage
if keys then
setkeys true,whichsprite,whichscript,newcastname
zkeyup
end if
-- wait while the user has the button still pressed
startTimer
repeat while the timer<3 OR the stillDown
do ("nothing")
end repeat
if not keys then
-- restore button
if oldCastName="Text On" then
set oldCastName="Text Off"
else if oldCastName="Text Off" then
set oldCastName="Text On"
else if oldCastName="Sound On" then
set oldCastName="Sound Off"
else if oldCastName="Sound Off" then
set oldCastName="Sound On"
end if
set oldCast=the number of cast oldCastName
set the castNum of sprite whichSprite=oldCast
updateStage
end if
end
ON ZKEYUP
global keysprite,keyscript,oldcast,keyoldcastname
if not keyscript or ((KEYSCRIPT CONTAINS "GOAHEAD") AND (frame=marker(0)+2)) then
UPDATESTAGE
abort
end if
set oldcastname=keyoldcastname
-- restore button
if oldCastName contains "Text On" then
set oldCastName="Text Off"
else if oldCastName contains "Text Off" then
set oldCastName="Text On"
else if oldCastName contains "nomusica" then
set oldCastName="Sound Off"
else if oldCastName contains "musica" then
set oldCastName="Sound On"
end if
if oldcastname contains "depressed" then set oldCast=oldcast
else set oldCast=the number of cast oldCastName
set the castNum of sprite keySprite=oldCast
set oldcastname= the castNum of sprite keySprite
updateStage
DO keySCRIPT
setkeys false
END
on setkeys a,whichsprite,whichscript,oldcastname
global keysprite,keyscript,oldcast,keyoldcastname
if a then
set keysprite=whichsprite
set keyscript=whichscript
set keyoldcastname=oldcastname
else
set keysprite=0
set keyscript=0
set oldcastname=0
end if
exit
end