# Problem with classes

**URL:** https://forum.kirupa.com/t/problem-with-classes/194821
**Category:** Uncategorized
**Created:** [July 26, 2006, 3:19pm UTC](https://forum.kirupa.com/t/problem-with-classes/194821 "2006-07-26T15:19:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![angaturama](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@angaturama](https://forum.kirupa.com/u/angaturama)
#### Post date: [July 26, 2006, 3:19pm UTC](https://forum.kirupa.com/t/problem-with-classes/194821/1 "2006-07-26T15:19:31Z")

</div>

Hi all, i’m trying to learn about clases, and i tried to make an easy XML loader, but i gotta a problem with the attributes that doen’t take the value i provide with the att variable. it shows me on the trace statement like undefined, and for example if i change the atrribute instead of being dynamic, to be static, it does work.

Any hint or help would be really appreciated

thanks in advance

```auto
class XMLS {
    function XMLS(Path:String, textfield:TextField, att:String, n:Number) {
        var miXML:XML = new XML();
        miXML.ignoreWhite = true;
        miXML.onLoad = function(success:Boolean) {
            if (success) {
                attributesLoader(miXML, textfield, att, n);
            } else {
                trace("error loading XML");
            }
        };
        miXML.load(Path);
    }
    public static function attributesLoader(miXML, textfield, att, n) {
        var main:Array = miXML.firstChild.childNodes;
        var numNodes:Number = main.length;
        for (var a:Number = 0; a<numNodes; a++) {
            if (atributos != "0") {
                trace(main[0].attributes.att);
                
            } else {
               trace("there's no attributes")
            }
        }
    }
}

```
