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);
}
}
}