Hi Guys,
This was weirdest problem that I faced while migrating my code base from 4.5 to 4.6 SDK.
When I compile my code with 4.5.1 SDK everything works as per required. But when I compile the same code base with 4.6 then TextInput seems to loose data when my view gets active.
There are couple of quick things that I tried and seems to work.
I think it appears that StageText is active by default in 4.6 so thats messing things up.
I tried couple of things which seems to work.
- After setting the value for the TextInput in one of my function I called setFocus() immediately on it and it seems to work, but the more appropriate solution would be (2)
- Another thing that I did is to actually have skinClass defined to use TextInputSkin exclusively.
I hope I am making sense if not here is what I did to setup my TextInput skin
[geshi lang=”mxml” nums=”1″ target=”_self” ]
1 |
<s:TextInput width="100" id='year' skinClass="spark.skins.mobile.TextInputSkin" text="blah"/> |
I did not do excessive tests on this topic so I cannot really add more to it right now. I hope above works for you. If not then try adobe forums.
Cheers,
Hi,
Another solution can be onCreationComplete please include the following code:
this.addEventListener(FocusEvent.FOCUS_IN,onFocus);
private function onFocus(event:FocusEvent){
focusManager.setFocus(txtInput)//txtInput is Id of the textInput
}
Thanks a Lot for giving such a great solution.
Thank you!
You really solved my problem.
Hi!, i have the same problems but only when i tested in my android, another problem i have, is when i create a component and i put it in the view, the text of the textfield is over the component i dont know why, and with the beta version of flex didnt happening, i dont know if the reason is the new SDK of the new version 4.6, but with another projects where didnt happen its happening now, any idea why happening?
ok,Your solution has solved my other problem, thanks for your help :)…
Wow! I can’t even begin to fathom how many hours you just saved me. Thanks for this great tip.