Author: info@alessandroperrone.com
Total downloads: 15725
Category: MovieClip
Publish Date: 2003-11-28 17:56:08
/*
Author: Alessandro PERRONE
Date: 28th November 2003
Copyright: ©2003 - alessandroPERRONE.com
License: Freeware
Contact: info@alessandroperrone.com - http://www.alessandroperrone.com
Description: add a cool Mac OSX Menu scaling effect on your movie clips Flash version: MX
Notes: inspired by Tsunami menu by Oxclove Workshop, Ltd. www.oxclove.com All rights reserved
*/
MovieClip.prototype.macOSXMenu = function(){ var startX = this._x; this.onEnterFrame = function(){
if(_root._ymouse <= this._y + 30 && _root._ymouse >= this._y - 30){
var mouseX = int(Math.abs((this._x-_root._xmouse)));
var mouseX2 = int(this._x-_root._xmouse);
if (mouseX<50) {
if (_root._xmouse < this._x + 200 || _root._xmouse > this._x - 200) {
var scale = 200-mouseX;
var xFactor =this._x+(mouseX2*.1);
} else {
var scale = 100;
var xFactor = startX;
}
} else {
var scale = 100;
var xFactor = startX;
}
var scalingFactor = (scale-this._xscale)*.3;
this._xscale += scalingFactor;
this._yscale += scalingFactor;
// update _x position
var x = (xFactor-this._x)*.3;
this._x += x;
}else{
// if mouse out of hit area (user defined) reset scaling with smooth effect
if(this._xscale > 100){
this._xscale += (100 - this._xscale) * .3
this._yscale += (100 - this._yscale) * .3;
}
}
};
};
/*
*
*USAGE
Place one or more movieclip symbols in your movie (each one is an item of your own menu) and call the Mac OSX Menu method in the following way.
yourMovieClipInstance.macOSXMenu();
**/
Comments (7)
cannot work out how to use this using _root.attachMovie("MyMovie", "MyMovieNew", this.getNextHighestDepth());
forgive my ignorance new to actionscript
the icons in the menu is just 5 . what will i do to add another icon?
My bad... don't worry about those values.
Don't place your menu movie manually.
On the stage that is going to have your MovieClipMenu containing the graphic or movieclips that expand, put the following code: _root.attachMovie("MyMovie", "MyMovieNew", this.getNextHighestDepth());
You have to fool around with the values in the first if statement and make sure you get the centering done properly.
anyone ever get this working? i applied it to some clips and it scaled them up, but did not take into account that there were clips next to it. just curious, i have an extreme need for something liek this.
Did you ever test it yourself?
For me clips just flicker around.
Any further tips on getting this to work?
Great site!
Regards
NPC
