At 10:33 AM -0500 2/7/01, Gene Fritzinger wrote:
>Can someone suggest a way of setting the visible of a sprite based 
>upon the location of the cursor defined by  a .rect? eg (25, 25, 
>100, 100)
>


I would create an invisible rectangle (from the tool palette), adjust 
it to 75 by 75 pixels, and attach a behavior to it like this 
(untested):

property spriteNum
property pchControlledSprite  -- channel of the sprite you want to control

on getPropertyDescriptionList
   lDescription = [:]
   addProp(lDescription,#pchControlledSprite, [\
         #default:1,\
         #format:#integer,\
         #comment:"Which channel do you want to control?",\
         #range:[#min:1,#max:the lastChannel]])
   return lDescription
end getPropertyDescriptionList


-- This is for turning on when the mouse is over this sprite,
-- If you want to reverse this, change the TRUEs to FALSEs and vice versa
on beginSprite me
    sprite(pchControlledSprite).visibility = FALSE  -- start it off
end

on endSprite me
    sprite(pchControlledSprite).visibility = TRUE  -- turn it on at end
end

on mouseEnter me
    sprite(pchControlledSprite).visibility = TRUE  -- show it
end

on mouseLeave me
    sprite(pchControlledSprite).visibility = FALSE  -- hide it
end


Irv
-- 
Lingo / Director / Shockwave development for all occasions.

        (Over two millions lines of Lingo code served!)

[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