Passing Click from Image to Field?

Scott Rossi scott at tactilemedia.com
Tue Dec 28 17:26:26 EST 2004


Recently, J. Landman Gay wrote:

> This will calculate a line number based on the click location

Dude, you rule.  Your function with bit of modification works:

on mouseUp
  put clickToLine(tFldNum)
end mouseUp

function clickToLine tFldNum
  put item 2 of the rect of fld tFldNum into T
  put the effective textHeight of fld tFldNum into H
  put (the scroll of fld tFldNum) div \
      (the effective textHeight of fld tFldNum) into S
  return (the clickV - T) div H + 1 + S
end clickToLine

Now to see if this can work in the real stack.  :-)

Regards,

Scott Rossi
Creative Director
Tactile Media, Development & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list