Restrict chars property
hi,
sorry if has been covered already, there property can set restrict characters entered in editable container? or have listen flowoperationevent , remove chars don't after they've been typed ... or there way.
thanks.
there no restrict chars property in tlf, there in flex gumbo components use tlf. may want @ using gumbo components. if doesn't work you, , want yourself, best way listen flowoperationend event, gets sent after operation has fired. check textlength of textflow there, , if it's on limit, call editmanager delete characters. undo single unit.
here's sketch @ how might look:
textflow.addeventlistener(flowoperationevent.flow_operation_end,limitpaste,false,0,true);
private function limitpaste(event:flowoperationevent):void
{
if (textflow.textlength > maxflowlength)
{
var trimamt:int = textflow.textlength - maxflowlength;
var pasteend:int = pasteposition + (operation.absoluteend - operation.absolutestart);
textflow.interactionmanager.setselection(pasteend - trimamt, pasteend);
( textflow.interactionmanager ieditmanager).deletenext();
}
}
this not debugged code, should give idea how go ahead -- or can use gumbo.
More discussions in Text Layout Framework
adobe
Comments
Post a Comment