home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club KidSoft Volume 3 #1
/
ClubKidsoft.iso
/
movies
/
cover.dir
/
00012_Script_12
< prev
next >
Wrap
Text File
|
1995-02-08
|
2KB
|
90 lines
-- KeyDown in FunWord field
--on keyDown
-- if the commandDown = TRUE then -- Let command keys through
-- pass
--
-- else
-- set curKey = charToNum(the key)
--
-- --put curKey
-- if curKey = 9 then -- tab
-- set the editableText of sprite 2 to TRUE
-- set the editableText of sprite 6 to FALSE
-- hilite field "Fun Word"
--
-- else if IsOKCancelKey(the key) = "OK" then
-- puppetSprite 2, FALSE
-- puppetSprite 6, FALSE
--
-- set the visible of sprite 5 to TRUE
-- updateStage
-- DelayFor 6
-- set the visible of sprite 5 to FALSE
-- updateStage
-- RegisterNow
--
-- else if (curKey < 48) or (curKey > 57 and curKey < 65) and (curKey > 90 and curKey < 97) or (curKey > 122) then
-- -- not a letter or number
--
-- else
-- pass
-- end if
--
-- end if
--end
--
--on keyUp
-- if the editableText of sprite 6 = TRUE then
-- put FormatFunWord(FormalizeFunWord(field "Fun Word")) into field "Fun Word"
-- end if
--end
on mouseDown
set the editableText of sprite 2 to TRUE
set the editableText of sprite 6 to FALSE
end
on keyDown
if the commandDown = TRUE then -- Let command keys through
pass
else
set curKey = charToNum(the key)
if curKey = 9 then -- tab key
EditRegCode
else if IsOKCancelKey(the key) = "OK" then
set the visible of sprite 5 to TRUE
updateStage
DelayFor 6
set the visible of sprite 5 to FALSE
updateStage
CLICK
RegisterNow
else if curKey = 8 then -- Allow delete key
set curStr = field "Fun Word"
set numChars = the number of chars of curStr
delete char numChars of curStr
put curStr into field "Fun Word"
else if (curKey < 48) or (curKey > 57 and curKey < 65) and (curKey > 90 and curKey < 97) or (curKey > 122) then
-- Ignore the key if not a letter (upper or lower)
else -- must be a number or letter key
set numChars = the number of chars of field "Fun Word"
if numChars = 8 then exit
if curKey >= 97 then
set curKey = curKey - 32
end if
put numToChar(curKey) after field "Fun Word"
end if
set the selEnd to 100
set the selStart to 100
end if
end