in the middle of the repeat loop, put in a 

if the mouseDown then
  doSomethingElse
  exit repeat
end if

the exit repeat will pull you out of the animation loop.


alternatively, you can restructure the thing so that instead of a tight
repeat loop, each iteration happens on an exitFrame, and you keep track
of which iteration it is using a property. then the button will respond
to a mousedown or up event.

--bhakti


maria miranda wrote:
> 
> hi, here is my problem.. I have creaated an animation, using lingo that
> randomly places sprites on the stage. The animation happens ok, but i
> want the user to be able to click on an exit button to leave. At the
> moment it just repeats endlessly and there's no way out..not sure how to
> set up an if /else sort of script. the pseudo lingo would be
> 
> < if the user clicks on the button
> go to movie"whichmovie"
> else
> keep repeating
> end>
> 
> and where should I put it? so that it can break the <repeat with i >
> statement. here is my animation script which is sitting in the movie
> script but called from an exit frame script.
> does all that make sense. thanks. would be grateful for any assistance.
> maria
> 
> on animation
>   repeat with x= 3 to 61
>     puppetSprite x, true
>     set the visible of sprite x to false
> 
>     repeat with i= 3 to 61
>       startTimer
>       repeat while the timer <3
> 
>       end repeat
>       set the locH of sprite i to horiz
>       set the locV of sprite i to vert
>       set the visible of sprite i to TRUE
>       updatestage
> 
>       set the locH of sprite i = (the locH of sprite i) -1
>       updatestage
>       set the loch of sprite i = (the loch of sprite i) +1
>       updatestage
> 
>       horiz= random  (800)
>       vert= random (600)
>       updatestage
>     end repeat
>   end repeat
> end animation
> 
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]

-- 
R. Bhakti Klein
�
Vocalist, Funky Little Shack
http://www.FunkyLittleShack.com
��
Instructional Media Developer, Distributed Learning Workshop
http://www.dlworkshop.net/
���
"On Earth, you can only do little things;
but you can do them with a lot of Love."
                              -- Mother Theresa

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to