Hi Bjarne,
It's working. Thank you very much.
Kamil
Bjarne Nyquist wrote:
> > Thanks for clarification.
> > But I need to lunch this animation buy clicking on a button in another
> sprite.
> > I've got something like this (script below). But I don't know how to send
> value
> > of moveNow from MoveLayer to exitframe handler. I send moveNow to
> MoveLayer from
> > the button.
>
> add this handler to the behavior on gthe animating sprite
>
> property moveNow
>
> on setState me, aState
> moveNow = aState
> end setState
>
> Then let the button You click have this handler on it:
>
> on mouseUp me
> sendSprite(theAnimatingSprite, #setState, true)
> end mouseUp
>
> If You need another button that will stop the animation You ca of course
> have
>
> on mouseUp me
> sendSprite(theAnimatingSprite, #setState, false)
> end mouseUp
>
> on that one
>
> If You want the same button to toggle animation on and off this could be one
> way to go:
>
> property pState
>
> on beginSprite me
> pState = false
> end beginSprite
>
> on mouseUp me
> pState = NOT pState
> sendSprite(theAnimatingSprite, #setState, pState)
> end mouseUp
>
> NOTE!!!! ALL CODE IN THIS MAIL IS UNTESTED
>
> Bjarne
> _______________________________________________________
> "solving a problem is not a case of finding a solution, it is a case of
> finding
> a set of easier problems that you already know how to solve."
> James Newton
>
> 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: <[EMAIL PROTECTED]>
> Sent: Sunday, June 10, 2001 1:35 PM
> Subject: Re: <lingo-l> Animation at one frame
>
> > Hi,
>
> >
> > Thanks
> >
> > Kamil
> >
> >
> > property pMin
> > property pMax
> >
> > on MoveLayer me, moveNow
> >
> > if moveNow = TRUE then
> > return moveNow
> > end if
> >
> > end
> >
> > on beginSprite me
> > pMin = 730
> > pMax = 870
> > end
> >
> >
> > on exitframe me, moveNow
> >
> > if moveNow = TRUE then
> >
> > if sprite(3).loch >= pMin and sprite(3).loch <= pMax then
> > sprite(3).loch = sprite(3).loch + 5
> > updateStage
> > else
> >
> > end if
> >
> > end if
> > end
> >
> >
> >
> > Bjarne Nyquist wrote:
> >
> > > > 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!]
> >
> > --
> > 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!]
--
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!]