# Alpha function runs while \_y movement function happening

**URL:** <https://forum.kirupa.com/t/alpha-function-runs-while--y-movement-function-happening/181217>\
**Category:** Uncategorized\
**Created:** [March 7, 2006, 1:42pm UTC](https://forum.kirupa.com/t/alpha-function-runs-while--y-movement-function-happening/181217 "2006-03-07T13:42:00Z")\
**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 7, 2006, 1:42pm UTC](https://forum.kirupa.com/t/alpha-function-runs-while--y-movement-function-happening/181217/1 "2006-03-07T13:42:00Z")

</div>

Basically I need to have the alpha function occur after the \_y movement function. here is what I have so far:

```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>30) {
            _root.portfolio_btn._y -= 10;
        } 
        else {
            delete _root.portfolio_btn.onEnterFrame;
        }
    };
    _root.contact_btn.onEnterFrame = function() {
        if (_root.contact_btn._y<560) {
            _root.contact_btn._y += 10;
        } 
        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.
