<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ActionScript Examples</title>
	<atom:link href="http://actionscriptexamples.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://actionscriptexamples.com</link>
	<description>A bunch of ActionScript 2.0 and ActionScript 3.0 examples*</description>
	<lastBuildDate>Tue, 05 Oct 2010 22:04:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting started with the TLFTextField class in ActionScript 3.0 and Flash CS5</title>
		<link>http://actionscriptexamples.com/2010/05/03/getting-started-with-the-tlftextfield-class-in-actionscript-3-0-and-flash-cs5/</link>
		<comments>http://actionscriptexamples.com/2010/05/03/getting-started-with-the-tlftextfield-class-in-actionscript-3-0-and-flash-cs5/#comments</comments>
		<pubDate>Tue, 04 May 2010 07:09:59 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TLFTextField]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[autoSize]]></category>
		<category><![CDATA[defaultTextFormat]]></category>
		<category><![CDATA[htmlText]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[setTextFormat()]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[tlfMarkup]]></category>
		<category><![CDATA[wordWrap]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=356</guid>
		<description><![CDATA[The following examples show how you can get started with the TLFTextField class in ActionScript in Adobe Flash Professional CS5. Download ZIP The following example shows how you can create a simple TLFTextField instance using ActionScript: import fl.text.TLFTextField; &#160; var tlfTxt:TLFTextField = new TLFTextField&#40;&#41;; tlfTxt.border = true; tlfTxt.text = &#34;The quick brown fox jumps over [...]]]></description>
				<content:encoded><![CDATA[<p>The following examples show how you can get started with the TLFTextField class in ActionScript in Adobe Flash Professional CS5.</p>
<p><span id="more-356"></span></p>
<p><strong>The following example(s) require Adobe Flash Professional CS5.</strong><br/><a href="http://www.adobe.com/go/tryflash">Click here to download the Adobe Flash Professional trial.</a></p>
<blockquote><p>
<a href="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/GettingStartedTLF.zip">Download ZIP</a>
</p></blockquote>
<ol>
<li>The following example shows how you can create a simple TLFTextField instance using ActionScript:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex01.html" width="100%" height="150"></iframe></p>
<li>If you want to set word wrap on a TLFTextField instance, you can set the Boolean <code>wordWrap</code> property, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex02.html" width="100%" height="150"></iframe></p>
<li>By default a TLFTextField instance is 100px by 100px. If you want to automatically resize the TLFTextField instance to the measured text width/height, you can set the <code>autoSize</code> property to one of the static constants from the flash.text.TextFieldAutoSize class, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex03.html" width="100%" height="100"></iframe></p>
<li>If you want to set rich text formatting, you can set the <code>htmlText</code> instead of the <code>text</code> format, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">htmlText</span> = <span style="color: #990000;">&quot;&lt;p&gt;The &lt;b&gt;quick&lt;/b&gt; brown &lt;i&gt;fox&lt;/i&gt; jumps &lt;font color='#FF0000'&gt;over&lt;/a&gt; the &lt;a href='http://actionscriptexamples.com/'&gt;lazy&lt;/a&gt; dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex04.html" width="100%" height="100"></iframe></p>
<li>If you want to set a custom text format to set the font color, face, size, etc., you can set the <code>defaultTextFormat</code> to a TextFormat object, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFormat</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> fmt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xFF0000<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// red</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">font</span> = <span style="color: #990000;">&quot;Arial&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span> = <span style="color: #000000; font-weight:bold;">32</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">defaultTextFormat</span> = fmt<span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>The <code>defaultTextFormat</code> property must be set <em>before</em> the <code>text</code> property.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex05.html" width="100%" height="200"></iframe></p>
<li>If you want to apply a custom text format to all characters or a range of characters in a TLFTextField, you can use the <code>setTextFormat()</code> method, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFormat</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> fmt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xFF0000<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// red</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">font</span> = <span style="color: #990000;">&quot;Arial&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
fmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span> = <span style="color: #000000; font-weight:bold;">32</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setTextFormat</span><span style="color: #000000;">&#40;</span>fmt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>The <code>setTextFormat()</code> method must be called <em>after</em> setting the <code>text</code> property.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex06.html" width="100%" height="200"></iframe></p>
<li>To set a custom text format to a range of characters, you can pass the optional start index and end index to the <code>setTextFormat()</code> method, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFormat</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> defaultFmt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
defaultFmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">font</span> = <span style="color: #990000;">&quot;Arial&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
defaultFmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span> = <span style="color: #000000; font-weight:bold;">32</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> redFmt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
redFmt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xFF0000<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// red</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">defaultTextFormat</span> = defaultFmt<span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setTextFormat</span><span style="color: #000000;">&#40;</span>redFmt<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex07.html" width="100%" height="200"></iframe></p>
<li>To set the text alpha on the TLFTextField instance you can set the <code>alpha</code> property, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">alpha</span> = <span style="color: #000000; font-weight:bold;">0.3</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>Unlike the TextField class which only supports setting text alpha on a TextField with an embedded font, the TLFTextField class supports setting text alpha on device (non-embedded) fonts.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex08.html" width="100%" height="100"></iframe></p>
<li>To set the text rotation on the TLFTextField instance you can set the <code>rotation</code> property, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span> = <span style="color: #000000; font-weight:bold;">15</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>Unlike the TextField class which only supports setting text rotation on a TextField with an embedded font, the TLFTextField class supports setting text retotation on device (non-embedded) fonts.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex09.html" width="100%" height="150"></iframe></p>
<li>Similar to setting the <code>htmlText</code> property, setting the <code>tlfMarkup</code> allows you to set rich text formatting on the TLFTextField instance, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tFlow<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&lt;TextFlow xmlns='http://ns.adobe.com/textLayout/2008'&gt;&lt;p&gt;The quick brown fox jumps over the lazy dog.&lt;/p&gt;&lt;/TextFlow&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span>tlfMarkup = tFlow<span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex10.html" width="100%" height="100"></iframe></p>
<p>Or, if you want to apply some more complex formatting (such as hyperlinks, bold, italics, superscript/subscript, or strike through text, you can use a more complex TextFlow string object, as seen in the following example:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tFlow<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&lt;TextFlow xmlns='http://ns.adobe.com/textLayout/2008' fontFamily='Arial' fontSize='24'&gt;&lt;p&gt;The &lt;span fontStyle='italic'&gt;quick&lt;/span&gt; &lt;span fontWeight='bold'&gt;brown&lt;/span&gt; &lt;span lineThrough='true'&gt;fox&lt;/span&gt; &lt;span color='#FF0000'&gt;jumps&lt;/span&gt; &lt;span baselineShift='superscript'&gt;over&lt;/span&gt; &lt;span typographicCase='uppercase'&gt;the&lt;/span&gt; &lt;a href='http://actionscriptexamples.com/'&gt;lazy&lt;/a&gt; dog.&lt;/p&gt;&lt;/TextFlow&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span>tlfMarkup = tFlow<span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex10b.html" width="100%" height="150"></iframe></p>
<li>Or you can load a TextFlow markup string dynamically at runtime using ActionScript, as seen in the following example:</li>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>TLFTextField<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Loader</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">URLLoader</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">URLLoaderDataFormat</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">URLRequest</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> tlfTxt<span style="color: #000066; font-weight: bold;">:</span>TLFTextField = <span style="color: #0033ff; font-weight: bold;">new</span> TLFTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">border</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">300</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = tlfTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tlfTxt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> ldr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
ldr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">dataFormat</span> = <span style="color: #004993;">URLLoaderDataFormat</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TEXT</span><span style="color: #000066; font-weight: bold;">;</span>
ldr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span> ldr_complete<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
ldr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;markup.xml&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> ldr_complete<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	tlfTxt<span style="color: #000066; font-weight: bold;">.</span>tlfMarkup = ldr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And the TLF markup file, <em>markup.xml</em>, is as follows:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextFlow</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://ns.adobe.com/textLayout/2008'</span> <span style="color: #000066;">fontFamily</span>=<span style="color: #ff0000;">'Arial'</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">'24'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">fontStyle</span>=<span style="color: #ff0000;">'italic'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>quick<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">fontWeight</span>=<span style="color: #ff0000;">'bold'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>brown<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">lineThrough</span>=<span style="color: #ff0000;">'true'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>fox<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">'#FF0000'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>jumps<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">baselineShift</span>=<span style="color: #ff0000;">'superscript'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>over<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">typographicCase</span>=<span style="color: #ff0000;">'uppercase'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>the<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://actionscriptexamples.com/'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>lazy<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> dog.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TextFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><iframe src="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/ex11.html" width="100%" height="150"></iframe></p>
</ol>
<blockquote><p>
<a href="http://dl.dropbox.com/u/4509565/ActionScriptExamples_com/GettingStartedTLF/GettingStartedTLF.zip">Download ZIP</a>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2010/05/03/getting-started-with-the-tlftextfield-class-in-actionscript-3-0-and-flash-cs5/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Adding tick marks to a Slider control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2009/03/07/adding-tick-marks-to-a-slider-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2009/03/07/adding-tick-marks-to-a-slider-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 08:26:17 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Slider]]></category>
		<category><![CDATA[tickInterval]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=348</guid>
		<description><![CDATA[The following example shows how you can add tick marks to a Flash/ActionScript 3.0 Slider control by setting the tickInterval property. Full code after the jump. // ActionScript 3.0 /** * Requires: * - Slider control in the Flash library. */ import fl.controls.Slider; &#160; var slider:Slider = new Slider&#40;&#41;; slider.tickInterval = 1; slider.move&#40;20, 20&#41;; addChild&#40;slider&#41;;]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can add tick marks to a Flash/ActionScript 3.0 Slider control by setting the <code>tickInterval</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-348"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/**
 * Requires:
 * - Slider control in the Flash library.
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Slider<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> slider<span style="color: #000066; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>tickInterval = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>slider<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2009/03/07/adding-tick-marks-to-a-slider-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Creating a vertical Slider control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2009/03/05/creating-a-vertical-slider-control-in-flash-using-actionscript-30-2/</link>
		<comments>http://actionscriptexamples.com/2009/03/05/creating-a-vertical-slider-control-in-flash-using-actionscript-30-2/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 15:10:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Slider]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[SliderDirection]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=345</guid>
		<description><![CDATA[The following example shows how you can create a horizontal or vertical Slider control in Flash using ActionScript 3.0 by setting the Slider control&#8217;s direction property to one of the static constants in the fl.controls.SliderDirection class (SliderDirection.HORIZONTAL or SliderDirection.VERTICAL). Full code after the jump. /** THIS EXAMPLE REQUIRES A COMBOBOX AND SLIDER COMPONENT IN YOUR [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can create a horizontal or vertical Slider control in Flash using ActionScript 3.0 by setting the Slider control&#8217;s <code>direction</code> property to one of the static constants in the fl.controls.SliderDirection class (<code>SliderDirection.HORIZONTAL</code> or <code>SliderDirection.VERTICAL</code>).</p>
<p>Full code after the jump.</p>
<p><span id="more-345"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** THIS EXAMPLE REQUIRES A COMBOBOX AND SLIDER COMPONENT IN YOUR FLASH LIBRARY */</span>
<span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ComboBox<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Slider<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>SliderDirection<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>DataProvider<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> dp<span style="color: #000066; font-weight: bold;">:</span>DataProvider = <span style="color: #0033ff; font-weight: bold;">new</span> DataProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
dp<span style="color: #000066; font-weight: bold;">.</span>addItem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>label<span style="color: #000066; font-weight: bold;">:</span>SliderDirection<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">HORIZONTAL</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
dp<span style="color: #000066; font-weight: bold;">.</span>addItem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>label<span style="color: #000066; font-weight: bold;">:</span>SliderDirection<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">VERTICAL</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> comboBox<span style="color: #000066; font-weight: bold;">:</span>ComboBox = <span style="color: #0033ff; font-weight: bold;">new</span> ComboBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
comboBox<span style="color: #000066; font-weight: bold;">.</span>dataProvider = dp<span style="color: #000066; font-weight: bold;">;</span>
comboBox<span style="color: #000066; font-weight: bold;">.</span>selectedIndex = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
comboBox<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
comboBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> comboBox_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>comboBox<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> slider<span style="color: #000066; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>direction = SliderDirection<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">VERTICAL</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">50</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>slider<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> comboBox_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    slider<span style="color: #000066; font-weight: bold;">.</span>direction = comboBox<span style="color: #000066; font-weight: bold;">.</span>selectedItem<span style="color: #000066; font-weight: bold;">.</span>label<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2009/03/05/creating-a-vertical-slider-control-in-flash-using-actionscript-30-2/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Creating a custom context menu item in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2009/03/05/creating-a-custom-context-menu-item-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2009/03/05/creating-a-custom-context-menu-item-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 08:23:10 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ContextMenu]]></category>
		<category><![CDATA[ContextMenuEvent]]></category>
		<category><![CDATA[ContextMenuItem]]></category>
		<category><![CDATA[customItems]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[hideBuiltInItems()]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=342</guid>
		<description><![CDATA[The following example shows how you can add a custom context menu item to a Sprite object by setting the Sprite&#8217;s contextMenu property to a ContextMenu object. Full code after the jump. // ActionScript 3.0 var red_cmi:ContextMenuItem = new ContextMenuItem&#40;&#34;red&#34;&#41;; red_cmi.addEventListener&#40;ContextMenuEvent.MENU_ITEM_SELECT, cmi_menuItemSelect&#41;; &#160; var cm:ContextMenu = new ContextMenu&#40;&#41;; cm.customItems.push&#40;red_cmi&#41;; cm.hideBuiltInItems&#40;&#41;; &#160; var spr:Sprite = new [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can add a custom context menu item to a Sprite object by setting the Sprite&#8217;s <code>contextMenu</code> property to a ContextMenu object.</p>
<p>Full code after the jump.</p>
<p><span id="more-342"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #6699cc; font-weight: bold;">var</span> red_cmi<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ContextMenuItem</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ContextMenuItem</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;red&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
red_cmi<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">ContextMenuEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MENU_ITEM_SELECT</span><span style="color: #000066; font-weight: bold;">,</span> cmi_menuItemSelect<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> cm<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ContextMenu</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ContextMenu</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
cm<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">customItems</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>red_cmi<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
cm<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">hideBuiltInItems</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> spr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">contextMenu</span> = cm<span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0x000000<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">120</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">90</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>spr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> cmi_menuItemSelect<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ContextMenuEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFF0000<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">120</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">90</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2009/03/05/creating-a-custom-context-menu-item-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rotating a Sprite object around its x-axis in Flash using ActionScript 3.0 and Flash Player 10</title>
		<link>http://actionscriptexamples.com/2009/02/26/rotating-a-sprite-object-around-its-x-axis-in-flash-using-actionscript-30-and-flash-player-10/</link>
		<comments>http://actionscriptexamples.com/2009/02/26/rotating-a-sprite-object-around-its-x-axis-in-flash-using-actionscript-30-and-flash-player-10/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 03:45:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[drawRect()]]></category>
		<category><![CDATA[rotationX]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=338</guid>
		<description><![CDATA[The following example shows how you can 3D rotate a Sprite object around its x-axis with Flash, ActionScript 3.0, and Flash Player 10 by setting the object&#8217;s rotationX property. Full code after the jump. // http://actionscriptexamples.com/2009/02/26/rotating-a-sprite-object-around-its-x-axis-in-flash-using-actionscript-30-and-flash-player-10/ // ActionScript 3.0 /** Requires: * - Slider control in Flash library. * - Publish for Flash Player 10. [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can 3D rotate a Sprite object around its x-axis with Flash, ActionScript 3.0, and Flash Player 10 by setting the object&#8217;s <code>rotationX</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-338"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// http://actionscriptexamples.com/2009/02/26/rotating-a-sprite-object-around-its-x-axis-in-flash-using-actionscript-30-and-flash-player-10/</span>
<span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/** Requires:
 *  - Slider control in Flash library.
 *  - Publish for Flash Player 10.
 */</span>
&nbsp;
<span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;400&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;300&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Slider<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>SliderDirection<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>SliderEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> slider<span style="color: #000066; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>direction = SliderDirection<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">HORIZONTAL</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>minimum = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>maximum = <span style="color: #000000; font-weight:bold;">360</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">value</span> = <span style="color: #000000; font-weight:bold;">45</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>tickInterval = <span style="color: #000000; font-weight:bold;">45</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>snapInterval = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>liveDragging = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SliderEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> slider_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>slider<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> spr<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">,</span> 0xFF0000<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">80</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span> <span style="color: #000066; font-weight: bold;">-</span> spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span> <span style="color: #000066; font-weight: bold;">-</span> spr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
spr<span style="color: #000066; font-weight: bold;">.</span>rotationX = <span style="color: #000000; font-weight:bold;">45</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>spr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> slider_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span>SliderEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    spr<span style="color: #000066; font-weight: bold;">.</span>rotationX = evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2009/02/26/rotating-a-sprite-object-around-its-x-axis-in-flash-using-actionscript-30-and-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detecting when the user changes the color in a ColorPicker control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2008/12/28/detecting-when-the-user-changes-the-color-in-a-colorpicker-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2008/12/28/detecting-when-the-user-changes-the-color-in-a-colorpicker-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 16:03:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[ColorPickerEvent]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=315</guid>
		<description><![CDATA[The following example shows how you can detect when the selected color in a Flash ActionScript 3.0 ColorPicker component by listening for the change event (using the static ColorPickerEvent.CHANGE constant). Full code after the jump. // ActionScript 3.0 /* Requires: * - ColorPicker control in the Flash library */ import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; &#160; var [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can detect when the selected color in a Flash ActionScript 3.0 ColorPicker component by listening for the <code>change</code> event (using the static <code>ColorPickerEvent.CHANGE</code> constant).</p>
<p>Full code after the jump.</p>
<p><span id="more-315"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/* Requires:
 * - ColorPicker control in the Flash library
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ColorPicker<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ColorPickerEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> bg<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0x000000<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bg<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> colorPicker<span style="color: #000066; font-weight: bold;">:</span>ColorPicker = <span style="color: #0033ff; font-weight: bold;">new</span> ColorPicker<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ColorPickerEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> colorPicker_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colorPicker<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> colorPicker_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span>ColorPickerEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">,</span> colorPicker<span style="color: #000066; font-weight: bold;">.</span>textField<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// 16711680 #ff0000</span>
    bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2008/12/28/detecting-when-the-user-changes-the-color-in-a-colorpicker-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the currently selected color as a hexadecimal value on a ColorPicker control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2008/12/23/getting-the-currently-selected-color-as-a-hexadecimal-value-on-a-colorpicker-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2008/12/23/getting-the-currently-selected-color-as-a-hexadecimal-value-on-a-colorpicker-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 22:33:36 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[hexValue]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=327</guid>
		<description><![CDATA[The following example shows how you can get the currently selected color as a hexadecimal value on a Flash ActionScript 3.0 ColorPicker component by using the read-only hexValue property. Full code after the jump. // ActionScript 3.0 /* Requires: * - ColorPicker control in Flash library * - Label control in Flash library */ import [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can get the currently selected color as a hexadecimal value on a Flash ActionScript 3.0 ColorPicker component by using the read-only <code>hexValue</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-327"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/* Requires:
 * - ColorPicker control in Flash library
 * - Label control in Flash library
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ColorPicker<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Label<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ColorPickerEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> colorPicker<span style="color: #000066; font-weight: bold;">:</span>ColorPicker = <span style="color: #0033ff; font-weight: bold;">new</span> ColorPicker<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ColorPickerEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> colorPicker_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colorPicker<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> lbl<span style="color: #000066; font-weight: bold;">:</span>Label = <span style="color: #0033ff; font-weight: bold;">new</span> Label<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
lbl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = colorPicker<span style="color: #000066; font-weight: bold;">.</span>hexValue<span style="color: #000066; font-weight: bold;">;</span>
lbl<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>lbl<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> colorPicker_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span>ColorPickerEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    lbl<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = colorPicker<span style="color: #000066; font-weight: bold;">.</span>hexValue<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// ff0000</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2008/12/23/getting-the-currently-selected-color-as-a-hexadecimal-value-on-a-colorpicker-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toggling the text field on the ColorPicker control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2008/12/23/toggling-the-text-field-on-the-colorpicker-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2008/12/23/toggling-the-text-field-on-the-colorpicker-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 18:46:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[showTextField]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=324</guid>
		<description><![CDATA[The following example shows how you can toggle the text field on the Flash ActionScript 3.0 ColorPicker control by setting the Boolean showTextField property. Full code after the jump. // ActionScript 3.0 /* Requires: * - CheckBox control in Flash library * - ColorPicker control in Flash library */ import fl.controls.CheckBox; import fl.controls.ColorPicker; &#160; var [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can toggle the text field on the Flash ActionScript 3.0 ColorPicker control by setting the Boolean <code>showTextField</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-324"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/* Requires:
 * - CheckBox control in Flash library
 * - ColorPicker control in Flash library
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>CheckBox<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ColorPicker<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> checkBox<span style="color: #000066; font-weight: bold;">:</span>CheckBox = <span style="color: #0033ff; font-weight: bold;">new</span> CheckBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
checkBox<span style="color: #000066; font-weight: bold;">.</span>selected = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
checkBox<span style="color: #000066; font-weight: bold;">.</span>label = <span style="color: #990000;">&quot;showTextField&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
checkBox<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> checkBox_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
checkBox<span style="color: #000066; font-weight: bold;">.</span>textField<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
checkBox<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>checkBox<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> colorPicker<span style="color: #000066; font-weight: bold;">:</span>ColorPicker = <span style="color: #0033ff; font-weight: bold;">new</span> ColorPicker<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">40</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colorPicker<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> checkBox_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span>showTextField = checkBox<span style="color: #000066; font-weight: bold;">.</span>selected<span style="color: #000066; font-weight: bold;">;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2008/12/23/toggling-the-text-field-on-the-colorpicker-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a vertical Slider control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2008/12/23/creating-a-vertical-slider-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2008/12/23/creating-a-vertical-slider-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 18:31:24 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[SliderDirection]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=322</guid>
		<description><![CDATA[The following example shows how you can create a vertical Flash ActionScript 3.0 Slider component by setting the direction property to one of the static constants in the SliderDirection class. Full code after the jump. // ActionScript 3.0 /* Requires: * - Slider control in Flash library */ import fl.controls.Slider; import fl.controls.SliderDirection; &#160; var slider:Slider [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can create a vertical Flash ActionScript 3.0 Slider component by setting the <code>direction</code> property to one of the static constants in the SliderDirection class.</p>
<p>Full code after the jump.</p>
<p><span id="more-322"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/* Requires:
 * - Slider control in Flash library
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Slider<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>SliderDirection<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> slider<span style="color: #000066; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>direction = SliderDirection<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">VERTICAL</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>tickInterval = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>slider<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2008/12/23/creating-a-vertical-slider-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting the number of columns on a ColorPicker control in Flash using ActionScript 3.0</title>
		<link>http://actionscriptexamples.com/2008/12/23/setting-the-number-of-columns-on-a-colorpicker-control-in-flash-using-actionscript-30/</link>
		<comments>http://actionscriptexamples.com/2008/12/23/setting-the-number-of-columns-on-a-colorpicker-control-in-flash-using-actionscript-30/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 18:21:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[columnCount]]></category>

		<guid isPermaLink="false">http://actionscriptexamples.com/?p=319</guid>
		<description><![CDATA[The following example shows how you can set the number of columns on a Flash ActionScript 3.0 ColorPicker control&#8217;s pop up menu by setting the columnCount style. Full code after the jump. // ActionScript 3.0 /* Requires: * - ColorPicker control in Flash library * - Slider control in Flash library */ import fl.controls.ColorPicker; import [...]]]></description>
				<content:encoded><![CDATA[<p>The following example shows how you can set the number of columns on a Flash ActionScript 3.0 ColorPicker control&#8217;s pop up menu by setting the <code>columnCount</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-319"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// ActionScript 3.0</span>
<span style="color: #3f5fbf;">/* Requires:
 * - ColorPicker control in Flash library
 * - Slider control in Flash library
 */</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>ColorPicker<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>Slider<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>SliderEvent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> slider<span style="color: #000066; font-weight: bold;">:</span>Slider = <span style="color: #0033ff; font-weight: bold;">new</span> Slider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>minimum = <span style="color: #000000; font-weight:bold;">9</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>maximum = <span style="color: #000000; font-weight:bold;">36</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">value</span> = <span style="color: #000000; font-weight:bold;">18</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>snapInterval = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>tickInterval = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>liveDragging = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SliderEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CHANGE</span><span style="color: #000066; font-weight: bold;">,</span> slider_change<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">200</span><span style="color: #000066; font-weight: bold;">;</span>
slider<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>slider<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> colorPicker<span style="color: #000066; font-weight: bold;">:</span>ColorPicker = <span style="color: #0033ff; font-weight: bold;">new</span> ColorPicker<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colorPicker<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">30</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>colorPicker<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> slider_change<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span>SliderEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;columnCount&quot;</span><span style="color: #000066; font-weight: bold;">,</span> evt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">value</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    colorPicker<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://actionscriptexamples.com/2008/12/23/setting-the-number-of-columns-on-a-colorpicker-control-in-flash-using-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
