Deleting a Button by Clicking it

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Deleting a Button by Clicking it

Post by bqsbarbqGAnC5Z » Tue Feb 28, 2012 5:42 am

Hi all,

I was wondering how I could delete a button by clicking it whenever the button is intersecting with a certain object.

I have tried using:

on mouseUp
if intersect(this button, "Door", "opaque pixels" then
delete this button
end if
end mouseUp

However, this always seems to end up failing. Does anyone have any advice for me? Thanks a lot!

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Deleting a Button by Clicking it

Post by sturgis » Tue Feb 28, 2012 6:06 am

Hey, check out this thread. http://forums.runrev.com/viewtopic.php? ... ete+itself

You will want to do the intersect in the stack script (from that thread) so you'll want to pass "the long id of me" as well as a reference to the object to check intersect against.

also, i'm sure its a typo but if not, make sure you put the closing ) on your intersect function.

Post Reply