<?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/"
	>

<channel>
	<title>Per Sommer</title>
	<atom:link href="http://www.persommer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.persommer.com</link>
	<description>Whatever makes my world go around</description>
	<pubDate>Wed, 10 Dec 2008 12:52:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AS3 Trace path back to root</title>
		<link>http://www.persommer.com/2008/07/15/as3-trace-path-back-to-root/</link>
		<comments>http://www.persommer.com/2008/07/15/as3-trace-path-back-to-root/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 23:35:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[as3]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[snippet]]></category>

		<category><![CDATA[as3 trace path snippet code]]></category>

		<guid isPermaLink="false">http://www.persommer.com/?p=21</guid>
		<description><![CDATA[This function will trace the path DisplayObject for a DisplayObject back to root in Actionscript 3. Useful for seeing witch containers it&#8217;s belonging to.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
private function tracePath &#40;dispObj : DisplayObject, s : String = &#34;&#34;&#41; : void
&#123;
	if&#40;dispObj.parent != null&#41;
	&#123;
		tracePath&#40;dispObj.parent, s + &#34;.&#34; + dispObj.name&#41;;
	&#125;
	else
	&#123;
		var a : Array = s.split&#40;&#34;.&#34;&#41;.reverse&#40;&#41;;
		var output : String = &#34;&#34;;
		for &#40;var i [...]]]></description>
			<content:encoded><![CDATA[<p>This function will trace the path DisplayObject for a DisplayObject back to root in Actionscript 3. Useful for seeing witch containers it&#8217;s belonging to.</p>

<div class="wp_syntax" ><table><tr><td class="line_numbers" ><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" ><pre class="actionscript actionscript"  style="font-family:monospace;" ><span style="color: #0066CC;" >private</span> <span style="color: #000000; font-weight: bold;" >function</span> tracePath <span style="color: #66cc66;" >&#40;</span>dispObj : DisplayObject, s : <span style="color: #0066CC;" >String</span> = <span style="color: #ff0000;" >&quot;&quot;</span><span style="color: #66cc66;" >&#41;</span> : <span style="color: #0066CC;" >void</span>
<span style="color: #66cc66;" >&#123;</span>
	<span style="color: #b1b100;" >if</span><span style="color: #66cc66;" >&#40;</span>dispObj.<span style="color: #006600;" >parent</span> <span style="color: #66cc66;" >!</span>= <span style="color: #000000; font-weight: bold;" >null</span><span style="color: #66cc66;" >&#41;</span>
	<span style="color: #66cc66;" >&#123;</span>
		tracePath<span style="color: #66cc66;" >&#40;</span>dispObj.<span style="color: #006600;" >parent</span>, s + <span style="color: #ff0000;" >&quot;.&quot;</span> + dispObj.<span style="color: #0066CC;" >name</span><span style="color: #66cc66;" >&#41;</span>;
	<span style="color: #66cc66;" >&#125;</span>
	<span style="color: #b1b100;" >else</span>
	<span style="color: #66cc66;" >&#123;</span>
		<span style="color: #000000; font-weight: bold;" >var</span> a : <span style="color: #0066CC;" >Array</span> = s.<span style="color: #0066CC;" >split</span><span style="color: #66cc66;" >&#40;</span><span style="color: #ff0000;" >&quot;.&quot;</span><span style="color: #66cc66;" >&#41;</span>.<span style="color: #0066CC;" >reverse</span><span style="color: #66cc66;" >&#40;</span><span style="color: #66cc66;" >&#41;</span>;
		<span style="color: #000000; font-weight: bold;" >var</span> output : <span style="color: #0066CC;" >String</span> = <span style="color: #ff0000;" >&quot;&quot;</span>;
		<span style="color: #b1b100;" >for</span> <span style="color: #66cc66;" >&#40;</span><span style="color: #000000; font-weight: bold;" >var</span> i : <span style="color: #0066CC;" >Number</span> = 0;i <span style="color: #66cc66;" >&lt;</span> a.<span style="color: #0066CC;" >length</span>; i++<span style="color: #66cc66;" >&#41;</span> 
		<span style="color: #66cc66;" >&#123;</span>
			output = output + <span style="color: #ff0000;" >&quot;.&quot;</span> + a<span style="color: #66cc66;" >&#91;</span>i<span style="color: #66cc66;" >&#93;</span>;
		<span style="color: #66cc66;" >&#125;</span>
		<span style="color: #0066CC;" >trace</span><span style="color: #66cc66;" >&#40;</span><span style="color: #ff0000;" >&quot;PATH: &quot;</span> + output.<span style="color: #0066CC;" >substr</span><span style="color: #66cc66;" >&#40;</span><span style="color: #cc66cc;" >1</span>, output.<span style="color: #0066CC;" >length</span> - <span style="color: #cc66cc;" >2</span><span style="color: #66cc66;" >&#41;</span><span style="color: #66cc66;" >&#41;</span>;
	<span style="color: #66cc66;" >&#125;</span>
<span style="color: #66cc66;" >&#125;</span></pre></td></tr></table></div>

<p>Usage example:</p>

<div class="wp_syntax" ><table><tr><td class="line_numbers" ><pre>1
2
</pre></td><td class="code" ><pre class="actionscript actionscript"  style="font-family:monospace;" >objName.<span style="color: #0066CC;" >name</span> = <span style="color: #ff0000;" >&quot;myDisplayObjectTest&quot;</span>
tracePath<span style="color: #66cc66;" >&#40;</span>objName<span style="color: #66cc66;" >&#41;</span>;</pre></td></tr></table></div>

<p>Output example:</p>

<div class="wp_syntax" ><table><tr><td class="line_numbers" ><pre>1
</pre></td><td class="code" ><pre class="actionscript actionscript"  style="font-family:monospace;" >PATH: root1.<span style="color: #006600;" >movPreloaderHolder</span>.<span style="color: #006600;" >loaderHolder</span>.<span style="color: #006600;" >instance3</span>.<span style="color: #006600;" >myDisplayObjectTest</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.persommer.com/2008/07/15/as3-trace-path-back-to-root/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.persommer.com/2007/03/19/hello-world/</link>
		<comments>http://www.persommer.com/2007/03/19/hello-world/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 01:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Wow! So finally I managed to join the revolution and get my own blog. About time as I&#8217;ve had this domain name and hosting for nearly two years now. I&#8217;ve been spending the last week designing and setting up WordPress to fit my needs. It took a while to find the right plugins and modifying [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.persommer.com/wp-content/uploads/2007/03/mess_fun_111.png"  rel="lightbox"  title="World" ><img src="http://www.persommer.com/wp-content/uploads/2007/03/mess_fun_111.png"  width="96"  height="96"  alt="World" /></a>Wow! So finally I managed to join the revolution and get my own blog. About time as I&#8217;ve had this domain name and hosting for nearly two years now. I&#8217;ve been spending the last week designing and setting up WordPress to fit my needs. It took a while to find the right plugins and modifying them to suit my needs. Hopefully, and in a short amount of time, I will be able write some decent and interesting tutorials. Now if only i could think of one that isn&#8217;t out there already. Meanwhile you may go have a look at my <a href="portfolio/" >portfolio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.persommer.com/2007/03/19/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
