anyway to make a field or button delete itself

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kcwvc52
Posts: 49
Joined: Sun Jun 12, 2011 9:55 pm

anyway to make a field or button delete itself

Post by kcwvc52 » Sun Oct 30, 2011 9:53 pm

I have tried to create and external button and make it wait 30 ticks but it just seems like livecode has no way of allowing a single field or button to delete itself. it throws an error and says that the script is still executing but i do not care all the important stuff is done and i want it to delete itself.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: anyway to make a field or button delete itself

Post by Mark » Sun Oct 30, 2011 9:57 pm

Hi,

Code: Select all

// stack script:
on deleteObject theObject
  delete theObject
end deleteObject

// object script:
on deleteMe
  put the long id of me into myObject
  send "delete myObject" to this stack in 0 millisecs
end deleteMe
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply