Need AS2 converted to AS3
This is a car collision game.  Here is the code.  I really need it converted into AS3.  Also, movie clip car1 is supposed to hit movie clip grass1 and bounce off.  I can't figure out this either.  Here is the code that needs to be converted, and any additional help would be awesome.  Thanks!



function step(who) {

	//check to see if the car in question is controlled by the player or by the computer
	if (_root["car"+who].code == "player") {
		//we will constantly decrease speed by multiplying it with a number below 1
		if (this["speed"+who]>0.3) {
			this["speed"+who] *= _root.speedDecay;
		} else {
			this["speed"+who] = 0;
		}
		//the car will react to certain keys
		//accelerate
		if (Key.isDown(Key.UP) && this["speed"+who]<_root.maxSpeed) {
			this["speed"+who] += _root.acceleration;
		}
		//brake (reverse)
		if (Key.isDown(Key.DOWN)) {
			this["speed"+who] -= _root.backSpeed;
		}
		//steer left
		if (Key.isDown(Key.LEFT) && this["speed"+who]>0.3) {
			_root["car"+who]._rotation -= _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
		}
		//steer right
		if (Key.isDown(Key.RIGHT) && this["speed"+who]>0.3) {
			_root["car"+who]._rotation += _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
		}
		
		
		this["rotation"+who] = _root["car"+who]._rotation;
		//we calculate the two components of speed (X axis and Y axis)
		this["speedx"+who] = Math.sin(this["rotation"+who]*(Math.PI/180))*this["speed"+who];
		this["speedy"+who] = Math.cos(this["rotation"+who]*(Math.PI/180))*this["speed"+who]*-1;

	 
		
		//apply the components on the actual position of the car
		_root["car"+who]._x += this["speedx"+who];
		_root["car"+who]._y += this["speedy"+who];




}
	
if (_root["car"+who].code == "computer") {
	}
	
	
	
	trace(car1._x);
	trace(car1._y);
	
	
}

Need AS2 converted to AS3
===

This is a car collision game.  Here is the code.  I really need it converted into AS3.  Also, movie clip car1 is supposed to hit movie clip grass1 and bounce off.  I can't figure out this either.  Here is the code that needs to be converted, and any additional help would be awesome.  Thanks!



function step(who) {

	//check to see if the car in question is controlled by the player or by the computer
	if (_root["car"+who].code == "player") {
		//we will constantly decrease speed by multiplying it with a number below 1
		if (this["speed"+who]>0.3) {
			this["speed"+who] *= _root.speedDecay;
		} else {
			this["speed"+who] = 0;
		}
		//the car will react to certain keys
		//accelerate
		if (Key.isDown(Key.UP) && this["speed"+who]<_root.maxSpeed) {
			this["speed"+who] += _root.acceleration;
		}
		//brake (reverse)
		if (Key.isDown(Key.DOWN)) {
			this["speed"+who] -= _root.backSpeed;
		}
		//steer left
		if (Key.isDown(Key.LEFT) && this["speed"+who]>0.3) {
			_root["car"+who]._rotation -= _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
		}
		//steer right
		if (Key.isDown(Key.RIGHT) && this["speed"+who]>0.3) {
			_root["car"+who]._rotation += _root.rotationStep*(this["speed"+who]/_root.maxSpeed);
		}
		
		
		this["rotation"+who] = _root["car"+who]._rotation;
		//we calculate the two components of speed (X axis and Y axis)
		this["speedx"+who] = Math.sin(this["rotation"+who]*(Math.PI/180))*this["speed"+who];
		this["speedy"+who] = Math.cos(this["rotation"+who]*(Math.PI/180))*this["speed"+who]*-1;

	 
		
		//apply the components on the actual position of the car
		_root["car"+who]._x += this["speedx"+who];
		_root["car"+who]._y += this["speedy"+who];




}
	
if (_root["car"+who].code == "computer") {
	}
	
	
	
	trace(car1._x);
	trace(car1._y);
	
	
}
