here’s the code for my buttons that lostinbeta helped me with
MovieClip.prototype.MCenlarge = function(endWidth, endHeight, minWidth, minHeight) {
this.speed = 10;
this.endX = endWidth;
this.endY = endHeight;
this.onEnterFrame = function() {
this._xscale += (this.endX-this._xscale)/this.speed;
this._yscale += (this.endY-this._yscale)/this.speed;
if (this._xscale<=minWidth && this._yscale<=minHeight) {
this._xscale = minWidth;
this._yscale = minHeight;
}
}
}
MovieClip.prototype.createRollOvers = function(clipWidth, clipHeight) {
this.onRollOver = function() {
this.MCenlarge(this._xscale+20, this._yscale+20, clipWidth, clipHeight);
}
this.onRollOut = function() {
this.MCenlarge(this._xscale-20, this._yscale-20, clipWidth, clipHeight);
}
}
this.onRollOut = function() {
this.MCenlarge(this._xscale+20, this._yscale+20, clipWidth, clipHeight);
}
//declare buttons to which fuctions will be applied
_root.mm.tech.createRollOvers(133.7, 133.7);
_root.mm.design.createRollOvers(180, 180);
_root.mm.contact.createRollOvers(102.9, 102.9);
_root.mm.fun.createRollOvers(75.7, 75.7);
_root.mm.logoAnim.logoAndName.apic.createRollOvers(19.3, 29.1);
_root.mm.window.closer.createRollOvers(11.8, 11.8);
i can’t get a maxHeight / Width variable to work b/c the min variables do their job … but how can i make a max variable work
i tried something like this :: but it doesn’t work
MovieClip.prototype.MCenlarge = function(endWidth, endHeight, minWidth, minHeight, maxWidth, maxHeight) {
this.speed = 10;
this.endX = endWidth;
this.endY = endHeight;
this.onEnterFrame = function() {
this._xscale += (this.endX-this._xscale)/this.speed;
this._yscale += (this.endY-this._yscale)/this.speed;
if (this._xscale<=minWidth && this._yscale<=minHeight) {
this._xscale = minWidth;
this._yscale = minHeight;
}
if (this._xscale>=maxWidth && this._yscale<=maxHeight) {
this._xscale = maxWidth;
this._yscale = maxHeight;
}
}
}
MovieClip.prototype.createRollOvers = function(clipWidth, clipHeight) {
this.onRollOver = function() {
this.MCenlarge(this._xscale+20, this._yscale+20, clipWidth, clipHeight, clipWidth, clipHeight);
}
this.onRollOut = function() {
this.MCenlarge(this._xscale-20, this._yscale-20, clipWidth, clipHeight, clipWidth, clipHeight);
}
}
this.onRollOut = function() {
this.MCenlarge(this._xscale+20, this._yscale+20, clipWidth, clipHeight, clipWidth, clipHeight);
}
//declare buttons to which fuctions will be applied
_root.mm.tech.createRollOvers(133.7, 133.7);
_root.mm.design.createRollOvers(180, 180);
_root.mm.contact.createRollOvers(102.9, 102.9);
_root.mm.fun.createRollOvers(75.7, 75.7);
_root.mm.logoAnim.logoAndName.apic.createRollOvers(19.3, 29.1);
_root.mm.window.closer.createRollOvers(11.8, 11.8);