You would want to have that code triggered by an enterFrame event. So for instance, you could place this on the first frame of the root that your swift3d movieclip shows up on.
this.onEnterFrame = function() {
bMoveAhead = !bMoveAhead;
if (bMoveAhead) { mySwiftAnimation.nextFrame(); }
}
just be sure to remove it when you're done with it:
delete(this.onEnterFrame);
Cheers,
Grant Skinner.