Showing linkText on mouse over

Jonathan Lynch jonathandlynch at gmail.com
Fri Feb 24 13:10:42 EST 2006


hello,

What I mean is this:

Pretend the following is a link:    Q


When your mouse moves over the Q, you display a field that shows the content
of the linktext. You have to make sure the position of that field does not
cover the link, and that it moves with the mouse.

Like this (untested, but derived from a longer working script):

on mousemove
  if the mousecharchunk <> empty and the linktext of the mousecharchunk <>
empty then
   set the cursor to Hand
   lock cursor
   put the linktext of the mousecharchunk into field "display field"
   put the mouseloc into tLoc
   put (item 1 of tLoc) - 10 into Y
   put (item 2 of tLoc) - (the width of field "display field")/2 into X
   set the topleft of field "display field" to X,Y
   set the visible of field "display field" to true
  else
   unlock cursor
   if the visible of field "display field" = true then
     set the visible of field "display field" to false
   end if
  end if
end mousemove


The actual script I use is more complex, because it adjusts the size of the
display field as needed, and has corrections to keep the field within the
stack window, and does a bunch of other stuff - but this is the basic idea.



More information about the use-livecode mailing list