Newbie Puzzled by Deleting Card

Ken Ray kray at sonsothunder.com
Thu Oct 31 13:56:00 EST 2002


Dave,

The problem is you can't delete the card because the button's script is
running and the button is on the card you're trying to delete. The simple
approach is a "send" command that is delayed a few milliseconds; just long
enough for the button's script to complete. Something like:

on mouseUp
  send "delete this card" to this card in 10 milliseconds
end mouseUp

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: <dave.mckee at shaw.ca>
To: <use-revolution at lists.runrev.com>
Sent: Thursday, October 31, 2002 11:47 AM
Subject: Newbie Puzzled by Deleting Card


> I have OS 10.2.1 running and am trying out revolution 1.1.1 and have run
into something strange;
>
> If I have 2 cards and each card has one button with the following script;
>
> on mouseup
>   delete this card
> end mouseup
>
> and then if I click on the button on either card, I get the following
error;
>
>  . There was an Execution Error at 9:45:15 AM
> Error description:  Chunk: can't delete object
> Object: button id 1005 of card id 1004 of stack "Untitled 1"
> --------------------
> delete this card
> --------------------
> Value: mouseup
>
>
>
> What am I doing wrong ?  There must be something so painfully obvious
about this that I just can not see why the script produces an error.
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list