<?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>Fort Fiction Blog</title>
	<atom:link href="http://blog.fortfiction.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fortfiction.com</link>
	<description>Thus, another flash genius is being invented</description>
	<lastBuildDate>Tue, 13 Oct 2009 11:22:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Scource &#8211; Full flash mousewheel enabled scrollbar for AS3 (Mac compatible)</title>
		<link>http://blog.fortfiction.com/2009/10/scource-full-flash-mousewheel-enabled-scrollbar-for-as3-mac-compatible/</link>
		<comments>http://blog.fortfiction.com/2009/10/scource-full-flash-mousewheel-enabled-scrollbar-for-as3-mac-compatible/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 10:54:58 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Experiments]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=84</guid>
		<description><![CDATA[Here&#8217;s a little flash scrollbar that will be working in most major browsers and is compatible with both Windows and Mac osx. It&#8217;s configured to be resizable and reused, as always. I have tested it on various major browsers, but obviously not all of them, so if there&#8217;s any bugs out there kindly leave us [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little flash scrollbar that will be working in most major browsers and is compatible with both Windows and Mac osx. It&#8217;s configured to be resizable and reused, as always. I have tested it on various major browsers, but obviously not all of them, so if there&#8217;s any bugs out there kindly leave us a comment and I will try to get a fix on that.</p>
<p>The Mac compatible mousewheel scroll is courtesy of SWFwheel from <a href="http://www.libspark.org" target="_blank">Spark Project</a>. For full documentation on the protocol (including a list of browser that will be working) click <a href="http://www.libspark.org/wiki/SWFWheel/en" target="_blank">here</a>.</p>
<p>Alas, the scrollbar itself can be seen by clicking <a href="http://blog.fortfiction.com/downloads/scroller/index.html" rel="shadowbox;width=750;height=550;">here</a> (shadowbox preview).</p>
<p>I am please to say that this scrollbar does all the basics of a html scrollbar, including clickable and dragable functions. The only apparent set back is that it wouldn&#8217;t react to a cursor that is not in the flash area, this could be somewhat annoying when the user is dragging the scroll face and rolled his mouse outside the stage. Once again, this is one of many flash flaws. Depending on the usage, it might not be significant, even so, this is why we don&#8217;t generally use a full screen flash scrollbar; We recommend using javascript to resize the HTML scrollbar. A great source could be found in <a href="http://blog.hy-brid.com/flash/20/fullscreen-flash-with-html-scrollbars/" target="_blank">Duncan Reid&#8217;s</a> website.</p>
<p>We needed a fullscreen flash scrollbar for a very specific reason, so I might as well share what we did with you.</p>
<p>Sourcecode Scroller.as: (download at the end of post)</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package com<span style="color: #339933;">.</span>fortfiction <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>Sprite<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>events<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>geom<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>MovieClip<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>Stage<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Scroller <span style="color: #000000; font-weight: bold;">extends</span> Sprite <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> scroller<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MovieClip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> stageHeight<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> previousHeight<span style="color: #339933;">:</span>Number <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> bgCount<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> scrollFace<span style="color: #339933;">:</span>iScrollface <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> iScrollface<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">var</span> containerHeight<span style="color: #339933;">:</span>Number <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> savedHeight<span style="color: #339933;">:</span>Number <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> top<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> bottom<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> dragBot<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> <a href="http://www.php.net/range"><span style="color: #990000;">range</span></a><span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> sRect<span style="color: #339933;">:</span>Rectangle <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #009900;">&#40;</span>0<span style="color: #339933;">,</span>0<span style="color: #339933;">,</span>0<span style="color: #339933;">,</span>1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> sPos<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> ratio<span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> allowScroll<span style="color: #339933;">:</span>Boolean<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">var</span> stage<span style="color: #339933;">:</span>Stage<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Scroller<span style="color: #009900;">&#40;</span>s<span style="color: #339933;">:</span>Stage<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stage <span style="color: #339933;">=</span> s<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>scroller<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>scrollFace<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_DOWN<span style="color: #339933;">,</span> dragScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_UP<span style="color: #339933;">,</span> stopScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> adjustHeightBg <span style="color: #009900;">&#40;</span>num<span style="color: #339933;">:</span>Number<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//duplicating scrollbar background</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stageHeight <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>previousHeight <span style="color: #339933;">&lt;</span> stageHeight<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> scrollBg<span style="color: #339933;">:</span>iScrollbg <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> iScrollbg<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scroller<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>scrollBg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollBg<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> bgCount<span style="color: #339933;">*</span>scrollBg<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bgCount<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; previousHeight <span style="color: #339933;">+=</span> scrollBg<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adjustHeightBg<span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; savedHeight <span style="color: #339933;">=</span> containerHeight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>savedHeight <span style="color: #339933;">&lt;</span> stageHeight<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>alpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allowScroll <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scroller<span style="color: #339933;">.</span>removeEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_DOWN<span style="color: #339933;">,</span> clickScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>alpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allowScroll <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scroller<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_DOWN<span style="color: #339933;">,</span> clickScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; top <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dragBot <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>0 <span style="color: #339933;">+</span> stageHeight<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> scrollFace<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bottom <span style="color: #339933;">=</span> stageHeight <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/range"><span style="color: #990000;">range</span></a> <span style="color: #339933;">=</span> bottom <span style="color: #339933;">-</span> top<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// CONTAINER MOVEMENT, change to refer to anything you want to scroll</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Main<span style="color: #339933;">.</span>container<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// CONTAINER MOVEMENT END</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sRect<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> dragBot<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> dragScroll<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>startDrag<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> sRect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stage<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_MOVE<span style="color: #339933;">,</span> moveScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> mouseWheelHandler<span style="color: #009900;">&#40;</span>event<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>allowScroll <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>event<span style="color: #339933;">.</span>delta <span style="color: #339933;">&lt;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">&lt;</span> dragBot<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y<span style="color: #339933;">-=</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">.</span>delta<span style="color: #339933;">*</span>2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">&gt;</span> dragBot<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> dragBot<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startScroll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">&gt;</span> top<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y<span style="color: #339933;">-=</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">.</span>delta<span style="color: #339933;">*</span>2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">&lt;</span> top<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> top<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startScroll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> clickScroll<span style="color: #009900;">&#40;</span>event<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> scroller<span style="color: #339933;">.</span>mouseY <span style="color: #339933;">-</span> scrollFace<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">&lt;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startScroll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> stopScroll<span style="color: #009900;">&#40;</span>event<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrollFace<span style="color: #339933;">.</span>stopDrag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stage<span style="color: #339933;">.</span>removeEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_MOVE<span style="color: #339933;">,</span> moveScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> moveScroll<span style="color: #009900;">&#40;</span>event<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startScroll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> startScroll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ratio <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>savedHeight <span style="color: #339933;">-</span> <a href="http://www.php.net/range"><span style="color: #990000;">range</span></a><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><a href="http://www.php.net/range"><span style="color: #990000;">range</span></a><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sPos <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>scrollFace<span style="color: #339933;">.</span>y <span style="color: #339933;">*</span> ratio<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// CONTAINER MOVEMENT, change to refer to anything you want to scroll</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Main<span style="color: #339933;">.</span>container<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>sPos<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// CONTAINER MOVEMENT END</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><a href="http://blog.fortfiction.com/downloads/scroller/scroller.zip">Download here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/10/scource-full-flash-mousewheel-enabled-scrollbar-for-as3-mac-compatible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New blog design is up</title>
		<link>http://blog.fortfiction.com/2009/09/new-blog-design-is-up/</link>
		<comments>http://blog.fortfiction.com/2009/09/new-blog-design-is-up/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 03:44:55 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Announcement]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=80</guid>
		<description><![CDATA[Announcing the new blog design, we don&#8217;t actually have a codename for this production because it took us a reasonably short amount of time to finalize it. Once again, feel free to mess around with everything we have here, it might take us some time to get some proper content up, but we are looking [...]]]></description>
			<content:encoded><![CDATA[<p>Announcing the new blog design, we don&#8217;t actually have a codename for this production because it took us a reasonably short amount of time to finalize it. Once again, feel free to mess around with everything we have here, it might take us some time to get some proper content up, but we are looking at a couple of really interesting post for flash deep linking.</p>
<p>We are currently developing a fully flash website for an energy supply company. That website that we are developing would be able to react (almost) as good as a HTML website. Which means it supports deep linking, scrollbars, mousewheel scrolling for different OSes, and SEO! I know, you probably heard about Gaia framework that has the capabilities of doing that (with the exception of seo?), but what we really plan to do with it is giving you snippet (in-depth) information of how to do it. Just in case you don&#8217;t want to browse through thousands of sourcecodes to get what you need.</p>
<p>Just so you know what&#8217;s coming.</p>
<p>edit: By the way, I haven&#8217;t have time to hack the design on PCs display, so sorry for any mess I&#8217;ll have you slog through. And don&#8217;t tell anyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/09/new-blog-design-is-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision triangle plane field with blur</title>
		<link>http://blog.fortfiction.com/2009/09/papervision-triangle-plane-field-with-blur/</link>
		<comments>http://blog.fortfiction.com/2009/09/papervision-triangle-plane-field-with-blur/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 11:25:09 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Papervision]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=61</guid>
		<description><![CDATA[Here is a sample to trying to get blur filter to work on papervision. The good thing is, it worked, that bad thing is, like all flash filters, it could drastically slow down your flash production if it is used on a mass scale. You can download the source at the very end of the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a sample to trying to get blur filter to work on papervision. The good thing is, it worked, that bad thing is, like all flash filters, it could drastically slow down your flash production if it is used on a mass scale. You can download the source at the very end of the post, and it&#8217;s quite short and self explainary. May your creative juice splatter all over:</p>
<p><a href="http://blog.fortfiction.com/downloads/triangle3d/TriangleField.swf" rel="shadowbox;width=750;height=550;"><img src="http://blog.fortfiction.com/wp-content/uploads/2009/09/triangle.jpg" alt="triangle" title="triangle" width="550" height="300" class="alignleft size-full wp-image-62" /></a><br />
(click to view sample via shadowbox)</p>
<p>Scripts:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>cameras<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>InteractiveScene3DEvent<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>materials<span style="color: #339933;">.</span>BitmapMaterial<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>materials<span style="color: #339933;">.</span>utils<span style="color: #339933;">.</span>MaterialsList<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>materials<span style="color: #339933;">.</span>ColorMaterial<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>objects<span style="color: #339933;">.</span>primitives<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>objects<span style="color: #339933;">.</span>special<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>render<span style="color: #339933;">.</span>BasicRenderEngine<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>scenes<span style="color: #339933;">.</span>Scene3D<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>view<span style="color: #339933;">.</span>Viewport3D<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>core<span style="color: #339933;">.</span>geom<span style="color: #339933;">.</span>renderables<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>materials<span style="color: #339933;">.</span>special<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>core<span style="color: #339933;">.</span>geom<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>objects<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>view<span style="color: #339933;">.</span>layer<span style="color: #339933;">.</span>BitmapEffectLayer<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>view<span style="color: #339933;">.</span>layer<span style="color: #339933;">.</span>ViewportLayer<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import org<span style="color: #339933;">.</span>papervision3d<span style="color: #339933;">.</span>view<span style="color: #339933;">.</span>layer<span style="color: #339933;">.</span>util<span style="color: #339933;">.</span>ViewportLayerSortMode<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>Sprite<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>Event<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>filters<span style="color: #339933;">.*;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TriangleField <span style="color: #000000; font-weight: bold;">extends</span> Sprite <span style="color: #009900;">&#123;</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> viewport<span style="color: #339933;">:</span>Viewport3D<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> scene<span style="color: #339933;">:</span>Scene3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scene3D<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> camera<span style="color: #339933;">:</span>FreeCamera3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FreeCamera3D<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> renderer<span style="color: #339933;">:</span>BasicRenderEngine<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _triNum<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">const</span> material1<span style="color: #339933;">:</span>ColorMaterial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #009900;">&#40;</span>0xccce00<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">const</span> material2<span style="color: #339933;">:</span>ColorMaterial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #009900;">&#40;</span>0xabad00<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">const</span> material3<span style="color: #339933;">:</span>ColorMaterial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #009900;">&#40;</span>0x848500<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">const</span> material4<span style="color: #339933;">:</span>ColorMaterial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #009900;">&#40;</span>0x0BE5FF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">const</span> material5<span style="color: #339933;">:</span>ColorMaterial <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #009900;">&#40;</span>0x08a8bb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> matCount<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TriangleField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; viewport <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Viewport3D<span style="color: #009900;">&#40;</span>750<span style="color: #339933;">,</span> 550<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>viewport<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; renderer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BasicRenderEngine<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; camera<span style="color: #339933;">.</span>z <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; camera<span style="color: #339933;">.</span>zoom <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEventListener<span style="color: #009900;">&#40;</span>Event<span style="color: #339933;">.</span>ENTER_FRAME<span style="color: #339933;">,</span> onEnterFrame<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onEnterFrame<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>Event<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; renderer<span style="color: #339933;">.</span>renderScene<span style="color: #009900;">&#40;</span>scene<span style="color: #339933;">,</span> camera<span style="color: #339933;">,</span> viewport<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; camera<span style="color: #339933;">.</span>yaw<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//camera.pitch((240)*-0.002);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//camera.x += speed*Math.sin(camera.rotationY*Math.PI/180);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init3D<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; material1<span style="color: #339933;">.</span>doubleSided <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; material2<span style="color: #339933;">.</span>doubleSided <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; material3<span style="color: #339933;">.</span>doubleSided <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; material4<span style="color: #339933;">.</span>doubleSided <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; material5<span style="color: #339933;">.</span>doubleSided <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> sphere<span style="color: #339933;">:</span>Sphere <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Sphere<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> 20<span style="color: #339933;">,</span> 8<span style="color: #339933;">,</span> 10<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> sphereFaces<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> sphere<span style="color: #339933;">.</span>geometry<span style="color: #339933;">.</span>faces<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <a href="http://www.php.net/each"><span style="color: #990000;">each</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> sphereTriangle<span style="color: #339933;">:</span>Triangle3D in sphereFaces<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>_triNum <span style="color: #339933;">&lt;=</span> 100<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> sphereTriangleVertices<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> sphereTriangle<span style="color: #339933;">.</span>vertices<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleVertices<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <a href="http://www.php.net/each"><span style="color: #990000;">each</span></a> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> sphereTriangleVertex3D<span style="color: #339933;">:</span>Vertex3D in sphereTriangleVertices<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> vertex3D<span style="color: #339933;">:</span>Vertex3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Vertex3D<span style="color: #009900;">&#40;</span>sphereTriangleVertex3D<span style="color: #339933;">.</span>x<span style="color: #339933;">,</span> sphereTriangleVertex3D<span style="color: #339933;">.</span>y<span style="color: #339933;">,</span> sphereTriangleVertex3D<span style="color: #339933;">.</span>z<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleVertices<span style="color: #339933;">.</span>push<span style="color: #009900;">&#40;</span>vertex3D<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangle3D<span style="color: #339933;">:</span>Triangle3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Triangle3D<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> material1<span style="color: #339933;">,</span> sphereTriangle<span style="color: #339933;">.</span>uv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleFaces<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>triangle3D<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SIMPLE SETTINGS FOR MULTIPLE TRIANGLE COLORS</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _triNum <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_triNum <span style="color: #339933;">&lt;=</span> 40<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleMesh3D<span style="color: #339933;">:</span>TriangleMesh3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TriangleMesh3D<span style="color: #009900;">&#40;</span>material1<span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> triangleFaces<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_triNum <span style="color: #339933;">&lt;=</span> 50<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleMesh3D<span style="color: #339933;">:</span>TriangleMesh3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TriangleMesh3D<span style="color: #009900;">&#40;</span>material2<span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> triangleFaces<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_triNum <span style="color: #339933;">&lt;=</span> 60<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleMesh3D<span style="color: #339933;">:</span>TriangleMesh3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TriangleMesh3D<span style="color: #009900;">&#40;</span>material3<span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> triangleFaces<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_triNum <span style="color: #339933;">&lt;=</span> 70<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleMesh3D<span style="color: #339933;">:</span>TriangleMesh3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TriangleMesh3D<span style="color: #009900;">&#40;</span>material4<span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> triangleFaces<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> triangleMesh3D<span style="color: #339933;">:</span>TriangleMesh3D <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TriangleMesh3D<span style="color: #009900;">&#40;</span>material5<span style="color: #339933;">,</span> triangleVertices<span style="color: #339933;">,</span> triangleFaces<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SETTING END</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangle3D<span style="color: #339933;">.</span>instance <span style="color: #339933;">=</span> triangleMesh3D<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//TO RANDOMIZE THE POSITION OF EACH TRIANGLE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>x <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span>random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> 350 <span style="color: #339933;">-</span> <span style="color: #cc66cc;">175</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span>random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> 350 <span style="color: #339933;">-</span> <span style="color: #cc66cc;">175</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>z <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span>random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> 350 <span style="color: #339933;">-</span> <span style="color: #cc66cc;">175</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//CUSTOM SETTING TO BLUR OUT TRIANGLE IF THEY APPEARED TOO FAR</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>triangleMesh3D<span style="color: #339933;">.</span>z <span style="color: #339933;">&gt;</span> 100 <span style="color: #339933;">||</span> triangleMesh3D<span style="color: #339933;">.</span>z <span style="color: #339933;">&lt;</span> <span style="color: #339933;">-</span>100<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>createViewportLayer<span style="color: #009900;">&#40;</span>viewport<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>filters <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #000000; font-weight: bold;">new</span> BlurFilter<span style="color: #009900;">&#40;</span>8<span style="color: #339933;">,</span> 8<span style="color: #339933;">,</span> 4<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>rotationY <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span>random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> 360 <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>360 <span style="color: #339933;">/</span> 2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triangleMesh3D<span style="color: #339933;">.</span>rotationX <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span>random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> 360 <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>360 <span style="color: #339933;">/</span> 2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scene<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>triangleMesh3D<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><a href="http://blog.fortfiction.com/downloads/triangle3d/PVDtriangleField.zip">Download Link</a>.</p>
<p>Here&#8217;s another way to play with it, it&#8217;s running too slow but I&#8217;m sure someday we&#8217;ll find some uses for it:<br />
<a href="http://blog.fortfiction.com/downloads/triangle3d/TriangleField2.swf" rel="shadowbox;width=750;height=550;"><img src="http://blog.fortfiction.com/wp-content/uploads/2009/09/triangle2.jpg" alt="triangle2" title="triangle2" width="550" height="337" class="alignleft size-full wp-image-78" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/09/papervision-triangle-plane-field-with-blur/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create instance name in AS3</title>
		<link>http://blog.fortfiction.com/2009/09/how-to-create-instance-name-in-as3/</link>
		<comments>http://blog.fortfiction.com/2009/09/how-to-create-instance-name-in-as3/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 13:06:55 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Basic AS3]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=49</guid>
		<description><![CDATA[This is already very well known, but if you&#8217;ve been on AS3 for a while you&#8217;ll notice that they have eliminate the instance name usage for AS3 (this, I agree is more practical for AS3 OOP&#8217;s structure). We can however, insert an instance name manually on stage, but what about the rest of us that [...]]]></description>
			<content:encoded><![CDATA[<p>This is already very well known, but if you&#8217;ve been on AS3 for a while you&#8217;ll notice that they have eliminate the instance name usage for AS3 (this, I agree is more practical for AS3 OOP&#8217;s structure). We can however, insert an instance name manually on stage, but what about the rest of us that are adding movieclips on stage programmatically?</p>
<p>Here&#8217;s what you might be attempting already:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> someNumber<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> mc<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MovieClip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc<span style="color: #339933;">.</span>name <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>mc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>And when you try to declare it (1.gotoAndPlay(2)), you can&#8217;t. I have yet to find a usage for the .name parameter (seriously, other than scene class, but in OOP you hardly use scene), but so far, it&#8217;s confirmed that it&#8217;s declaring it in such a way is not working by any means. Here&#8217;s what we could do to turn it around &#8211; by create an Array or Object to store your movieclip.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> mcArr<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> someNumber<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> mc<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MovieClip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mcArr<span style="color: #339933;">.</span>push<span style="color: #009900;">&#40;</span>mc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>mc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>We can now run the gotoAndPlay function by using mcArr[0].gotoAndPlay(2). This method also goes with any form of display, for example if it&#8217;s a textfield that is in the array, you could change it&#8217;s text by using mcArr[0].text = myString. What about trying to insert a mouse event for the movieclips? Surely we won&#8217;t use the no brainer way to declare mcArr[0].addEventListener(&#8230;) onto each and everyone of the movieclip.</p>
<p>Either that, or we can store another variable inside the movieclip so that we can read it from the listener later.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> mcArr<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> someNumber<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> mc<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MovieClip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> num<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> i<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc<span style="color: #339933;">.</span>num <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>MOUSE_DOWN<span style="color: #339933;">,</span> down<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mcArr<span style="color: #339933;">.</span>push<span style="color: #009900;">&#40;</span>mc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>mc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>In order to put it in good use, your mouse event function could look like this:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> down<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">.</span>currentTarget<span style="color: #339933;">.</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mcArr<span style="color: #009900;">&#91;</span>e<span style="color: #339933;">.</span>currentTarget<span style="color: #339933;">.</span>num<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>gotoAndPlay<span style="color: #009900;">&#40;</span>2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
<p>What the above script and function does is creating numerous movieclips, and each of them will gotoAndPlay(2) itself when clicked. This is just a tip of an iceberg, but it could turn into a pretty fancy xml gallery. To those professionals, I know this is a little bit ameteurish, but I&#8217;m sure someone or something out there will find this useful. And they could thank me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/09/how-to-create-instance-name-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Masked dynamic textfield animation</title>
		<link>http://blog.fortfiction.com/2009/09/as3-masked-dynamic-textfield-animation/</link>
		<comments>http://blog.fortfiction.com/2009/09/as3-masked-dynamic-textfield-animation/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 10:25:21 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Experiments]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=31</guid>
		<description><![CDATA[This is a class developed internally to animate a dynamic textfield full of content, with masking. The best one I&#8217;ve seen animated so far is seen on the world renowned RED INTERACTIVE AGENCY&#8217;s website. Here is our replica of that class using caurina tween (click to view shadowbox sample):

You may realize that the code is [...]]]></description>
			<content:encoded><![CDATA[<p>This is a class developed internally to animate a dynamic textfield full of content, with masking. The best one I&#8217;ve seen animated so far is seen on the world renowned <a href="http://www.ff0000.com" target="_blank">RED INTERACTIVE AGENCY</a>&#8217;s website. Here is our replica of that class using caurina tween (click to view shadowbox sample):</p>
<p><a href="http://blog.fortfiction.com/downloads/TextMaskAni/splash.swf" rel="shadowbox;width=550;height=400;background-color=#FFFFFF"><img src="http://blog.fortfiction.com/wp-content/uploads/2009/09/textani1.jpg" alt="textani" title="textani" width="538" height="413" class="alignleft size-full wp-image-35" /></a></p>
<p>You may realize that the code is longer that what it&#8217;s needed to create something like this, but. It&#8217;s best that we could include these functionality to that class:<br />
1) reusable, this is because flash as3 collects garbage data. If you create a new one over and over again, flash will eventually crash due to too much memory usage. Which is the thing that makes this class special, by the way.<br />
2) text changable, flexible text field height, so that you can trace it for other reasons<br />
3) including functions Start() and Reset()<br />
4) able to use your own imported font<br />
5) able to change colour<br />
6) able to set your width<br />
so on so forth.</p>
<p>To call the class, it is required to do something like this:<br />
private static var myText:Readingtext = new Readingtext(font:String, size:uint, color:String, width:uint, speed:Number, words:String);</p>
<p>You can change the font type, font size, font color, width of textfield, speed of animation(seconds) and the text from the parameters respectively. Please bare in mind that you have to import your font into flash in order for this script to use that font, or any script, for that matter. To import your font, click on the top right of your flash&#8217;s library, choose &#8220;New Font&#8221; and add your font. Then you have to do some linkage settings on your fonts for flash to read it, to do this, right click on your font in the library, select &#8220;Linkage&#8221;, choose &#8220;Export for ActionScript&#8221;, the put in whatever name for the class; it doesn&#8217;t matter. When you need to call your font via scripts, make sure to type the ORIGINAL name of the font instead of the class name. For my sample, I imported &#8220;Futura Medium&#8221; instead of &#8220;FuturaMedium&#8221;, which is the class name I&#8217;ve given that font. This is a bug in flash&#8217;s side, as far as CS3 in concerned.</p>
<p>NOTE: It is essentially required to import font or else people without your particular font in their computer will not see your font properly, they will see a default font of Times New Roman, if I&#8217;m not mistaken.</p>
<p>Here&#8217;s the script, a download link can be found at the end of the post.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>Sprite<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>MovieClip<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>text<span style="color: #339933;">.*;</span><br />
&nbsp; &nbsp; import caurina<span style="color: #339933;">.</span>transitions<span style="color: #339933;">.</span>Tweener<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>utils<span style="color: #339933;">.</span>Timer<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>TimerEvent<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>Event<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; import flash<span style="color: #339933;">.</span>display<span style="color: #339933;">.</span>Shape<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Readingtext <span style="color: #000000; font-weight: bold;">extends</span> Sprite <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//CREATE TEXT FIELD</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> texter<span style="color: #339933;">:</span>TextField <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TextField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> texterFormat<span style="color: #339933;">:</span>TextFormat <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TextFormat<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//CREATE MASK</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> masker<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MovieClip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> clips<span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//CREATE TIMER</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> repeatcount<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> delay<span style="color: #339933;">:</span>uint<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myTimer<span style="color: #339933;">:</span>Timer<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> mc<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #339933;">:</span>Number<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//LEADING AND SPACING OF YOUR TEXT FIELD, SIZER IS TO SAVE THE FONT SIZE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> sizer<span style="color: #339933;">:</span>uint<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> leading<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> letterSpacing<span style="color: #339933;">:</span>Number <span style="color: #339933;">=</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//THIS IS A WILDCARD SETTING FOR TEXT HEIGHT, SINCE EACH FONT HAVE A DIFFERENT HEIGHT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> wildCardNum<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//LINES NUMBERS</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> lineNum<span style="color: #339933;">:</span>uint<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Readingtext<span style="color: #009900;">&#40;</span>font<span style="color: #339933;">:</span>String<span style="color: #339933;">,</span> size<span style="color: #339933;">:</span>uint<span style="color: #339933;">,</span> color<span style="color: #339933;">:</span>String<span style="color: #339933;">,</span> w<span style="color: #339933;">:</span>uint<span style="color: #339933;">,</span> speed<span style="color: #339933;">:</span>Number<span style="color: #339933;">,</span> words<span style="color: #339933;">:</span>String<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sizer <span style="color: #339933;">=</span> size<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> w<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a> <span style="color: #339933;">=</span> speed<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delay <span style="color: #339933;">=</span> speed<span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #009900;">&#40;</span>delay<span style="color: #339933;">,</span> repeatcount<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>multiline <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>selectable <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>condenseWhite <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>autoSize <span style="color: #339933;">=</span> TextFieldAutoSize<span style="color: #339933;">.</span>LEFT<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span><a href="http://www.php.net/wordwrap"><span style="color: #990000;">wordWrap</span></a> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>text <span style="color: #339933;">=</span> words<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>antiAliasType <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;advanced&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>embedFonts <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>color <span style="color: #339933;">=</span> color<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>align <span style="color: #339933;">=</span> TextFormatAlign<span style="color: #339933;">.</span>LEFT<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>size <span style="color: #339933;">=</span> size<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SEE EVENT FOR THE USE OF THIS</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>Event<span style="color: #339933;">.</span>SCROLL<span style="color: #339933;">,</span> onScroll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>letterSpacing <span style="color: #339933;">=</span> letterSpacing<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>font <span style="color: #339933;">=</span> font<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texterFormat<span style="color: #339933;">.</span>leading <span style="color: #339933;">=</span> leading<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>setTextFormat<span style="color: #009900;">&#40;</span>texterFormat<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//DYNAMICALLY SETTING UP THE MASK</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> num<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span><a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span>texter<span style="color: #339933;">.</span>height<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>size<span style="color: #339933;">+</span>wildCardNum<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num <span style="color: #339933;">=</span> texter<span style="color: #339933;">.</span>numLines<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lineNum <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> num<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> _masker<span style="color: #339933;">:</span>Shape <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>beginFill<span style="color: #009900;">&#40;</span>0x000000<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>drawRect<span style="color: #009900;">&#40;</span>0<span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span> 100<span style="color: #339933;">,</span> 32<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>endFill<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> size<span style="color: #339933;">+</span>leading<span style="color: #339933;">+</span>letterSpacing<span style="color: #339933;">+</span>wildCardNum<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> i<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>_masker<span style="color: #339933;">.</span>height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; masker<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>_masker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clips<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> _masker<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//COUNTING HOW MANY TIMES THE TIMER SHOULD MOVE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; repeatcount <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span>repeatCount <span style="color: #339933;">=</span> repeatcount<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>texter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #009900;">&#40;</span>masker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//DEACTIVATE THIS TO SEE HOW THE MASK WORKS</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>mask <span style="color: #339933;">=</span> masker<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;timer&quot;</span><span style="color: #339933;">,</span> timedFunction<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//BY DEFAULT, SOME BROWSER ALLOW USER TO USE MOUSEWHEEL TO SCROLL THE TEXTFIELD, THIS COULD BE ANNOYING TO SOME, THIS FUNCTION IS TO DEACTIVATE IT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onScroll<span style="color: #009900;">&#40;</span>evt<span style="color: #339933;">:</span>Event<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>scrollV <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> timedFunction<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>TimerEvent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>mc <span style="color: #339933;">==</span> lineNum<span style="color: #339933;">-</span>1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener<span style="color: #339933;">.</span>addTween<span style="color: #009900;">&#40;</span>clips<span style="color: #009900;">&#91;</span>mc<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span>texter<span style="color: #339933;">.</span>width<span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #339933;">*</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> transition<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;easeOutSine&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener<span style="color: #339933;">.</span>addTween<span style="color: #009900;">&#40;</span>clips<span style="color: #009900;">&#91;</span>mc<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span>texter<span style="color: #339933;">.</span>width<span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #339933;">:</span><a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #339933;">,</span> transition<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;easeOutSine&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc<span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//THIS FUNCTION IS FOR YOU TO CHANGE THE TEXT IN THE TEXT FIELD, ALLOWING YOU TO REUSE THE TEXT FIELD</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//THIS IS ADDED SO THAT AS3 WOULDN'T COLLECT GARBAGE DATA, WHICH EVENTUALLY WILL CRASH YOUR BROWSER</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> changeText<span style="color: #009900;">&#40;</span>wordie<span style="color: #339933;">:</span>String<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> j<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> clips<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener<span style="color: #339933;">.</span>removeTweens<span style="color: #009900;">&#40;</span>clips<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clips<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//NOTE: THIS IS A USEFUL FUNCTION TO REMOVE ALL CHILD IN A MOVIECLIP</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> v <span style="color: #339933;">=</span> masker<span style="color: #339933;">.</span>numChildren<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>v<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; masker<span style="color: #339933;">.</span>removeChildAt<span style="color: #009900;">&#40;</span>v<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>text <span style="color: #339933;">=</span> wordie<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; texter<span style="color: #339933;">.</span>setTextFormat<span style="color: #009900;">&#40;</span>texterFormat<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> num<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span><a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span>texter<span style="color: #339933;">.</span>height<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>sizer<span style="color: #339933;">+</span>wildCardNum<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num <span style="color: #339933;">=</span> texter<span style="color: #339933;">.</span>numLines<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lineNum <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> num<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> _masker<span style="color: #339933;">:</span>Shape <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>beginFill<span style="color: #009900;">&#40;</span>0x000000<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>drawRect<span style="color: #009900;">&#40;</span>0<span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span> 100<span style="color: #339933;">,</span> 32<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>graphics<span style="color: #339933;">.</span>endFill<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> sizer<span style="color: #339933;">+</span>leading<span style="color: #339933;">+</span>letterSpacing<span style="color: #339933;">+</span>wildCardNum<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _masker<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> i<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>_masker<span style="color: #339933;">.</span>height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; masker<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>_masker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clips<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> _masker<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; repeatcount <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span>repeatCount <span style="color: #339933;">=</span> repeatcount<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//CALL THIS FUNCTION EXTERNALLY TO REMOVE THE TEXTFIELD (TO RENDER IT INVISIBLE)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//YOU MAY MANUALLY CHANGE TO TEXTFIELD X AND Y POSITION TO REMOVE IT, WHICH IS RECOMMENEDED IF YOU'LL EB REUSING IT</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <a href="http://www.php.net/reset"><span style="color: #990000;">Reset</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener<span style="color: #339933;">.</span>removeAllTweens<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span>stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> clips<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clips<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//START THE ANIMATION. CAN BE USED OVER AND OVER AGAIN</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener<span style="color: #339933;">.</span>removeAllTweens<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mc <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span><a href="http://www.php.net/reset"><span style="color: #990000;">reset</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myTimer<span style="color: #339933;">.</span>start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>uint <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> clips<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clips<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><a href="http://blog.fortfiction.com/downloads/TextMaskAni/TextMaskAni.zip">Download link</a>. By the way, pretty nifty code colorer plugin for wordpress huh? We used this plugin from <a href="http://kpumuk.info/projects/wordpress-plugins/codecolorer/" target="_blank">Dmytro Shteflyuk&#8217;s site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/09/as3-masked-dynamic-textfield-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Covering the basics</title>
		<link>http://blog.fortfiction.com/2009/09/covering-the-basics/</link>
		<comments>http://blog.fortfiction.com/2009/09/covering-the-basics/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 06:47:07 +0000</pubDate>
		<dc:creator>FF Flash Geek</dc:creator>
				<category><![CDATA[Announcement]]></category>

		<guid isPermaLink="false">http://blog.fortfiction.com/?p=21</guid>
		<description><![CDATA[Hello strangers.
We build this blog in hopes of being a part of the web open source community, to give back what we took, here, at our very own start of a long and perilous journey on becoming an ActionScript developer. That&#8217;s about it for the introduction, the old joke would be if you don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>Hello strangers.</p>
<p>We build this blog in hopes of being a part of the web open source community, to give back what we took, here, at our very own start of a long and perilous journey on becoming an ActionScript developer. That&#8217;s about it for the introduction, the old joke would be if you don&#8217;t have anything more to say in your blog, get your readers occupied by showing them <a href="http://www.fortfiction.com">who you are and what you do</a>. If you like what you see, tell us if you&#8217;re considering <a href="mailto:fireatwill@fortfiction.com">hiring us</a>. Else, if you want to know how we did what we did, ask <a href="mailto:hunson@fortfiction.com">him</a> how and we&#8217;ll be as naked as possible.</p>
<p>For a starter, we&#8217;ll be covering the basics on AS 3.0, bug fixes and tutorials as we go along the way developing our projects. Please leave us a message on your struggle in AS 3.0 that you do not already see here and we will try to get to a solution for you as soon as possible.</p>
<p>If we have one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fortfiction.com/2009/09/covering-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
