[color=black]**I want to draw a ellipse using a function that looks like this :
function crearecerc(mcClip:MovieClip)
{
nRadius=parseInt(raza.text);
nX=parseInt(corx.text)+X;
nY=parseInt(cory.text)+Y;
mcClip.beginFill(parseInt(culoare_t.text, 16),100);
mcClip.lineStyle(1,parseInt(culoare_t.text, 16), 100);
var nAngleDelta:Number = Math.PI / 4;
var nCtrlPoint:Number = nRadius/Math.cos(nAngleDelta/2);
var nAngle:Number = 0;
var nRx:Number = 0;
var nRy:Number = 0;
var nAx:Number = 0;
var nAy:Number = 0;
mcClip.moveTo(nX + nRadius, nY);
for (var i:Number = 0; i < 8; i++) {
nAngle += nAngleDelta;
nRx = nX + Math.cos(nAngle-(nAngleDelta/2))*(nCtrlPoint);
nRy = nY + Math.sin(nAngle-(nAngleDelta/2))*(nCtrlPoint);
nAx = nX + Math.cos(nAngle)*nRadius;
nAy = nY + Math.sin(nAngle)*nRadius;
mcClip.curveTo(nRx, nRy, nAx, nAy);
}
mcClip.endFill();
}
This function creates a circle but I want to create an ellipse knowing just the center , right distance and down distance like in this figure :
figure
mcClip is the movie clip .
the center and the distances I take from a input text.**[/color]