Formatting User-Input Text : text format « TextField « Flash / Flex / ActionScript

Flash / Flex / ActionScript
1. Animation
2. Array
3. Class
4. Data Type
5. Development
6. Function
7. Graphics
8. Language
9. Network
10. Regular Expressions
11. Statement
12. String
13. TextField
14. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Flash / Flex / ActionScript » TextField » text format 
Formatting User-Input Text
 
package {

  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
    
      var formatter:flash.text.TextFormat = new flash.text.TextFormat(  );
      formatter.color = 0x0000FF;      // Make the text blue
      field.defaultTextFormat = formatter;
      field.text="text";
      addChild(field);
    }
  }
}

        
Related examples in the same category
1. Change Text format
2. Formatting a Portion of Existing Text
3. Setting a Text Field's Font
4. Use the TextFormat object's color and underline properties
5. Embedded font warning: Bold and italic require separate fonts
6. setTextFormat( ) does not apply to future text assignments
7. To set the alignment for the first paragraph in the text field only, we apply the format to the first character in the first paragraph, which resides at index 0:
8. To set the alignment for the second paragraph only, we apply the format to the first character in the second paragraph, which resides at index 23:
9. To set the alignment for a range of paragraphs, we apply the format using beginIndex and endIndex arguments that include the desired paragraphs:
10. Apply alignment formatting to the entire span of characters in the second paragraph.
11. Retrieving formatting information for a span of characters
12. If a specific format (e.g., font, bold, or italic) is not the same for all characters in a specified span, the corresponding variable of the TextFormat object for that span will be null
13. Default formatting for text fields
14. Set text format by searching the substring in textfield
15. The format for an empty TextField object is specified by assigning a TextFormat object to the TextField object's defaultTextFormat variable
16. Two formats
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.