PDA

View Full Version : Cylcing movie clips


dschiltz
08-17-2007, 01:19 AM
Hello, pretty quick & basic question here. I have three movie clips I want to use buttons to cycle through the clips and that have fades in between them. I think that I should be able to use an if else statement, but I think I'm goofin' it somewhere. I can't seem to get it to work so that all options are available no matter that clips the user is on. It will cycle through once and then I can't get it to remain active. The code I'm trying to work with is as follows:

prvBtn.onRelease = function() {
if (sm03._alpha>=100) {
sm03.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
this._alpha = 0;
delete this.onEnterFrame;
} else {
sm02.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
this._alpha = 0;
delete this.onEnterFrame;
sm01.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha = 100;
delete this.onEnterFrame;
}
}
}
}
}
};
}
};


nxtBtn.onRelease = function() {
if (sm01._alpha>=100) {
sm01.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
this._alpha = 0;
delete this.onEnterFrame;
} else {
sm03.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
this._alpha = 0;
delete this.onEnterFrame;
sm02.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha = 100;
delete this.onEnterFrame;
}
}
}
}
}
};
}
};


So any help would be appreciated.

THanks!