set fontStyle in dynamic text with a combobox
hello,
I'm trying to make a combobox so the user can change the fontstyle they input in a dynamic text field.
Right now it says that the properties of fontStyle and setStyle are undefined properties o f TextRenderer and Textfield.
This is what I have so far.
//change font style
fontStyleCombo.prompt = "Font Style";
fontStyleCombo.addItem({label:"Medium"});
fontStyleCombo.addItem({label:"Bold"});
fontStyleCombo.addItem({label:"Italic"});
fontStyleCombo.addItem({label:"Bold Italic"});
fontStyleCombo.addEventListener(Event.CHANGE, setFontStyle);
function setFontStyle(evt:Event):void
{
var fontStyles:Object = "Bold";
if(fontStyleCombo.selectedIndex > -1)
{
fontStyles = fontStyleCombo.selectedItem.data;
}
var fontStyleFormat:TextRenderer = new TextRenderer();
fontStyleFormat.fontStyle = fontStyles;
inputTextRender01.setStyle(fontStyleFormat);
}