script interruption

Ian McKnight iangmcknight at gmail.com
Tue Nov 16 16:25:47 EST 2010


Hi Yves

I did the following which I think gives you the behaviour you want:

Create a stack with a scrolling field and a button.
Lock the text of the field so that it can respond to mouse clicks.

Put this in the script of the field (called Display)

global gEndFlag
on mouseup
   put true into gEndFlag
end mouseup

and put this in the script of the button

global gEndFlag

on mouseUp
   put false into gEndFlag
   randomText
end mouseUp

command randomText
   if gEndFlag is False
   then

-- your line of  text
      put any line of the weekdaynames into theText
      put theText&cr after fld "display"


      send randomText to me in 1 sec -- timing can be varied

   end if
end randomText


send in time effectively is your repeat
and allows other processes to continue
namely the ability to check when you have clicked in the field
which I don't think the repeat loop will allow since it is still running
when you click in the field.


HTH



On 16 November 2010 20:43, Yves COPPE <yvescoppe at skynet.be> wrote:

> Hello list
>
> I have a script
>
> on doStuff
> end doStuff
>
> this script makes a fld appearing on the screen and writes different text
> in this fld in a repeat loop
> I'd like that a click in this fld stops the loop : exit repeat
> I don't find how to proceed
>
> can anyone explain me how ?
> thanks.
>
> Greetings.
>
> Yves COPPE
> yvescoppe at skynet.be
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
Regards


Ian McKnight

iangmcknight at gmail.com
=======================



More information about the use-livecode mailing list