Trying to get the alpha function to happen after the movement

I’m trying to get the alpha function to happen only while the conditions of _root.portfolio_btn._y and the _root.contact_btn._y values are met. right now i’m just frustrated and can’t figure out how to rewrite this to make that happen tried if statements and they worked with little success for some reason. also it seems that the _root.contact_btn._y value changes however i’m positive nothing else is interacting with it…


this.onRelease = function(){
    mainButtonsReset();
    this.gotoAndStop (2);
    this.swapDepths(2);
    _global.portfolio_btn = 2;
    _root.content_mc._alpha = 0;
    _root.portfolio_btn.onEnterFrame = function() {
        if (_root.portfolio_btn._y>44) {
            _root.portfolio_btn._y -= 20;
        } 
        else {
            delete _root.portfolio_btn.onEnterFrame;
        }
    };
    _root.contact_btn.onEnterFrame = function() {
        if (_root.contact_btn._y<586.4) {
            _root.contact_btn._y += 20;
        } 
        else {
            delete _root.contact_btn.onEnterFrame;
        }
    };
        _root.content_mc.onEnterFrame = function() {
            if (_root.content_mc._alpha<100) {
                _root.content_mc._alpha += 10;
            } else {
                delete _root.content_mc.onEnterFrame;
            }
        };
}

thanks to those who reply