TLFTextField text property not accessible in const

2019-09-19 06:42发布

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条回答
你好瞎i
2楼-- · 2019-09-19 07:34

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

查看更多
登录 后发表回答