<?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>ria-coder.com &#187; tilelist</title>
	<atom:link href="http://ria-coder.com/blog/tag/tilelist/feed" rel="self" type="application/rss+xml" />
	<link>http://ria-coder.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Apr 2010 19:35:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fixing that annoying feature of List controls</title>
		<link>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls</link>
		<comments>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls#comments</comments>
		<pubDate>Sun, 15 Nov 2009 21:57:07 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[creationPolicy]]></category>
		<category><![CDATA[offscreen]]></category>
		<category><![CDATA[tilelist]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=469</guid>
		<description><![CDATA[Learn how to fix that ever-painful "optimization" feature of Flex's list components]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t you just hate it&#8230; Doesn&#8217;t it just piss you off when you want to display a gallery of images in Flex and Flex decides that it&#8217;s actually going to set it so that when you scroll, it&#8217;ll <em>only</em> <em>then</em> load the images displayed offscreen? I find this particularly &#8220;ball-ache-ish&#8221; with the TileList component.</p>
<p>I was browsing through the documentation like i had many times before, but this time i noticed the <strong>offscreenExtraRowsOrColumns</strong> property. At first you think &#8220;wtf&#8221; but then i got curious&#8230;</p>
<p>Say you have 25 images in a grid that displays one row of 5 images at a time:</p>
<table border="0" width="200">
<tbody>
<tr style="background-color:#C7E811">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>The row in green will be the only row visible at this point in time. When you scroll, Flex will chuck out the first row and create the second row:</p>
<table border="0" width="200">
<tbody>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#C7E811">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#8230;and so on. Isn&#8217;t that just damn irritating? (If you&#8217;re thinking &#8220;nah, what&#8217;s the big deal?&#8221; then you obviously haven&#8217;t tried this before).</p>
<p>Anyway, the way to fix it is to tell Flex how many rows there are offscreen so that it can create them in the interim. This seems like a bit of a weird method because in the navigator classes (ViewStack, et al) there is a <strong>creationPolicy</strong> property which &#8211; when set to &#8220;all&#8221; &#8211; will create all the non-visible components before they&#8217;re navigated to, thus slowing down the processing a bit (depending on your app) but also speeding up the switch between views. Alas, no such property to be found in the TileList component. Can anybody tell me why? I think i should code a modified version of the TileList component to accept this property&#8230; <em>+1 to TODO list&#8230; *sigh*</em></p>
<p>Hopefully this will help those of you experiencing the ball-ache that i did.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

