mouseEnter-Leave conundrum

J. Landman Gay jacque at hyperactivesw.com
Mon May 14 17:01:19 EDT 2007


J. Landman Gay wrote:

> I might try something like this instead:
> 
> local sObj
> 
> on mouseEnter
>   if the name of the target contains "graphic" then
>     put the name of the target into sObj
>   end if
> end mouseEnter
> 
> on mouseMove x,y
>   if sObj = "" then pass mouseMove
>   if x,y is not within the rect of sObj then
>     hide fld "field1"
>     put "" into sObj
>   else
>     show fld "field1"
>   end if
> end mouseMove

I just tried it with multiple fields and graphics. You need this version:

local sObj

on mouseEnter
   if the name of the target contains "graphic" then
     if sObj <> "" then
       put last char of of the short name of sObj into tNum
       hide fld ("field"&tNum)
     end if
     put the name of the target into sObj
   end if
end mouseEnter

on mouseMove x,y
   if sObj = "" then pass mouseMove
   put last char of of the short name of sObj into tNum
   if x,y is not within the rect of sObj then
     hide fld ("field"&tNum)
     put "" into sObj
   else
     show fld ("field"&tNum)
   end if
end mouseMove

I'm afraid you do lose the fine distinction between "the rect" of the 
graphic and its actual outline, but the behavior comes close to what you 
want I think.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list