Page 1 of 1

Can't get rid of my last image by scripting

Posted: Sun Sep 15, 2019 4:58 pm
by pderks
Hi,

I have built a Slide Show stack, which displays the images of a long image file list.

When resetting the stack, the last shown image is still sitting there: script lines like
set the filename of image XY to empty
set the ID of image XX to 0
are ignored without message: the image keeps its filename and its ID.

However the msg box command "set the filename of image XY to empty" gets executed.

Do I have to delete the image (and to recreate it before next run) ?

Thanks in advance

Peter

Re: Can't get rid of my last image by scripting

Posted: Sun Sep 15, 2019 6:06 pm
by Klaus
Hi Peter,

I'm not sure if we are allowed to set any ID to ZERO!?
Does it work if you comment that line out?

Best

Klaus

Re: Can't get rid of my last image by scripting

Posted: Sun Sep 15, 2019 7:21 pm
by richmond62
Well, here we are . . .

, . . I just opened a new stack, 700 x 700 pixels with an image in it "PIC", 600,600
and set it's image source to a rather silly picture on my desktop.

I noticed one of two interesting things:

1. The filename of the image did NOT change when I set its image source.

2. The ID of the image did NOT change when I set its image source.

And, quite frankly, that really doesn't seem relevant.

HOWEVER . . . Boom-Boom-Boom-Ba-Di-Boom!

When I ran this script in a button:

Code: Select all

on mouseUp
   set the fileName of image "PIC" to " "
   end mouseUp
image "PIC" went blank. :D

Mind you, this:

Code: Select all

on mouseUp
   set the fileName of image "PIC" to empty
   end mouseUp
had the same effect.

I was doing this on a Macintosh running MacOS 10.14.6.

So . . .

Question #1: What OS is LiveCode running on with you?

Question #2: Check your code again, and ask yourself if something else might not be b*gg*ring things up.

Re: Can't get rid of my last image by scripting

Posted: Wed Sep 18, 2019 6:35 pm
by pderks
Thank you, Klaus,
thank you, richmond62.

Peter