<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: Ways to use E4X to filter data in ActionScript 3</title>
	<atom:link href="http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Tue, 31 Jan 2012 13:51:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: AS3/E4X: Rekursiv alle Unterknoten mit einem Attribut finden / crusy.net</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-5283</link>
		<dc:creator>AS3/E4X: Rekursiv alle Unterknoten mit einem Attribut finden / crusy.net</dc:creator>
		<pubDate>Tue, 08 Mar 2011 13:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-5283</guid>
		<description>[...] ist. Man beachte: Den doppelten Punkt hinter &#8220;xml&#8221;, sowie den Sternchen-Selektor. Quelle, man beachte auch die unten verlinkten weiterführenden [...]</description>
		<content:encoded><![CDATA[<p>[...] ist. Man beachte: Den doppelten Punkt hinter &#8220;xml&#8221;, sowie den Sternchen-Selektor. Quelle, man beachte auch die unten verlinkten weiterführenden [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Auzzie</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-550</link>
		<dc:creator>Auzzie</dc:creator>
		<pubDate>Sat, 06 Feb 2010 19:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-550</guid>
		<description>Great post, I was able to use a couple of scripts above but ran into an issue and was wondering if anyone had some insight:

I have some data that I separated into labels of a combobox:

---
Features3
Features1,Features2,Features3
Features2,Features3
Features1
----
if (featuresCombo.selectedLabel != item.FEATURES)
return false;

return true;
----

If you select &#039;Features3&#039; for example it doesn&#039;t return the selections that have multiple entries separated by commas.

Is there a way to filter based on the occurance of a string rather than matching the whole string?

I tried to use the (contains) function from above and was getting this error:Error #1123: Filter operator not supported on type mx.utils.ObjectProxy.

Thanks for any help.
-Auzzie</description>
		<content:encoded><![CDATA[<p>Great post, I was able to use a couple of scripts above but ran into an issue and was wondering if anyone had some insight:</p>
<p>I have some data that I separated into labels of a combobox:</p>
<p>&#8212;<br />
Features3<br />
Features1,Features2,Features3<br />
Features2,Features3<br />
Features1<br />
&#8212;-<br />
if (featuresCombo.selectedLabel != item.FEATURES)<br />
return false;</p>
<p>return true;<br />
&#8212;-</p>
<p>If you select &#8216;Features3&#8242; for example it doesn&#8217;t return the selections that have multiple entries separated by commas.</p>
<p>Is there a way to filter based on the occurance of a string rather than matching the whole string?</p>
<p>I tried to use the (contains) function from above and was getting this error:Error #1123: Filter operator not supported on type mx.utils.ObjectProxy.</p>
<p>Thanks for any help.<br />
-Auzzie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristin</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-549</link>
		<dc:creator>Kristin</dc:creator>
		<pubDate>Mon, 25 Jan 2010 18:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-549</guid>
		<description>By the way, while I&#039;m here... I&#039;m trying to write a picture viewer program and I&#039;ve seen a lot of tuts on the web, but they don&#039;t seem to address my needs. I have 3 xml elements: name, file (an image), and comments. I have so many image files that I&#039;ve chosen to load them into a list component which I can load up with name data. For some reason I&#039;ve hit a road block in that I don&#039;t know how to link the selectedItem in the list box so I can display the other elements on the page. I hope this isn&#039;t too complicated a question to ask. Thanks</description>
		<content:encoded><![CDATA[<p>By the way, while I&#8217;m here&#8230; I&#8217;m trying to write a picture viewer program and I&#8217;ve seen a lot of tuts on the web, but they don&#8217;t seem to address my needs. I have 3 xml elements: name, file (an image), and comments. I have so many image files that I&#8217;ve chosen to load them into a list component which I can load up with name data. For some reason I&#8217;ve hit a road block in that I don&#8217;t know how to link the selectedItem in the list box so I can display the other elements on the page. I hope this isn&#8217;t too complicated a question to ask. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristin</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-548</link>
		<dc:creator>Kristin</dc:creator>
		<pubDate>Mon, 25 Jan 2010 18:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-548</guid>
		<description>Thanks Josh, that was it and I should have tried it. I only had intro classes to Flash MX2004 and that&#039;s been almost 3 years ago. Kinda rusty.</description>
		<content:encoded><![CDATA[<p>Thanks Josh, that was it and I should have tried it. I only had intro classes to Flash MX2004 and that&#8217;s been almost 3 years ago. Kinda rusty.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Tynjala</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-546</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-546</guid>
		<description>Put the trace() call after the loop and you might see the correct result. During the loop, it&#039;s still filtering by field name and value, and that means it will search over each of the items more than once.</description>
		<content:encoded><![CDATA[<p>Put the trace() call after the loop and you might see the correct result. During the loop, it&#8217;s still filtering by field name and value, and that means it will search over each of the items more than once.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristin</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-545</link>
		<dc:creator>Kristin</dc:creator>
		<pubDate>Mon, 25 Jan 2010 06:13:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-545</guid>
		<description>Hey, great article, but I&#039;ve run into a snag with your last example. I cut and pasted your code and get this in my output window:

(your code and your xml file which I swear I did not change)

&lt;pre&gt;var filtered:XMLList = data.item;
var fields:Array = [{name: &quot;source&quot;, value: &quot;Amazon&quot;}, {name: &quot;price&quot;, value: &quot;599.99&quot;}];
       
var fieldCount:int = fields.length;
for(var i:int = 0; i &lt;fieldCount; i++)
{
    var fieldName:String = fields[i].name;
    var fieldValue:String = fields[i].value;
    filtered = filtered.(child(fieldName) == fieldValue);
	trace(filtered);
}&lt;/pre&gt;

this code is supposed to return Amazon items worth 599.99, however it returns 3 Amazon items. It&#039;s returning 2-599.99 items and 1-399.99 item which is not what&#039;s in the xml file.

output results



  Amazon
  399.99


  Amazon
  599.99


  Amazon
  599.99


I&#039;m new to xml and AS3 so I wanted to make sure this wasn&#039;t happening because I&#039;m using Flash CS4 (since your original post is almost 3 years old)</description>
		<content:encoded><![CDATA[<p>Hey, great article, but I&#8217;ve run into a snag with your last example. I cut and pasted your code and get this in my output window:</p>
<p>(your code and your xml file which I swear I did not change)</p>
<pre>var filtered:XMLList = data.item;
var fields:Array = [{name: "source", value: "Amazon"}, {name: "price", value: "599.99"}];
       
var fieldCount:int = fields.length;
for(var i:int = 0; i &lt;fieldCount; i++)
{
    var fieldName:String = fields[i].name;
    var fieldValue:String = fields[i].value;
    filtered = filtered.(child(fieldName) == fieldValue);
	trace(filtered);
}</pre>
<p>this code is supposed to return Amazon items worth 599.99, however it returns 3 Amazon items. It&#039;s returning 2-599.99 items and 1-399.99 item which is not what&#039;s in the xml file.</p>
<p>output results</p>
<p>  Amazon<br />
  399.99</p>
<p>  Amazon<br />
  599.99</p>
<p>  Amazon<br />
  599.99</p>
<p>I&#8217;m new to xml and AS3 so I wanted to make sure this wasn&#8217;t happening because I&#8217;m using Flash CS4 (since your original post is almost 3 years old)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Tynjala</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-544</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Thu, 21 Jan 2010 21:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-544</guid>
		<description>Jon, if you have multiple elements as children, it might not be possible to do it in a single statement. You might have to put source into an XMLList and search that separately.

However, you might also look at &lt;a href=&quot;http://livedocs.adobe.com/flex/3/langref/XMLList.html#contains()&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;contains()&lt;/code&gt;&lt;/a&gt; on XMLList. It might be useful here. I&#039;ve never played with that one, though.</description>
		<content:encoded><![CDATA[<p>Jon, if you have multiple elements as children, it might not be possible to do it in a single statement. You might have to put source into an XMLList and search that separately.</p>
<p>However, you might also look at <a href="http://livedocs.adobe.com/flex/3/langref/XMLList.html#contains()" rel="nofollow"><code>contains()</code></a> on XMLList. It might be useful here. I&#8217;ve never played with that one, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-543</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Thu, 21 Jan 2010 21:26:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-543</guid>
		<description>trying to figure out how to sort if an item has more than one of the same node type...

such as:

&lt;item name=&quot;Consoles&quot;&gt;
&lt;source&gt; PS3 &lt;/source&gt;
&lt;source&gt; PS2 &lt;/source&gt;
&lt;/item&gt;

if I searched for all items with PS2 this would be skipped with the methods used above...</description>
		<content:encoded><![CDATA[<p>trying to figure out how to sort if an item has more than one of the same node type&#8230;</p>
<p>such as:</p>
<p>&lt;item name=&quot;Consoles&quot;&gt;<br />
&lt;source&gt; PS3 &lt;/source&gt;<br />
&lt;source&gt; PS2 &lt;/source&gt;<br />
&lt;/item&gt;</p>
<p>if I searched for all items with PS2 this would be skipped with the methods used above&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giles</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-542</link>
		<dc:creator>Giles</dc:creator>
		<pubDate>Tue, 01 Dec 2009 11:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-542</guid>
		<description>Josh, absolutely great post and has helped me out a lot but I seem to have discovered an intractable problem. I am attempting to filter for two attributes within descendants.

I&#039;ve tried using every method I could think of - (contains); attribute(&quot;&quot;); hasOwnProperty(&quot;@&quot;); att==; but none will work. Flash seems to ignore anything that comes after the &amp;&amp;.

Here is one of the lines I&#039;ve tried, can you think why it won&#039;t work?

mediaFilterDays = filterDays.(descendants(&quot;programme&quot;).(@genre == Filter &amp;&amp; @media == mediaFilter));</description>
		<content:encoded><![CDATA[<p>Josh, absolutely great post and has helped me out a lot but I seem to have discovered an intractable problem. I am attempting to filter for two attributes within descendants.</p>
<p>I&#8217;ve tried using every method I could think of &#8211; (contains); attribute(&#8220;&#8221;); hasOwnProperty(&#8220;@&#8221;); att==; but none will work. Flash seems to ignore anything that comes after the &amp;&amp;.</p>
<p>Here is one of the lines I&#8217;ve tried, can you think why it won&#8217;t work?</p>
<p>mediaFilterDays = filterDays.(descendants(&#8220;programme&#8221;).(@genre == Filter &amp;&amp; @media == mediaFilter));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parenthesis &#8211; the round mystery &#171; Max Blog</title>
		<link>http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-541</link>
		<dc:creator>Parenthesis &#8211; the round mystery &#171; Max Blog</dc:creator>
		<pubDate>Sat, 07 Nov 2009 14:13:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/#comment-541</guid>
		<description>[...] There are a few nice posts about E4X filters on this blog: http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/ [...]</description>
		<content:encoded><![CDATA[<p>[...] There are a few nice posts about E4X filters on this blog: <a href="http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/" rel="nofollow">http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

