Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : cyclic algorithm in flash...how can I do this?


sandrod
6/5/2004 7:41:22 PM
my problem is pretty simple - I have an algorithm but don't know how to write
that for flash...I mean cyclic alg

read on:


:rolleyes:

the case is as follows:

my program calculates

ax,ay -> using this variables -> vx,vy -> after that I calculate the little
step that my mc will make, in other words I calc x,y position

[CODE]//
ax = ((G * _root.satmass)/(r * r * r))*(_root.m2._x);
ay = ((G * _root.satmass)/(r * r * r))*(_root.m2._y);
//
vx += (_root.t * ax);
vy += (_root.t * ay);
//changing x and y coordinates
_root.m2._x += (_root.t * vx);
_root.m2._y += (_root.t * vy);[/CODE]

as you can see all depend on each other...but the problem is that after
getting new x,y I want this x,y to be used to calculate next step!
fo every new coordinate I want new vx,vy ax ay!

I want a cyclic algorithm...but duno how to get along with flash MX

any help appreciated!

:o
kglad
6/5/2004 8:38:46 PM
setInterval(calcF, 100);
function calcF() {
_root.m2._x += _root.t*_root.t*_root.m2._x*G*_root.satmass/(r*r*r);
_root.m2._y += _root.t*_root.t*_root.m2._y*G*_root.satmass/(r*r*r);
AddThis Social Bookmark Button