Hi Kamil

One way to avoid repeat loops is doing "counterLoops"

To show a comparison of a counterloop and a repeatloop

repeatloop:

on exitframe
  repeat with a = 1 to 100
    member("some member").text = string(a*a)
  end repeat
end

Counterloop:

property Mycounter

on exitframe
  if MyCounter = VOID then
    MyCounter = 0
  end if

  mycounter = myCounter + 1
  if Mycounter < 100 then
    member("some member").text = string(a*a)
    go to the frame
  else
    nothing
  end if
end

The Idea with a counterloop is that it executes "one repeat" per frame,
without interfering with everything else you are doing. Naturally there are
some places counterloops cannot be used.

PEkka




> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Kamil Dabkowski
> Sent: 10. kesakuuta 2001 11:59
> To: Lingo Mailing List
> Subject: <lingo-l> Animation at one frame
>
>
> Hi,
>
> I'd like to animate one sprite with lingo while I jump between markers.
> My problem is that when the script (below) is running all film loops at
> the frame start to run very very fast. I think I shouldn't use repeat
> loop here but what else i can do?
>
> BTW Can I send events (something like sendsprite) to frame scripts?
>
> Thanks
>
> Kamil
>
> -- I use sendSprite to send moveNow and moveOut values.
>
>
> property pMin
> property pMax
> property pCurrent
>
> on MoveLayer me, moveNow, moveOut
>   pMin = 730
>   pMax = 870
>
>   if moveNow = TRUE then
>
>
>     repeat while sprite(3).loch < pMax
>       sprite(3).loch = sprite(3).loch + 1
>       updateStage
>     end repeat
>   end if
>
>   if moveOut = FALSE then
>
>     repeat while sprite(3).loch > PMin
>       sprite(3).loch = sprite(3).loch - 1
>       updateStage
>     end repeat
>
>   end if
>
> end
>
>
> --
> Kamil Dabkowski
> Geometrek
> http://stop.at/kamil
>
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/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!]
>


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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