<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2009://34.37298-</id>
  <updated>2009-11-16T14:53:51Z</updated>
  <title>Comments for Utilizing Flash Text Layout Framework using MXML tags (http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2009://34.37298</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=37298" title="Utilizing Flash Text Layout Framework using MXML tags" />
    <published>2009-06-25T11:47:46Z</published>
    <updated>2009-06-25T20:17:28Z</updated>
    <title>Utilizing Flash Text Layout Framework using MXML tags</title>
    <summary>Flash Text Layout Framework (TLF) Created by the InDesign team (http://labs.adobe.com/technologies/textlayout/), TLF is Adobe&#8217;s new Flash framework for dealing with text. The TLF can be used in Flash CS4, Flex 3.2 and Flex 4 SDK The new framework consists of...</summary>
    <author>
      <name>Elad Elrom</name>
      
    </author>
    
    <category term="Blogs" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[Flash Text Layout Framework (TLF) Created by the InDesign team (http://labs.adobe.com/technologies/textlayout/), TLF is Adobe&#8217;s new Flash framework for dealing with text. The TLF can be used in Flash CS4, Flex 3.2 and Flex 4 SDK The new framework consists of a set of classes in Flash Player 10 that brings print-quality graphics to the Web and AIR application and allows you to create multilingual web applications using device fonts.<br>
<br>
There are already few articles out there that gives examples and show how to work with pure action script to utilize TLF, however I didn't find any article that cover TLF using MXML tags so I decided to post this article.<br>
Here are some of TLF features:<br>
<br>
<ul>
<li><strong>Bidirectional text: </strong>Includes vertical text and over 30 writing systems including Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Lao, the major writing systems of India, Tate-Chu-Yoko (horizontal within vertical text) and more.</li>
<li><strong>Formatting</strong>: Text with inline graphics (images, SWFs, or any DisplayObject) and multiple columns of text with text flow and text selection through these columns.  Additionally support for vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier (Eastern European).</li>
<li><strong>Print-quality typography for the web: </strong>Allows for kerning, ligatures, typographic case, digit case, digit width, and discretionary hyphens.</li>
<li>Mouse and Keyboard user gestures - standard keyboard and mouse functionality for copy, paste, undo and cut.</li>
<li><strong>Text metrics: </strong>Includes measurements and offsets of fonts</li>
</ul><br>
The architecture of the framework is shown below. The TLF is the high-level implementation of the Flash Text Engine (FTE). The FTE is a low-level API, so you can come up with you own set of components for FTE. FTE is limited in functionality and offers basic manipulation of text and is the foundation for the TLF.<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="TLF1.jpg" src="http://www.insideria.com/TLF1.jpg" width="295" height="223" class="mt-image-none" style="" /></span><br>
<br>
In Flash Builder 4 there are two SWC library that include and provide the support for FTE: framework_textLayout.swc and textLayout.swc.<br>
<br>
<ul>
<li><strong>framework_textLayout.swc</strong> - includes classes to allow components such as DataGrid or TextField to support TLF.</li>
<li><strong>textLayout.swc</strong> - include the entire class library to support TLF.</li>
</ul>
<br>
Since the last built of Flash Gumbo, which was given at Adobe MAX 2008 and is available on the pre-release Adobe site, the TLF and components such as TextBox, TextElement or content components have been changed and they are no longer available.  The best way to check the TLF version is using the BuildInfo class as follow:<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category2">trace</span>("<span class="quote">TLF version: </span>" + BuildInfo.VERSION);
<span class="category2">trace</span>("<span class="quote">TLF Build number: </span>" + BuildInfo.kBuildNumber);
<span class="category2">trace</span>("<span class="quote">TLF Audit id: </span>" + BuildInfo.AUDIT_ID);</pre>
</code>

</div></div> 

I am using the Flash Builder 4 Beta and I got the following version:<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
TLF <span class="category2">version</span>: 1.0
TLF Build number: 427 (699527)
TLF Audit id: &lt;AdobeIP 0000486&gt;</pre>
</code>

</div></div> 
<br>
Based on the TLF architecture we can use the following to create, format and control our text components:<br>
<br>
Flex Components:<br>
<br>
<ol>
<li><strong>GraphicElement </strong>- graphic element in a TextBlock or GroupElement object extends ElementFormat and offers limited manipulation of the text. It supports UIComponent-style layout and invalidation capability.
</li><li><strong>simpleText</strong> - lightweight text that mostly uses the FTE and some of the TLF classes it extends GraphicElement and provide limited functionality.  Since it&#8217;s of GraphicElement type UIComponent can have few simpleText objects share the same DisplayObject.
</li><li><strong>RichText</strong> - can be used to replace the <mx:Text>. Supports all TLF text formats and can draw background but not a border. Text can be in horizental and vertical but cannot be scrolled.  Text can also be truncated and show &#8220;&#133;&#8221; for the missing text.
</li><li><strong>RichEditableText</strong> - can be used to replace the <mx:TextArea>.  Heavyweight class compares to simpleText and RichText and support TLF and all the features mentioned in RichText.  Additionally, it also supports hyperlinks, border, background, scrolling, selection, and editing.
</li><li><strong>TextFlow</strong> - TextFlow element is the root of a TLF text object model.
</li><li><strong>FlowElement</strong> - TextFlow holds the FlowElements.
</ol>
<br>
Pure ActionScript classes:<br>
<br>
<ol>
<li><strong>contentElement</strong> - holds content such as text or graphic of the textBlock</li>
<li></li><strong>ElementFormat</strong> - represent the format of the contentElement
<li></li><strong>fontDescription</strong> - represent properties of the font applied to the elementFormat
<li></li><strong>TextBlock</strong> - represent the factory for creating a paragraph of text
<li></li><strong>textLine</strong> - displayObject used for creating a line of text for the textBlock
</ol>

<strong>TLF primitive Flex components:</strong><br>
<br>
There are three text primitives that you can use: SimpleText, RichText, and RichEditableText.
Let&#8217;s take a simple example using Flex 4 Beta SDK:<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;s:<span class="category2">Application</span> xmlns:fx="<span class="quote">http://ns.adobe.com/mxml/2009</span>" xmlns:s="<span class="quote">library://ns.adobe.com/flex/spark</span>" xmlns:mx="<span class="quote">library://ns.adobe.com/flex/halo</span>" minWidth="<span class="quote">1024</span>" minHeight="<span class="quote">768</span>"&gt;
		
		&lt;s:Group fontSize="<span class="quote">12</span>" <span class="category2">height</span>="<span class="quote">242.936</span>" <span class="category2">width</span>="<span class="quote">383.055</span>"&gt;
		&lt;s:RichText rotation="<span class="quote">12</span>" alpha="<span class="quote">0.8</span>" <span class="category2">x</span>="<span class="quote">50</span>" <span class="category2">y</span>="<span class="quote">50</span>"&gt;
			&lt;s:TextFlow <span class="category2">color</span>="<span class="quote">0x555555</span>"&gt;
		   		&lt;s:p&gt;
				&lt;s:span fontWeight="<span class="quote">bold</span>"&gt;Just <span class="category2">text</span>&lt;/s:span&gt;
				&lt;s:br /&gt;
				&lt;s:a href="<span class="quote">http://twitter.com/eladnyc</span>"&gt;Elad Elrom&lt;/s:a&gt;
				&lt;/s:p&gt;
			&lt;/s:TextFlow&gt;
		&lt;/s:RichText&gt;
		
	&lt;/s:Group&gt;
&lt;/s:<span class="category2">Application</span>&gt;</pre>
</code>

</div></div> 
<br>
simpleText element, which extends the GraphicElement and uses the FTE, and thus offers limited manipulation of the text.<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;s:SimpleText fontSize="<span class="quote">12</span>" <span class="category2">width</span>="<span class="quote">100</span>"&gt; Hello, world!&lt;/s:SimpleText&gt;</pre>
</code>

</div></div> 
<br>
Using TLF-based components, you have more control over text, and you can set fonts properties such as style, alpha, anti-aliasing, and rotation values, as well create custom text components. <br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;s:RichText fontFamily="<span class="quote">arial</span>" <span class="category2">color</span>="<span class="quote">0x4697c4</span>" <span class="category2">text</span>="<span class="quote">RichText</span>"  /&gt;</pre>
</code>

</div></div> 
<br>
The most advanced text component is RichEditableText, it extends the UIComponent and uses the TLF API. However, it is also the most heavyweight and costly of the three text primitives, since it&#8217;s based on UIComponent. Take a look at the following code:<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;s:RichEditableText fontFamily="<span class="quote">arial</span>" <span class="category2">color</span>="<span class="quote">0x4697c4</span>" <span class="category2">text</span>="<span class="quote">RichEditableText</span>" /&gt;</pre>
</code>

</div></div> 
Notice that we the RichEditableText and RichText are UIComponent, we don&#8217;t need to place them in the Group element. Also, once you compile, you will notice that RichEditableText text by default will be scrollable, selectable, and editable.<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;s:<span class="category2">Application</span> xmlns:fx="<span class="quote">http://ns.adobe.com/mxml/2009</span>" xmlns:s="<span class="quote">library://ns.adobe.com/flex/spark</span>" xmlns:mx="<span class="quote">library://ns.adobe.com/flex/halo</span>" minWidth="<span class="quote">1024</span>" minHeight="<span class="quote">768</span>"&gt;

     &lt;s:RichEditableText fontFamily="<span class="quote">arial</span>" <span class="category2">color</span>="<span class="quote">0x4697c4</span>" <span class="category2">text</span>="<span class="quote">RichEditableText</span>"  <span class="category2">x</span>="<span class="quote">0</span>" <span class="category2">y</span>="<span class="quote">18</span>"/&gt;
     &lt;s:RichText fontFamily="<span class="quote">arial</span>" <span class="category2">color</span>="<span class="quote">0x4697c4</span>" <span class="category2">text</span>="<span class="quote">RichText</span>"  /&gt;     

&lt;/s:<span class="category2">Application</span>&gt;</pre>
</code>

</div></div> 

<strong>TextFlow and FlowElement </strong><br>
<br>
The TLF's component object model is a tree of FlowElements such as ParagraphElements and SpanElements (corresponding to <span> tags). What TLF essentially does is create, render or manipulate the TextFlows classes.
SpanElements tags available for you can be seen here:<br>
<br>
<ul>
<li></li>a tag - used to embed a link.  Can include: br, img, span, tcy, tab or tags.
<li></li>br tag - used to add a break. Text will continue to the next line.
<li></li>div tag - used for division of the text.  Inner tags can include div or p tags.
<li></li>img tag - used for adding an image in a paragraph
<li></li>p tag - a new paragraph, can include all the elements other than div.
<li></li>span tag - used to create a run of text in a paragraph; can contain only a text tag.
<li></li>tab tag - used to add a tab character to the paragraph.
<li></li>tcy tag - used in vertical text to run an horizontal text. Can be used for languages such as Japanese. Can contain the following tags: code, break, img, span, tab, code.
</ul>
<br>
 Take a look at an example, which uses the RichText primitive components as well as SpanElements and TextFlow element.  The example will use the RichText primitive components and add customozation.<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
     &lt;s:Group fontSize="<span class="quote">12</span>"&gt;
	&lt;s:RichText rotation="<span class="quote">12</span>" alpha="<span class="quote">0.8</span>" <span class="category2">x</span>="<span class="quote">50</span>" <span class="category2">y</span>="<span class="quote">50</span>"&gt;
	          &lt;s:TextFlow <span class="category2">color</span>="<span class="quote">0x555555</span>"&gt;
             	                 &lt;s:p&gt;
                                      &lt;s:span fontWeight="<span class="quote">bold</span>"&gt;Just <span class="category2">text</span>&lt;/s:span&gt;
                                      &lt;s:br /&gt;
                                      &lt;s:a href="<span class="quote">http://twitter.com/eladnyc</span>"&gt;Hello World&lt;/s:a&gt;
             	                 &lt;/s:p&gt;
                        &lt;/s:TextFlow&gt;
               &lt;/s:RichText&gt;
     &lt;/s:Group&gt;</pre>
</code>

</div></div> 

Notice that, in this example, we have a RichText that has a TextFlow element. The TextFlow element is the root of a TLF text object model. The TextFlow holds FlowElements such as the ParagraphElements p element, the SpanElements span element, or the ImageElement img element.  Essentially, the TLF creates, renders, manipulates, and edits TextFlow elements.<br>
<br>
<strong>Spark TextArea</strong><br>
<br>
Up until Flex 4 Beta Flex offers out of the box rich text editor called RichTextEditor.  It was not that rich since it was very hard to control and manipulate many of the features needed to create a rich text editor.  To create the editor you can just type the following element:<br>

<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;mx:RichTextEditor fontFamily="<span class="quote">arial</span>" <span class="category2">color</span>="<span class="quote">0x4697c4</span>" <span class="category2">text</span>="<span class="quote">RichTextEditor</span>"/&gt;</pre>
</code>

</div></div> 
Flex 4 Beta Flex offers TextArea which is based on TextBase which extends SkinnableComponent and is another Flex 4 core class. It is used as the base class for all the skinnable components, such as Spark TextInput. Each skinnable component includes a TextView in its skin. It is also part of Adobe&#8217;s effort to rework the component and separate the view, model, and logic to allow a better manipulation and the ability to move to design-centric development.<br>
<br>
Let&#8217;s create an example that uses the Spark TextArea component and gives the user control over some of the text properties, see complete code example below:

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="TLF2.jpg" src="http://www.insideria.com/TLF2.jpg" width="629" height="425" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></span>

<div class="acode" style="overflow: auto; padding: 10px; height: 240px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

&lt;s:<span class="category2">Application</span> xmlns:fx="<span class="quote">http://ns.adobe.com/mxml/2009</span>" 
	xmlns:s="<span class="quote">library://ns.adobe.com/flex/spark</span>" 
	xmlns:mx="<span class="quote">library://ns.adobe.com/flex/halo</span>" 
	minWidth="<span class="quote">1024</span>" minHeight="<span class="quote">768</span>"
	<span class="category2">initialize</span>="<span class="quote">initializeHandler(event)</span>"&gt;

	&lt;fx:Script&gt;
		&lt;![CDATA[

			<span class="category1">import</span> flash.<span class="category2">text</span>.engine.FontDescription;
			<span class="category1">import</span> mx.events.FlexEvent;

			[Bindable]
			<span class="category1">private</span> <span class="category1">var</span> fontDataProvider:<span class="category2">Array</span> = <span class="category1">new</span> <span class="category2">Array</span>();
		
			<span class="category1">private</span> <span class="category1">function</span> exportText(evt:Event):<span class="category1">void</span>
			{
 				exportTextArea.<span class="category2">text</span> = textArea.export().toXMLString();
 			}
			
			protected <span class="category1">function</span> initializeHandler(event:FlexEvent):<span class="category1">void</span>
			{
 				<span class="category1">var</span> allFonts:<span class="category2">Array</span> = Font.enumerateFonts(<span class="category1">true</span>);
 				
 				<span class="category1">for</span> (<span class="category1">var</span> i:<span class="category1">int</span> = 0; i &lt; allFonts.<span class="category2">length</span>; i++) 
 				{
  					<span class="category1">if</span> (allFonts[i].fontType == "<span class="quote">device</span>") 
  						fontDataProvider[i] = allFonts[i].fontName;
  				}
 			}

		]]&gt;
	&lt;/fx:Script&gt;

	&lt;s:HGroup <span class="category2">height</span>="<span class="quote">408</span>" <span class="category2">width</span>="<span class="quote">599</span>" left="<span class="quote">15</span>" top="<span class="quote">5</span>"&gt;
		
		&lt;s:VGroup <span class="category2">height</span>="<span class="quote">400</span>"&gt;
		
			&lt;mx:HSlider id="<span class="quote">widthSlider</span>"
				labels="<span class="quote">Width:</span>"
				minimum="<span class="quote">50</span>"
				maximum="<span class="quote">100</span>"
				value="<span class="quote">250</span>"
				snapInterval="<span class="quote">1</span>"
				liveDragging="<span class="quote">true</span>"/&gt;
		
				&lt;mx:HSlider id="<span class="quote">indentSlider</span>"
					labels="<span class="quote">Indent:</span>"
					minimum="<span class="quote">0</span>"
					maximum="<span class="quote">100</span>"
					value="<span class="quote">0</span>"
					snapInterval="<span class="quote">1</span>"
					liveDragging="<span class="quote">true</span>"/&gt;
			
				&lt;mx:HSlider id="<span class="quote">textAlphaSlider</span>"
					labels="<span class="quote">Text alpha:</span>"
					minimum="<span class="quote">0</span>"
					maximum="<span class="quote">100</span>"
					value="<span class="quote">100</span>"
					snapInterval="<span class="quote">1</span>"
					liveDragging="<span class="quote">true</span>" /&gt;				

				&lt;mx:HSlider id="<span class="quote">marginTopSlider</span>"
					labels="<span class="quote">Margin top:</span>"
					minimum="<span class="quote">0</span>"
					maximum="<span class="quote">100</span>"
					value="<span class="quote">0</span>"
					snapInterval="<span class="quote">1</span>"
					liveDragging="<span class="quote">true</span>" /&gt;

				&lt;mx:HSlider id="<span class="quote">fontSizeSlider</span>"
					labels="<span class="quote">Font size:</span>"
					minimum="<span class="quote">0</span>"
					maximum="<span class="quote">100</span>"
					value="<span class="quote">16</span>"
					snapInterval="<span class="quote">1</span>"
					liveDragging="<span class="quote">true</span>" /&gt;
					
				&lt;mx:ComboBox id="<span class="quote">fontFamilyComboBox</span>" dataProvider="<span class="quote">{fontDataProvider}</span>" selectedIndex="<span class="quote">1</span>"/&gt;
				
				&lt;s:HGroup&gt;
					&lt;s:SimpleText <span class="category2">text</span>="<span class="quote">align: </span>" /&gt;
					&lt;mx:ComboBox id="<span class="quote">alignComboBox</span>" dataProvider="<span class="quote">[start,end,left,center,right,justify]</span>" selectedIndex="<span class="quote">1</span>"/&gt;
				&lt;/s:HGroup&gt;
			
			&lt;s:<span class="category2">Button</span> id="<span class="quote">exportButton</span>" <span class="category2">width</span>="<span class="quote">200</span>"
				<span class="category1">label</span>="<span class="quote">export</span>"
				click="<span class="quote">exportText(event);</span>"/&gt;

		&lt;/s:VGroup&gt;

		&lt;s:VGroup <span class="category2">width</span>="<span class="quote">336</span>" <span class="category2">height</span>="<span class="quote">400</span>"&gt;
				
				&lt;s:TextArea id="<span class="quote">textArea</span>"
					textAlpha="<span class="quote">{textAlphaSlider.value/100}</span>"
					fontFamily="<span class="quote">{fontFamilyComboBox.selectedItem}</span>"
					<span class="category2">textAlign</span>="<span class="quote">{alignComboBox.selectedItem}</span>"
					<span class="category2">textIndent</span>="<span class="quote">{indentSlider.value}</span>"
					fontSize="<span class="quote">{fontSizeSlider.value}</span>"
					percentWidth="<span class="quote">{widthSlider.value}</span>"
					<span class="category2">height</span>="<span class="quote">297</span>" <span class="category2">width</span>="<span class="quote">100%</span>"&gt;
	
				   &lt;s:content&gt;
					  &lt;s:p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed&lt;/s:p&gt;
					  &lt;s:p&gt;incididunt ut labore et dolore magna aliqua. Ut enim ad minim&lt;/s:p&gt;
					  &lt;s:p&gt;exercitation ullamco laboris nisi ut aliquip ex ea commodo&lt;/s:p&gt;
					  &lt;s:p&gt;dolor <span class="category1">in</span> reprehenderit <span class="category1">in</span> voluptate velit esse cillum dolore eu&lt;/s:p&gt;
					  &lt;s:p&gt;Excepteur sint occaecat cupidatat non proident,  fugiat nulla&lt;/s:p&gt;
					  &lt;s:p&gt;sunt <span class="category1">in</span> culpa qui officia deserunt mollit anim id est laborum.&lt;/s:p&gt;
				   &lt;/s:content&gt;
	
			   &lt;/s:TextArea&gt;
	
				&lt;s:TextArea id="<span class="quote">exportTextArea</span>"
					<span class="category2">width</span>="<span class="quote">100%</span>" <span class="category2">height</span>="<span class="quote">83</span>"/&gt;
		&lt;/s:VGroup&gt;
			
	&lt;/s:HGroup&gt;

&lt;/s:<span class="category2">Application</span>&gt;</pre>
</code>

</div></div> 
<br>
Few things to notice.<br>
<br>
The exportText method uses the toXMLString property, which can export the contents of a Flex 4 TextArea control. In our case, we will post the results in another text area component. initializeHandler method create an array that contain a list of all the available fonts names so we can use them on in a drop down menu.<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

                  <span class="category1">private</span> <span class="category1">function</span> exportText(evt:Event):<span class="category1">void</span>
                  {
                         exportTextArea.<span class="category2">text</span> = textArea.export().toXMLString();
                   }</pre>
</code>

</div></div>
<br>
TextArea allows controlling white space, such as indenting and line breaks; the following slider controls the indent property in the TextArea component:<br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

&lt;mx:HSlider id="<span class="quote">indentSlider</span>"
                              labels="<span class="quote">Indent:</span>"
                              minimum="<span class="quote">0</span>"
                              maximum="<span class="quote">100</span>"
                              value="<span class="quote">0</span>"
                              snapInterval="<span class="quote">1</span>"
                              liveDragging="<span class="quote">true</span>"/&gt; </pre>
</code>

</div></div>
<br>
Margins of text in all directions can be controlled using marginLeft, marginTop, marginRight, and marginButton, as illustrated in the following example code: <br>
<br>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

&lt;mx:HSlider id="<span class="quote">marginTopSlider</span>"
      labels="<span class="quote">Margin top:</span>"
      minimum="<span class="quote">0</span>"
      maximum="<span class="quote">100</span>"
      value="<span class="quote">0</span>"
      snapInterval="<span class="quote">1</span>"
      liveDragging="<span class="quote">true</span>" /&gt; </pre>
</code>

</div></div>

<br>To read more about TLF see Adobe wiki: <br>
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Spark+Text+Primitives#SparkTextPrimitives-content">http://opensource.adobe.com/wiki/display/flexsdk/Spark+Text+Primitives#SparkTextPrimitives-content</a>
<br><br>
<a href="http://twitter.com/EladElrom">Click here</a> to follow Elad Elrom on Twitter<br>
<br>]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37298-comment:2067150</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37298" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html#comment-2067150" />
    <title>Comment from Charles on 2009-06-25</title>
    <author>
        <name>Charles</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Wow. good start</p>]]>
    </content>
    <published>2009-06-25T15:34:11Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37298-comment:2067155</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37298" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html#comment-2067155" />
    <title>Comment from Daniel Wabyick on 2009-06-25</title>
    <author>
        <name>Daniel Wabyick</name>
        <uri>http://www.wabysabi.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.wabysabi.com">
        <![CDATA[<p>This is a really great summary of using TLF in Flex. Serious kudos for distilling everything down so well.   </p>

<p>One caveat for those new to working we TLF in MXML. Be aware that <i>empty</i> paragraphs and spans will get normalized out of a TextFlow on compose.  If you have an ID reference to them, they will still exist, but they won't be part of the flow.  </p>

<p>This problem can occur when trying to use TLF TextFlows as multifield 'templates' for visual components, such as item renderers. </p>]]>
    </content>
    <published>2009-06-25T16:03:00Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37298-comment:2070035</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37298" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html#comment-2070035" />
    <title>Comment from philip andrew on 2009-08-09</title>
    <author>
        <name>philip andrew</name>
        <uri>http://www.philipandrew.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.philipandrew.com">
        <![CDATA[<p>Hi, after reading this about flash text layout I think you might be able to answer my question at <br />
<a href="http://forums.adobe.com/thread/474696;jsessionid=0EA586902ABA5F25896B509DEFC91192.node0?tstart=0">http://forums.adobe.com/thread/474696;jsessionid=0EA586902ABA5F25896B509DEFC91192.node0?tstart=0</a></p>

<p>What I want to do is I want a red box to appear around some text in my s:TextArea, which is editable.</p>]]>
    </content>
    <published>2009-08-09T14:17:00Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37298-comment:2142195</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37298" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/utilizing-flash-text-layout-fr.html#comment-2142195" />
    <title>Comment from kiran kumar on 2009-10-15</title>
    <author>
        <name>kiran kumar</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>hi Elad Elrom<br />
 It's a grate article. <br />
I have a problem in TLF , i want to display text as ordered list as HTML <ol> tag does.  I try to get this by working with api s i sort out some extend but its not fully functioning. here is wat i tryed</ol></p>

<p>	private function numberedBullets(e:Event):void<br />
			{<br />
				var textArea:TextArea = rte.textArea;<br />
				var tf:TextFormat = new TextFormat();<br />
				//var textField:IUITextField = textArea.mx_internal::getTextFiled();<br />
				<br />
				var beginIndex:int = textArea.mx_internal::getTextField().selectionBeginIndex;<br />
				var endIndex:int = textArea.mx_internal::getTextField().selectionEndIndex;<br />
				<br />
				if (beginIndex == endIndex)<br />
				{<br />
					tf= new TextFormat();<br />
				}<br />
				<br />
				beginIndex = textArea.mx_internal::getTextField().getFirstCharInParagraph(beginIndex) - 1;<br />
				beginIndex = Math.max(0, beginIndex);<br />
				endIndex = textArea.mx_internal::getTextField().getFirstCharInParagraph(endIndex)+textArea.mx_internal::getTextField().getParagraphLength(endIndex) - 1;<br />
				<br />
				var textRange:TextRange = new TextRange(textArea,true,textArea.selectionBeginIndex, textArea.selectionEndIndex);<br />
				//textRange.text = bulletIndx++ +" . "+textRange.text;<br />
				textRange.bullet = false;<br />
				<br />
				var noOfTextLines:int = textArea.mx_internal::getTextField().numLines;<br />
				var tempString:String = "";<br />
				for(var i:int = 0; i 
                {<br />
                	tempString += bulletIndx++ +" . "+ textArea.mx_internal::getTextField().getLineText(i); 	<br />
                }<br />
				<br />
				textRange.text = tempString;<br />
				tf.indent = 20;<br />
				textArea.mx_internal::getTextField().setTextFormat(tf);<br />
				<br />
				<br />
			}</p>

<p><br />
can you help me out how to get this .<br />
Please suggest me . it's important for me</p>

<p>Thanks <br />
kirankumar</p>]]>
    </content>
    <published>2009-10-16T06:44:54Z</published>
  </entry>

</feed
