Hi guy,

First off, my English isn't perfect so bare with me , also, this could be quite a wall of text...sorry. I've been working on this physics application in Flash 8 again lately and I have a few problems. I'm quite new to actionscript since I'm more of an animator. Still, I'd like to pull this off, but I'm going to need some help. Anyways, here's what I'm trying to do:

I'm trying to simulate the path an electron (or proton) would take if it were shot into an electric field (in this case, a parallel plate capacitor). I've programmed all the necessary things for the particle to move in the direction of the x-axis, and move in the direction of the y-axis too once it enters the field. The charge, mass, Voltage connected to the capacitor and the distance between the two plates make up the acceleration which should be applied to the particle when it enters the electric field. Right now my program is just working with natural numbers for the speeds (like 3 or 4) so it wont be too fast. When I have things working with those, I can have the user enter realistic values and flash will calculate with those and transform them into values it can work with so you can actually watch the path of the particle. I'm not quite there yet since I have a problem. Right now, once the particle enters the magnetic field it is applied the velocity v_y in the direction of the y-axis which creates a path that looks like this:



So there is no acceleration at work here yet. Just constant speeds in both directions. The velocity in the direction of x stays constant throughout the entire experiment. What it should look like though, is like this:



As you can see the path of the electron is a parabola (sp?). If it helps, the formula for this path can be derived from a = (Q * U) / (m * d) and y = 0.5 * a * t^2. I hope these formulas are clear, if you want me to explain them if it will help you understand it, then I will, but for now I wont. The formula for the parabola type path is: y = (Q * U * x^2) / (2 * m * d * v_x^2). v_x would be the speed in the direction of x (see images).

How can I code it in flash so that the speed in the direction of y is not constant, but indeed influenced by the acceleration, giving the path of the particle the form of a parabola? Everytime I try doing it with functions or in another way, it doesn't work. I would need a function that always calculates the new speed and gives the output right aways, everytime the position in the direction of x changes (see formula). Any ideas guys? I would really appreciate it. If it would help, I can send the fla file for anyone who wants to have a look at it. Remember it's Flash 8.

Cheers,
Chris!