Showing linkText on mouse over

Trevor DeVore lists at mangomultimedia.com
Fri Feb 24 14:49:08 EST 2006


On Feb 24, 2006, at 9:04 AM, Devin Asay wrote:

> I have an application with a field that can have link style text in  
> it. I wanted the contents of the linkText of link-style text to  
> show up in a field when you mouse over it, just like in a web  
> browser when you mouse over a hot link. So I wrote this handler in  
> the field.
>
> on mouseWithin
>   if the textStyle of the mouseText contains "link" then
>     put the linkText of the mouseText into fld "status"
>   else
>     put empty into fld "status"
>   end if
> end mouseWithin
>
> It works great, but it intermittently blocks the linkClicked  
> handler in the same field from executing. I assume it's because the  
> mouseWithin message is sent continuously and it's occasionally  
> blocking the mouse clicks. Can anyone suggest a more reliable way  
> to make these functionalities play nicely together?

Devin,

Would something like this work:

on mouseMove pX, pY
	if word 1 of the target is "field" then
		if the mouseChunk is not empty then
			get the linkText of the mouseChunk
			if it is not empty then
				set toolTip of the target to it
			else
				set toolTip of the target to empty
			end if
		end if
	end if
		
	pass mouseMove
end mouseMove

It just sets the tooltip of the field to the linkText which will  
appear below the cursor.


-- 
Trevor DeVore
Blue Mango Learning Systems - www.bluemangolearning.com
trevor at bluemangolearning.com





More information about the use-livecode mailing list