EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Textformat Constructor

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
TextFormat 1243
Availability: ActionScript 1.0; Flash Player 6
Example
The following example creates a text field with a hyperlink to the Macromedia website. The
example uses
TextFormat.target to display the Macromedia website in a new browser
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
null to indicate that it is not defined. All of the parameters are
optional; any omitted parameters are treated as
null.
Availability: ActionScript 1.0; Flash Player 6
Parameters
font:String [optional] - The name of a font for text as a string.
size:Number [optional] - An integer that indicates the point size.
color:Number [optional] - The color of text using this text format. A number containing
three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.
bold:Boolean [optional] - A Boolean value that indicates whether the text is boldface.
italic:Boolean [optional] - A Boolean value that indicates whether the text is italicized.

Table of Contents

Related product manuals