# Hiding btns

**URL:** <https://forum.kirupa.com/t/hiding-btns/181287>\
**Category:** Uncategorized\
**Created:** [March 8, 2006, 3:42am UTC](https://forum.kirupa.com/t/hiding-btns/181287 "2006-03-08T03:42:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![james182](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@james182](https://forum.kirupa.com/u/james182)\
**Post date:** [March 8, 2006, 3:42am UTC](https://forum.kirupa.com/t/hiding-btns/181287/1 "2006-03-08T03:42:46Z")

</div>

i am trying to hide my prev and next btns when they are not needed.  
example at beginning no prev is needed and at end no next btn is needed.

any help my code is below.

```auto

stop();
var loc = 30;
//hide btn
prevBtn = function () {
    if (loc<30) {
        loc += 335;
        _root.prevMC._visible = false;
    }else{
        _root.prevMC._visible = true;
    }
};

prevMC.onRelease = function() {
    if (loc<30) {
        loc += 335;
        prevBtn();
    }
};

nextMC.onRelease = function() {
    if (loc>30-(slider_mc._width-335)) {
        loc -= 335;
    }
};
//hide btn
nextBtn = function () {
    if (loc>slider_mc._width-335) {
        _root.nextMC._visible = false;
    }else{
        _root.nextMC._visible = true;
    }
};

slider_mc.onEnterFrame = function() {
    this._x = (loc+this._x)/2;
};

```
