<?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>Design With Flex</title>
	<atom:link href="http://designwithflex.com/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://designwithflex.com/wp</link>
	<description>My Flex Blog</description>
	<lastBuildDate>Thu, 09 Jun 2011 23:16:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Free Flex Magazine &#8211; flash and Flex developer&#8217;s Magazine</title>
		<link>http://designwithflex.com/wp/2010/ffdmag/</link>
		<comments>http://designwithflex.com/wp/2010/ffdmag/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 17:06:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://designwithflex.com/?p=58</guid>
		<description><![CDATA[Hey there, there&#8217;s an awesome free magazine at ffdmag.com check it out!]]></description>
			<content:encoded><![CDATA[<p>Hey there, there&#8217;s an awesome free magazine at<a href="http://ffdmag.com/" target="_blank"> ffdmag.com</a></p>
<p>check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://designwithflex.com/wp/2010/ffdmag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Portfolio for Steve McLaughlin</title>
		<link>http://designwithflex.com/wp/2010/portfolio/</link>
		<comments>http://designwithflex.com/wp/2010/portfolio/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 01:25:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://designwithflex.com/?p=48</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://designwithflex.com/wp/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-48">Password:<br />
<input name="post_password" id="pwbox-48" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://designwithflex.com/wp/2010/portfolio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improved HSLider component for Flex (part 2)</title>
		<link>http://designwithflex.com/wp/2007/improved-hslider-component-for-flex-part-2/</link>
		<comments>http://designwithflex.com/wp/2007/improved-hslider-component-for-flex-part-2/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 06:56:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://designwithflex.com/?p=28</guid>
		<description><![CDATA[An improved HSlider (slider) component for Flex (part 2) I will show you how to code a slider component in a way that is usable. Here is an example of a HSlider out of the box: Here is an example &#8230; <a href="http://designwithflex.com/wp/2007/improved-hslider-component-for-flex-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>An improved HSlider (slider) component for Flex (part 2)<br /> I will show you how to code a slider component in a way that is usable.  Here is an example of a HSlider out of the box:</p>
<p> <embed src="http://designwithflex.com/pics/sliderPrice.swf" type="application/x-shockwave-flash" height="160" width="300"></embed> 
<p>Here is an example of my modified HSlider.</p>
<p> <embed src="http://designwithflex.com/pics/sliderfixed.swf" type="application/x-shockwave-flash" height="150" width="300"></embed><br />
<span id="more-28"></span><br />
 
<p>Compare the way the thumbs interact when they meet.  In the first example, the two thumbs cannot meet or both pick the same value when the thumboverlap value is false.  When the thumbOverlap value is true, then both thumbs can select a single value, however the upper slider can now move below the lower slider giving an undesirable effect.  In this article, I will show how to create a two thumb slider where the two thumbs can meet at a single point, yet not overlap any further.</p>
<p>Look at the SliderEvent Class for Public Properties. This will describe the properties of the SliderEvent class. We will use these docs to determine what values are available when the slider is moved and how to reference them. For Flex 2 here is the link to the SliderEvent Class:<br /> <a href="http://livedocs.adobe.com/flex/201/langref/mx/events/SliderEvent.html">http://livedocs.adobe.com/flex/201/langref/mx/events/SliderEvent.html</a></p>
<p>The properties that look interesting are ‘thumbIndex’, (0 or 1) indicating which slider is moving, and ‘value’ &#8211; the new value of the thumb that is moving. Notice that only one of the values is available here &#8211; but that’s ok, only one thumb slider is changing at a time. We’ll be using dollar amounts for values and I’ll show how to format the amounts to include dollar signs and proper formatting with commas and two decimal places. Let’s import the CurrencyFormatter so we can use it, declare variables for the PriceMin and PriceMax, and declare a priceFormatter.  We’ll use the default<br /> Settings (currencySymbol=&#8221;$&#8221;, UseThousandsSeparator=&#8221;true&#8221;, etc.) of the CurrencyFormatter, so no parameters are needed. It’s a good idea to look at the help documentation to see what options are available for CurrencyFormatter.</p>
<p><code>import mx.formatters.CurrencyFormatter;<br /> [Bindable] public var PriceMin:uint = 0;<br /> [Bindable] public var PriceMax:uint = 25000;<br /> public var priceFormatter:CurrencyFormatter = new CurrencyFormatter(); </code></p>
<p>Next, let’s create the HSlider and some labels. Setting allowThumbOverlap to true will allow the two thumbs to meet, and we’ll add some code to prevent them from overlapping. Setting the snapInterval to 1000, allows the slider to move in increments of 1000. Setting the allowTrackClick to true allows you to click on the track and the closest slider will move to the value under the mouse.  Setting liveDragging to true allows the values to update immediately rather than waiting for the thumbrelease.</p>
<p><code>          &lt;mx:Label  fontWeight="bold" text="Price"/&gt;<br /> &lt;mx:HSlider id="hsPrice" allowThumbOverlap="true" thumbCount="2" values="{[PriceMin,PriceMax]}"<br /> labels="{[priceFormatter.format(PriceMin), priceFormatter.format(PriceMax)]}"<br /> snapInterval="1000" tickInterval="1000" allowTrackClick="true" liveDragging="true"<br /> width="250" dataTipFormatFunction="priceDataTip"<br /> minimum="{Number(PriceMin)}" maximum="{Number(PriceMax)}" change="priceSliderUpdate(event)"  /&gt;<br /> &lt;mx:Label id="hsPriceLabel"   text=""  /&gt; </code></p>
<p>When the HSlider is updated, the priceSliderUpdate function gets notified with an event. Look at the help file for the Class SliderEvent, Look here for values that we can use. There are a lot of choices here, the only two items that I find usefull are thumbIndex and value. ‘thumbIndex’ is the zero-based index of the thumb whose position has changed and ‘value’ is the new value of the slider.<br /> We’ll use these properties of the event to prevent the thumbs from overlapping.<br /> First lets check to see which slider is moving, if it’s the left slider (thumbindex=0) then we need to check to see if it’s greater than the upper slider.  If it is, then push the right slider along with it by setting the value of the upper slider equal to the lower slider.  If the right slider is being updated, then check to see if the upper slider (hsPrice.values[1] ) is less than the lower slider (hsPrice.values[0]), and adjust accordingly (hsPrice.values[1] = hsPrice.values[0]).<br /> Next, set the label below the HSlider to display the minimum and maximum values.</p>
<p><code>hsPriceLabel.text = "Min: " + priceFormatter.format(hsPrice.values[0])+ "           Max: " + priceFormatter.format(hsPrice.values[1]); </code></p>
<p>Here’s the full code for this function:</p>
<p><code>private function priceSliderUpdate(evt:SliderEvent):void {<br /> if (evt.thumbIndex == 0) {  // the left slider is moving<br /> if (hsPrice.values[0] &gt; hsPrice.values[1]){<br /> hsPrice.values[1] = hsPrice.values[0];<br /> }<br /> } else {  // right slider is moving<br /> // if the upper slider moves below the lower slider adjust the lower slider down<br /> if (hsPrice.values[1] &lt; hsPrice.values[0]){<br /> hsPrice.values[0] = hsPrice.values[1];<br /> }<br /> }<br /> hsPriceLabel.text = "Min: " + priceFormatter.format(hsPrice.values[0])+ "           Max: " + priceFormatter.format(hsPrice.values[1]);<br /> } </code></p>
<p>The only thing left is to code the dataTip for the sliders.  A dataTip is a little bubble that appears above a slider when it is active.  For the dataTip function, the parameter passed in is the value for the slider that moved.  How do we know which slider this datatip is for??  If the value passed in is greater than the minimum value, then it must be for the slider of the maximum value. Let’s return a label with a formatted value.  If it’s the maximum slider return (&#8220;Maximum: &#8221; + priceFormatter.format(item) ), if it’s the minimum slider return: (&#8220;Minimum: &#8221; + priceFormatter.format(item) ), if the two sliders are equal, just return the formatted number without a minimum or maximum label: priceFormatter.format(item).<br /> Here is the full code for the DataTip function:<br /> <code>         private function priceDataTip(item:Number):String {<br /> if ( item  &gt; hsPrice.values[0]){<br /> return ("Maximum: " + priceFormatter.format(item) ); // Maximum:<br /> } else {<br /> if ( hsPrice.values[0] == hsPrice.values[1]){<br /> return (String(priceFormatter.format(item)));  // min = max<br /> }else {<br /> return ("Minimum: " + priceFormatter.format(item)); // Minimum<br /> }<br /> }<br /> }  </code></p>
<p>Here is the complete code for everything:</p>
<p><code>&lt;?xml version="1.0"?&gt;<br /> &lt;mx:Application xmlns:mx="<a href="http://www.adobe.com/2006/mxml" ?="?">http://www.adobe.com/2006/mxml"</a>&gt;<br /> &lt;mx:Script&gt;<br /> &lt;![CDATA[<br /> import mx.events.SliderEvent;<br /> import mx.controls.sliderClasses.Slider;<br /> import mx.formatters.CurrencyFormatter;<br /> [Bindable] public var PriceMin:uint = 0;<br /> [Bindable] public var PriceMax:uint = 25000;<br /> public var priceFormatter:CurrencyFormatter = new CurrencyFormatter();<br /> private function priceSliderUpdate(evt:SliderEvent):void {<br /> // if using allowTrackClick="true" then thumbdown or thumbdrag doesn't catch changes<br /> // allowThumbOverlap doesn't allow both sliders to be on the same value<br /> // if the lower slider moves past the upper slider, adjust upper slider<br /> //    so that the lower slider doesn't overlap the upper slider<br /> if (evt.thumbIndex == 0) {  // the left slider is moving<br /> if (hsPrice.values[0] &gt; hsPrice.values[1]){<br /> hsPrice.values[1] = hsPrice.values[0];<br /> }<br /> } else {  // right slider is moving<br /> // if the upper slider moves below the lower slider adjust the lower slider down<br /> if (hsPrice.values[1] &lt; hsPrice.values[0]){<br /> hsPrice.values[0] = hsPrice.values[1];<br /> }<br /> }<br /> hsPriceLabel.text = "Min: " + priceFormatter.format(hsPrice.values[0])+ "           Max: " + priceFormatter.format(hsPrice.values[1]);<br /> }<br /> private function priceDataTip(item:Number):String {<br /> // item is the value for the slider that moved<br /> // Set the data tip based on the value of the<br /> // selected thumb - if greater than the minimum value,<br /> // then it's the maximum datatip<br /> if ( item  &gt; hsPrice.values[0]){<br /> return ("Maximum: " + priceFormatter.format(item) ); // Maximum:<br /> } else {<br /> if ( hsPrice.values[0] == hsPrice.values[1]){<br /> return (String(priceFormatter.format(item)));  // min = max<br /> }else {<br /> return ("Minimum: " + priceFormatter.format(item)); // Minimum<br /> }<br /> }<br /> }<br /> ]]&gt;<br /> &lt;/mx:Script&gt;<br /> &lt;mx:Label  fontWeight="bold" text="Price"/&gt;<br /> &lt;mx:HSlider id="hsPrice" allowThumbOverlap="true" thumbCount="2" values="{[PriceMin,PriceMax]}"<br /> labels="{[priceFormatter.format(PriceMin), priceFormatter.format(PriceMax)]}"<br /> snapInterval="1000" tickInterval="1000" allowTrackClick="true" liveDragging="true"<br /> width="250" dataTipFormatFunction="priceDataTip"<br /> minimum="{Number(PriceMin)}" maximum="{Number(PriceMax)}" change="priceSliderUpdate(event)"  /&gt;<br /> &lt;mx:Label id="hsPriceLabel"   text=""  /&gt;<br /> &lt;/mx:Application&gt; </code></p>
]]></content:encoded>
			<wfw:commentRss>http://designwithflex.com/wp/2007/improved-hslider-component-for-flex-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An improved HSlider (slider) component for flex</title>
		<link>http://designwithflex.com/wp/2007/an-improved-hslider-slider-component-for-flex/</link>
		<comments>http://designwithflex.com/wp/2007/an-improved-hslider-slider-component-for-flex/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 22:37:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://designwithflex.com/?p=15</guid>
		<description><![CDATA[I was trying to use the two thumb HSlider in a project and was unhappy with the way the basic HSlider performed, so this is a tutorial on how the HSlider works and how to improve it so that it &#8230; <a href="http://designwithflex.com/wp/2007/an-improved-hslider-slider-component-for-flex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was trying to use the two thumb HSlider in a project and was unhappy with the way the basic HSlider performed, so this is a tutorial on how the HSlider works and how to improve it so that it works correctly.</p>
<p>A two thumb slider lets you choose a range of values. If you have a slider with a range of years from 2000 to 2007, I want the user to pick a range of dates. The range can be all dates (2000 &#8211; 2007) or some (2002-2005) or just one year (2004). Choosing specific years is not possible (2001, 2004, 2005). The problem with the basic HSlider is that you can not pick just a single year. With the thumbOverlap property disabled, the two thumbs could not be on the same value. With the thumbOverlap property enabled, then the lower slider could overlap and go past the upper slider. For example, if the upper slider was at 2005, then the lower slider could choose any value, including 2005, 2006, and 2007 &#8211; a feature that doesn’t look right. The proper behavior that I wanted was for the lower slider to meet the upper slider and push it further up if needed, but never go past the upper slider. The same behavior is true for the upper slider &#8211; never go below the lower slider.</p>
<p> <embed src="http://designwithflex.com/pics/myslider.swf" height="370" width="300"></embed> <br /> <br />
<span id="more-15"></span></p>
<p>and here is the code</p>
<pre>
&lt;?xml version="1.0"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
import mx.events.SliderEvent;
import mx.controls.sliderClasses.Slider;
private function sliderChange(event:SliderEvent):void {
var slid:Slider=Slider(event.currentTarget);
thumbLeft.text="Thumb Left: " + String(slid.values[0]);
thumbRight.text="Thumb Right: " + String(slid.values[1]);
thumbIndex.text="Thumb index: " + String(event.thumbIndex);
}
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:HSlider thumbCount="2" change="sliderChange(event);" id="slider1" labels="['0'],['5'],['10']"/&gt;
&lt;mx:CheckBox label="allowThumbOverlap" id="thumbOverlap" selected="false" click="slider1.allowThumbOverlap=thumbOverlap.selected"/&gt;
&lt;mx:CheckBox label="allowTrackClick" id="trackClick" selected="true" click="slider1.allowTrackClick=trackClick.selected"/&gt;
&lt;mx:CheckBox label="liveDragging" id="dragging" selected="false" click="slider1.liveDragging=dragging.selected"/&gt;
&lt;mx:Label text="TickInterval:"/&gt;
&lt;mx:NumericStepper minimum="0" maximum="10" stepSize="1" id="tickinterval" value="0" change="slider1.tickInterval=tickinterval.value"/&gt;
&lt;mx:Label text="SnapInterval:"/&gt;
&lt;mx:NumericStepper id="snapinterval" value="0" minimum="0" maximum="10" stepSize="1" change="slider1.snapInterval=snapinterval.value"/&gt;
&lt;mx:Text id="thumbLeft"/&gt;
&lt;mx:Text id="thumbRight"/&gt;
&lt;mx:Text id="thumbIndex"/&gt;
&lt;/mx:Application&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://designwithflex.com/wp/2007/an-improved-hslider-slider-component-for-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 3 example of TileList with effects</title>
		<link>http://designwithflex.com/wp/2007/flex-3-example-of-tilelist-with-effects-2/</link>
		<comments>http://designwithflex.com/wp/2007/flex-3-example-of-tilelist-with-effects-2/#comments</comments>
		<pubDate>Sun, 23 Sep 2007 23:12:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://designwithflex.com/?p=26</guid>
		<description><![CDATA[Flex 3.0 is awesome! Flex 3.0 beta is out now, production version is due out around February 2008. With Flex 3.0 you can EASILY do animation effects with adding and removing items from the TileList. Here is an example of &#8230; <a href="http://designwithflex.com/wp/2007/flex-3-example-of-tilelist-with-effects-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Flex 3.0 is awesome! Flex 3.0 beta is out now, production version is due out around February 2008.    <br />With Flex 3.0 you can EASILY do animation effects with adding and removing items from the TileList.     <br />Here is an example of what I&#x2019;ll show you how to code: </p>
<p> <embed src="http://designwithflex.com/pics/tileListv3.swf" width="450" height="510" type="application/x-shockwave-flash"></embed></embed></embed></embed></embed></embed></embed></embed>  <br /> <br />
<span id="more-26"></span></p>
<p>Let&#x2019;s start out with the data that we&#x2019;ll use.&#xA0; I&#x2019;ll start with an array called mydata, each item with a name and an age: </p>
<p> <code>public var mydata:Array=[    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;A&quot;,age:16},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;B&quot;,age:17},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;C&quot;,age:18},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;D&quot;,age:19},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;E&quot;,age:20},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;F&quot;,age:21},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;G&quot;,age:22},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;H&quot;,age:23},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;I&quot;,age:24},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;J&quot;,age:25},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;K&quot;,age:26}]; </code>
<p>Then create an ArrayCollection called myAC initialized with mydata. </p>
<p> <code>&#xA0;&#xA0; public var myAC:ArrayCollection = new ArrayCollection(mydata); </code>
<p>As we remove items from the TileList we&#x2019;ll need someplace to keep them in case we need to display them again later, so declare another ArrayCollection for this task. </p>
<p> <code>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; private var hidden:ArrayCollection = new ArrayCollection; </code>
<p>We&#x2019;ll have two ArrayCollections one for the display and one for the non-display items.&#xA0; All items will be on one of these lists.&#xA0; As we delete one item, we&#x2019;ll remove it from the display list and put it on the hidden list.&#xA0; As we add an item to the display list, we&#x2019;ll remove it from the hidden list. An item will either be on the display list or the hidden list. </p>
<p>Let&#x2019;s build the TileList to display the data, give it an id of &#x2018;tlist&#x2019;, height and width of 400, make it a 4&#215;4 grid with the Data direction of horizontal.&#xA0;&#xA0; New with Flex 3 are parameters: offscreenExtraColumns, offscreenExtraRows, and dataChangeEffect. The manual says to use 2 or a multiple of 2 for both offscreenExtraColumns and offScreenExtraRows, however when I tried that, Then some of the display items disappeared, zero appears to work fine, but you may want to try out the values 2 or 4 with your setup. The new ListBase property offscreenExtraRows and offscreenExtraColumns helps to eliminate visual glitches in data effects. Setting this property to a small even number such as 2 or 4, or possibly larger if many items may be deleted at once, is recommended. </p>
<p> <code>&#xA0;&#xA0;&#xA0; &lt;mx:TileList id=&quot;tlist&quot;    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; height=&quot;400&quot; width=&quot;400&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fontSize=&quot;30&quot; fontStyle=&quot;bold&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; columnCount=&quot;4&quot; rowCount=&quot;4&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; direction=&quot;horizontal&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; dataProvider=&quot;{myDP}&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; itemRenderer=&quot;Thumbnail&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; offscreenExtraColumns=&quot;0&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; offscreenExtraRows=&quot;0&quot;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; dataChangeEffect=&quot;{dataChangeEffect1}&quot;/&gt; </code>
<p>The TileList uses a custom itemRenderer so let&#x2019;s create the itemRenderer: create a new MXML component called &#x2018;Thumbnail.mxml&#x2019; with    <br />Two labels inside a VBox with size 100&#215;100: </p>
<p> <code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;    <br />&lt;mx:VBox xmlns:mx=&quot;<a href="http://www.adobe.com/2006/mxml" ?="?">http://www.adobe.com/2006/mxml&quot;</a> width=&quot;100&quot; height=&quot;100&quot;&gt;     <br />&lt;mx:Label text=&quot;{data.name}&quot; /&gt;     <br />&lt;mx:Label text=&quot;{data.age}&quot; /&gt;     <br />&lt;/mx:VBox&gt; </code>
<p>Next let&#x2019;s add two numeric steppers that will allow us to interact with the data in the TileList, the two steppers will define a range of values that are viewable.&#xA0; Shrinking the range of numbers will delete those data items in the TileList, while expanding the range will bring the data back into view.&#xA0; Create a HBox, add a label and then create a NumericStepper with a range of 14-26, and a current value of &#x2018;24&#x2019;, set the stepSize to 1, and when this value changes, make a call to lowchange(). </p>
<p> <code>&#xA0;&#xA0;&#xA0; &lt;mx:HBox &gt;    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:Label text=&quot;Lowest Value:&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:NumericStepper id=&quot;low&quot; value=&quot;24&quot; minimum=&quot;14&quot; maximum=&quot;26&quot; stepSize=&quot;1&quot; change=&quot;lowchange()&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;/mx:HBox&gt; </code>
<p>Create another NumericStepper to act as the higher range, setting the value to 26, and call highchange() when the user changes this value. </p>
<p> <code>&#xA0;&#xA0;&#xA0; &lt;mx:HBox &gt;    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:Label text=&quot;Highest Value:&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:NumericStepper id=&quot;high&quot; value=&quot;26&quot; minimum=&quot;17&quot; maximum=&quot;26&quot; stepSize=&quot;1&quot; change=&quot;highchange()&quot;/&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;/mx:HBox&gt; </code>
<p>Now for the real code &#x2013; what is required is the index value of the items that will be deleted and calling removeItemAt() for the effect to play.&#xA0; In the lowchange function we search for values that are outside the range specified by the two numeric steppers.&#xA0; Loop thru all the values of the ArrayCollection (myAC), when a value is found less than the lower limit, add the index (removelist.push(j)) to a list of&#xA0; items to remove. As we look for items to remove, copy the items that we remove to another list (hidden) so that we can add these items back later when the lower limit changes again.&#xA0; i.e. there will be two lists &#x2013; one containing the items outside the range, and another containing all the items within the range which will be displayed. </p>
<p> <code>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; private function lowchange():void {    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var removelist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (var j:int = 0; j &lt; myAC.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (myAC[j].age &lt; low.value) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.addItem(myAC[j]);&#xA0; // copy item to remove to hidden list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to remove, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; } </code>
</p>
<p>At this point we have a list of indices to the items that we need to remove, next the list is sorted in descending order and then step thru the list removing items one by one from the end of the array.&#xA0; If&#xA0; the remove list is not sorted descending is to prevent us from stepping on ourselves.&#xA0;&#xA0; For example if the remove list contains indices 2 and 4, and you remove item at index #2, then the item at index #4 moves up one to become index #3, then if you remove the item at index #4, this is really the item at index #5.&#xA0; Removing them from the end solves this problem.&#xA0; </p>
<p> <code>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />for (var i:int = 0; i &lt; removelist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.removeItemAt(removelist[i]);&#xA0;&#xA0;&#xA0; // remove item     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; } </code>  <br />Next, let&#x2019;s look thru the hidden list and see if any items need to be moved back to the display.&#xA0; Loop thru the hidden list checking values that are inside the range, if found then user the random function to insert them back in at a random place.&#xA0; Keep a list of the items added so that they can be removed from the hidden list.&#xA0; Here is the code:
</p>
<p> <code>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; /*&#xA0; look thru hidden list and see if we need to add any items back */    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var addlist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for ( j = 0; j &lt; hidden.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if ((hidden[j].age &gt;= low.value) &amp;&amp; (hidden[j].age &lt;=high.value) ) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.addItemAt(hidden[j], Math.floor(Math.random() * myAC.length ));&#xA0; // copy item to a random spot (and later remove from hidden list)&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to add, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist = addlist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (i = 0; i &lt; addlist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.removeItemAt(addlist[i]);&#xA0;&#xA0;&#xA0; // remove item from hidden list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; </code>
<p>Next. Let&#x2019;s add the effect that gets played when an item is added or removed: </p>
<p> <code>&lt;mx:DefaultListEffect id=&quot;myDLE&quot;    <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fadeOutDuration=&quot;1000&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fadeInDuration=&quot;350&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; color=&quot;0x0044ff&quot;/&gt; </code>
<p>That&#x2019;s it!&#xA0; Here is the complete code for the main component, (following is the code for the itemrenderer): </p>
<p> <code>&lt;?xml version=&quot;1.0&quot;?&gt;    <br />&lt;!-- dataEffects\CustomTileListEffect.mxml --&gt;     <br />&lt;mx:Application xmlns:mx=&quot;<a href="http://www.adobe.com/2006/mxml" ?="?">http://www.adobe.com/2006/mxml&quot;</a> xmlns:comp=&quot;*&quot; &gt;     <br />&#xA0; &lt;mx:Script&gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;![CDATA[     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; import mx.effects.easing.Elastic;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; import mx.collections.ArrayCollection;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; public var mydata:Array=[     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;A&quot;,age:14},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;B&quot;,age:15},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;C&quot;,age:16},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;D&quot;,age:17},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;E&quot;,age:18},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;F&quot;,age:19},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;G&quot;,age:20},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;H&quot;,age:21},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;I&quot;,age:22},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;J&quot;,age:23},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;J&quot;,age:24},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;J&quot;,age:25},     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; {name:&quot;K&quot;,age:26}];     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; [Bindable]     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; public var myAC:ArrayCollection = new ArrayCollection(mydata);     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; private var hidden:ArrayCollection = new ArrayCollection;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; private function lowchange():void {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var removelist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (var j:int = 0; j &lt; myAC.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (myAC[j].age &lt; low.value) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.addItem(myAC[j]);&#xA0; // copy item to remove to hidden list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to remove, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (var i:int = 0; i &lt; removelist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.removeItemAt(removelist[i]);&#xA0;&#xA0;&#xA0; // remove item     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; /*&#xA0; look thru hidden list and see if we need to add any items back */     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var addlist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for ( j = 0; j &lt; hidden.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if ((hidden[j].age &gt;= low.value) &amp;&amp; (hidden[j].age &lt;=high.value) ) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.addItemAt(hidden[j], Math.floor(Math.random() * myAC.length ));&#xA0; // copy item to a random spot (and later remove from hidden list)&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to add, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist = addlist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (i = 0; i &lt; addlist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.removeItemAt(addlist[i]);&#xA0;&#xA0;&#xA0; // remove item from hidden list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; private function highchange():void {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var s:int = 0;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var randm:int = 0;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for ( s = 0; s&lt; 100; s++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; randm = (Math.floor(Math.random() * myAC.length)&#xA0; );     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; trace ( &quot;random is &quot; + randm + &quot; leng is &quot; + myAC.length);     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var removelist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (var j:int = 0; j &lt; myAC.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if (myAC[j].age &gt; high.value) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.addItem(myAC[j]);&#xA0; // copy item to remove to hidden list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to remove, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; removelist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (var i:int = 0; i &lt; removelist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.removeItemAt(removelist[i]);&#xA0;&#xA0;&#xA0; // remove item     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; /*&#xA0; look thru hidden list and see if we need to add any items back */     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; var addlist:Array = []; // an array of indexes of items to remove     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for ( j = 0; j &lt; hidden.length; j++){     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; if ((hidden[j].age &gt;= low.value) &amp;&amp; (hidden[j].age &lt;=high.value) ) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; myAC.addItemAt(hidden[j], Math.floor(Math.random() * myAC.length) );&#xA0; // copy item to myAC list&#xA0; (and later remove from hidden list)&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist.push(j);&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; // keep index of item to add, so that we can remove in next step     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; addlist = addlist.sort(Array.DESCENDING);&#xA0; // sort list so that we can start deleting from end of the list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; for (i = 0; i &lt; addlist.length; i++) {     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; hidden.removeItemAt(addlist[i]);&#xA0;&#xA0;&#xA0; // remove item from hidden list     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; }&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; ]]&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;/mx:Script&gt;     <br />&lt;mx:DefaultListEffect id=&quot;myDLE&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fadeOutDuration=&quot;1000&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fadeInDuration=&quot;350&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; color=&quot;0x0044ff&quot;/&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;!-- This TileList uses a custom data change effect --&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;!-- offscreenExtraColumns and ..Rows should be 2, but '2' causes items to disappear --&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;mx:TileList id=&quot;tlist&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; height=&quot;400&quot; width=&quot;400&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; fontSize=&quot;30&quot; fontStyle=&quot;bold&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; columnCount=&quot;4&quot; rowCount=&quot;4&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; direction=&quot;horizontal&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; dataProvider=&quot;{myAC}&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; itemRenderer=&quot;Thumbnail&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; offscreenExtraColumns=&quot;0&quot;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; offscreenExtraRows=&quot;0&quot;&#xA0;&#xA0;&#xA0; <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; dataChangeEffect=&quot;{myDLE}&quot;/&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;mx:HBox &gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:Label text=&quot;Lowest Value:&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:NumericStepper id=&quot;low&quot; value=&quot;16&quot; minimum=&quot;14&quot; maximum=&quot;26&quot; stepSize=&quot;1&quot; change=&quot;lowchange()&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;/mx:HBox&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;mx:HBox &gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:Label text=&quot;Highest Value:&quot; /&gt;     <br />&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; &lt;mx:NumericStepper id=&quot;high&quot; value=&quot;26&quot; minimum=&quot;17&quot; maximum=&quot;26&quot; stepSize=&quot;1&quot; change=&quot;highchange()&quot;/&gt;     <br />&#xA0;&#xA0;&#xA0; &lt;/mx:HBox&gt;     <br />&lt;/mx:Application&gt;
</p>
<p> </code>
<p>Here is Thumbnail.mxml: </p>
<p> <code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;    <br />&lt;mx:VBox xmlns:mx=&quot;<a href="http://www.adobe.com/2006/mxml" ?="?">http://www.adobe.com/2006/mxml&quot;</a> width=&quot;100&quot; height=&quot;100&quot;&gt;     <br />&lt;mx:Label text=&quot;{data.name}&quot; /&gt;     <br />&lt;mx:Label text=&quot;{data.age}&quot; /&gt;     <br />&lt;/mx:VBox&gt; </code>
<p>Next article will show how to add a few more effects. </p>
]]></content:encoded>
			<wfw:commentRss>http://designwithflex.com/wp/2007/flex-3-example-of-tilelist-with-effects-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

