views:

478

answers:

1

Hi,

I want to change font name, font size and character embedding properties of a component (Combobox in my case) through Flash IDE (not in action script). Is there an option to do that?

Thanks.

+1  A: 

No, you need to use ActionScript to do that. Here is how I do it:

package com.twoa.ui.base.controls {
    import fl.controls.ComboBox;
    import fl.controls.List;
    import flash.text.Font;
    import flash.text.TextFormat;

    public class MyComboBox extends ComboBox {

        private var textFormat:TextFormat;
        private var textFormat2:TextFormat;

        public function MyComboBox() {
            super();
            forceStyle();
        }

        public function forceStyle() {

            var f:Font = new Interface();

            var textFormat:TextFormat = new TextFormat()
            textFormat.size = 8;
            textFormat.color = 0xffffff;
            textFormat.font = f.fontName

            var textFormat2:TextFormat = new TextFormat()
            textFormat2.size = 8;
            textFormat2.color = 0xffffff;
            textFormat2.font = f.fontName

            dropdown.setRendererStyle("embedFonts", true);
            dropdown.setRendererStyle("textFormat", textFormat);

            textField.setStyle("embedFonts", true);
            textField.setStyle("textFormat", textFormat2);

        }

    }
}
sberry2A
well, the thing is that I am using default comboBox component and do quite a lot of skinning in IDE (I would have to write really lots of code in action script for that). I believe that using my own class won't allow me to change its look through Flash IDE.
negative