slide show lite

Klaus Major k_major at os.surf2000.de
Sat Jan 4 08:29:01 EST 2003


Hi Mike,

concerning the "grey" images:
You said that you have used these images in another context
and had no troubles displaying them.

In that case i would check for typos in the field "allphotos".
Maybe a "space" too much or whatever...

And here is a solution with the send command.

Advantage: this will not block RR during the execution ot this
script at all as it did in the repeat-loop.

Put this in your button-script:

local currentline, maxlines
## here we will store the actual line(file) that is being
##displayed and the number of lines in fld "allphotos"

on mouseup
   put 1 into currentline
   ## start from beginning
   put the num of lines of fld "allphotos" into maxlines
   ## you guessed :-)
   send "do_the_slide" to me
end mouseup

on do_the_slide
   hide img 1
   wait 1 secs with messages
   set the filename of img 1 to \
      (the cphotoFolderPath of this stack & "/" & line currentline of 
fld "allphotos")
   show img 1
   if currentline < maxlines then
     ## we did not reach the last image yet...
    ## means there is at leat one more file to display
     add 1 to currentline
     send "do_the_slide" to me in 5 secs
   end if
end do_the_slide

That's it...

To add a tiny bit of glamour to your script, i would suggest to
use a transition instead of no image for 1 second.

If you'd like to try this, put this in your button-script:

local currentline, maxlines
## don't forget these locals !

on mouseup
   put 1 into currentline
   put the num of lines of fld "allphotos" into maxlines
   send "do_the_slide" to me
end mouseup

on do_the_slide
   lock screen
   set the filename of img 1 to \
      (the cphotoFolderPath of this stack & "/" & line currentline of 
fld "allphotos")
   unlock screen with visual dissolve slow
   if currentline < maxlines then
      add 1 to currentline
      send "do_the_slide" to me in 5 secs ##:-)
   end if
end do_the_slide


Have a nice weekend...


Regards from germany, where it just started to snow :-)

Klaus Major
k_major at os.surf2000.de




More information about the use-livecode mailing list