slide show lite

Klaus Major k_major at os.surf2000.de
Sat Jan 4 06:22:01 EST 2003


Hi Mike,

> on mouseUp
>  put the cphotoFolderPath of this stack into folderPath
>  put 1 into z
>  repeat(the number of lines in fld "allphotos")times
>    put the value of line z of fld"allphotos" into photoToShow
>    set the filename of img 1 to (folderPath&"/"&photoToShow)
>    show image 1
>    wait 5 seconds
>    hide image 1
>    wait 1 second
>    add 1 to z
>  end repeat
> end mouseUp

try this:

on mouseup
   repeat with i = 1 to the num of lines of fld "allphotos"
      set the filename of img 1 to (the cphotoFolderPath of this stack & 
"/" & line i of fld "allphotos")
      show img 1
      wait 5 secs with messages
      hide img 1
      wait 1 secs with messages
   end repeat
end mouseup

Problem with your script was that there was in fact 1 more loop than
the num of lines of fld "allphotos" ;-)

The "wait x with messages" will NOT block MC during this wait.
Might not be necessary in your example, but could be in future
projects.

Hope thus helps.


Regards


Klaus Major
k_major at os.surf2000.de

P.S.
I can supply another solution with the "send...in..." command.
But i am in a hurry, so it might arrive this evening or tomorrow.



More information about the use-livecode mailing list