Firefox 3 AS3 Textfield Bug

I just wanted to show it off I don’t think theres a solution to fix it.

I had Anogar test it just to be sure it wasn’t me. Basically if one puts a textfield in an swf and embeds it into a flash in any way (I tried a couple different ways) an equals sign is always turned into a plus sign.

Its probably the most annoying bug ever in Firefox 3. Test it yourself below (they both work in IE7 and Safari).

http://www.kirupa.templarian.com/bug/ < “=” are read as “+”

http://www.kirupa.templarian.com/bug/syntax.swf < Works

Just if anyone wanted to see the flash (I doubt its the issue though).

package 
{
    import flash.display.*;
    import flash.text.*;

    public class Main extends Sprite
    {
		private var syntaxRegion:TextField = new TextField();
		
		public function Main()
        {
			syntaxRegion.text = "Click Here and Press = ";
			syntaxRegion.type = TextFieldType.INPUT;
			syntaxRegion.x = 32;
			syntaxRegion.y = 0;
			syntaxRegion.width = 200;
			stage.addChild(syntaxRegion);
        }
		
	}
}

[whisper]… why did i post this in client-side hmm… seems like more of a random thing… I can’t be the only one that ran into this bug though.[/whisper]

//edit, I fixed it (its a FF3 bug so it took a quick work around).

This bug aint showing up on FF3 OS X …

^I fixed it on the example page. lol… should of left that one broken so you guys could see what it was doing. FF3 has a lot of key input errors and those get forced to flash also.

My fix was pretty simple all I did was check to see if shift was held down when a + was being hit. Its impossible for a plus to be inputted when the shift isn’t held down thus fixed.

package 
{
    import flash.display.*;
	import flash.events.*;
    import flash.text.*;

    public class Main extends Sprite
    {
		private var syntaxRegion:TextField = new TextField();
		
		public function Main()
        {
			syntaxRegion.text = "t";
			syntaxRegion.type = TextFieldType.INPUT;
			syntaxRegion.x = 32;
			syntaxRegion.y = 0;
			syntaxRegion.width = 200;
			stage.addChild(syntaxRegion);
			syntaxRegion.addEventListener(Event.CHANGE, textChange);
			syntaxRegion.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
        }
		public var damnFF3:Boolean = false;
		public function onKeyDown(e:KeyboardEvent) : void
		{
			if (!e.shiftKey)
			{
				if (e.charCode == 43)
				{
					damnFF3 = true;
				}
			}
		}
		
		public function textChange(e:Event) : void
		{
			if (damnFF3)
			{
				syntaxRegion.replaceText(syntaxRegion.caretIndex-1, syntaxRegion.caretIndex, "=");
				damnFF3 = false;
			}
		}
	}
}