Try
private function addAccountText(): void {
this.pAccountTextField = new UITextField();
this.pAccountTextField.styleName = this;
this.pAccountTextField.width = this.width * 65 / 100;
this.pAccountTextField.height = this.height;
this.pAccountTextField.x = this.width-this.pAccountTextField.width;
this.pAccountTextField.y = 0;
this.addChild( this.pAccountTextField );
this.setStyle( 'paddingRight', this.pAccountTextField.width + 5 );
}

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Marco 
Catunda
Sent: Saturday, December 06, 2008 7:03 AM
To: [email protected]
Subject: [flexcoders] Set up style for TextField


Hi,

I extended a textinput component to show other relationed text based
on input user.
It is a kind of personal component for application interface rules. I
could show this
text in other component behind it, but the design and usability was not so good.

The snipet code above show how I added other text (TextField) behind TextInput:

private function addAccountText(): void {
this.pAccountTextField = new TextField();
this.pAccountTextField.width = this.width * 65 / 100;
this.pAccountTextField.height = this.height;
this.pAccountTextField.x = this.width-this.pAccountTextField.width;
this.pAccountTextField.y = 0;
this.addChild( this.pAccountTextField );
this.setStyle( 'paddingRight', this.pAccountTextField.width + 5 );
}

The only problem about this code is text format.
Is is not the same format as textinput componente inheritance.
How could I apply the same format into TextField?

I've tried the following lines with no success:

this.pAccountTextField.styleSheet = this.textField.styleSheet;

this.pAccountTextField.setTextFormat( this.textField.getTextFormat() );

Any tips?

Regards
--
Marco Catunda

Reply via email to