Solved

Formatting Dynamic Text

Posted on 2003-11-14
7
1,593 Views
Last Modified: 2010-04-03
Please tell me what each value means in the ( ) of this line of code, particulaly the falses and the blank ones

var style1_fmt = new TextFormat("textFont", 13, 0x000000, false, false, false, "", "", "center");
0
Comment
Question by:madasczik
7 Comments
 
LVL 5

Expert Comment

by:zenlion420
ID: 9750739
This may help you along:

http://actionscript-toolbox.com/flashmx_createtext.php

aloha,

j
0
 
LVL 5

Expert Comment

by:Calron
ID: 9751171
This link is to the online version of the API docs:

http://livedocs.macromedia.com/flash/mx2004/main/12_as726.htm
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 500 total points
ID: 9751666
here is the information that you are looking for....

from MM:

Usage
new TextFormat([font, [size, [color, [bold, [italic, [underline, [url, [target, [align, [leftMargin, [rightMargin, [indent, [leading]]]]]]]]]]]]])

Parameters
font The name of a font for text as a string.

size An integer that indicates the point size.

color The color of text using this text format. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, 0x00FF00 is green.

bold A Boolean value that indicates whether the text is boldface.

italic A Boolean value that indicates whether the text is italicized.

underline A Boolean value that indicates whether the text is underlined.

url The URL to which the text in this text format hyperlinks. If url is an empty string, the text does not have a hyperlink.

target The target window where the hyperlink is displayed. If the target window is an empty string, the text is displayed in the default target window _self. If the url parameter is set to an empty string or to the value null, you can get or set this property, but the property will have no effect.

align The alignment of the paragraph, represented as a string. If "left", the paragraph is left-aligned. If "center", the paragraph is centered. If "right", the paragraph is right-aligned.

leftMargin Indicates the left margin of the paragraph, in points.

rightMargin Indicates the right margin of the paragraph, in points.

indent An integer that indicates the indentation from the left margin to the first character in the paragraph.

leading A number that indicates the amount of leading vertical space between lines.

Returns
Nothing.

Description
Constructor; 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.



rp
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 27

Expert Comment

by:negatyve
ID: 9751672
var style1_fmt =

new TextFormat

("textFont", // font name (that one linked from the library)

13, // font size

0x000000, // font color

false, // boolean for bold

false, // boolean for italic

false, // boolean for underline

"", // string for url, if "" there's no url

"", // string for target window, if "" it doesn't care

"center"); // text align
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 9751686
just follow the line above...  the ones that are not being used are:

[leftMargin, [rightMargin, [indent, [leading]]]]


so in order of appearance:

font name = textFont
font size = 13
text color = 0x000000
bold = false
italic = false
underline = false
url = ""   //which means no url
target = ""  //which means no target
text alignment = center

let me know if you have any more questions...

rp
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 9751728
just beat you to it Stallion  :)


rp
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9751849
>just beat you to it Stallion  :)

hehe, you did it.. :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question