When @ becomes “
Flash Player - text input problems
Ever been vexed when Flash seems to think you're using a US keyboard layout, only when it's embedded in a page?
We came across the issue while building sites that require users to input an email address; when using Firefox, the @ character arrived in Flash as a " quote mark. After a little more testing it turned out, regardless of your setup, a transparent Flash movie in Firefox will always receive keyboard input as if from a US keyboard.
So (here in the UK) our @ and " characters get swapped around. Indeed, it seems that Flash embedded on a page with the wmode parameter set to transparent has been giving Flash developers headaches with text input for many a moon.
It's not just the Firefox @ mix-up either, but rather than me reiterating the specific issues, why not read about them and get a handy ActionScript 2 / JavaScript workaround here.
But Mike, why are you telling us this?
Well, I recently needed an AS3 solution to the problem, and converted astgtciv's AS2 version to meet my needs.
So here it is, released under a Creative Commons licence (as was the original)
Try it / Get it
Update 22/04/09 :
It seems that Adobe are aware of the issue, but as yet there's no official solution.
Update 11/12/09 :
This has apparently been fixed in Flash Player 10.1 - out now.












Thanks for transform it to AS3. It works very well but don’t support htmlText. The Style Information always reseted.
Hi Daniel,
You’re right – the current version doesn’t support editing textfields with HTML content, it only works on the .text property of a field.
Support for editing HTML might be something I’ll look into but I have no need / time for it right now.
If you want to have a dabble, I think the trick will be calculating the html equivalent of the caretIndex after an insert – the position of the insert in the .htmlText
If anyone does want to add any features to the code we could upload it to google code – leave a comment to let us know.
This was annoying me for at least an hour. Thanks!!
Looks like this may finally be solved in 10.1 later this year…
http://bugs.adobe.com/jira/browse/FP-501
What to do to use it on Flex?
It’ll be just the same as any other situation, include the JSTextReader class in your project and initialise it with a reference to the Flash stage.
JSTextReader.getInstance().init(stage);
That’s it. It will intercept change events in input TextFields and make sure the right characters are displayed (by checking them against JavaScript key events).
Hi there to all,
I try this solution but it don’t work on safari, is there any workaround??
Not worked ar Opera browser at all. It does not recieving 2-bytes characters in his flash-plugin. There are always 1-character… sadly…
You could try out the beta of Flash Player 10.1 – which fixes various long-standing issues with the player, including this one.
http://labs.adobe.com/technologies/flashplayer10/
so this is not a complete fix?
anyone know of a complete fix – could really do with knowing this as i embed a lot of videos on transparency which have flash forms at the end of them
The only complete fix will be to ensure your users view the content with Flash Player 10.1 – which fixed the issue, and was released earlier this year.
If you specify a minimum version of 10.1 in your embed html (assuming you’re using SWFObject or similar) then you’re on your way…
And this bug still manages to raise it’s ugly head – using up-to-date Crome 8 Beta that (I believe) has integrated Flash Player 10.1.103.19… and @ became 2 on Swedish/Finnish keyboard.
Thank you – this fix saves the day.
Doesn’t work with safari! Any ideas?
With firefox 4 it doesn’t work again
FP is 10.2
Yes, in FF4 the AltGr+q is broken (should be @) – testing on German keyboard. Instead, the input of AltGr+q is just skipped; all other inputs work fine.