Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Input is reverting text when the application is deployed to IPhone, using Flash Builder 4.5

We are building a mobile application using Flash Builder 4.5.1, our application contains a text input that must accept arabic characters and should be "Right To left" directed. on the emulator all is working fine, while on the device it is not. When you type the characters they appear fine, but as soon as the textinput looses focus, the characters are instantly reverted.

The code for the text input is simply <s:TextInput id="txtTest" direction="rtl"/>,

Does any know what might be the issue?

This is also appearing on Android devices, When I compile the application to android mode, the arabic text in the Text Input is appearing as white boxes!!! also the arabic text in labels is fine.I tried embedding fondts but the text input won't take the new fonts!

Thanks

like image 386
Hassan Mokdad Avatar asked Jan 10 '12 15:01

Hassan Mokdad


1 Answers

I noticed something similar to this while developing an application with Flash Builder 4.6. What I noticed is that when I focus on a text area the font in that text area will change and when I focus out the font will revert back. This only happens in iOS. It appears that some default device font is used when inputting text and then the app's font is applied after the text is inputted. The reason you are not seeing the font after the text is inputted and your app's font is then applied, is most likely because you did not embed the font into the app (this would also explain why it works in the emulator and not on the device). Embedding fonts in a flex mobile project is not very straight forward. You need to embed a font twice, once with embedAsCFF set to false and again with embedAsCFF set to true. Then depending on what type of text area you are using, you need to apply CSS with the proper font family to it. Here is an article which explains the process clearer http://blogs.adobe.com/jasonsj/2011/08/embedding-fonts-in-flex-mobile-projects.html. One last thing, if you embed the fonts and are still having trouble, try setting the textarea's embedFonts property to true (it does not mention this in the article, but it worked for me).

like image 76
hackattack Avatar answered Nov 03 '22 08:11

hackattack