# Filtering in E4X XML in Actionscript 3 is broke?

**URL:** <https://forum.kirupa.com/t/filtering-in-e4x-xml-in-actionscript-3-is-broke/278800>\
**Category:** flash\
**Created:** [January 6, 2009, 12:36am UTC](https://forum.kirupa.com/t/filtering-in-e4x-xml-in-actionscript-3-is-broke/278800 "2009-01-06T00:36:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MastaShake](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mastashake/32/2281_2.png) [@MastaShake](https://forum.kirupa.com/u/MastaShake)\
**Post date:** [January 6, 2009, 12:36am UTC](https://forum.kirupa.com/t/filtering-in-e4x-xml-in-actionscript-3-is-broke/278800/1 "2009-01-06T00:36:29Z")

</div>

Hi Everyone,

Can anyone explain why this works:

```auto
xml..event.(eventID == 1) //No Errors

```

But this doesn’t?:

```auto
xml..event.(event_location == "Rome") //ReferenceError: Error #1065: Variable event_location is not defined.

```

Uhm, hello Actionscript, event\_location isn’t a variable! Therefore I shouldn’t have to define it. Its an xml element. Also I quadruple checked that those elements DO exist. I am an otherwise AS3 XML expert, so I thought.

So just for testing purposes, to prove that both eventID and event\_location are actual XML elements:

```auto
trace(xml..event[0].eventID) //traces 1

```

```auto
trace(xml..event[0].event_location) //traces Brisbane

```

Also here is what one of the many event XML elements looks like:

```auto
<event>
     <event_location>Brisbane</event_location>
     <level>International</level>
     <prize>$220,000</prize>
     <surface_type>HO</surface_type>
     <draw_size>
          <MD>32</MD>
          <QF>32</QF>
     </draw_size>
     <QF_start_date>Jan 2</QF_start_date>
     <MD_start_date>Jan 4</MD_start_date>
     <MD_end_date>Jan 10</MD_end_date>
     <eventName></eventName>
     <region>Asia/Oceana</region>
     <acclimation>Heat/Humidity, Jetlag</acclimation>
     <prior_year_cutoff></prior_year_cutoff>
</event>

```

PLZ HELP!!!
