Highlighting Text on MouseOver
Mac OS 9 Mac OS X Windows Linux

>I would like to implement text that hilites itself on mouse over like RR
>uses in its documentation. Anybody have an script example I could look at?

Here’s an example I posted a few weeks back, replying to a similar query:

---------

Here’s a simplified version which you can place in a field’s script. To make a word or phrase “highlightable”, change its text style to “link”. You may also want to turn off link coloring and link underlining in the Stack Properties palette.
on mouseMove
  -- first unhighlight the "old" phrase if necessary
  if the storedHilitedChunk of this stack is not empty \
      and the storedHilitedChunk of this stack is not the mouseChunk then
    do "set the backgroundColor of" && \
        (the storedHilitedChunk of this stack) && "to empty"
    set the storedHilitedChunk of this stack to empty
  end if
  if the mouseChunk is not empty \
      and "link" is in the textStyle of the mouseChunk then
    set the storedHilitedChunk of this stack to the mouseChunk
      -- save for later unhighlighting
    set the backgroundColor of the mouseChunk to "yellow"
  end if
  pass mouseMove
end mouseMove

on mouseLeave
  if the storedHilitedChunk of this stack is not empty then
    do "set the backgroundColor of" && \
       (the storedHilitedChunk of this stack) && "to empty"
    set the storedHilitedChunk of this stack to empty
  end if
  pass mouseLeave
end mouseLeave
				
Posted 2/8/2002 by Jeanne DeVoto to the Use Revolution List   (See the complete post/thread)