# Firefox 3 AS3 Textfield Bug

**URL:** <https://forum.kirupa.com/t/firefox-3-as3-textfield-bug/264634>\
**Category:** web dev\
**Created:** [June 27, 2008, 10:41pm UTC](https://forum.kirupa.com/t/firefox-3-as3-textfield-bug/264634 "2008-06-27T22:41:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [June 27, 2008, 10:41pm UTC](https://forum.kirupa.com/t/firefox-3-as3-textfield-bug/264634/1 "2008-06-27T22:41:04Z")

</div>

**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/](http://www.kirupa.templarian.com/bug/) \< “=” are read as “+”

[http://www.kirupa.templarian.com/bug/syntax.swf](http://www.kirupa.templarian.com/bug/syntax.swf) \< Works

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

```auto
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).

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [June 28, 2008, 1:16pm UTC](https://forum.kirupa.com/t/firefox-3-as3-textfield-bug/264634/2 "2008-06-28T13:16:08Z")

</div>

This bug aint showing up on FF3 OS X …

---

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [June 28, 2008, 2:20pm UTC](https://forum.kirupa.com/t/firefox-3-as3-textfield-bug/264634/3 "2008-06-28T14:20:15Z")

</div>

^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.

```auto
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;
			}
		}
	}
}

```
