Textformat Constructor - MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Example
The following example creates a text field with a hyperlink to the Macromedia website. The
example uses
TextFormat.target
window.
var myformat:TextFormat = new TextFormat();
myformat.url = "http://www.macromedia.com";
myformat.target = "_blank";
this.createTextField("mytext",1,100,100,200,100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.html = true;
mytext.text = "Go to Macromedia.com";
mytext.setTextFormat(myformat);
See also
url (TextFormat.url property)

TextFormat constructor

public TextFormat([font:String], [size:Number], [color:Number],
[bold:Boolean], [italic:Boolean], [underline:Boolean], [url:String],
[target:String], [align:String], [leftMargin:Number],
[rightMargin:Number], [indent:Number], [leading:Number])
Creates a TextFormat object with the specified properties. You can then change the properties
of the TextFormat object to change the formatting of text fields.
Any parameter may be set to
optional; any omitted parameters are treated as
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
[optional] - The name of a font for text as a string.
font:String
[optional] - An integer that indicates the point size.
size:Number
[optional] - The color of text using this text format. A number containing
color:Number
three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.
[optional] - A Boolean value that indicates whether the text is boldface.
bold:Boolean
[optional] - A Boolean value that indicates whether the text is italicized.
italic:Boolean
underline:Boolean
underlined.
708
ActionScript classes
to display the Macromedia website in a new browser
to indicate that it is not defined. All of the parameters are
null
[optional] - A Boolean value that indicates whether the text is
.
null

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash lite 2

Table of Contents