Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | RE: FLASH: accel and decel |
From: | Glen Rhodes |
Date: | Thu, 20 Apr 2000 20:33:45 +0100 |
To move the object from p1 to p2:
(this is pseudocode, not just applicable to flash)
p1x = the object's current x position
p1y = the object's current y position
p2x = the target destination x position
p2y = the target destination y position
dx = p2x - p1x (the difference between the points along x)
dy = p2y - p1y (the difference between the points along y)
dx = dx * .5 (the difference divided by 2)
dy = dy * .5
finally, move the object along the path like this:
objectx = p1x + dx
objecty = p1y + dy
Loop this until p1x = p2x and p1y = p2y
This will make the object leap towards it's destination point, and settle
into position. Note that the .5 can be changed to any fraction of 1 to
change the speed of the approach.
------------------
Glen Rhodes
dot com Entertainment Group Inc.
Tel: (905) 337-8524
Fax: (905) 337-8630
www.dceg.com
-----Original Message-----
From: ownerchinwag [dot] com [ownerchinwag [dot] com]On">mailto:ownerchinwag [dot] com]On Behalf Of kris Okun
Sent: Thursday, April 20, 2000 2:41 PM
To: flasherchinwag [dot] com
Subject: FLASH: accel and decel
Ok I got a movie clip to stick to my mouse on movie start so that I can
get the x and y properties of the mouse. How do I get it so that the
movie clip accelerates and decelrates into position instead of just
exactly following it?
Kris
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: accel and decel, kris Okun
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]