Page 1 of 1

On arrowKey issue, changing cards

Posted: Sun Dec 12, 2010 7:52 pm
by matt
Hi Everyone, I have a memorizer stack that works great within Rev on my Mac but intermittently causes the card to change unexpectedly when the stack is made into a Windows standalone. I'm using rev 4 still, if that matters. The script is on my main card of my stack and looks like what I've pasted below (I replaced some code with ellipses to shorten this post, but all that does is change the color of the text in the main field, word by word). On Windows, what happens is that the first couple of times I use the left or right arrow, the card will change. Then by the third or fourth press the behaviour will start working as expected on the card's main field to show or hide the text the user is trying to memorize. Thanks for any advice. I'm hoping someone else on the forum has run into this before. -Matt

Code: Select all

on arrowKey the key
case "left"
...
exit switch
case "right" 
...
exit switch
end arrowKey

Re: On arrowKey issue, changing cards

Posted: Sun Dec 12, 2010 7:54 pm
by Janschenkel
Check out the documentation for the navigationArrows global property.

Jan Schenkel.

Re: On arrowKey issue, changing cards

Posted: Sun Dec 12, 2010 8:48 pm
by matt
Jan, thank you! I should have thought to see whether there was a property involved, but it confused me that everything worked as expected except on Windows. I had gone through some of the early tutorials in which card navigation was tied to buttons and I thought that was always the way Rev handled movement between cards.

Re: On arrowKey issue, changing cards

Posted: Sun Dec 12, 2010 10:09 pm
by Klaus
Hi Matt,

some general hints, the script should look like this:

Code: Select all

on arrowKey the_key
## No space in parameter names!
  switch the_key
   case "left"
   ...
  BREAK
## Keep correct "switch" syntax, remember Murphys law ;-)
   case "right" 
   ...
  BREAK
  end switch
end arrowKey
8)

Best

Klaus