Hey, I need some help with ActionScript. I'm supposed to write a script to track a movement of an object, such as a ball, using action script 2.0 (yes, my school's really outdated). Can anyone help me with this?
I'm bad at explaining this but say an object falls, every ~5 pixels, it will create that object stationary in that location. So that way you can see the path the object takes.
Path prediction?
Write a formula for the motion of the object with respect to time, plug in time, and check if the ball or whatever collides with the boundary each frame. The moment it does, t-1 is the time to predict the path.
Off the top of my head.
function psuedoformula(time)
{
var new_y = ball._y + time*5;
if (new_y > 300) //if the ball is past 300 (the boundary)
return -1;
else
return new_y;
}
var time = 0;
while (psuedoformula(time) != -1)
{
time++;
}
var ball2 = attachMovieClip(ball_symbol);
ball2._alpha = 50;
ball2._y = psuedoFormula(time-1);
BRING BACK BT, BRING BACK SAGA, BRING BACK VF, BRING BACK MPGHCRAFT, BRING BACK HABAMON
| ∞ | (05-16-2014)