xmlactionscript-3flixel

Xml data referencing and flixel


I have started using XMLs for the first time in flixel, and I have run into some trouble.

I am trying to get the tileset out of this:

<Ground tileset="Tiles" exportMode="CSV">

//some code

</Ground>

I have tried: Ground.tileset and Ground.@tileset, this may be a very simple solution... but I haven't used XMLs very much.

Thanks,


Solution

  • I think that you have just to use an XML object like this :

    var xml:XML = 
        <Ground tileset="Tiles" exportMode="CSV">
            <!-- some code -->
        </Ground>
    ;
    
    trace(xml.@tileset);    // gives : Tiles
    

    Hope that can help.