Anyone know ActionScript 2?

Posts 15 of 5 · Page 1 of 1
Anyone know ActionScript 2?
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.
Quote Originally Posted by user415141 View Post
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.
Does it have to be ActionScript 2? Why not ActionScript 3?
^

If it was AS3 I could help you out -- but too bad it isn't.
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.


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);
Off the top of my head.
Quote Originally Posted by AQWThunder View Post
Does it have to be ActionScript 2? Why not ActionScript 3?
My school requires that for some reason.

Quote Originally Posted by arunforce View Post
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.
Awesome thanks!
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?