Parameter question

Hi!

I´m working on an game and need some help with collisiondetection. This is wath my collision function looks like

[AS]
function ballClass(){
}

ballClass.prototype.collisionDetection = function(){
if(this.hitState == false){
this.xdistance = Math.abs(Number(this._x - target._x));
this.ydistance = Math.abs(Number(this._y - target._y));
this.distance = Math.round(Number(this.xdistance * this.xdistance + this.ydistance * this.ydistance));
this.realDistance = Math.round(Number(Math.sqrt(Number(this.distance))));
if(this.realDistance < 15){
this.hitState = true;
}
}
}
Object.registerClass(“ball”,ballClass);
attachMovie(“ball”,“ball”,3);
[/AS]

I have two targets, my question is, how do I use that collision function to check both targets? Should I use an inparameter like
[AS]
ballClass.prototype.collisionDetection = function(target){
[/AS]

and how do I call that funtion from the other movieclips?

Hope you understand!

Thanks
/Rebus