# Disable buttons

**URL:** <https://forum.kirupa.com/t/disable-buttons/285351>\
**Category:** Uncategorized\
**Created:** [March 30, 2009, 9:29pm UTC](https://forum.kirupa.com/t/disable-buttons/285351 "2009-03-30T21:29:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laertjansen](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@laertjansen](https://forum.kirupa.com/u/laertjansen)\
**Post date:** [March 30, 2009, 9:29pm UTC](https://forum.kirupa.com/t/disable-buttons/285351/1 "2009-03-30T21:29:34Z")

</div>

Hello everyone,

I got a problem and I would like to share with you all. Maybe someone here could give me a little help about how to solve this.

I have a menu (mc\_menu) and inside it 7 other movie clips that are the buttons.

Each button has the following code:

```auto
onClipEvent (load) {
    function colorTween() {
        for (i=0; i<3; i++) {
            difference = endRGB*-startRGB*;
            startRGB* = startRGB*+difference*0.150000;
        }
        // end of for
        col.setRGB(startRGB[0] << 16 | startRGB[1] << 8 | startRGB[2]);
    }
    // End of the function
    col = new Color(this);
    startRGB = new Array(153, 0, 0);
    endRGB = new Array(153, 0, 0);
    // Sets the first, default _alpha value
    this._alpha = 0;

    // Stores its original _x position on a variable for later using
    this.yOscale = 250;

    // When the mouse moves over this movieclip, highlight and move it
    this.onRollOver = function() {
        // Makes it 100% opaque, on 0.5 seconds, using a linear transition
        this.alphaTo(100,0.5,"linear");
        // Moves it a bit down, on 1.6 seconds, using the default animation (easeoutexpo, standard deacceleration)
        this.tween("_yscale",this.yOscale+400,1.6);
    };
    this.onRollOut = function() {
        // Makes it 50% transparent again, on 0.4 seconds, using a linear transition
        this.alphaTo(0,0.5,"linear");
        // Moves it back to its original _x position, on 0.5 seconds, using the default animation again
        this.tween("_yscale",this.yOscale,1.6);
    };

}

onClipEvent (enterFrame) {
    colorTween();
}

```

This code controls the over state of the buttons and changes its color.

I want to disable each button after clicked but of course enable again when other page is called. I can´t figure out how to do it.

Here´s the website I´m working on it.  
[http://www.laertjansen.com/juliana/](http://www.laertjansen.com/juliana/)

Thank you very much in advance for any sort of help.
