1

Using Flash CS3, I'm trying to center a static textfield with jsfl after I've altered its text, like so:

textElement.setTextString( text );

fl.outputPanel.trace( 'text width: ' + textElement.width );
textElement.x = -( textElement.width / 2 );
fl.outputPanel.trace( 'text x: ' + textElement.x );

fl.outputPanel.trace( 'text height: ' + textElement.height );
textElement.y = -( textElement.height / 2 );
fl.outputPanel.trace( 'text y: ' + textElement.y );

The traces all give me the correct numbers. However when I open the relevant symbol with said textfield from the library the textfield's position is off by some amount of pixels:

x: varies depending on the text width
y: always -2, no matter the text height

I've even tried the _sans font to see if that made a difference, but it didn't.

Any idea what might be going on here?

Kumsal Obuz
  • 825
  • 5
  • 14
Decent Dabbler
  • 22,532
  • 8
  • 74
  • 106

0 Answers0