First the code:
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