Slide an object upon click

I have the below function that is called when a button is clicked, however nothing happens. For testing purposes, I disabled all of the code within the function and get put in: iObject._y = EndPos; and that worked so I know the object is being passed correctly.


function SlideObjectDown(iObject,EndPos) {
   _root.onEnterFrame = function() {
   	   yMC = getProperty(iObject, _y);
	   moveMC = EndPos + yMC;
	   setProperty(iObject, _y, yMC + (moveMC/10));
    if (getProperty(iObject, _y)>=EndPos) {
         delete this.onEnterFrame;
      }
   };
}

Thanks for your help.