Hey Folks,
I could really use you’re help on this one. I am building a site in flash that contains a number of cog movie clips. In this animation I have a lever that can shut off the cogs and make the cogs go forward and reverse. I seem to have the forward and stop functionality working, but I can’t seem to get the cogs to go in reverse in a constant loop. They will only go in reverse until the beginning of the timeline. Below is the script I am using:
CODE TO STOP CLIP:
function stopClip() {
this.stop();
}
lever1_mc.onPress = function() {
cog1_mc.onEnterFrame = stopClip;
cog2_mc.onEnterFrame = stopClip;
wmncg.onEnterFrame = stopClip;
cog3_mc.onEnterFrame = stopClip;
cog4_mc.onEnterFrame = stopClip;
cog5_mc.onEnterFrame = stopClip;
cog6_mc.onEnterFrame = stopClip;
cnvyr .onEnterFrame = stopClip;
logo.onEnterFrame = stopClip;
balls.onEnterFrame = stopClip;
chn.onEnterFrame = stopClip;
swish_mc.onEnterFrame = stopClip;
gotoAndStop(2);
};
CODE TO REVERSE CLIP:
function rewindClip() {
this.prevFrame();
if (this._currentframe == 1) { delete this.onEnterFrame;
}
for(var i:Number =0; i < 20; i++)
{
this.rotation.prevFrame();
}
}
rewind_bttn.onPress = function() {
cog1_mc.onEnterFrame = rewindClip;
cog2_mc.onEnterFrame = rewindClip;
wmncg.onEnterFrame = rewindClip;
cog3_mc.onEnterFrame = rewindClip;
cog4_mc.onEnterFrame = rewindClip;
cog5_mc.onEnterFrame = rewindClip;
cog6_mc.onEnterFrame = rewindClip;
cnvyr .onEnterFrame = rewindClip;
logo.onEnterFrame = rewindClip;
chn.onEnterFrame = rewindClip;
balls.onEnterFrame = rewindClip;
swish_mc.onEnterFrame = rewindClip;
gotoAndStop(5);
};