> 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?
>
I would definitevy use a behavior attached to the sprite You want to animate
and do all limit checking and  animation on exitFrame

That way You will be independent of score prosition, updateStage and repeat
loops.

You can of course still send commands to the behavior to change the property
values for moveNow and moveOut

Heres a modification of Your script according to this idea

propsert spriteNum, pMin ,pMax

on beginSprite me
    pMin = 730
    pMax = 870
end beginSprite

on exitFrame me
    if moveNow = TRUE then
        if sprite(spriteNum).locH < pMax then
            sprite(spriteNum).locH = sprite(spriteNum).locH + 1
        end if
    else if moveOut = FALSE then
        if sprite(spriteNum).locH > pMin then
            sprite(spriteNum).locH = sprite(spriteNum).locH - 1
        end if
    end if
end exitFrame
_______________________________________________________
Bjarne Nyquist
Researcher, Lingo Programmer
The Interactive Institute, phone: +46-(0)8 783 24 74
www.interactiveinstitute.se
----- Original Message -----
From: "Kamil Dabkowski" <[EMAIL PROTECTED]>
To: "Lingo Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, June 10, 2001 10:58 AM
Subject: <lingo-l> Animation at one frame


> Hi,
>

> 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

>
>   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