< Day Day Up > |
Availability Flash MX 2004. Description The TextAttrs object contains all the properties of text that can be applied to a subselection. This object is a property of the TextRun object (textrun.textAttrs). Property summary for the TextAttrs objectThe following properties are available for the TextAttrs object.
textAttrs.aliasTextAvailability Flash MX 2004. Usage textAttrs.aliasText Description Property; a Boolean value that specifies that Flash should draw the text using a method optimized for increasing the legibility of small text. Example The following example sets the aliasText property to true for all the text in the currently selected text field: fl.getDocumentDOM().setElementTextAttr('aliasText', true); textAttrs.alignmentAvailability Flash MX 2004. Usage textAttrs.alignment Description Property; a string that specifies paragraph justification. Acceptable values are "left", "center", "right", and "justify". Example The following example sets the paragraphs that contain characters between index 0 up to, but not including, index 3 to justify. This can affect characters outside the specified range if they are in the same paragraph. fl.getDocumentDOM().setTextSelection(0, 3); fl.getDocumentDOM().setElementTextAttr('alignment', 'justify'); textAttrs.autoKernAvailability Flash MX 2004. Usage textAttrs.autoKern Description Property; a Boolean value that determines whether Flash uses (TRue) or ignores (false) pair kerning information in the font(s) when it kerns the text. Example The following example selects the characters from index 2 up to, but not including, index 6 and sets the autoKern property to true: fl.getDocumentDOM().setTextSelection(3, 6); fl.getDocumentDOM().setElementTextAttr('autoKern', true); textAttrs.boldAvailability Flash MX 2004. Usage textAttrs.bold Description Property; a Boolean value. A value of TRue causes text to appear with the bold version of the font. Example The following example selects the first character of the selected text object and sets the bold property to TRue: fl.getDocumentDOM().setTextSelection(0, 1); fl.getDocumentDOM().setElementTextAttr('bold', true); textAttrs.characterPositionAvailability Flash MX 2004. Usage textAttrs.characterPosition Description Property; a string that determines the baseline for the text. Acceptable values are "normal", "subscript", and "superscript". This property applies only to static text. Example The following example selects the characters from index 2 up to, but not including, index 6 of the selected text field and sets the characterPosition property to "subscript": fl.getDocumentDOM().setTextSelection(2, 6); fl.getDocumentDOM().setElementTextAttr("characterPosition", "subscript"); textAttrs.characterSpacingAvailability Flash MX 2004. Deprecated in Flash 8 in favor of textAttrs.letterSpacing. Usage textAttrs.characterSpacing Description Property; an integer that represents the space between characters. Acceptable values are -60 through 60. This property applies only to static text; it generates a warning if used with other text types. Example The following example sets the character spacing of the selected text field to 10: fl.getDocumentDOM().setElementTextAttr("characterSpacing", 10); textAttrs.faceAvailability Flash MX 2004. Usage textAttrs.face Description Property; a string that represents the name of the font, such as "Arial". Example The following example sets the font of the selected text field from the character at index 2 up to, but not including, the character at index 8 to "Arial": fl.getDocumentDOM().selection[0].setTextAttr("face", "Arial", 2, 8); textAttrs.fillColorAvailability Flash MX 2004. Usage textAttrs.fillColor Description Property; the color of the fill, in one of the following formats:
Example The following example sets the color of the selected text field from the character at index 2 up to, but not including, the character at index 8 to red: fl.getDocumentDOM().selection[0].setTextAttr("fillColor", 0xff0000, 2, 8); textAttrs.indentAvailability Flash MX 2004. Usage textAttrs.indent Description Property; an integer that specifies paragraph indentation. Acceptable values are -720 through 720. Example The following example sets the indentation of the selected text field from the character at index 2 up to, but not including, the character at index 8 to 100. This can affect characters outside the specified range if they are in the same paragraph. fl.getDocumentDOM().selection[0].setTextAttr("indent", 100, 2, 8); textAttrs.italicAvailability Flash MX 2004. Usage textAttrs.italic Description Property; a Boolean value. A value of true causes text to appear with the italic version of the font. Example The following example sets the selected text field to italic: fl.getDocumentDOM().selection[0].setTextAttr("italic", true); textAttrs.leftMarginAvailability Flash MX 2004. Usage textAttrs.leftMargin Description Property; an integer that specifies the paragraph's left margin. Acceptable values are 0 through 720. Example The following example sets the leftMargin property of the selected text field from the character at index 2 up to, but not including, the character at index 8 to 100. This can affect characters outside the specified range if they are in the same paragraph. fl.getDocumentDOM().selection[0].setTextAttr("leftMargin", 100, 2, 8); textAttrs.letterSpacingAvailability Flash 8. Usage textAttrs.letterSpacing Description Property; an integer that represents the space between characters. Acceptable values are -60 through 60. This property applies only to static text; it generates a warning if used with other text types. Example The following code selects the characters from index 0 up to but not including index 10 and sets the character spacing to 60: fl.getDocumentDOM().setTextSelection(0, 10); fl.getDocumentDOM().setElementTextAttr("letterSpacing", 60); textAttrs.lineSpacingAvailability Flash MX 2004. Usage textAttrs.lineSpacing Description Property; an integer that specifies the line spacing (leading) of the paragraph. Acceptable values are -360 through 720. Example The following example sets the selected text field's lineSpacing property to 100: fl.getDocumentDOM().selection[0].setTextAttr("lineSpacing", 100); textAttrs.rightMarginAvailability Flash MX 2004. Usage textAttrs.rightMargin Description Property; an integer that specifies the paragraph's right margin. Acceptable values are 0 through 720. Example The following example sets the rightMargin property of the selected text field from the character at index 2 up to, but not including, the character at index 8 to 100. This can affect characters outside the specified range if they are in the same paragraph. fl.getDocumentDOM().selection[0].setTextAttr("rightMargin", 100, 2, 8); textAttrs.rotationAvailability Flash MX 2004. Usage textAttrs.rotation Description Property; a Boolean value. A value of TRue causes Flash to rotate the characters of the text 90°. The default value is false. This property applies only to static text with a vertical orientation; it generates a warning if used with other text types. Example The following example sets the rotation of the selected text field to TRue: fl.getDocumentDOM().setElementTextAttr("rotation", true); textAttrs.sizeAvailability Flash MX 2004. Usage textAttrs.size Description Property; an integer that specifies the size of the font. Example The following example retrieves the size of the character at index 2 and shows the result in the Output panel: fl.outputPanel.trace(fl.getDocumentDOM().selection[0].getTextAttr("size", 2)); textAttrs.targetAvailability Flash MX 2004. Usage textAttrs.target Description Property; a string that represents the target property of the text field. This property works only with static text. Example The following example gets the target property of the text field in the first frame of the top layer of the current scene and shows it in the Output panel: fl.outputPanel.trace(fl.getDocumentDOM().getTimeline().layers[0].frames[0]. elements[0].getTextAttr("target")); textAttrs.urlAvailability Flash MX 2004. Usage textAttrs.url Description Property; a string that represents the URL property of the text field. This property works only with static text. Example The following example sets the URL of the selected text field to http://www.macromedia.com: fl.getDocumentDOM().setElementTextAttr("url", "http://www.macromedia.com"); |
< Day Day Up > |