Stop the button code until animation ends

[COLOR=black][FONT=Verdana]Hi Guys,

very new here, don’t know whether someone had similar problem. I need help in fixing this ■■■■ thing. I think it is a small fix. Well here is the scenario.

I have Previous and Next Buttons. I have the required code that makes them work perfectly. And on each button click i am doing some animation using the Tween effect in Action Script 3. My code on Next is this

var PMTween1:Tween = new Tween(P_M, “x”, Regular.easeOut, P_MN1, P_M.x, 1, true);

Since the animation spans for 1 sec I don’t want any code to be executed until it stops. That means during this animation if the user clicks Previous i don’t want that code to get execute until the Next codes animation stops. Hope I made it clear.

Please help.[/FONT][/COLOR]