Simple Math.sin/cos problem

Hey guys!
I’m currently making a car “game” and i have some issues with the navigation. See i want to change the cars X and Z position, since i want to make this look like 3d. So if i press the UP key, i want my sprite, which contains the car to move a specific number of Z and X depending on what the cars rotation is. I figured i would use his simple function:
For the Z value : sin angle = z1
For the X value : cos(angle) = x1

and then multiply the z1 and x1 with the proper speeds and acceleration ect…
but i have issues witht the Math.sin/cos code, can’t really get it to work.

var degtorad:Number = Math.PI / 180;
var radtodeg:Number = 180/Math.PI;
var degturn:Number = container.rotationY-90

//degturn is the function that makes the rotation value start from the right place,
// hope you’ll understand what i mean :stuck_out_tongue:

var container:Sprite = new Sprite();
addChild(container);
container.x = 512
container.y = 600
container.z = 0

stage.addEventListener ( Event.ENTER_FRAME, enterFrameHandler );
stage.addEventListener (KeyboardEvent.KEY_DOWN, _onKeyDown);
stage.addEventListener (KeyboardEvent.KEY_UP, _onKeyUp);

function _onKeyDown (e:KeyboardEvent):void
{
keyPressed[e.keyCode] = true;
}

function _onKeyUp (e:KeyboardEvent):void
{
keyPressed[e.keyCode] = false;
}
function enterFrameHandler ( event : Event ):void
{
if (keyPressed[Keyboard.UP])
{
container.z += Math.sin(degturn);
container.x += Math.cos(degturn);
trace(“up”)
}
if (keyPressed[Keyboard.DOWN])
{
container.z += Math.sin(degturn);
container.x += Math.cos(degturn);
trace(“down”)
}
}

hope you get what im trying to create, let me know if you want the source or if you got ideas of better ways to solve this then with that function.

peace