Hi Robert,
This is a problem of a MIAW on Macintosh. The 'keyDown' event is not
received in a MIAW and passed to the stage. The sample scripts below
are to send back the event from the stage and to receive it by the
sprite that the behavior is attached in a MIAW.
_____
Robert Wright wrote:
> I'm having trouble getting a clipboard features behavior to work on a field
> in a MIAW. I've narrowed it down to the lingo within an "if the
> commandDown..." statement is never getting called. I've tried just using
> this simple script:
>
> on keyDown me
> if the commandDown then beep
> end
Good luck,
Fumio Nonaka
Attain Corporation
[EMAIL PROTECTED]
------------------------------------------------------
-- Getting the keyDown message form the stage behavior
-- For field sprite
------------------------------------------------------
on beginSprite me
-- Initializing for testing
the keyDownScript = "put #keydown"
sprite(me.spriteNum).member.editable = true
me.xSetKeyDownBack()
end
on keyDown me
alert string([#key: the key, #movie: the movieName])
end
on xSetKeyDownBack me
-- Sending the sprite number to the stage
tell the stage
call(#xSendKeyDownTo, the actorList, me.spriteNum)
end tell
end
-------------------------------------
-- Sending state of MIAW to the stage
-- Movie script
-------------------------------------
on activateWindow
-- Sending the message of activated MIAW
sActiveWindow = the activeWindow
tell the stage
call(#xActivateMIAW, the actorList, sActiveWindow)
end tell
end
on deactivateWindow me
-- Sending the message of deactivated MIAW
sActiveWindow = the activeWindow
tell the stage
call(#xDeactivateMIAW, the actorList, sActiveWindow)
end tell
end
------------------------------------------
-- Sending back the keyDown event behavior
-- For a sprite in the stage
------------------------------------------
property psMIAW, pnMIAWSpriteNum, psKeyDownScript, pbMIAWActive
on beginSprite me
-- Initialize for testing
sprite(me.spriteNum).member.editable = true
sMIAW = the moviePath & "KeyDownMIAW85"
me.xOpenMIAW(sMIAW)
the keyDownScript = "put [#init: the key, #movie: the movieName]"
end
on endSprite me
-- Cleanup to finish test
me.xForget()
the keyDownScript = empty
end
on xOpenMIAW me, sMIAW
-- Opening a MIAW and activating the behavior
(the actorList).append(me)
psMIAW = sMIAW
pbMIAWActive = true
open window(psMIAW)
end
on xForget me
-- Forgetting a MIAW and deactivating the behavior
forget window(psMIAW)
(the actorList).deleteOne(me)
the keyDownScript = psKeyDownScript
end
on xSendKeyDownTo me, nMIAWSpriteNam
-- Setting a target sprite in the MIAW
pnMIAWSpriteNum = nMIAWSpriteNam
psKeyDownScript = the keyDownScript
the keyDownScript = "call(#xSendKeyDownToMIAW, the actorList)"
end
on xSendKeyDownToMIAW me
-- Sending back the keyDown event to the MIAW
if pbMIAWActive then
tell window(psMIAW)
do the keyDownScript
sendSprite(pnMIAWSpriteNum, #keyDown)
end tell
stopEvent
else
do psKeyDownScript
end if
end
on xActivateMIAW me, sActiveMIAW
-- Setting for activated MIAW
pbMIAWActive = true
end
on xDeactivateMIAW me, sActiveMIAW
-- Setting for deactivated MIAW
pbMIAWActive = false
end
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]
- <lingo-l> problem with the commandDown in a MIAW Robert Wright
- Re: <lingo-l> problem with the commandDown in a ... Fumio Nonaka
- Re: <lingo-l> problem with the commandDown i... Fumio Nonaka
- RE: <lingo-l> problem with the commandDown in a ... Robert Wingate
