Trap/script for arrow keys?

Monte Goulding monte at sweattechnologies.com
Thu Mar 6 18:52:01 EST 2003


Try

on arrowKey tKey
	put the loc of btn "Fish" into tLoc
  	switch tKey
    	case "left"
   		subtract 10 from item 1 of tLoc
  		break
    	case "right"
		add 10 to item 1 of tLoc
  		break
	case "up"
		subtract 10 from item 2 of tLoc
	case "down"
		add 10 to item 2 of tLoc
		break
 	end switch
 	set the loc of btn "Fish" to tLoc
end arrowKey

Put it in the card script

Cheers

Monte

> 
> 
> Still doesn't work:
> 
> on arrowKey tKey
>   switch tKey
>     case "left"
>    subtract "10" from theYcoord
>   set the loc of btn "Fish" to theXcoord,theYcoord
>     break
>     case "right"
> add 10 to theYcoord
>   set the loc of btn "Fish" to theXcoord,theYcoord
> 
>     break
> case "up"
> subtract 10 from theXcoord
>   set the loc of btn "Fish" to theXcoord,theYcoord
> break
> case "down"
> add 10 to theXcoord
>   set the loc of btn "Fish" to theXcoord,theYcoord
> break
>   end switch
> end arrowKey
> 
> 
> ???
> 
> Judy
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list