;

PDA

Click to See Complete Forum and Search --> : How do you link shapes and buttons together?


zeckdude
12-09-2005, 07:44 AM
Hello,

I'm trying to link a shape and a button together like in the Menu Slider example at http://www.flashpulse.com/koolsource/ under scripts. The Actual Flash is at http://www.flashpulse.com/koolsource/preview/menuslider.html.

Also, do you all know if there are any other mouse over states other than color fill? Is there any blinking or flash or gradual fill on a mouse over state for example?

Also, does anybody know of a complete tutorial that explains the basics behind making a simple Flash Menu?

blanius
12-09-2005, 09:14 AM
my entire site is based on this code.

Basically it's a matter of keeping track of the variables

In the movie(shape must be a MC) to move you put code like

onClipEvent(load){
_root.posx=5;
}

onClipEvent(enterFrame){
this._x-=(this._x-_root.posx)/5;
}

what that does is every frame it reduces by the difference in the clip's X position less the variable until it's zero difference. The /5 sets the speed that this happens. A little trial and error is needed to find the need posx value to put the clip where you need it.

Then each button just sets the posx value, since the clip is always adjusting the x position by the difference it will move as soon as that variable changes. In my case I put the posx as a varible in the root movie so it's always referenced as _root.posx in the buttons and the child movie.


As for over states you can do anything you want in the over state, that example (button I think is included with KM) just happens to change the fill, but you could but an entire movie clip in there instead if you want, this was made much easier in the current version.