You just turned wmode to “opaque” or “transparent” ?
Your keyboard does weird things in TextInputs and TextAreas ?
You are running Firefox ?
Then you just discovered a pretty flash bug called “THE WMODE BUG“.
Because everyone is complaining to Adobe and Adobe claims it is browsers fault, this issue might not be fixed tomorrow. Thus I’ve decided to create a workaround for non-standard keyboards. It currently supports 5 keyboards: French, Belgian, German, Swiss & Arabic, but the code has been designed to support other keyboards.
Here is an example. If you are using an Azerty keyboard try to type “?” or “@” char in both following text inputs.
Two components have been created, extending TextArea and TextInput Flex components. It currently uses javascript functions getClientLang() and getBrowserName() for default settings. You can also force a keyboard configuration using the forceLang parameter.
You are free to use this code, adding new text components or new keyboards support. If you want your implementation to be published, send me an email: nicolas.cynober-at-pearltrees-dot-com.
Thanks to Hans Van de Velde (Beligan Keyboard mapping), Christian Gambardella (German Keyboard mapping), Ahmad Adel Eldardiry (Arabic Keyboard mapping) and Julien Wallen (Swiss-FR keyboard mapping).
If your keyboard is not fixed yet, and you don’t want to code anything. You can use the following form to submit a list of wrong keys:
updates:
- 18/05/2008: Stop supporting this code: pearltrees.com now use the default wmode. So this workaround has been used and tested during 5 monthes.
- 18/05/2008: Add Arabic, German & Swiss keyboards. Thx to Ahmad Adel Eldardiry, Christian Gambardella & Julien Wallen.
- 18/05/2009: Add a static const to disable easily the workaround
- 18/05/2009: Fixing various bugs
- 14/12/2008: Create a form helping people to submit wrong characters.
- 11/12/2009: Fix bug for english locale.
Note aux lecteurs: Ça vous est déjà arrivé de ne pas pouvoir faire de “@” dans un site en flash ? Bah c’est ce problème là que j’essaye de résoudre. Problème qui survient uniquement sur certains types de claviers. Aucun problème sur les qwerty US…
Tags: Adobe, bug, Flash, Flex, TextArea, TextInput, wmode, workaround




20 responses so far ↓
Pierre-Antoine // déc 9, 2008 at 1:03
GG ! J’avais ce bug depuis trop longtemps… Non, jdéconne, j’avais jamais vu ça
Hans Van de Velde // déc 9, 2008 at 10:16
You’re welcome !
Wallen's // déc 11, 2008 at 1:07
When does the Swiss version comes?
Rémi Toffoli // jan 5, 2009 at 5:47
I love it !
But what about mac/pc keyboard support, does it work ?
Nicolas // jan 5, 2009 at 6:08
Yes. It does work. Through javascript the component may render inputs based on operating system.
Anyway it has not been tested that much on mac.
Devaraj // fév 2, 2009 at 1:46
I am loving it!!
Micky // fév 17, 2009 at 12:01
Hi
I am trying your fix
however,
lang = ExternalInterface.call(”getClientLang”);
browser = ExternalInterface.call(”getBrowserName”);
I am readying null, any idea?
Nicolas // fév 17, 2009 at 12:26
Indeed. I didn’t comment that part. You have to create two javascript functions called getClientLang and getBrowserName.
getClientLang must return the lang code. e.g: “fr” or “en”.
getBrowserName must return the browser name. e.g: “Firefox” or “Explorer”.
In my case the lang value is generated by the server. And the getBrowserName is using the following code:
http://www.quirksmode.org/js/detect.html
Micky // fév 17, 2009 at 12:30
Non capisco dove trovare quelle due funzioni scusa
Micky // fév 17, 2009 at 12:35
Thank you Nicolas
Do you know how I can get the language with a js?
Nicolas // fév 17, 2009 at 1:01
As I said, I use my server to create dynamically this value. So it depends of what you are using on your server (in my case PHP Zend).
Basically I use the language sent by the client in its HTTP header.
xenogears // fév 25, 2009 at 1:02
I’m french, but I will try to speek english (sorry).
you had a good iddea but it doen’t working. I’ve a french keyboard, and I can’t make ë % µ £ ¤ .
and how do you make for mac keyboards and for linux ? have you tryed on it ? I think not.
Sorry but your source isn’t perfect.
good luck
Nicolas // fév 25, 2009 at 3:56
Thanks for your input !
“I can’t make ë % µ £ ¤ .”
=> I will add them in the next release. It should come pretty soon, I’ve fixed several bugs recently.
“have you tryed on it ? I think not.”
=> I did, but it is less supported than Firefox.
“Sorry but your source isn’t perfect.”
=> Indeed. Don’t forget it is still a workaround. I have ideas on how to improve it, and no time to test it.
These components are used on my website, thus you have the guarantee they will be updated and improved.
Annabelle // mai 12, 2009 at 5:36
Hello,
Frenchy girl this time
This is a good job, I guess this the most advanced script that can be found for now.
I can’t type following letters : ¨ §
Is it part of the next release ?
Thanks a lot
Nicolas // mai 18, 2009 at 5:21
Oups Annabelle I have forgot this one
next time maybe…
jdecuyper // mai 22, 2009 at 7:10
Bonjour Nicolas!
I used your code to port it to AS 2.0. I left your credits inside of course. I changed the interface a bit since the mexican keyboard allows other keys combinations to write down é, á, etc. Is this ok with you?
Excellent work by the way, like Annabelle said, there is no such good script available yet.
Pieter // juin 10, 2009 at 9:39
Hello Nicolas, quite decent indeed! I’ve been dicing with this bug as well, and you’ve given me a few good ideas to improve on my workaround.
Unfortunately, I fear I have to add to your troubles, since not only FF is affected. This bug extends to Safari and Chrome as well (pretty much all the webkit browsers)
This is definitely one of the most annoying bugs I’ve encountered in my years of using both Flash and Flex, and it doesn’t seem like it will get fixed anytime soon. Perhaps we should sit together some time and see if we can’t start a project to find a suitable workaround once and for all
maxime // août 20, 2009 at 3:36
Bonjour, je suis tombé sur votre code qui m’a l’air bien pratique. Je me le garde sous le coude au cas ou, mais j’ai remarqué que la dernière version de firefox corrige le problème.
En effet j’ai eu le problème de charactères qui ne passent pas avec FF3.0.13, et j’ai trouvé ce workaround… entremps une mise à jour de firefox vers la 3.5.2, et je n’ai plus de problème.
Merci en tout cas pour partager votre travail.
Cedseat // oct 9, 2009 at 9:30
In firefox 3.5.2, the arrows keys are dispatch to time in wmode (transparent or opaque), whereas in firefox 3.0.* the bug not exist.
In addition, in chrome the problem of combination already exist.
ali benabdelaziz // nov 19, 2009 at 11:03
I had the same problem(and head ache) with email fields on a flex contact form using french keyboard.
Characters like “@” are rendered as”à” and so on.
For email fields the replace method included in a validateField() method would do the job seamlessly.
Let’s say I plugged my “validateField” method to the “change” event listener of a TextInput.
It’d look like this
private function validateField(event:Event):void{
var field:TextInput= event.target as TextInput;
if(field.text.indexOf(”à”)>-1){
field.text=field.text.split(”à”).join(”@”);
}
}
Leave a Comment