a _tiny_ flash question

Out of context: Reply #5

  • Started
  • Last post
  • 5 Responses
  • o0o0

    I think what you're after is 'easing'
    mennik's example is more complex. Easing is easy.

    Say your want to move MyMC to x=0 ... first you find out the difference between MyMC._x (current location) and 0 (or whatever your target location is).. call it diff.
    OnEnterFrame you do something like this:

    lag = 5;
    MyMC._x += diff/lag

    just make sure diff is +/- depending on which direction you want your mc to move...
    the higher you make 'lag' the more slowly it will move to the target x

    hope that made sense....

View thread