I’m trying to add a stylesheet to a textfield and I keep getting this error:
1119: Access of possibly undefined property styleSheet through a reference with static type fl.controls:TextInput.
here is the code in question (chatarea is the textfield obviously):
var style:StyleSheet = new StyleSheet();
var heading:Object = new Object();
heading.fontWeight = "bold";
heading.color = "#FF0000";
var body:Object = new Object();
body.fontStyle = "italic";
style.setStyle(".h1", heading);
style.setStyle("body", body);
chatarea.styleSheet = style;
I get the error on “chatarea.styleSheet = style;”. Anyone know what’s causing this?
Thanks in advance.