Making an object permeable for events?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Making an object permeable for events?

Post by kcorey » Fri Feb 03, 2012 12:06 pm

Hi All,

I have an image that I'd like to use to highlight the user's last choice. It' an image that just adds a glow.

However if I put it on top, it eats all events so the object behind it isn't getting the event...so when the user clicks on the glowing past choice, nothing happens.

I was told to set a field to transparent for events I set the disabled to true. That was great for the field, but it doesn't seem to work for the image.

Anyone?

-Ken

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Making an object permeable for events?

Post by jmburnod » Fri Feb 03, 2012 2:40 pm

Hi Ken,

You can store the name of the last chooses object in a local variable or write a function to get the name of the objects behind your image and send the message to this object

Best regards

Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9729
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Making an object permeable for events?

Post by dunbarx » Fri Feb 03, 2012 2:43 pm

Pass the messages you want to the underlying object:

On mouseup
send "mouseUp" to theUnderlyingObject"
end mouseUp

This was a thread somewhere just a few weeks ago. Making objects transparent does not permit messages to pass through them. There is no "messageTransParent" property.

Craig Newman

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Making an object permeable for events?

Post by kevin11 » Sat Feb 04, 2012 11:57 am

I had a similar problem the other day. I resolved it by putting the objects in a group, and on a click (which is presumably returning your glow image), getting the owner of the glow image, which is the group. And then taking action based on what group had been clicked. Hope this helps.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Making an object permeable for events?

Post by jmburnod » Sat Feb 04, 2012 12:27 pm

Hi Ken,

If i understand what you want the stack in attachment maeby help you.

Best regards

Jean-Marc
Attachments
getUnderlyingObject.livecode.zip
(1.42 KiB) Downloaded 212 times
https://alternatic.ch

kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Re: Making an object permeable for events?

Post by kcorey » Mon Feb 06, 2012 8:46 am

Thanks for all your answers!

Actually, someone pointed out that though an image doesn't have a "enabled" checkbox in the IDE, you can still set the property via code:

set the disabled of image "blah" to true

Which accomplishes all that I needed.

-Ken

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”