I haven't tested it, but here's a quick sketch of what you need. Where they have:
protected function boldBtn_clickHandler(evt:MouseEvent):void {
var txtLayFmt:TextLayoutFormat = editor.getFormatOfRange(null,
editor.selectionAnchorPosition,
editor.selectionActivePosition);
txtLayFmt.fontWeight = (txtLayFmt.fontWeight == FontWeight.BOLD) ? FontWeight.NORMAL : FontWeight.BOLD;
editor.setFormatOfRange(txtLayFmt,
editor.selectionAnchorPosition,
.selectionActivePosition); editor.setFocus();
}
You would have this:
protected function boldBtn_clickHandler(evt:MouseEvent):void {
var txtLayFmt:TextLayoutFormat = new TextLayoutFormat();
txtLayFmt.fontWeight = (txtLayFmt.fontWeight == FontWeight.BOLD) ? FontWeight.NORMAL : FontWeight.BOLD;
(textFlow.interactionManager as IEditManager).applyLeafFormat(txtLayFmt); }
- robin