PDA

View Full Version : error when adding style to textfield



uberalles
June 18th, 2008, 11:06 AM
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.

Alex Lexcuk
June 18th, 2008, 01:24 PM
unknown, but


var style:StyleSheet = new StyleSheet();
var styleA:Object = new Object();
var styleA_linc:Object = new Object();
var style_div:Object = new Object();
style_div.color="#220000";
style_div.textAlign="center";
styleA_linc.color="#220000";
styleA.color = "#FF0000";
styleA_linc.fontWeight = "bold";
//styleA.fontStyle = "italic";
style.setStyle("h1", style_div);
styleA.textDecoration="underline";
style.setStyle("a", styleA);
style.setStyle("a:hover", styleA_linc);

my_txt.styleSheet=style;


http://dnadillo.dn.ua/fla/XML/img-xml.swf
http://dnadillo.dn.ua/fla/XML/mur_xml_file_img.xml