Auto re-scale text that's has been rotated

Hi

I’m using a standard piece of AS3 code that someone kindly showed me on the old forum, (possibly Didi).

private static function ScaleDownTextFieldLEFT(Input:String, Field:TextField):void
{
var wi:int = Field.width;
var xcoord: int = Field.x;
Field.autoSize = TextFieldAutoSize.LEFT;
Field.text = Input;
if (wi < Field.width)
{
Field.scaleX = wi / Field.width;
Field.x = xcoord;
}
}

This works well to scale down any text that is longer than the text field it is meant to fit in. Now I am wanting to rotate the text 90 degrees counter clockwise so it sits on its side. This scaling doesn’t work anymore. I’ve tried amending as follows:-

  private static function ScaleDownTextFieldLEFT(Input:String, Field:TextField):void
  {
  	var wi:int = Field.height;
  	var ycoord: int = Field.y;
      Field.autoSize = TextFieldAutoSize.LEFT;
      Field.text = Input;
  	if (wi < Field.height)
  	{
      	Field.scaleY = wi / Field.height;
  		Field.y = ycoord;
  	}
  }

This isn’t working though. Does anyone have any thoughts?

This seems to have done the trick in case anyone wondered:-

private static function ScaleDownTextField(Input:String, Field:TextField):void
{
var wi:int = Field.height;
var xcoord: int = Field.y;
Field.autoSize = TextFieldAutoSize.LEFT;
Field.text = Input;
if (wi < Field.height)
{
Field.scaleX = wi / Field.height;
Field.y = xcoord;
}
}

I would try to wrap the textfield into a movieClip and rotate that. That should work with the standard code.