Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
i scroll image and when a image leaves the screen to the left, i delete him exept the floor but after delete i have a error to the line put the short name of image x into nomImage
repeat with x=1 to the number of images of card "niveau 1"
put x & cr after message
put the short name of image x into nomImage
if not(nomImage contains "sun" ) and not(nomImage contains "sky" ) then
set the loc of image nomImage to (item 1 of the location of image x - 10), (item 2 of the loc of image x)
if not(nomImage contains "floor" ) then
if the right of image nomImage < 0 then
delete image nomImage
end if
end if
end if
end repeat
When looping with index from 1 upwards, if you delete an object with that index number then on the next loop your index will have been incremented but the set of objects will not have a "gap" so if you deleted image 4 then next loop you will still have an image 4 but it was image 5 last time. The index will now be 5 though, but image 5 has become image 4 and so the index no longer corresponds to the relevant image.
When looping like this where the index and the set over which you are iterating may chang, start at the end and count downwards.
repeat with x=the number of images of card "niveau 1" down to 1