Script being inherited by other objects; bug?

Dave Cragg dave.cragg at lacscentre.co.uk
Tue Nov 6 17:26:45 EST 2007


On 6 Nov 2007, at 21:22, User wrote:
> I have a script attached to an image of a green arrow that I've  
> turned into a group with background behavior that also uses a  
> mouseEnter/mouseLeave with cursor changes.
>
> Problem is:  the cursor change happens with ALL visible images,  
> even thouse not having any scripts attached to them.  It also  
> happens in "development" mode.
>
> Does this sound like a bug?  I sent the stack (a whole, whopping 2  
> cards worth) to another Rev user; he couldn't save any changes to  
> the stack, confirmed the behavior and, what's more, when he tried  
> to save changes to the stack, Rev crashed on him.

Are the mouseEnter/mouseLeave handlers in the group script or the  
image script? If they are in the group script, this doesn't sound  
like a bug (apart from the crash).

If you have backgroundBehavior turned on, messages will pass from  
object to card to background (group). So a mouseEnter message on any  
object on the card will be handled by the background script (if it  
isn't handled earlier).

Possible workarounds:

-- Turn off background behavior of the group.
-- Check "the target" in the handlers to confirm it is the right  
object generating the mouseEnter message.
-- Put the script in the image object and not the group.

Cheers
Dave



More information about the use-livecode mailing list