Questo ti può essere utile?
codice:/************************************** ************************************** ___________________________________________ ------------- MacOSXMenu effect---------------- ___________________________________________ 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 movieclips 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(); ****************************************** ******************************************/


Rispondi quotando