RE: [Flashcoders] preventing control characters from being typed

2010-05-26 Thread Mattheis, Erik (MIN-WSW)
List Subject: Re: [Flashcoders] preventing control characters from being typed Mattheis, Erik (MIN-WSW) wrote: > I need to make a form that can be used without a mouse. I have > > etc, which captures a control-s just fine, but it types a "box" character > into the textfield. H

Re: [Flashcoders] preventing control characters from being typed

2010-05-26 Thread Henrik Andersson
Mattheis, Erik (MIN-WSW) wrote: I need to make a form that can be used without a mouse. I have etc, which captures a control-s just fine, but it types a "box" character into the textfield. How do I go about preventing this? There is a preventDefault method in the Event class. But I am not sur

Re: [Flashcoders] preventing control characters from being typed

2010-05-26 Thread Glen Pike
You can set the "restrict" property to a list of characters - see TextField docs. On 26/05/2010 16:54, Mattheis, Erik (MIN-WSW) wrote: I need to make a form that can be used without a mouse. I have private function keyHandler(e:KeyboardEvent):void { if (e.controlKey) { switch (e.keyCo

[Flashcoders] preventing control characters from being typed

2010-05-26 Thread Mattheis, Erik (MIN-WSW)
I need to make a form that can be used without a mouse. I have private function keyHandler(e:KeyboardEvent):void { if (e.controlKey) { switch (e.keyCode) { case SAVE : saveCurrentContent(); break; etc, which captures a control-s just fine, but it types a "box" character i