Audio player - need help tracing mouse position in a circle

Hi,

I’m working on a simple audio player in which the play progress bar is in the shape of a circle, thus I’m having a difficult time coming up with the formula to track where the mouse is so that when you click, the track (and playhead) advance to that spot.

The SWF can be see here for reference: http://bus15.com/temp/audioplayer/

My code looks like this:

stop();
import caurina.transitions.Tweener;
import caurina.transitions.properties.*;
ColorShortcuts.init();

var startVolume:Number = 100;
var loopTrack:Boolean = false;


var duration:Number;


//--------------------------------------------------------------------------
// Locate MP3 File
//--------------------------------------------------------------------------
if(file != undefined){
	var file:String = file;
} else {
	var file:String = "audio/test.mp3";
}

//--------------------------------------------------------------------------
// Check AutoStart
//--------------------------------------------------------------------------
if (autoStart == false) {
	playBut._visible = true;
	pauseBut._visible = false;
} else {
	playSong();
	playBut._visible = false;
	pauseBut._visible = true;
}

//--------------------------------------------------------------------------
// Play Function
//--------------------------------------------------------------------------
function playSong() {
	if (pausePos>0) {
		my_sound.start(pausePos,0);
		pausePos = 0;
	} else {
		loadSound();
	}
	
	playBut._visible = false;
	pauseBut._visible = true;
	
	my_interval = setInterval(updateProgressBar, 100, my_sound);

}


function loadSound(){
	my_sound = new Sound();
	
	my_sound.onLoad = function(success:Boolean) {
		duration = this.duration/1000;
		trace(this.duration+" ms ("+Math.round(duration)+" seconds)");
		var minutes:Number = Math.floor(duration/60);
		var seconds = Math.floor(duration)%60;
		if (seconds<10) {
			seconds = "0"+seconds;
		}
		trace(minutes+":"+seconds);
	};
	
	my_sound.setVolume(startVolume);
	my_sound.loadSound(file,true);
		
	my_sound.onSoundComplete = function(info):Void {
		if(loopTrack){
			playSong();
		} else {
			pauseBut._visible = false;
			playBut._visible = true;
			my_sound.position = 0;
			my_sound.stop();
		}
	};

	// check loading bar
	this.onEnterFrame = function() {

		total = my_sound.getBytesTotal();
		loaded = my_sound.getBytesLoaded();
		percentloaded = Math.round(loaded/total*100);
		//trace("Loading: "+percentloaded);
			
		circleProgress.loadProgress.gotoAndStop(percentloaded);
		if(loaded == total){
			//trace("100%");
			delete this.onEnterFrame;
		}
	};
}


//--------------------------------------------------------------------------
// Updating Play Progress Bar
//--------------------------------------------------------------------------
function updateProgressBar(the_sound:Sound):Void {
	pos = Math.round(the_sound.position/the_sound.duration*100);
    if (trackDrag != true) {
		circleProgress.playProgress.gotoAndStop(pos);			
	}
}


//--------------------------------------------------------------------------
// Track Advance
//--------------------------------------------------------------------------
circleProgress.loadProgress.onPress = function() {
	this._parent.trackDrag = true;
	
	this.onEnterFrame = function() {
		//mousePosition = ??????????????????
		trace(mousePosition);
		
		perc = (mousePosition/100);
		max = pos/100;
		perc > max ? perc = max : null;
		perc < 0.01 ? perc = 0.01 : null;
		
		circleProgress.playProgress.gotoAndStop(perc);
		pausePos = (perc*duration);
	};
};
circleProgress.loadProgress.onRelease = circleProgress.loadProgress.onReleaseOutside = function() {
	delete this.onEnterFrame;
	this._parent.trackDrag = false;
	my_sound.stop();
	playSong();
};



//--------------------------------------------------------------------------
// Play button
//--------------------------------------------------------------------------
playBut.onRollOver = function() {
	//Tweener.addTween(this,{_color:"0x"+playPauseRollOver, _alpha:"0x"+playPauseRollOverAlpha});
};
playBut.onRollOut = function() {
	//Tweener.addTween(this,{_color:"0x"+playPauseColor, _alpha:"0x"+playPauseAlpha});
};
playBut.onRelease = function() {
	playSong();
};
//--------------------------------------------------------------------------
// Pause button
//--------------------------------------------------------------------------
pauseBut.onRollOver = function() {
	//Tweener.addTween(this,{_color:"0x"+playPauseRollOver, _alpha:"0x"+playPauseRollOverAlpha});
};
pauseBut.onRollOut = function() {
	//Tweener.addTween(this,{_color:"0x"+playPauseColor, _alpha:"0x"+playPauseAlpha});
};
pauseBut.onRelease = function() {
	this._visible = false;
	playBut._visible = true;
	pausePos = my_sound.position/1000;
	my_sound.stop();
};