# Trying to get the alpha function to happen after the movement

**URL:** <https://forum.kirupa.com/t/trying-to-get-the-alpha-function-to-happen-after-the-movement/181460>\
**Category:** Uncategorized\
**Created:** [March 9, 2006, 3:34pm UTC](https://forum.kirupa.com/t/trying-to-get-the-alpha-function-to-happen-after-the-movement/181460 "2006-03-09T15:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![warloc4326](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@warloc4326](https://forum.kirupa.com/u/warloc4326)\
**Post date:** [March 9, 2006, 3:34pm UTC](https://forum.kirupa.com/t/trying-to-get-the-alpha-function-to-happen-after-the-movement/181460/1 "2006-03-09T15:34:10Z")

</div>

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…

```auto

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
