I am almost there I think. I am using the FUSEKit to fade in and out clips from an array.
The fade in and fade out cycle works fine for the first item in the array, however it doesn’t increment like it should to fade in and out the next clip from the array. It seems to me that the second onEnterFrame isn’t being called for some reason, perhaps an inheritance problem?
The code is basically just using an onClipEvent to see if the current clip has hit either 0 or 100 alpha and then playing the next fade in or out function after that point.
Any clue why it doesn’t increment? It should finish the cycle, move to the next array item, and then when they are all done go back to the first item, infinitely.
Thanks!
Neil
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts, PennerEasing);
function tweenStartF(box1, box2, box3) {
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}
mcArray = new Array(box1, box2, box3);
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}
n = 0;
tweenIn(n);
}
function tweenIn(n) {
mcArray[n].alphaTo(100, 2, "easeOutBack");
this.onEnterFrame = function() {
if(this._alpha == 100){
tween1Out(n);
delete this.onEnterFrame;
}
}
}
function tween1Out(n) {
this.alphaTo(0, 4, "easeInBack");
this.onEnterFrame = function() {
if(this._alpha == 0 && n<mcArray.length-1) {
n++;
tweenIn(n);
delete this.onEnterFrame;
} else {
n = 0;
}
tweenIn(n);
}
}
tweenStartF(box1, box2, box3);