Setinterval script causing problems

Ok here’s good practice for you ActionScript wizards out there.

I have 6 buttons. When clicked they are assigned a value (num =1 for button 1 and 2 for button 2, etc). Then there’s 6 corresponding MC which are numbered from 1-6. If num = 1 then MC1 plays. And if num=2 then MC2 play, etc.

Pretty simple stuff so far. Although a problem was that if you click button one and then you click say button 3, I needed the animation in MC1 to stop so the animation in MC3 can start. So for this I had


this.onEnterFrame = function() {
	if (_root.click != num) {
		this.onEnterFrame = {};
		gotoAndStop(1);
	}
};

This worked great. It stopped the MC animation. Although in these same MC’s I have added a setinterval script as well


stop();
timer = function(){
        gotoAndPlay("2bubble");
        clearInterval(playInterval);
}
playInterval = setInterval(timer,6000);

So now when you click button 1 and then you click say button 3 the animation in button 1 does not stop. So it appears that first function up above is not being read. Anyone know why? Anyone had a similar problem with setInterval in the past?

Sandman9