This is a style, so use setStyle() method.
hbox.setStyle('horizontalAlign','center');
I'll also note that creation and attachment of children should be done in
createChildren() which is part of the SDK Component Lifecycle and
automatically called when necessary.
DK
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
On Wed, Dec 3, 2008 at 1:00 PM, eric decoff <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> Trying to extend HBox in ActionScript 3 back to formula ( heheheh )
>
> Question how do I get HorizonalAlign to work?
>
>
> // ActionScript file
> package components{
> import flash.text.AntiAliasType;
> import flash.text.TextField;
> import flash.text.TextFieldAutoSize;
> import flash.text.TextFormat;
>
> import mx.containers.HBox;
> import mx.controls.Label;
> import mx.events.FlexEvent;
>
> public class AdvanceHBoxTest extends HBox {
> [Embed(source="Fonts/SanvitoPro-Semibold.otf",
> fontFamily="SanvitoPro-Semibold",
> fontWeight="bold")]
> private var SanvitoPro_Semibold:Class;
>
> protected var TitleLabel:Label = new Label();
> protected var TitleTextField:TextField = new TextField();
>
> public function AdvanceHBoxTest(){
> super();
> this.addEventListener(FlexEvent.CREATION_COMPLETE, buildTitle);
> }
>
> protected function buildTitle(enable:Boolean):void{
> TitleTextField.embedFonts = true;
> TitleTextField.autoSize = TextFieldAutoSize.LEFT;
> TitleTextField.antiAliasType = AntiAliasType.ADVANCED;
>
> // TextFormat
> var tf:TextFormat = new TextFormat();
> tf.font = "SanvitoPro-Semibold";
> tf.size = 72;
> tf.color = "0xFFFFFF";
> tf.bold = true;
>
> TitleTextField.background = true;
> TitleTextField.backgroundColor = 0x00FF00;
> TitleTextField.border = true;
> TitleTextField.defaultTextFormat = tf;
> TitleTextField.text = "Test";
> TitleTextField.alpha = 1;
>
> rawChildren.addChild(TitleTextField);
> }
> }
> }
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------