Help with setInterval and pausing animation?

Howdy all,

I am using this script from Actionscript.org:

[AS]
//In your main “action” timeline, frame 1 put the following code:
////////////////// Pause Function /////////////////////
this.createEmptyMovieClip(“timer”,50);
timer.onEnterFrame = function()
{
if (this.startTime>0)
{
var diff = getTimer()-this.startTime;
if (diff>this.timerLength)
{
this.target.play();
this.startTime = 0;
}
}
};
function pauseFor(theTime)
{
stop();
timer.timerLength = theTime;
timer.startTime = getTimer();
timer.target = this;
}
///////////////////////////////////////////////////
//Then on the frame you want to pause, add: pauseFor(3000)
//this would pause for 3 seconds.
[/AS]

I have the function written on my main time line but I want to call it from the middle of an animation on a movie clip. I’m not sure how to reference the function on the maintimeline. I’ve tried referencing the created MC “timer”, I’ve tried referencing _root and other things but nothing seems to work. :h:

Basically I have a simple motion tween. I want it to get to a certain point then stop then continue. I have two tweens on one layer in my animated MC. Any suggestions?

oh yeah, and I’d like to be able to call the same function from other MCs doing similar things. How can I reference the function?