A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: scripting 'real' movement

  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    43
    Hey guys,

    I'm working on a scrolling menu system based on actionscript. I really want to add real movement to it, i.e. acceleration and deceleration. I've had a bash but to no avail.

    I have both my start and finish values for the x axis of the menu. All i need to know now is the correct method to generate the realistic movement. Any hints would be much appreciated.

    Matt

  2. #2
    well
    here's a script you might want

    menu._y = menu._y + ((target._y - menu._y)/3)
    you gotta repeat this tho

    that's deceleration

    acceleration is a bit more complex, but you can just distort the tween timeline by making new keyframes and moving them "later" in the timeline. cheap? well that's my first acceleration and deceleration techniques

    no actionscript needed on the second method.

    did this help?

  3. #3
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807
    accel can be done the same way. you just multiply instead of divide. and you have to throw in a check for when to stop accelerating (i.e.-

    Code:
    if(this._x >= 25)
      stop();
    else
      gotoAndPlay(1);
    where frame 1 has your accel script

    just one of many ways...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center