Clicking on linked text sends a mouseLeave message?
Jim Hurley
jhurley at infostations.com
Thu Jul 24 16:51:15 EDT 2003
The script below allows students to click on various words
("objective lens", "ocular lens" etc.) in a "Help field" and an arrow
is drawn from the linked word or phrase to the object in question.
But I want the arrow to go away (set the points of graphic "arrow" to
empty) when the the mouse leaves the field.
But my handler "mouseLeave" beeps every time I click on a link, the
arrow flashes but immediately disappears.
Why should clicking on a link send a mouseLeave message?
If I omit the mouseLeave handler, the arrow appears and stays as it
should. (But of course it doesn't go away when the mouse leaves the
field.)
on mouseUP
if there is no graphic "arrow" then
set the style of the templateGraphic to "line"
set the endarrow of the templateGraphic to true
set the lineSize of the templateGraphic to 2
create graphic "arrow"
end if
put the mouseLoc into line 1 of tGraphicPoints --Set the start
point of the arrow
put the clicktext into what
switch what
case "objective lens"
put 869,217 into line 2 of tGraphicPoints -- Set the end point
break
case "ocular lens"
put 545,263 into line 2 of tGraphicPoints
break
case "focal point"
put 435,327 into line 2 of tGraphicPoints
break
default
put "" into line 2 of tGraphicPoints
break
end switch
set the points of graphic "arrow" to tGraphicPoints --Draw the arrow
send "choose the browse tool" to me in 1 tick
end mouseUp
on mouseLeave
beep
set the points of graphic "arrow" to ""
end mouseLeave
More information about the use-livecode
mailing list