# XML & AS3 - "code recognition"

**URL:** <https://forum.kirupa.com/t/xml-as3-code-recognition/313936>\
**Category:** flash\
**Created:** [September 14, 2010, 9:19am UTC](https://forum.kirupa.com/t/xml-as3-code-recognition/313936 "2010-09-14T09:19:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![inkSheep](https://avatars.discourse-cdn.com/v4/letter/i/e495f1/32.png) [@inkSheep](https://forum.kirupa.com/u/inkSheep)\
**Post date:** [September 14, 2010, 9:19am UTC](https://forum.kirupa.com/t/xml-as3-code-recognition/313936/1 "2010-09-14T09:19:45Z")

</div>

Hi!

New to these forums, and quite new to the XML/Flash enviroment aswell, however i have common knowledge of action script and have been using XML along with it in previous applications.

I’ve run into a quite stupid problem, i am to create sort of a “database viewer” with some basic functions, and i’ve run into two problems so far.

Problem 1:

```auto
 
[COLOR=red] **XML** [/COLOR]
<articles>
  **<arti nr="101">**
    <nr1>XXX</nr1>
    <nr2>XXX</nr2>
    <nr3>XXX</nr3>
    <nr4>XXX</nr4>
**</arti>**
 **<arti nr="102">**
    <nr1>XXX</nr1>
    <nr2>XXX</nr2>
    <nr3>XXX</nr3>
    <nr4>XXX</nr4>
**</arti>**
</articles>

```

As you can see in the XML file the “arti” also assigns a number, so how do i state this in the actionscript to properly load the object?

Problem 2:

```auto
 
[COLOR=red] **ACTIONSCRIPT** [/COLOR]
function onLoaded(e:Event):void {
 myXML=new XML(e.target.data);
 var articles:XMLList=myXML.articles;

```

Say i am using the above to load my xml (all articles) how do I in an easy manner load one of the articles (arti nr=“101”) for example?  
cause i want to access the numbered “arti” by an easy input of their assigned number (which in this case would be 101 or 102)

I know this is a pretty basic problem, and i’m sure i could “tame” it after juggling with it for a bit longer, but i need some perspective and help to make it happen faster 😉

Help greatly appriciated!!
