I'm trying to create a button that acts as a trash can of sorts.
The button will sit at the bottom of the screen and I would like it so any object that it slid into it will be deleted.
I'm not sure why it's so hard to find an example. Thanks for any help.
Create a button that deletes objects when they touch it?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Create a button that deletes objects when they touch it?
Hi Sinep,
I dont know if that way is the best way but you can try it
object script obj you want delete :
cd script :
Best regards
Jean-Marc
I dont know if that way is the best way but you can try it
object script obj you want delete :
Code: Select all
on mousedown
grab me
end mousedown
on mouseUp
deControlMU
end mouseUp
Code: Select all
on deControlMU
put the short id of the target into tTargetID
if intersect(the target,btn "bPoubelle") then
send "deleteMyObject tTargetID" to me in 10 milliseconds
end if
end deControlMU
on deleteMyObject pID
delete control id pID
end deleteMyObject
Jean-Marc
https://alternatic.ch