<richtexteditarea>

JavaScript: lz.richtexteditarea
extends
A view which contains the text area for a rich text editor. Combine with a richtexttoolbar to make an actual editor.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
currentformat expression any   read/write
  The current format in which text should be added, and which the toolbar should reflect. Everyone interested in the current format should look at this attribute to see what it is.
defaultfontcolor expression any 0x000000 read/write
  Default font color
defaultfontname string String Verdana read/write
  Default font name
defaultfontsize number Number 11 read/write
  Default size of text
editortype string String flash-html read/write
  Attribute indicating the type of HTML content produced by editor.
indentsize expression any 35 read/write
  The size in points of an indent
insertionpoint expression any 0 read/write
  The current index of the insertion point. Should be -1 if there's no insertion point.
isHTML expression any false read/write
  Indicates whether there's formatting on the text contained by this editor.
linkpanel expression any null read/write
  Reference to the hyperlink creation dialog. This attribute should be set by users, if there is an associated link panel
startformat expression any   read/write
   
toolbar expression any null read/write
  Reference to the toolbar associated with this editor. For the toolbar to show the correct format when the insertion point moves, this attribute must be set by users.
toolbarplacement expression any null read/write
  The placement for the toolbar in the richtexteditor.

Methods

delegateInitSelection()
richtexteditarea.delegateInitSelection();
Initialize the selection region on focus event

delegateRestoreSelection()
richtexteditarea.delegateRestoreSelection();
Restore the selection region, but do it in the next "frame." This is necessary because Flash is frame-based and can't handle certain selection changes in a single "frame."

reset()
richtexteditarea.reset();
Reset the values of the richtexteditor.

saveSelectionRegion()
richtexteditarea.saveSelectionRegion();
Save selected region.

setCurrentFormat()
richtexteditarea.setCurrentFormat(fmt : textformat, inCaretMove : boolean);
Change the format of the selection by attributes contained in TextFormat object.
Parameter Name Type Description
fmt textformat The TextFormat object to apply to the current selection or the insertion point
inCaretMove boolean True when the the method was called from a caret motion event

setFormatAttribute()
richtexteditarea.setFormatAttribute(attr : string, val : string);
Change the format of the selection by just one attribute. This allows the selection to keep non-uniform formats on attributes which are not being adjusted. That is: select "pear, cherry", where pear is green and cherry is red. Change the font to helvetica using the combo box. Now it's all helvetica, but pear is still green and cherry is still red. If no text is currently selected, format the insertion point. This handles character formatting only. Not paragraph formatting. See setParagraphAttribute.
Parameter Name Type Description
attr string name of the attribute to change
val string value to change the attribute to

setLinkPanel()
richtexteditarea.setLinkPanel(lp);
Hook this editor up to a link panel, so that the linkpanel will be hidden when the editor is reset
Parameter Name Type Description
lp    

setSelection()
richtexteditarea.setSelection(ns, ne);
Parameter Name Type Description
ns    
ne    

setToolbar()
richtexteditarea.setToolbar(tb);
Hook this editor up to a toolbar, so that the toolbar's ui will stay synchronized with the format at the insertion point of this editor.
Parameter Name Type Description
tb    

Events

Name Description
oncurrentformat