hiliting a word

Signe.Sanne at roman.uib.no Signe.Sanne at roman.uib.no
Thu Mar 3 02:29:43 EST 2005


Quoting Nicolas Cueto <nicolas_cueto at yahoo.com>:

> Hello All,
> 
> I'm after a hilited text effect. Namely, when a user clicks on a word
> displayed in locked text field, that one word:
> 
> 1) becomes hilited, i.e., it changes color
> 
> 2) becomes placed into a variable
> 
> My scription "solution" is this:
> 
> on mouseUp
>  put the clickChunk into tPos
>  set the textColor of char (word 2 of tPos) to (word 4 of tPos) of field
> "fText" to red
>  put char (word 2 of tPos) to (word 4 of tPos) of field "fText" into
> gSomeVariable
> end mouseUp

Try:
on mouseUp
  put the clickChunk into tPos
  put the textColor of char (word 2 of tPos) to (word 4 of tPos) of me into
tOriginalColor
  set the textColor of char (word 2 of tPos) to (word 4 of tPos) of me to red
  put char (word 2 of tPos) to (word 4 of tPos) of field 1 into gSomeVariable
  wait 30 ticks
  set the textColor of char 1 to -1 of me to tOriginalColor
end mouseUp

Signe Marie Sanne


More information about the Use-livecode mailing list