Troubles using TLF text fields

Hello guys! Here is the issue:
I have some text field inside the movie clip. And if its width greater than specific amount - i need to squeeze the text field horisontally to fit some fixed area. My multiple tries doesn't give an effect: FullClip.width = 300 doesn't change the WIDTH of text, but change the visible area of this text.
Later i tried TLF tex field and the command FullClip.width = 300 affects correctlly. Text field fits up to area 300 px wide. And then goes troubles...
After that i compile template into .FT and uses it with CasparCG. Error is: Could not set data on layer 10. The method setData was not found. Why is it so? How can TLFTextField can affect on setData?
When i use TextField instead of TLFTextField - everything is OK, like it was before, but .width property does not affect on width of text field. What am i gonna do?

Re: Troubles using TLF text fields

I use this routine to scale the text, for many years now:

Code: Select all

private static function ScaleDownTextField(Input:String, Field:TextField, initialFieldWidth:int):void
   var wi:int = initialFieldWidth;
   Field.autoSize = TextFieldAutoSize.LEFT;
   Field.scaleX = 1;
   Field.text = Input;
   if (wi < Field.width)
      Field.scaleX = wi / Field.width;
You give it the input text, the dynamic textfield and the with of the field as it should be (the parameter is called initialTextWidth, but it's the width it should have in the end).
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland
Problems? Guide to posting Bug reports & Feature requests