hiliting a word

Nicolas Cueto nicolas_cueto at yahoo.com
Thu Mar 3 02:10:56 EST 2005


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

This script words as far as selecting and placing the word into the
variable. However, the textColor change persists for that one word, instead
of returning to its original color.

So, failing a better scripting solution than the above one, my question then
is how do I reset the textColor of the selected word and/or the entire
field? I tried "set the textColor" of the entire field but no luck.. Of
course, I could use the clickChunk info to manually recolor each word, but
something tells me that there must be a better way.

Thank you.

Cheers,
Nicolas Cueto
niconiko language school




More information about the use-livecode mailing list