# Prototype problem

**URL:** <https://forum.kirupa.com/t/prototype-problem/242529>\
**Category:** Uncategorized\
**Created:** [October 26, 2007, 11:38pm UTC](https://forum.kirupa.com/t/prototype-problem/242529 "2007-10-26T23:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)\
**Post date:** [October 26, 2007, 11:38pm UTC](https://forum.kirupa.com/t/prototype-problem/242529/1 "2007-10-26T23:38:52Z")

</div>

First the code:

```auto

var memory:Array = new Array();
var mainmenu:Array = ["RECENT", "LINKS", "ABOUT", "CONTACT", "WORKS"];
var worksmenu:Array = ["PRINT", "SCREEN", "MOTION", "WEBDESIGN"];

function **** () {
    trace(" ****");
    }

MovieClip.prototype.openMenu = function(h, w, s, iAlpha) {
    var h, w, s;
    if (String(memory[0]) != this._name) {
        
        trace(memory[0]);
        memory.push(this._name);
        trace(memory);
        this.onEnterFrame = function() {
            this._alpha += (iAlpha-this._alpha)/s;
            this._xscale += (w-this._xscale)/s;
            this._yscale += (h-this._yscale)/s;
            if (Math.round(this._xscale)>=(w-1)) {
                trace(this._width);
                delete this.onEnterFrame;
            }
        };
    } else {
        **** ();
        _root.memory[0].closeMenu(50,50,3,70);
        }
};

MovieClip.prototype.closeMenu = function(h, w, s, iAlpha) {
    if (String(memory[0]) == this._name) {
        memory.pop();
        trace(memory);
        var h, w, s;
        this.onEnterFrame = function() {
            this._alpha -= (this._alpha-iAlpha)/s;
            this._xscale -= (this._xscale-w)/s;
            this._yscale -= (this._yscale-h)/s;
            if (Math.floor(this._xscale)<=(w+1)) {
                delete this.onEnterFrame;
            }
        };
    }
};

```

Now, I have 2 boxes. Both of them has a plus and minus buttons to resize them. Plus calls openMenu, minus calls closeMenu. Now the thing I cant do is: When I open a menu with a plus button, it resizes and become bigger.  
After that when I press the plus on the second box, I want first box to become smaller again and then other menu to resize.  
Thanks
