<?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>nightdrops.com &#187; recursion</title>
	<atom:link href="http://www.nightdrops.com/tag/recursion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nightdrops.com</link>
	<description>like the color blue</description>
	<lastBuildDate>Thu, 01 Jul 2010 13:19:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Easy recursion: determine if a component is showing</title>
		<link>http://www.nightdrops.com/2009/easy-recursion-determine-if-a-component-is-showing/</link>
		<comments>http://www.nightdrops.com/2009/easy-recursion-determine-if-a-component-is-showing/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 15:54:09 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/?p=97</guid>
		<description><![CDATA[A good and easy example of a recursive function has come to my mind while replying to this question on stackoverflow. The problem was how to know is a component (mx:UIComponent) was visible or not, just like Component.isShowing() works in Java. You canno&#8217;t rely on the visible property of the UIComponent, you have to check [...]]]></description>
			<content:encoded><![CDATA[<p>A good and easy example of a recursive function has come to my mind while replying to <a href="http://stackoverflow.com/questions/452344/flex-determine-if-a-component-is-showing#456699" target="_blank">this question</a> on <a href="http://stackoverflow.com/">stackoverflow</a>.</p>
<p>The problem was how to know is a component (mx:UIComponent) was visible or not, just like <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Component.html#isShowing()">Component.isShowing()</a> works in Java. You canno&#8217;t rely on the visible property of the UIComponent, you have to check every parent to see if it too is visible.</p>
<p>First step in recursion is to block the basic level. If the component reference is null, it is not visible; if the component we are checking is an Application, it should be visible, according to his visible property (it doesn&#8217;t have a parent).</p>
<p>All the other cases should check the property, AND the parent&#8217;s property. (If a component isn&#8217;t on the DisplayList, his parent will be null, and it will not be visible,  and so for all of his children).</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><br /><strong>GeSHi Error:</strong> GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)<br /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/easy-recursion-determine-if-a-component-is-showing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
