<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0">In a message dated 28/08/2003 10:19:35 PM GMT Daylight Time, use-revolution-request@lists.runrev.com writes:<BR>
> Thanks to Dar, Sarah, and Monte for a solution to this.  I was able to use a<BR>
> combination of your suggestions to make it work.  If anyone is interested,<BR>
> here's my final script for this:<BR>
> <BR>
> on mouseMove pMouseH, pMouseV<BR>
 > -- only if we're timing<BR>
>  if the cTiming of this stack and the cShowGuide of this stack then<BR>
>   put (pMouseV - the top of fld "myText" + the margins of fld "myText") \<BR>
> div (the textHeight of fld "myText") into tLineNum<BR>
>   if tLineNum is 0 then<BR>
>    put 1 into tLineNum<BR>
>   end if<BR>
>   if tLineNum >(the height of fld "myText" div the textHeight of fld<BR>
> "myText") then<BR>
>    put (the height of fld "myText" div the textHeight of fld "myText")<BR>
> into tLineNum<BR>
>   end if<BR>
>   set the top of grc "ReadingGuide" to the top of fld "myText" + \<BR>
>     (the margins of fld "myText" div 2) + (the textHeight of fld<BR>
> "myText" * (tLineNum-1))<BR>
>  end if<BR>
<BR>
<BR>
Small point: the above needs "the effective textHeight" to avoid an inherited empty textHeight and a div.zero error.<BR>
<BR>
A one-liner version is...<BR>
<BR>
set the top of grc "ReadingGuide" to max(the top of fld "myText", min(the bottom of fld "myText",item 2 of the mouseLoc))<BR>
<BR>
TIP:<BR>
max (a, min (b, var) ) ... is a useful general constraining algorithm for all sorts of things where the minimum value is "a" and the maximum value is "b" and the changing value is "var". Useful, for example, in a stack resize with minWidth and maxWidth, or ensuring an object lies between two values like the left of the card and the right of the card. Or when any value has an upper and lower limit. Also very powerful when used in conjuction with setProp.<BR>
<BR>
/H<BR>
<BR>
_________________________________________________<BR>
Hugh Senior<BR>
The Flexible Learning Company<BR>
Consultant Programming & Software Solutions<BR>
Fax/Voice: +44 (0)1483.27 87 27<BR>
Email: mailto:h@flexibleLearning.com<BR>
Web: www.flexibleLearning.com</FONT></HTML>