Hey ActionScripters!

I've recently started using Flash (Action Script 2.0). For one of the projects at school they are getting us to essentially make our own puzzle games from scratch.

On the frame at which the puzzle sits I have a big button that says start. Clicking this button makes the first puzzle piece appear on stage and when you place it within set coordinate the next puzzle piece is moved on stage and so on until piece 9; the final piece were it goes to the next frame - The score frame/winning frame?

Pretty simple, but another function the start button has is it starts a timer (timer is a var name set to a dynTextbox). Essentially I want it so that when the final piece of the puzzle is placed the timer is stopped and the time that it stopped on is saved and put on the score tab, plus stored in a var or something so that I can use it later.

I made the timer, but when I sorta figured out how to make it trace the last number in the timer I broke it and have hit a wall with no idea what to do.

Here are my codes:


START button -

Code:
on (release){
	timer = 0; //Sets the variable to 0	
	
	countup = function(enabled:Boolean){ //Creating the countup function
		if (enabled == true) {
			timer += 1; //timer function
		} else {
			timer = timer;
		}
		_root.btn_llamastart.enabled = false;
	}
	
}
on (release){
	countupInterval = setInterval(countup,1000); //Set the counting internval to X
	
	setProperty(_root.llama_p1, _x, "640.80");
	setProperty(_root.llama_p1, _y, "164.30");
}
Piece 9 (last piece) -

Code:
on (press) { //On event 'press'
	startDrag(this); //Starts draging object }
	
}

on (release) {
	stopDrag(); //Stops dragging
    if ((this._x >0) && (this._x < 30) && (this._y >260) && (this._y <360)) {  // if puzzle pieces is within these set boundaries
    	setProperty(this, _x,"14.60"); //Set objects coordinates to set ones
    	setProperty(this, _y,"314.25"); //Set objects coordinates to set ones
		gotoAndStop(4);
		var totalTime:Number = _root.timer;
		trace(totalTime);
		countup(false);
    }
}
If someone could help me do what I want to achieve, that would be awesome.

Cheers!

Also : I want to use the last time to be put on a leader board kind of thing as well. Less amount of time taken to most.