Harold's ArrowKey Handler problem (please enter a subject)

Mark Schonewille m.schonewille at economy-x-talk.com
Sun Apr 18 07:57:10 EDT 2010


Hi Harold,

Do you have your short arrowKey handler in a background or group? If  
so, you might want to set the hcBehavior of the group to true.  
Probably it would be still easier to move the script to stack level.  
You will also need to set the navigationArrows to true. I tried your  
short script and it works fine for me this way. Your long script  
should work fine, too (perhaps with some minor modifications).

Just in case you are using the cards of a RunRev stack as the records  
of a database: this is not recommended. Instead, use files, MySQL,  
SQlite, custom properties or one or more fields as containers. Use the  
card solely as your interface and not as a data holder. This is makes  
your stack often faster and you will be able to detach data from the  
standalone, which may be necessary. Naturally, if you have imported a  
HyperCard stack, this advice probably won't help you much until you  
start making brand new stacks with RunRev.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Share the clipboard of your computer with other computers on a local  
network with Clipboard Link
http://clipbaordlink.economy-x-talk.com

Op 18 apr 2010, om 13:29 heeft Haroldo Mauro Jr. het volgende  
geschreven:

> Hi everybody, I just joined this list. I used Hypercard for many  
> years, since I got my first Mac in 1991. Then, some years ago  
> swiched to  Supercard, which I've been using a lot.  I've had  
> Revolution Studio for over a year but only now am trying to use it  
> more steadly. So, here's what I need help with right now.
> In a converted Hypercard stack, an arrowKey handler in the stack  
> script is not behaving as expected. So I checked the Revolution  
> dictionary and found this example below, which I tested on my stack  
> and it didn't work, just the same:
>
> (example from Rev dictionary)
> on arrowKey theKey -- make Up arrow go to the first card
>  if theKey is "up" then go to card 1
>  else pass arrowKey
> end arrowKey
>
> Instead of going to card 1 it kept going to the next card each time  
> I pressed the up arrow key, and after the last card the stack just  
> closed.
>
> Here's my original handler, from the Hypercard stack script, which  
> doens't work:
> (handler is in stack script)
> on arrowKey whichKey
>  if whichKey is "right" then
>    if the optionKey is down then
>      go first card of next bg
>    else
>      go next card of this bg
>    end if
>  end if
>  if whichKey is "left" then
>    if the optionKey is down then
>      go last card of previous bg
>    else
>      go previous card of this bg
>    end if
>  end if
> end arrowKey
>
> Any help would be appreciated. Thank you.
> Harold




More information about the use-livecode mailing list