Hei dunbarx and doobox
thanks for your ideas.
I tried to use your code but it looks that it does not works in this case.
your examples wont help me in this issue, but I am also not sure about I implemented it at the right places ...
I will explain a bit more to understand what is coing on in this issue.
all my code are as handlers or functions on the stack script because there where used an different cards (at the moment just the first) on the buttons just are handlers that calls it from there.
pressing test button "ABC ..." starts "playABC" wich loads and plays one finger-spelling-sing-letter after the other until all are over. but now I would like to stop/ pause/ or make some other interaction to this loop ...
but it looks that this repeat dont want hear to anything until it exit by itself and then starts to do all what I pressed in the running time.
The button "X" should stop the repeat off "playABC".
Only "command period" and sometimes pressing "esc" for about 4-5s change to the debugging window where I can stop the script from running.
The "next" and "back" buttons on the screenshot has no functionality in this running mode.
Code: Select all
on playABC
repeat with i = 1 to (the number of lines of the cABC of this stack)
## loads next video & picture to the card
## itself calls 2 other commands that
## - change the number "i" to the coresponding letter
## - load the media files to the card and starts playing.
loadLetterToCardUsingLineNummber i
## wait for the video is finished playing
## because there are different length and waiting needs
waitForVideoPlayTime
## Job to do ## (not fixed yet)
#############
## find a exit "functionality" to stop the loop
## if someone press "escape" key or press the stop button
if sSomeVariable is true then
send repeatLookalike to card 1 in 2 milliseconds // send to the object we are on/in
end if
-- if theKey is the escapeKey then exit to top ## try also the optionKey / commandKey / shiftkey
end repeat
end playABC