I’m having trouble understanding why my i variable in this script doesn’t carry through to the " mySubMenus*.alphaTo (100,1);" line. When I trace it returns a value of 3, but it’s working for myButtons*. There must be a way to pass that * value someplace else, but I can’t figure it out. Any one have any ideas?
BTW, this is a variation of one of the mc_tween samples. Thanks!
var myButtons = [this.servicesBtn, this.portfolioBtn, this.peopleBtn];
var mySubMenus = [this.servicesLevel2, this.portLevel2, this.peopleLevel2];
// Loops on all buttons from the first to the last one
for (var i=0; i<myButtons.length; i++) {
myButtons*.onRollOver = function() {
this.colorTo(0xFFFFFF,.25,"easeOutSine");
};
myButtons*.onRollOut = myButtons*.onReleaseOutside = function() {
this.colorTo(0xCCCCCC,.25,"easeOutSine");
};
myButtons*.onRelease = function() {
this._parent.activateItem (this);
// *** Function here
this.blueArrow.alphaTo (100, 1);
mySubMenus*.alphaTo (100,1);
};
}
this.activateItem = function(item) {
// Function that activates a button.
// Checks if there's an activated item already; if so, deactivates it.
if (this.currentItem != false) this.deActivateItem();
// Activates it, finally
this.currentItem = item;
this.currentItem.colorTo(0x4F89AB,.25,"easeOutSine"); // makes it 'disabled'
this.currentItem.enabled = false; // makes it a disabled button, so it won't receive mouse events
};
this.deActivateItem = function() {
// Deactivates the current activated menu item.
this.currentItem.enabled = true; // back to a normal button/movieclip
this.currentItem.colorTo(0xCCCCCC,.25,“easeOutSine”); // back to its original color
this.currentItem.blueArrow.alphaTo (0, 1);
mySubMenus*.alphaTo (0,1);
this.currentItem = undefined;
};
this.stop();