Enlarging buttons

Does anyone knows what the code would be for series of buttons that would enlarge smothly and smothly go back to original state? Enlargement is about 1.5x to 2x. They should not overlay each other once the button is enlarged. Other buttons may be enlarged little to create a wave like effect.

I don’t want to do it with animation because it wouldn’t look as good as if it would be programed.

Thanks :slight_smile:

I think you mean a Mac Os X Dock effect. It can be found at flashkit HERE :slight_smile:

Heres another type similar…


Those all are great tips. I’ve done tutorial suggested by Voetsjoeba before and it’s not the exact effect I’m looking for. But yes I’m looking for something that would work look OSX menu.

I’ll try other tutorial suggested by lostinbeta later. I looked at it and I thought it’s too fancy. I’m still consider myself as a beginer.

I thank you for all your replies.

I want to do something like this:


I’m trying to do it as a sepate movie clip. The slide in/out effect works fine but buttons don’t. But ironically all I need is the button effect. I tryed to tweek actionscript several times but buttons still don’t work until I put them on the main time line.

I would appreciate if you could please tell me what should I do to get buttons working as a separate movie clip.


Given that you are new to AS and Flash I am going to do this with a button symbol inside a movieclip symbol.

This will make it easier on your. I recommend down the road you learn how to use a movie clip as a button as well though. You use the same on handlers, but it functions slightly different since there are no Over, Out, and Down frames.

Anywho, check my .fla file. I commented some coding so hopefully it helps you out.

This is great. Thanks for the explanation.

Unfortunatly buttons and actionscript are on the main timeline. I was hoping to make them as a separate movie clip so I could multiply that button effect easly to other files and scenes.

Thanks for all your help

Why can’t you put them in a seperate movie clip? All you have to do is select all the movieclip symbols of the navigation and convert them into 1 big movie clip symbol that houses all the buttons. You can add the actions to a frame in that timeline too so you don’t have to change any targetting.

Here is a modified attachment showing what I mean.

Now this is perfect. Exactly what I was looking for.

I was trying to convert them in the first file but I didn’t get the result. I guess it’s just me.

Thanks for help

Your targeting was probably wrong. I cut and pasted the AS from the main timeline into the timeine of the movie clip of the navigation so that a)it would be easier to find and b)easier to target the clips

I am glad I could help you out.

If you don’t mind, could you please explain the first part of the actionscript. I got confused what does where.

MovieClip.prototype.elasticScale = function(targt, accel, friction) {
this.speed += (targt-this._xscale)*accel;
this.speed *= friction;
this._xscale = this._yscale += Math.floor(this.speed);

I understand the first line:

MovieClip.prototype.elasticScale = function(targt, accel, friction)

I don’t understand how speed, tergt, accel, and friction are understood by program.

targt, accel, and friction in the function are called parameters.

When you call the function you must define these parameters for the code to work.

As you see it says function(targt, accel, friction)

And in the script it is called as…[AS]this.elasticScale(120, .9, .6);[/AS]

Where 120 is the targt (target size), .9 is the accel (acceleration), and .6 is the friction. These are basically just variables that you can name whatever you want, as long as you make sure they coorespond with the code within the function.

If you look at the code in the function you will see how targt, accel, and friction are used, these pull the values of parameters in the function and use it within the script.

As for the code itself… it is just an equation for elasticity, if you want a better explanation of the equations you best ask Senocular, he originally wrote the prototype and is excellent and explaining things.