Posts Tagged ‘ActionScript’

We are hiring!

February 17th, 2011 by Martin

Are you a Flex developer that love UX and cool  application design? Do you love Erlang and want to build something with it? Or are you interested in Linux customisation/tuning or even embedded devices? Yes? So why not work together? Our company is looking for developers that want to work on cutting edge technologies. If you are interested do not hesitate to contact me for more information. ;)

 Tags

AIR issues with entering Czech characters into text control

February 2nd, 2009 by Martin

While I was working on Flex application that was integrated as desktop application using Adobe AIR, I face this very strange issue. While I was entering text into TextField, all previously entered text disappears after pressing Shift+4/č! It was really frustrating bug not only from user experience point of view ;). So how to fix it if it is out of your control? Simplest way is to wait for a fix from Adobe, but I was not my case.  I wrote a small workaround. It is not ideal, because all these workarounds are for certain cost.  I created a small method for filtering wrong inputs and correct them. Yes, it is not so nice, but it saved my project timeline ;).

public static function fixTextInput(event:KeyboardEvent) : void {
  if ((event.charCode == 13) && (event.keyCode == 52)) {
    event.preventDefault();
    var control:TextInput = TextInput(event.currentTarget);
    if (event.shiftKey) {
      control.text = control.text.substring(0,control.selectionBeginIndex) + "4" + control.text.substring(control.selectionBeginIndex,control.text.length);
    } else {
      control.text = control.text.substring(0,control.selectionBeginIndex) + "č" + control.text.substring(control.selectionBeginIndex,control.text.length);
    }
    control.setSelection(control.selectionBeginIndex + 1, control.selectionBeginIndex + 1);
  }
}
 Tags
Text size: A A