This content has been marked as final. Show 3 replies
You must detect key strokes using one of several methods. I use an
exitFrame handler with a case statement and keyCodes:
on exitFrame me
case (the keyCode) of
13: -- Carriage return
-- code here when CR is hit
46: -- this is some ascii code for a alpha char
-- code here when that alpha char is hit
of course you would use the keyCodes from the arrow keys. You can get them
by putting "the keyCode" (without quotes) into the object inspector then
hitting the up and down arrow keys separately and noting the value of the
keyCode. A director movie must be running and the stage must have focus
for the values to be captured. Or you could use "put the keyCode" in an
exitFrame handler and check the message window for the numbers. Of course
the message window will fill up pretty fast so I recommend the first method.
Then, within the cases for up and down arrows you use the scrollLine and/or
scrollPage methods to move the text in the field/text member up or down.
This is a simplified answer because correct coding always requires checks
and monitoring that I haven't listed here. It's not critical but makes for
cleaner code and operation.
"Almudever" <email@example.com> wrote in message
>I want to scroll the text up and down with the keyboard. With the arrow
>keys up and down.
> How is it possible?
You can find demo and source for a custom scroll bar here. This includes a ScrollByArrows behavior, attached to the lower of the two scrolling sprites. You could use this as a starting point for a behavior of your own.