Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


MovieClip.macOSXMenu

Flash Version: FLASH MX
Author: info@alessandroperrone.com
Total downloads: 15725
Category: MovieClip
Publish Date: 2003-11-28 17:56:08

the code:
/*
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)

davewardy (from United Kingdom ) on 13th December 2005

cannot work out how to use this using _root.attachMovie("MyMovie", "MyMovieNew", this.getNextHighestDepth());

forgive my ignorance new to actionscript

toki on 12th August 2005

the icons in the menu is just 5 . what will i do to add another icon?

pennerjoel on 3rd August 2005

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());

pennerjoel on 3rd August 2005

You have to fool around with the values in the first if statement and make sure you get the centering done properly.

briandarley on 7th July 2005

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.

gungpetrol on 1st March 2004

Did you ever test it yourself?
For me clips just flicker around.

npc2001 on 6th January 2004

Any further tips on getting this to work?

Great site!

Regards
NPC