X & Y Position Function

I know I am doing something wrong but cant figure it out. I am trying to create a function that will allow me to set the x and y position in one line of code instead of having to write out the code everytime. I tried this:


var testBtn:mcTest = new mcTest();

testBtn.setPosition(100, 100);


function setPosition(xPos:Number, yPos:Number):void {
    this.x = Math.round(xPos);
    this.y = Math.round(yPos);
}

and Ive tried

function setPosition(xPos:Number, yPos:Number):void {
    this.x = xPos;
    this.y = yPos;
}


addChild(testBtn);

But I am getting an error:

TypeError: Error #1006: setPosition is not a function.

If anyone can help please let me know I have messed with this a few times and still cant get it to work. Thanks for any help on this topic.

not function!!! she is absent in class mcTest
if mcTest has default MovieClip class tray it code


var testBtn:mcTest = new mcTest();

setPosition(testBtn,100, 100);

function setPosition(my_mc:MovieClip,xPos:Number, yPos:Number):void {
    my_mc.x = xPos;
    my_mc.y = yPos;
}

addChild(testBtn);

THANK YOU!!! I cant believe I didnt figure it out