I may be losing my mind. I am simply trying to add a textfield and addchild to that textfield.
Here is the textfield class
package {
import flash.display.*;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
public class TextTween {
// public var label:TextField;
// public var labelText:String;
public function setLabel(str:String) {
var labelText:String = str;
configureLabel(labelText);
}
public function configureLabel(labelText:String):void {
var tField:TextField = new TextField();
tField.text = labelText;
tField.x = 200;
tField.y = 200;
tField.autoSize = TextFieldAutoSize.LEFT;
tField.background = true;
tField.border = true;
var format:TextFormat = new TextFormat();
format.font = "Verdana";
format.color = 0xFF0000;
format.size = 10;
format.underline = true;
tField.defaultTextFormat = format;
// addChild(tField);
trace (tField.text); // traces out perfectly
}
} // end class
} // end package
This is how I am calling it from Frame 1
var texty:TextTween = new TextTween();
var blah:String = "blabbers";
texty.setLabel(blah);
Works great until I try to addChild to that textField from either Frame 1 or the class itself. I can trace it perfectly, trace the class, trace the functions, trace everything in the functions but I can not addChild. Ugh. Anybody know whats going on? This is scaring me.:look: