<?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>Interactive IQ : The Hessler Design Blog &#187; XML</title>
	<atom:link href="http://www.hesslerdesign.com/blog/category/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hesslerdesign.com/blog</link>
	<description>Smart Developers = Smart Websites</description>
	<lastBuildDate>Thu, 26 Jan 2012 23:00:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Streaming RSS Feeds into Your Flash Application</title>
		<link>http://www.hesslerdesign.com/blog/flash/streaming-rss-feeds-into-your-flash-application/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/streaming-rss-feeds-into-your-flash-application/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 21:30:35 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=300</guid>
		<description><![CDATA[One of the great things about RSS feeds is that RSS formats are specified using XML.  Because of this, you can parse the RSS feed in your Flash applications just as you would an XML file.  So if, for instance, you have a Flash-based website that you would like to add a &#8220;Recent Blog Posts&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great things about RSS feeds is that RSS formats are specified using XML.  Because of this, you can parse the RSS feed in your Flash applications just as you would an XML file.  So if, for instance, you have a Flash-based website that you would like to add a &#8220;Recent Blog Posts&#8221; section to, you can just import the RSS into Flash and *BAM*, you&#8217;re all set.  Here&#8217;s a quick rundown of how to do it:</p>
<h4>Step 1: Locate the RSS Feed</h4>
<p>If you&#8217;re the owner of a blog that you want to get the RSS feed to, all you should need to do is go to the blog&#8217;s home page, and add &#8220;/feed/&#8221; to the end of the URL.  (For example: <a title="Hessler Design Blog Feed" href="http://www.hesslerdesign.com/blog/feed/" target="_blank">http://www.hesslerdesign.com/blog/feed/</a>)  This is an XML-based page that gives you a list of the blog&#8217;s posts, titles, contents/extracts, etc.</p>
<p>If you need an RSS feed through a service like FeedBurner, you first need to go to the FeedBurner page of the site you want an RSS feed from. (For example: <a title="Hessler Design Blog Feed" href="http://feeds.feedburner.com/hesslerdesign" target="_blank">http://feeds.feedburner.com/hesslerdesign</a>)  This page is NOT the one you need to link to, however.  At this page you&#8217;ll notice a link to &#8220;View Feed XML&#8221; in the Subscribe Now! box.  Click on that link, and you&#8217;ll be presented with a page exactly like that of the &#8220;/feed/&#8221; URL mentioned in the previous paragraph.</p>
<p>Once you get to the XML-based page, copy the URL, because you&#8217;ll need it in Flash.  (If you want to confirm that the page is the correct one, view the page&#8217;s source. It will be set up as an XML file, with a line like <code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code> at the very top.)</p>
<h4>Step 2: Importing the RSS Feed into Flash</h4>
<p>To import the feed into Flash, just follow the normal steps you would to import an XML file.  Create an <code>XML</code> object and a <code>URLLoader</code> object, then load your RSS feed URL using the <code>URLLoader</code>.  Since I&#8217;m the type of developer who likes to code as dynamically and flexibly as possible, I like to also set up an empty array for each of the items I want to hold from the RSS feed, such as titles and permalinks.  Then, when I parse the XML, I assign a slot in the appropriate array for each title and accompanying permalink, and then have them to use when I display the Recent Posts section.  Here&#8217;s how to do this:</p>
<div style="margin-left: 24px;"><code><span style="color: #808080;">/* Begin ActionScript 3.0 Code */</span><br />
<span style="color: #0000ff;">var</span> rssXML:<span style="color: #0000ff;">XML</span>;<br />
<span style="color: #0000ff;">var</span> rssLoader:<span style="color: #0000ff;">URLLoader</span>;<br />
<span style="color: #0000ff;">var</span> rssTitles_arr:<span style="color: #0000ff;">Array</span> = <span style="color: #0000ff;">new Array</span>();<br />
<span style="color: #0000ff;">var</span> rssLinks_arr:<span style="color: #0000ff;">Array</span> = <span style="color: #0000ff;">new Array</span>();<br />
<span style="color: #0000ff;">function</span> importFeed():<span style="color: #0000ff;">void</span> {<br />
rssLoader = <span style="color: #0000ff;">new URLLoader</span>();<br />
rssLoader.<span style="color: #0000ff;">addEventListener</span>(<span style="color: #0000ff;">Event.COMPLETE</span>, loadRSS);<br />
rssLoader.<span style="color: #0000ff;">load</span>(<span style="color: #0000ff;">new URLRequest</span>(<span style="color: #009900;">"http://www.hesslerdesign.com/blog/feed/"</span>));<br />
}<br />
<span style="color: #0000ff;">function</span> loadRSS(e:<span style="color: #0000ff;">Event</span>):void {<br />
rssXML = <span style="color: #0000ff;">new XML</span>(e.<span style="color: #0000ff;">target.data</span>);<br />
<span style="color: #0000ff;">trace</span>(rssXML);<br />
<span style="color: #0000ff;">for</span> (<span style="color: #0000ff;">var</span> i=0; i&lt;4; i++) {<br />
rssTitles_arr[i] = rssXML.channel.item[i].title;<br />
rssLinks_arr[i] = rssXML.channel.item[i].link;<br />
}<br />
<span style="color: #808080;">// Garbage Collection</span><br />
rssLoader.<span style="color: #0000ff;">removeEventListener</span>(<span style="color: #0000ff;">Event.COMPLETE</span>, loadRSS);<br />
}<br />
importFeed();<br />
<span style="color: #808080;">/* End ActionScript 3.0 Code */</span></code></div>
<h4>An important note:</h4>
<p>To dig down into the XML and get things like Post titles and permalinks, you need to be familiar with the structure of the RSS file.  You can see from the code above that the title for each post is inside an item tag, which sits inside of the channel tag.  If you want to get more info than just these two items, just go to the RSS URL (see Step 1) and view the page source.  Or, you can do as I&#8217;ve done in the code above and trace out the XML in Flash once the XML loads.  This is a helpful first step to see what the structure of the XML file is before you get into parsing the XML into appropriate arrays.</p>
<p>Another quick thing to note is in the <code>for</code> loop, inside of the <code>loadRSS()</code> function.  I used the number 4 as a benchmark to populate my arrays (seen in the snippet <code>i&lt;4</code>).  You can use a different number if you want.  It&#8217;s a matter of (a) the number of posts available in the RSS feed, and (b) personal preference.</p>
<p>Once you incorporate the code above, you can then use the arrays populated with RSS info and populate text fields, buttons, etc.  Since it&#8217;s stored in an array, the possibilities are virtually limitless.</p>
<p>So there you have it.  The flexibility of RSS feeds makes it just that easy to import into Flash.  Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/streaming-rss-feeds-into-your-flash-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using &amp; Formatting HTML Text in Flash</title>
		<link>http://www.hesslerdesign.com/blog/flash/using-formatting-html-text-in-flash/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/using-formatting-html-text-in-flash/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 04:05:41 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[cdata]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=74</guid>
		<description><![CDATA[I import XML into my Flash projects a lot. From time to time, the XML will contain special characters that can&#8217;t be rendered by Flash.  Or maybe it will contain text that should act as a hyperlink, or be bold or italic.  Whatever the case may be, there are a few key steps to successfully [...]]]></description>
			<content:encoded><![CDATA[<p>I import XML into my Flash projects a lot. From time to time, the XML will contain special characters that can&#8217;t be rendered by Flash.  Or maybe it will contain text that should act as a hyperlink, or be bold or italic.  Whatever the case may be, there are a few key steps to successfully importing and displaying these special characters and HTML styles.</p>
<p>First, we need to set up the XML file.  In the text editor of your choice, you can begin setting it up by entering the following code:</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code><br />
<code>&lt;site&gt;</code><br />
&nbsp; &nbsp;<code>&lt;theItem&gt;&lt;/theItem&gt;</code><br />
<code>&lt;/site&gt;</code></p>
<p>In the code above, we simply set up the main tag, named <code>site</code>, and put another tag named <code>theItem</code> inside of it. (I&#8217;m not going to get into explaining best practices for setting up XML files here. That&#8217;s a topic for another post.)  Inside the <code>theItem</code> tag, we can put our text. I&#8217;ll start by putting one sentence, contained inside of a <code>&lt;p&gt;</code> tag, with <code>&lt;b&gt;</code>, <code>&lt;i&gt;</code>, and <code>&lt;a&gt;</code> HTML tags.</p>
<p><code>&lt;theItem&gt;&lt;p&gt;This is an example of XML text with &lt;b&gt;bold&lt;/b&gt; and &lt;i&gt;italic&lt;/i&gt; words, as well as &lt;a href="#"&gt;hyperlinks&lt;/a&gt;.&lt;/p&gt;&lt;/theItem&gt;</code></p>
<p>Save your XML file as &#8220;text.xml&#8221;.</p>
<p><span id="more-74"></span></p>
<p>Now that we have the XML built, let&#8217;s move over to Adobe Flash and import the XML.  With Adobe Flash open, create a new ActionScript 3.0 file, and make a new dynamic text field and name it &#8220;text_txt&#8221;.  Set the color, font, and size to your own liking.  Then, create a new layer, named Actions, and lock it.  (I always name my ActionScript layer &#8220;Actions&#8221;, lock it, and put it as the top layer.  It&#8217;s a good practice to get into if you don&#8217;t already.)  Save your Flash file in the same directory location as the XML file.</p>
<p>Now, in your Actions panel, type the following code:</p>
<p><code><span style="color: #0000ff;">var</span> theXML:<span style="color: #0000ff;">XML</span>;</code><br />
<code><span style="color: #0000ff;">var</span> xmlData:<span style="color: #0000ff;">Array</span> = <span style="color: #0000ff;">new Array</span>();</code><br />
<code><span style="color: #0000ff;">var</span> loader:<span style="color: #0000ff;">URLLoader</span> = <span style="color: #0000ff;">new URLLoader</span>();</code><br />
<code>loader.<span style="color: #0000ff;">addEventListener</span>(Event.COMPLETE, processXML);</code><br />
<code>loader.<span style="color: #0000ff;">load</span>(<span style="color: #0000ff;">new URLRequest</span>(<span style="color: #009900;">"test.xml"</span>));</code></p>
<p><code><span style="color: #0000ff;">function</span> processXML(e:<span style="color: #0000ff;">Event</span>){</code><br />
&nbsp; &nbsp;<code>theXML = <span style="color: #0000ff;">new XML</span>(e<span style="color: #0000ff;">.target.data</span>);</code><br />
&nbsp; &nbsp;<code><span style="color: #0000ff;">var</span> xmlLength:<span style="color: #0000ff;">Number</span> = theXML.theItem<span style="color: #0000ff;">.length</span>();</code><br />
&nbsp; &nbsp;<code><span style="color: #0000ff;">for</span> (<span style="color: #0000ff;">var</span> i=0; i&lt;xmlLength; i++){</code><br />
&nbsp; &nbsp;&nbsp; &nbsp;<code>xmlData[i] = theXML.theItem[i];</code><br />
&nbsp; &nbsp;<code>}</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.text</span> = xmlData[0];</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.multiline</span> = <span style="color: #0000ff;">true</span>;</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.wordWrap</span> = <span style="color: #0000ff;">true</span>;</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.height</span> = text_txt<span style="color: #0000ff;">.textHeight</span> + 6;</code><br />
<code>}</code></p>
<p>Here&#8217;s a quick rundown of what this code does:<br />
- Define a new XML object named <code>theXML</code><br />
- Create a new Array named <code>xmlData</code><br />
- Create a new URLLoader named <code>loader</code>.  This loader then gets an event listener that will fire the function <code>processXML</code> when loading is complete.  To load the XML file, we load a new URLRequest to the path of our XML file (which should be in the same directory as your Flash file.)<br />
- The <code>processXML</code> function then creates our XML object, filling it with the data from the loader.<br />
- Create a number variable containing the length of the XML. This is essential for what&#8217;s coming next.<br />
- Run a <code>for</code> loop starting at 0 and going through the length of the XML object.  This loop populates our Array, <code>xmlData</code>, with each <code>theItem</code> tag from the XML.<br />
- Fill the text field with the text from the first spot in the array (our only tag in this example).<br />
- Set <code>multiline</code> and <code>wordWrap</code> to true so the text won&#8217;t be limited to one line.<br />
- Set the text field height so it includes all of the text, plus a few extra pixels of buffer at the bottom.</p>
<p>Save your Flash file and test your movie.  You&#8217;ll see something very similar to the image below, which isn&#8217;t very appealing yet.</p>
<p><img class="size-full wp-image-77" title="flash_initialImport" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flash_initialImport.gif" alt="Initial Import of XML" width="552" height="152" /></p>
<p>Close the test movie and return to your Actions panel.</p>
<p>In the Actions panel, we&#8217;re going to change the line of code that sets the text in our text field to the array data.  Instead of using <code>text_txt<span style="color:#0000ff;">.text</span></code>, we&#8217;re going to use <code>text_txt<span style="color:#0000ff;>.htmlText</span></code> (see below).  By setting the text field to <code>htmlText</code>, we enable the ability to accept HTML tags and display the results appropriately.</p>
<p><code>text_txt<span style="color: #0000ff;">.htmlText</span> = xmlData[0];</code></p>
<p>Save your Flash file and re-test your movie.  You&#8217;ll notice the results are much nicer, but the lines break up each time there is an HTML tag, as in the image below.  The good news is that the bold and italic tags display the text correctly, and the hyperlink does work.  But there&#8217;s really no way to tell the user that the hyperlink is actually a hyperlink.</p>
<p><img class="size-full wp-image-78" title="flash_textNoStyle" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flash_textNoStyle.gif" alt="Flash Export - Text Unstyled" width="552" height="152" /></p>
<p>Close the test movie and return to your Actions panel once again.</p>
<p>To style our HTML text, we&#8217;re going to need to create a style sheet object and attach it to our text field.  To do this, we can use the following code, placed above our <code>processXML</code> function:</p>
<p><code><span style="color: #0000ff;">var</span> textStyles:<span style="color: #0000ff;">StyleSheet</span> = <span style="color: #0000ff;">new StyleSheet</span>();</code><br />
<code>textStyles<span style="color: #0000ff;">.setStyle</span>(<span style="color: #009900;">"a:link"</span>, {color:<span style="color: #009900;">'#01628b'</span>, textDecoration:<span style="color: #009900;">'underline'</span>});</code><br />
<code>textStyles<span style="color: #0000ff;">.setStyle</span>(<span style="color: #009900;">"a:hover"</span>, {color:<span style="color: #009900;">'#d68402'</span>, textDecoration:<span style="color: #009900;">'underline'</span>});</code><br />
<code>text_txt<span style="color: #0000ff;">.styleSheet</span> = textStyles;</code></p>
<p>Here, we create a new <code>StyleSheet</code> object, and set styles for <code>&lt;a&gt;</code> tags, based on the correct syntax that Flash uses.  In this example, we assigned a color and underline to our link, and to its hover state.  (For more info on <code>StyleSheets</code>, consult the <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/StyleSheet.html" target="_blank">Flash documentation on StyleSheets</a>.</p>
<p>Lastly, we set the <code>styleSheet</code> attribute on our text field to our <code>StyleSheet</code> object.</p>
<p>Save your Flash file and re-test your movie again.  Our lines are still broke, but our hyperlink now looks like a hyperlink.  We&#8217;re getting closer.</p>
<p><img class="size-full wp-image-79" title="flash_textStyled" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flash_textStyled.gif" alt="Flash Export - Text Styled" width="552" height="152" /></p>
<p>Close the test movie, and return to your XML file.</p>
<p>Here, we will get to the key to successfully displaying the HTML content correctly, and on one line:  The CDATA tag.</p>
<p>In order to display HTML content and special characters successfully, we need to put a CDATA tag into our <code>theItem</code> tag.  The syntax of the CDATA tag starts with <code>&lt;![CDATA[</code> and ends with <code>]]&gt;</code>.  It wraps around the outside of the <code>theItem</code> content, like this:</p>
<p><code>&lt;theItem&gt;&lt;![CDATA[&lt;p&gt;This is an example of XML text with &lt;b&gt;bold&lt;/b&gt; and &lt;i&gt;italic&lt;/i&gt; words, as well as &lt;a href="#"&gt;hyperlinks&lt;/a&gt;.&lt;/p&gt;]]&gt;&lt;/theItem&gt;</code></p>
<p>Save the XML file, and return to Flash.  Once in Flash, re-rest your movie.  You&#8217;ll notice that the text now flows correctly, and is styled according to our HTML tags and style sheet data!</p>
<p><img class="size-full wp-image-75" title="flash_cdata01" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flash_cdata01.gif" alt="Flash Export - CDATA #1" width="552" height="52" /></p>
<p>Ah, sweet success!  We did it!  But the fun doesn&#8217;t stop there.  Inside of the CDATA tag, we not only have the ability to successfully show HTML tags, but also special characters.  Let&#8217;s put some special characters into our XML tag and see what happens.</p>
<p>To use special characters, we will need to know the respective HTML Entity Number, which can be found at the W3 Schools website here: <a href="http://www.w3schools.com/tags/ref_entities.asp" target="_blank">HTML Entity Number Reference</a>.</p>
<p>Now that we have a reference for finding special character entity numbers, we&#8217;ll put in another sentence containing a handful of them to see how they look.  In your XML file, add another sentence to the <code>theItem</code> tag, like the one I&#8217;ve included below:</p>
<p><code>&lt;![CDATA[&lt;p&gt;This is an example of XML text with &lt;b&gt;bold&lt;/b&gt; and &lt;i&gt;italic&lt;/i&gt; words, as well as &lt;a href="#"&gt;hyperlinks&lt;/a&gt;. It also contains special characters, like &amp;#198;, &amp;amp;, &amp;#169;, &amp;#174;, and &amp;#187;.&lt;/p&gt;]]&gt;</code></p>
<p>Save the XML file, return to Flash, and re-test your movie.  Notice that the special characters show up correctly, and in line with everything else without those annoying line breaks!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="60" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flashXML_specialCharacters.swf" /><embed type="application/x-shockwave-flash" width="550" height="60" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/06/flashXML_specialCharacters.swf"></embed></object></p>
<p>Now, I will say this:  CDATA tags aren&#8217;t needed to merely display HTML tags and special characters within Flash. Flash has done a good job with the <code>htmlText</code> attribute, but we still need to set up the XML file with CDATA tags to make the content flow properly without the line breaks.</p>
<p>Here&#8217;s a look at our final code for this test:</p>
<p><code><span style="color: #999999;">&lt;!-- Begin XML --&gt;</span></code><br />
<code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code><br />
<code>&lt;site&gt;</code><br />
&nbsp; &nbsp;<code>&lt;theItem&gt;</code><br />
&nbsp; &nbsp;&nbsp; &nbsp;<code>&lt;![CDATA[&lt;p&gt;This is an example of XML text with &lt;b&gt;bold&lt;/b&gt; and &lt;i&gt;italic&lt;/i&gt; words, as well as &lt;a href="#"&gt;hyperlinks&lt;/a&gt;. It also contains special characters, like &amp;#198;, &amp;amp;, &amp;#169;, &amp;#174;, and &amp;#187;.&lt;/p&gt;]]&gt;</code><br />
&nbsp; &nbsp;<code>&lt;/theItem&gt;</code><br />
<code>&lt;/site&gt;</code><br />
<code><span style="color: #999999;">&lt;!-- End XML --&gt;</span></code></p>
<p><code><span style="color: #999999;">/* Begin ActionScript */</span></code><br />
<code><span style="color: #0000ff;">var</span> theXML:<span style="color: #0000ff;">XML</span>;</code><br />
<code><span style="color: #0000ff;">var</span> xmlData:<span style="color: #0000ff;">Array</span> = <span style="color: #0000ff;">new Array</span>();</code><br />
<code><span style="color: #0000ff;">var</span> loader:<span style="color: #0000ff;">URLLoader</span> = <span style="color: #0000ff;">new URLLoader</span>();</code><br />
<code>loader.<span style="color: #0000ff;">addEventListener</span>(<span style="color: #0000ff;">Event.COMPLETE</span>, processXML);</code><br />
<code>loader.<span style="color: #0000ff;">load</span>(<span style="color: #0000ff;">new URLRequest</span>(<span style="color: #009900;">"test.xml"</span>));</code></p>
<p><code><span style="color: #0000ff;">var</span> textStyles:<span style="color: #0000ff;">StyleSheet</span> = new StyleSheet();</code><br />
<code>textStyles.<span style="color: #0000ff;">setStyle</span>(<span style="color: #009900;">"a:link"</span>, {color:<span style="color: #009900;">'#01628b'</span>, textDecoration:<span style="color: #009900;">'underline'</span>});</code><br />
<code>textStyles.<span style="color: #0000ff;">setStyle</span>(<span style="color: #009900;">"a:hover"</span>, {color:<span style="color: #009900;">'#d68402'</span>, textDecoration:<span style="color: #009900;">'underline'</span>});</code><br />
<code>text_txt.<span style="color: #0000ff;">styleSheet</span> = textStyles;</code></p>
<p><code><span style="color: #0000ff;">function</span> processXML(e:<span style="color: #0000ff;">Event</span>){</code><br />
&nbsp; &nbsp;<code>theXML = <span style="color: #0000ff;">new XML</span>(e<span style="color: #0000ff;">.target.data</span>);</code><br />
&nbsp; &nbsp;<code><span style="color: #0000ff;">var</span> xmlLength:<span style="color: #0000ff;">Number</span> = theXML.theItem.<span style="color: #0000ff;">length</span>();</code><br />
&nbsp; &nbsp;<code><span style="color: #0000ff;">for</span> (<span style="color: #0000ff;">var</span> i=0; i&lt;xmlLength; i++){</code><br />
&nbsp; &nbsp;&nbsp; &nbsp;<code>xmlData[i] = theXML.theItem[i];</code><br />
&nbsp; &nbsp;<code>}</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.htmlText</span> = xmlData[0];</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.multiline</span> = <span style="color: #0000ff;">true</span>;</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.wordWrap</span> = <span style="color: #0000ff;">true</span>;</code><br />
&nbsp; &nbsp;<code>text_txt<span style="color: #0000ff;">.height</span> = text_txt<span style="color: #0000ff;">.textHeight</span> + 6;</code><br />
<code>}</code><br />
<code><span style="color: #999999;">/* End ActionScript */</span></code></p>
<p>If you want the source files, you can download them here.  <a href="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/09/flashXML_specialCharacters.zip">Download Source Files »</a></p>
<p>I hope that this sheds some light on the topic of getting HTML text to correctly display and flow inside of your Flash application.  Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/using-formatting-html-text-in-flash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

