<?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>Journey of a Software Developer &#187; Flash</title>
	<atom:link href="http://www.tyronedavisjr.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tyronedavisjr.com</link>
	<description>HTML &#124; CSS &#124; JavaScript &#124; ASP.NET &#124; PHP &#124; C# &#124; Java &#124; VB.NET &#124; MS SQL &#124; MySQL &#124; Flash</description>
	<lastBuildDate>Sun, 17 Apr 2011 03:51:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flash CS3, UIScrollBar, scroll arrows not displaying on dynamic text</title>
		<link>http://www.tyronedavisjr.com/2007/12/03/flash-cs3-uiscrollbar-scroll-arrows-not-displaying-on-dynamic-text/</link>
		<comments>http://www.tyronedavisjr.com/2007/12/03/flash-cs3-uiscrollbar-scroll-arrows-not-displaying-on-dynamic-text/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 04:01:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.tyronedavisjr.com/?p=6</guid>
		<description><![CDATA[I am currently working on a Flash CS project and I recently came across an issue with using the UIScrollBar component..&#160; The issue was quite intermittent; but after attaching the scroll bar component to dynamic the text box I was expecting to see bars and the arrows when the contents within the text box were]]></description>
			<content:encoded><![CDATA[<p>I am currently working on a Flash CS project and I recently came across an issue with using the UIScrollBar component..&#160; The issue was quite intermittent; but after attaching the scroll bar component to dynamic the text box I was expecting to see bars and the arrows when the contents within the text box were larger than the constraints defined for the text box. After running the project both within the browser and in the SWF player, I noticed that on some occasions the scrolling was active and on some, inactive.&#160; </p>
<p>After a few hours of research, I still couldn&#8217;t find a resolution to this issue. Then, I turned to the Flash CS3 documentation and after some careful reading of the UIScrollBar component documentation, I found the answer. The documentation mentioned that if you are dynamically loading text from an external source from ActionScript and then assigning that text to the dynamic text box, you must call the update() method on the scroll bar component to alert it that the contents have changed. So, if you have an instance of a dynamic text box on the stage called mytext_txt, and you attach a UIScrollBar component to the box by dragging the component on top of it.&#160; You then must assign a instance name to the scroll bar component so that you can reference it within ActionScript.&#160; Let&#8217;s say I name it mytext_scroll. Here is what the ActionScript 3 would look like:</p>
<p>&#160;</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>import flash.display.*;</pre>
<pre><span class="lnum">   2:  </span>import flash.events.*;</pre>
<pre><span class="lnum">   3:  </span>&#160;</pre>
<pre><span class="lnum">   4:  </span><span class="kwrd">var</span> textLoader:URLLoader = <span class="kwrd">new</span> URLLoader();</pre>
<pre><span class="lnum">   5:  </span><span class="kwrd">var</span> simpleReq:URLRequest = <span class="kwrd">new</span> URLRequest(<span class="str">&quot;mytext.txt&quot;</span>);</pre>
<pre><span class="lnum">   6:  </span>&#160;</pre>
<pre><span class="lnum">   7:  </span>textLoader.load(simpleReq);</pre>
<pre><span class="lnum">   8:  </span>textLoader.addEventListener(Event.COMPLETE, textComplete);</pre>
<pre><span class="lnum">   9:  </span>&#160;</pre>
<pre><span class="lnum">  10:  </span><span class="kwrd">function</span> textComplete(<span class="kwrd">event</span>:Event):<span class="kwrd">void</span> {</pre>
<pre><span class="lnum">  11:  </span>    mytext_txt.text = textLoader.data;</pre>
<pre><span class="lnum">  12:  </span>    mytext_scroll.update();</pre>
<pre><span class="lnum">  13:  </span>}</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Notice the update() on line 12. This seem to do the trick for me.&#160; Hopefully, I was able to help someone figure this issue out. Until next time&#8230;</p>
<p>Happy Coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tyronedavisjr.com/2007/12/03/flash-cs3-uiscrollbar-scroll-arrows-not-displaying-on-dynamic-text/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

