The property “name” refers to more than “ticket”, it also includes the
description of the control, in your case the name will be “image ticket”.
You also will need to count down from the number of images in order to delete
all of them, otherwise you will run into a situation where x is higher than the
number of images still on your card
Use short name instead of name, this will script will work:
on mouseUp
put the number of images of this card into tImages
repeat with x = tImages down to 1
if the short name of image x = “ticket” then
delete image x
end if
end repeat
end mouseUp
> 17. jan. 2018 kl. 23:25 skrev William de Smet via use-livecode
> <[email protected]>:
>
> Hi there,
>
> I have several cloned images and all have the same name: ticket.
> Of course there ID is different.
> On close card I want to delete them.
> How do I delete them all at once?
> Wat is wrong with this code?
>
> on mouseup
> repeat with x= 1 to the number of images of this card
> if the name of image x is "ticket" then put the ID of image x into GONE
> end repeat
> send ("delete GONE") to me in 0 ticks
> end mouseup
>
>
>
>
> greetings,
>
> William
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode