I need some help with this one. It works upon first click and then it goes haywire. Here’s what’s supposed to happen.
RollOver = Scale to 150% and change Alpha to 100%
RollOut = Scale back to 100% and change Alpha to 60%
Release = Scale back to 100% and change Alpha to 100% and reset all other buttons’ alpha to 60%
Additionaly, I need to figure out an easy way to apply actions to these buttons individually while still using a succint script such as the one i’m working on here. Any ideas to make this script more to the point and dynamic so that I would only have to enter the name of each button once and the name of it’s link or action once would be great! I’d like to make this an easily reusable script.
This is a Flash 8 File
http://bradlyjon.com/MENU.fla
// BUTTONS //////////////////////////////////////////////////
home_btn.onRollOver = over;
home_btn.onRollOut = out;
home_btn.onRelease = clicked;
about_btn.onRollOver = over;
about_btn.onRollOut = out;
about_btn.onRelease = clicked;
projects_btn.onRollOver = over;
projects_btn.onRollOut = out;
projects_btn.onRelease = clicked;
contact_btn.onRollOver = over;
contact_btn.onRollOut = out;
contact_btn.onRelease = clicked;
// FUNCTIONS //////////////////////////////////////////////////
import mx.transitions.Tween;
import mx.transitions.easing.*;
function over() {
if(this != _root.activeMenu) {
new Tween(this, "_alpha", Regular.easeIn, 60, 100, 5, false);
new Tween(this, "_yscale", Strong.easeOut, 100, 150, 1, true);
new Tween(this, "_xscale", Strong.easeOut, 100, 150, 1, true);
}}
function out() {
if(this != _root.activeMenu) {
new Tween(this, "_alpha", Regular.easeIn, this._alpha, 60, 5, false);
new Tween(this, "_yscale", Bounce.easeOut, this._yscale, 100, 1, true);
new Tween(this, "_xscale", Bounce.easeOut, this._xscale, 100, 1, true);
}}
function clicked() {
if(this != _root.activeMenu) {
new Tween(this, "_alpha", Regular.easeIn, this._alpha, 100, 10, false);
new Tween(this, "_yscale", Regular.easeOut, this._yscale, 100, 10, false);
new Tween(this, "_xscale", Regular.easeOut, this._xscale, 100, 10, false);
new Tween(_root.activeMenu, "_alpha", Regular.easeIn, this._alpha, 60, 1, true);
_root.activeMenu = this;
}}