Debug.write("art deco.");
var tf = new textformat();
tf.font = "Futura";
tf.color = 0xAACC44;
tf.size = 32;
this.setTextFormat(tf, 5, 9);
Debug.write("soSerify");
var tf = new textformat();
tf.color = blue;
tf.italic = true;
tf.font = 'Courier';
this.setDefaultFormat(tf);
Debug.write("defuseBomb");
var tf = new textformat();
tf.color = green;
tf.bold = true;
tf.font = 'Monaco';
this.setDefaultFormat(tf);
this.setSelection(11, 11);
Debug.write("bestGuess");
var tf = new textformat();
tf.color = 0x3399FF;
tf.underline = true;
tf.font = 'Arial';
this.setDefaultFormat(tf);
this.setSelection(this.getText().length, this.getText().length);
// User typing now will be blue and at the end of the field
Debug.write("pratfall");
var tf = new textformat();
tf.color = 0xFF9933; ;
tf.italic = true;
tf.font = 'Times';
this.setDefaultFormat(tf);
// HERE'S THE FLASH BUG.
// The user will type and ONLY THE FIRST CHAR will be orange.
this.setSelection(3,3);
Debug.write("headphones");
var tf = new textformat();
tf.color = 0xFF3399; ;
tf.italic = true;
tf.font = 'Times';
this.setSelection(11,11);
this.setDefaultFormat(tf);
// HERE'S THE FLASH BUG.
// The user will type and ONLY THE FIRST CHAR will be orange.
Debug.write("goowy");
var tf = new textformat();
tf.color = 0xFF3399; ;
tf.italic = true;
tf.font = 'Times';
// Set the format of the character *after* the insertion point
// to the desired format.
this.setTextFormat(tf, 6, 7);
this.setSelection(6, 6);
Debug.write("spacer");
var tf = new textformat();
tf.color = 0xFF3399;
tf.italic = true;
tf.font = 'Times';
var insertion = 9
var txt = this.getText();
var firstpart = txt.substr(0, insertion);
var secondpart = txt.substr(insertion);
// todo: if there's already a space there, don't add a space.
var newtxt = firstpart + " " + secondpart;
this.setText(newtxt);
this.setTextFormat(tf, insertion, insertion + 1);
this.setSelection(insertion, insertion);
rich.setTextFormat(tf, 0, 300);