Placing code on the Main Timeline

I have been generosuly given this code…

main timeline -
c = 0;
on frame#1 of the clip to duplicate -
function Select(d){
if(!dragged){
duplicateMovieClip(this,“clip”+d,d);
dragged = true;
startDrag(this);
} else {
startDrag(this);
}
if(Key.isDown(Key.DELETEKEY)){
this.removeMovieClip();
}
};
on the button inside the clip -
on(press){
Select(_parent.c++);
}

I know how to add code to frames, and to symbols - but how do you add the code at the start of the message to the ‘Main Timeline’??

That looks like Jacks code to me.Ive learnt tons from him.
The main timeline is the one which contains your other clips(_root)
So as soon as you open the file, click on the first frame and type c=0