Help fixing a power bar

'm trying to make a simple power bar seen in PC billiard games, in which the power bar extends as far as the mouse is. But I’ve been having some problems.

If you’d like to see the problem its very obvious heh,
::FILE::

As for the code I currently have, it’s here:

var xdif:Number;
var ydif:Number;
var tehpwr:Number;
pwrbar.addEventListener(Event.ENTER_FRAME, rot);

function rot(e:Event):void
{
	xdif = mouseX-pwrbar.x;
	ydif = mouseY-pwrbar.y;
	pwrbar.rotation = Math.atan2(ydif,xdif)*(180/Math.PI);
	pwrbar.width = Math.sqrt(Math.pow(xdif,2) + Math.pow(ydif,2));
	
        // tehpwr = Math.sqrt(Math.pow(xdif,2) + Math.pow(ydif,2));
	//pwrbar.height = Math.sin(pwrbar.rotation * (Math.PI/180)) * tehpwr;
	//pwrbar.width = Math.cos(pwrbar.rotation * (Math.PI/180)) * tehpwr;
	
	//trace(Math.sqrt(Math.pow(xdif,2) + Math.pow(ydif,2)), "  xdif: ", xdif, "  ydif: ", ydif);
	//pwrbar.scaleY = 1;
}
}

I’ve also tried splitting up the height and width to fix the problem (that code is commented out)

If any additional information is needed just let me know. All help is appreciated! Thanks!