PDA

View Full Version : Checkbox text align


sonic_2k_uk
06-28-2007, 01:20 PM
Hi,

I am using the checkbox component in CS3 and am struggling to get the text "aligned" to the left.

The label is placed to the left of the checkbox field, however when i list 6 checkbox's underneath each other the start of the text in each field is at a different x coord.

I belive this is because the textField in the checkbox component is aligning the left left, but the width of the textField is set to that of the text.

I have tried setting a width to the component and to the textField e.g.

// Set input

option.input_field = new CheckBox ();
option.input_field.width = 300;
option.input_field.x = 0;
option.input_field.y = 0;
option.input_field.labelPlacement = "left";
option.input_field.label = option.name_field.text;
option.input_field.textField.width = 300;
option.input_field.textField.border = true;
option.input_field.textField.x = 0;
option.input_field.textField.y = 0;

// Set the input text format

var inputFormat:TextFormat = new TextFormat ();
inputFormat.align = TextFormatAlign.LEFT;

option.input_field.setStyle ("textFormat", inputFormat);

The code above does still not "align" the text to the left.

Cheers for any help!

Andy