I wrote a simple class called CustomTextField.as as follows:
package{
import flash.text.TextField;
public class CustomTextField extends TextField{
private var custom_TextField:TextField=new TextField();
public function CustomTextField(){
initCustomTextField();
}
private function initCustomTextField():TextField{
custom_TextField.background=true;
custom_TextField.backgroundColor=0x333333;
return custom_TextField;
}
}
}
…and I am initiating it inside a document class as follows:
private var myTextField:CustomTextField = new CustomTextField();
myTextField.text=“Hello World!”
stage.addChild(myTextField);
It is not throwing an error but the background color is unchanged.
Can anyone answer this or help point me in the right direction?
Thanks in advance.