Flash
  Home arrow Flash arrow Page 5 - Working with Text and HTML in Flash
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Working with Text and HTML in Flash
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 94
    2005-05-04

    Table of Contents:
  • Working with Text and HTML in Flash
  • Creating text fields at runtime
  • Using TextFormat Class
  • Formatting Text using HTML
  • Supported HTML tags
  • Embedding media in text fields

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with Text and HTML in Flash - Supported HTML tags


    (Page 5 of 6 )

    The following is the list of supported HTML tags in Flash:

    Anchor tag (<a>) The <a>tag creates a hypertext link and supports the following attributes: href and target. sample_txt.htmlText= “<a href='http://www.devarticles.com' target='_blank'>Visit Dev Articles</a>”; Bold tag (<b>)

    The
    <b>tag renders text as bold.
    
    sample_txt.htmlText = “<b>Bold Text</b>”;
     

    A bold typeface must be available for the font used to display the text.

    Break tag (<br>)

    The <br>tag creates a line break in the text field.

    sample_txt.htmlText = "First Line of text. <br>Second Line";
    

    The closing </br>tag is optional, but it is good practice to include it.

    Font tag (<font>)

    The <font>tag specifies a font or list of fonts to display the text and supports the attributes color, face and size.

    sample_txt.htmlText = "<font size=’24’ color=’#0000FF’ face=’Arial Black’>This is blue, 24-point text with Arial Black font</font>";

      Image tag (<img>)

    The <img>tag lets you embed external JPEG files, SWF files, and movie clips inside text fields and TextArea component instances. Text automatically flows around images you embed in text fields or components. This tag is supported only in dynamic and input text fields that are multiline and wrap their text.

    The <img>tags supports the following attributes:

    src Specifies the URL to a JPEG or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG and SWF files) do not show until they have downloaded completely.

    id Specifies the name for the movie clip instance (created by Flash Player) that contains the embedded JPEG file, SWF file, or movie clip. This is useful if you want to control the embedded content with ActionScript.

    width The width of the image, SWF file, or movie clip being inserted, in pixels.

    height The height of the image, SWF file, or movie clip being inserted, in pixels.

    align Specifies the horizontal alignment of the embedded image within the text field. Valid value are leftand right. The default value is left.

    hspace Specifies the amount of horizontal space that surrounds the image where no text appears. The default value is 8.

    vspace Specifies the amount of vertical space that surrounds the image where no text appears. The default value is 8. 

    Italic tag (<i>)

    The <i>tag displays the tagged text in italics.

    sample_txt.htmlText = “<i>Italic Text</i>”;
    

    An italic typeface must be available for the font used.

    List item tag (<li>)

    The <li>tag places a bullet in front of the text that it encloses.

    <li>One</li>
    
    <li>Two</li>
    
    <li>Three</li>
     

    Paragraph tag (<p>)

    The <p>tag creates a new paragraph. It supports the following attributes: align and class.

    Span tag (<span>)

    The <span>tag is available only for use with CSS text styles. It supports the attribute class.

    Text format tag (<textformat>)

    The <textformat>tag lets you use a subset of paragraph formatting properties of the TextFormat class within HTML text fields. It supports the attributes blockindent, indent, leading, leftmargin, rightmargin and tabstops.

    Using the Text tool, create a dynamic text field that’s approximately 300 pixels wide and 100 pixels high.

    The use of the tab character escape sequence ( \t) adds tabs between each column in the table.

    Underline tag (<u>)

    The <u> tag underlines the tagged text.

    sample_txt.htmlText = “<u>Underlined Text</u>”;
    

    More Flash Articles
    More By Adi Reddy Mora


       · writing html-tags in a textarea field for printing (via database)in a flash-field...
     

    FLASH ARTICLES

    - Critical Flash Vulnerability Heats Up the Web
    - More on Nonpersistent Client-Side Remote Sha...
    - Nonpersistent Client-Side Remote Shared Obje...
    - Using the Decorator Pattern for a Real Web S...
    - Using Concrete Decorator Classes
    - Delving More Deeply into the Decorator Patte...
    - The Decorator Pattern in Action
    - A Simple Decorator Pattern Example
    - Decorator Pattern
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT