Prevent Button message from going to card handler - Solved

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
DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

Prevent Button message from going to card handler - Solved

Post by DR White » Sat Aug 12, 2017 2:12 pm

How do I Prevent Button message from going to card handler?

I thought a message would stop at the lowest level of execution, unless told to be passed.

Thanks,

David
Last edited by DR White on Sat Aug 12, 2017 3:45 pm, edited 1 time in total.

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: Prevent Button message from going to card handler

Post by LiveCode_Panos » Sat Aug 12, 2017 2:26 pm

Hi David,

Which message are you trying to trap?

Panos
--

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

Re: Prevent Button message from going to card handler

Post by DR White » Sat Aug 12, 2017 2:27 pm

I am trying to trap MouseDown

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Prevent Button message from going to card handler

Post by Randy Hengst » Sat Aug 12, 2017 2:54 pm

Double-check to make sure you have an “empty” mouseDown handler in the button. If there is no mouseDown handler in the button, then you will see the mouseDown in the card. I assume you have a mouseDown handler defined in the button script?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Prevent Button message from going to card handler

Post by richmond62 » Sat Aug 12, 2017 2:58 pm

Trapper.png
Trapper.livecode.zip
Here's the stack
(64.98 KiB) Downloaded 172 times
I'm not entirely sure why you have a problem.
I just made this very simple stack with a mouseDown script in both the card and a button.

Please can you either explain further and/or upload a stack demonstrating the problem.

DR White
Posts: 686
Joined: Fri Aug 23, 2013 12:29 pm
Location: Virginia, USA

Re: Prevent Button message from going to card handler

Post by DR White » Sat Aug 12, 2017 3:45 pm

richmond62,

Thanks so much for taking the time to post a simple stack that works.
It allowed me to see that my problem was a scripting issue.
My Card script had "MouseUp" and "MouseRelease" handlers that were getting messages from my button
that only had "MouseDown" handler. When I added "MouseUp" and "MouseRelease" handlers to my button,
no more messages were passed to card.

I Love this Forum.

Thanks,

David

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”