ActionScript 2.0

Hello…Basically iv included actionscript which produces a 3d carousel through an xml file. everything has worked out well except I dont knw how to stop the carousel from playing throughout my flash document. I have included button and frame labels which allow you to go to different pages, but on every page the carousel is playing throughout. iv tried the stop();

What i would like is for the actionscript to disappear after frame 19 and beyound. is there anyway I could do that through actionscript maybe?

I am using Flash CS5 and Actionscript 2.0

Thank You