Public static function (am I doing something bad?)

Ok, this is related to some 3D classes I’m writing, but don’t be afraid, you don’t need to understand how it works, I just need to understand why a parameter to a method is getting overwritten.

I have a class vector {}:
with a public function for multiplying by a matrix:

public static function mult (M:matrix, V:vector):vector {}

the problem is that inside the function i need to create a new vector instance for the result to return:

var R:vector = new vector();

after I do that, the vector V that was passed in get’s overwritten
(as if the constructor was called again with no params)

I do the same thing in the matrix class but it works fine
(actually pass in two matrixes and neither get’s overwritten)

Please check out the source to see it happen in action.