I have a small mobile application (flex 4.5) in which I want to set a TextInput field to have focus when the View is finished being created. So in the creationComplete handler I just call setFocus on the TextInput field. However, this throws a null object exception in the StyleableTextField setFocus method. It appears the stage field is null. Has anyone else ran into this? Or, it there some special conditions that must be met before this can occur without an error?
Try waiting for addedToStage event.
Thanks for the suggestion. That worked. I guess the Flex world and the Air world are slightly different. Never had to do that before.
I think it is a mobile thing. If you want, file a bug and we'll see if we
can find a way around that.