Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | RE: FLASH: giving an object velocity |
From: | Kenneth.Austin |
Date: | Fri, 7 Apr 2000 03:03:20 +0100 |
velocity isn't too bad in actionscript. actually i think you're talking
about a gravity effect, right? basically you set a controller movie clip
with three frames, and an object movie clip. name the object instance name
"object". now edit the controller mc and add two frames so it's 3 frames
long. on the first frame set a variable "speed" to 1 ( or whatever you want
it's initial speed to be.) on the second frame set an action as follows:
Set Property ("/object", Y Position) = GetProperty ("/object", _y) + speed
Set Variable: "speed" = speed*1.2
then on the third frame set these same actions, but with a Go To and Play
Frame 2 action as a third action
as the mc loops it sets the position in increasing increments, giving the
illusion of acceleration. i add the speed because the y gets larger as it
goes down, you can subtract speed to send the object upwards. if you
multiply by .9 or something less than one, the object will decellerate.
there is a great tutorial on colin moock's site entitled programmatic
movement, i strongly suggest this to anyone as a beginning to moving things
around with actionscript
hope this helps
Kenneth Austin
Hands On Labs
KnowledgeNet
14624 N Scottsdale Rd, Suite 300
Scottsdale AZ 85254
Email: <Kenneth [dot] Austinknowledgenet [dot] com>
Web: <www.knowledgenet.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: More text questions... sorry, Michael Dunn
FLASH: Syncing sound, Michael Dunn
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]