I use As3, and I don't have Flash CS3, which I'm gonna guess is what your using. But I do work with animations. I haven't had to do something like this yet, but i would find out the length of your animation and then connect it to an integer...
private var i:int; /*this is the number relating to the length of the animation */
public function Attack(e:Event): void {
if (Key.isDown(Space)) {
/* Do the animation */
removeEventListener(Event.ENTER_FRAME,At tack);
addEventListener(Event.EntEr_Frame, Animate);
}
publi function Animate(e:Event): void {
i++;
if (i == "HoweverLong the animation is") {
/*remove the animation*/
i = 0;
addeventListener(Event.ENTER_FRAme, Attack);
}
its a slightly ugly looking chunk of code, and like i said i have never used it before. But that would probably be my first approach to the problem. If it doesn't work then... MY BAD =P