HTMLtext is a crasher - BrowserX is not!

Mark Brownell gizmotron at earthlink.net
Fri Jan 16 11:28:14 EST 2004


On Friday, January 16, 2004, at 05:19  AM, xbury.cs at clearstream.com 
wrote:

> Now, they are clickeable, Im looking for a way to make them appear in a
> separate field when you hover over them... Anyone got an idea on how 
> to do that?
> (on hoverlink would be nice!)
>
> Cheers and happy browsing!
> Xavier

I put this into my field that the links are in. On roll-over links puts 
an image into field "linkL" and the link's destination cleaned up and 
displayed into field "linkR"

on mouseDown
   global transMoveX
   put TRUE into transMoveX
end mouseDown

on mouseUp
    global transMoveX
    ..... other stuff here first
    put FALSE into transMoveX
end mouseUp

on mouseWithin
   global transMoveX
   if transMoveX = FALSE then
     if the textstyle of the mouseText = "link" then
       put the htmlText of the mouseText into blip
       put the mouseText into blap
       --
       replace "<a href=" with empty in blip
       put ">" & blap & "</a>" into tx
       replace tx with empty in blip
       put offset("<font", blip) into tNum1
       put offset(">", blip,tNum1) into tNum4
       replace "</font>" with empty in blip
       if tNum1 < 1 then
       else
         delete char tNum1 to (tNum1 + tNum4) of blip
       end if
       if char 5 to 8 of blip = "buy=" then
         put "<p>Go to purchase this product with your purchase key 
already placed on your clipboard</p>" into blip
       end if
       put "<p><img src=" & quote & "linkX" & quote & "></img> </p> " 
into blip2
       set the HTMLText of field "linkL" to blip2
       set the HTMLText of field "linkR" to blip
     else
       put "" into field "linkL"
       put "" into field "linkR"
     end if
   else
   end if
end mouseWithin

Hope this helps.

Mark Brownell



More information about the use-livecode mailing list