PDA

View Full Version : [AS3] formatText for List Component???


jeff357
10-19-2009, 01:54 PM
Can anyone help me with the "simple" task of aligning the text in a List control to be centered?

I have tried setStyle many different ways and it doesn't do anything. What am I missing?

Thanks.

jeff357
10-19-2009, 02:15 PM
Answered it myself, of course...

var tf:TextFormat = new TextFormat();
tf.align = TextFormatAlign.CENTER;

test.addItem({label:"hello1"});
test.addItem({label:"hello2"});
test.addItem({label:"hello3"});
test.addItem({label:"hello4"});

test.setRendererStyle("textFormat", tf);