Hi Andre,
This is guesswork on my part but according to the message path diagram in
the User Guide, background scripts are executed after card scripts.  My
guess is that causes some sort of conflict due to deleting the card in a
script that is executing on the card to be deleted.

Moving it to the button means it is handled before the card comes into play
so maybe the conflict doesn't exist in those circumstances.

Once again, just a theory.

Pete
lcSQL Software <http://www.lcsql.com>



On Fri, Dec 21, 2012 at 3:14 AM, André Bisseret
<andre.bisse...@wanadoo.fr>wrote:

> Stating the problem as simply as possible :
>
> On a cards of a stack I have 2 buttons
> - New card
> - delete card
> they are grouped in group "grAction" (backgroundBehavior true)
>
> The script of group "grAction" is the following :
> -------
> on mouseUp
>     switch the short name of the target
>         case "New card"
>             create cd
>             break
>         case "delete card"
>           delete this cd
>     end switch
> end mouseUp
> -----------
> Button "new card" works as expected.
> Button "delete card" does not work
> I get: "can't delete object"
> and also (in Remo): "can't find object"
>
> Fortunately, if I put "delete this cd" as a mouseUp handler in btn "delete
> card" it works ;-))
>
> What am I missing
>
> Thanks for any hint
>
> Best regards from Grenoble
>
> André
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to