At 11:14 AM -0800 1/13/2001, Kerry Thompson wrote:

>A side note--processing is faster if you do your if statement like this:
>
>if the mouseH < 475 then
>   if the mouseH > 385 then
>     if the mouseV < 393 then
>       if the mouseV > 370
>
>The way you have it written, Director will assess all the tests 
>connected by the AND. My example is a little harder to read at 
>first, but when one test fails, it skips the rest. The multiple if 
>procedure is faster 75% of the time.
>
>Another approach would be to have a transparent (NOT invisible) 
>vector graphic overlay and have it check for mouseWithin.


fwiw, I tend to use inside(point, rect) for this sort of thing. 
Haven't done any speed texts since it has always been fast enough. 
Advantages are that you can define the rect in one place and use any 
of the rect functions like inflate or offset to handle things like 
scrolling image maps, etc.
-- 

     Roy Pardi
---------------------------------------------------------------
Contract Multimedia Developer   +  Lingo Programmer
                                 [EMAIL PROTECTED]
---------------------------------------------------------------



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to