TLFTextField text property not accessible in constructor

爷,独闯天下 提交于 2019-12-13 07:14:54

问题


I've placed TLFTextField in a MovieClip with some default text, MovieClip is assigned a class,

In the constructor,

trace(first_name, first_name.text); //textField is available but not the default text

however default text is available inside another function a bit later, I need the default text to be available inside constructor to do some validations stuff

(like for instance if field is empty, get the default text back on focus out event)


回答1:


got it, TLFTextFields are only available once added to the stage, did my work in stageaddedhandler.



来源:https://stackoverflow.com/questions/10656065/tlftextfield-text-property-not-accessible-in-constructor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!