Styled Text

You need Adobe Flash Player v.10 or above.

Install Adobe Flash player

Styled Text is a Flash component that allows you to apply several predefined expressive styles to a text.

Features:

  • 5 predefined cool text styles
  • User defined material and light colors
  • You can set font size greater than 128

Requirements: Flash CS3 (or above), ActionScript 3.

Price: Free.

Install:
Download Styled Text Flash mxp-component. Double-click on the file loaded and follow instructions.
To use the Styled Text component open the Component panel (Ctrl-F7 or Window>Components) and drag the StyledText item to the Stage. To adjust parameters open the Component Inspector window (Shift-F7 or Window>Component Inspector).

Properties:

  • font - String (default value "Arial"). Specifies the font name.
  • lightColor - Color (default value #FFFF33). Specifies the so-called light color in our 2-color model.
  • materialColor - Color (default value #FF9933). Specifies the so-called material color in our 2-color model.
  • size - Number (default value 120). Specifies the size of the font.
  • style - String (default value "Style 1"). Specifies the style selected.
  • text - String (default value ""). Specifies the text value.

Methods:

  • getProperty(prop:String, fmt:Boolean = true):Object - returns the value of the specified property prop of the internal TextField object. If fmt is true then this method returns the value of the TextFormat object associated with the internal TextField object.
  • setProperty(prop:String, v:Object, fmt:Boolean = true) - Sets the value of the specified property prop of the internal TextField object.

Please see the source code below to understand the details of these methods.

public function setProperty(prop:String, v:Object, fmt:Boolean = true):void {
	if (fmt){
		var format:TextFormat = tf.defaultTextFormat;
		format[prop] = v;
		tf.setTextFormat(tf.defaultTextFormat = format);
	} else {
		tf[prop] = v;
	}
	invalidate();
}
public function getProperty(prop:String, fmt:Boolean = true):Object {
	if (fmt){
		var format:TextFormat = tf.defaultTextFormat;
		var res:Object = format[prop];
	} else {
		res = tf[prop];
	}
	return res;
}