
Feb 6th, 2007, 20:10
|
|
New Member
|
|
Join Date: Feb 2007
Location: Vermont
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
It's got to be simple, but eludes...
I have a series of movieClip buttons. Only one of them can be in the "down" state at a time. What I want is for "but1" to start off in the "down" state when the movie loads, and then follow my other script that switches it to the "up" state when another button in the series is hit.
Here is my fla file
http://www.dougbarba.com/ftp/timeline3.zip
Here's what's not working. My onEnterframe code dominates the rest of the script. It is always "up".
- Code: Select all
controller_mc.but1.onEnterframe = function() {
this.gotoAndStop("down");
};
//but1,2,3,4,5,6,7,8, all here
for (var i = 1; i<=8; i++) {
controller_mc["but"+i].i = i;
controller_mc["but"+i].onRollOver = function() {
this.frameHold = this._currentframe;
this.gotoAndStop("over");
};
controller_mc["but"+i].onRollOut = function() {
this.gotoAndStop(this.frameHold);
};
controller_mc["but"+i].onRelease = function() {
butRelease(this);
};
}
function butRelease(obj) {
this = obj;
arrayIndex = this.i-1;
for (var mc in this._parent) {
var thisHold = this;
if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) {
this._parent[mc].gotoAndStop("down");
} else {
this._parent[mc].gotoAndStop("up");
}
}
this.frameHold = this._currentframe;
}
|