Cameron A. Ellis
Cameron A. Ellis

Reputation: 3881

XML attribute access in AS3

I have an xml file (loaded in with URLLoader) that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <localizations>
        <words>
            <Brand us="Brand Here"></Brand>
        </words>
    </localizations>
    <world squareunits="100"></world>
</root>

Once loaded,what is the quickest way to access world.squareunits with E4X or just pure AS3?

Upvotes: 1

Views: 1099

Answers (1)

Don Neufeld
Don Neufeld

Reputation: 23218

var xml : XML = new XML( yourStringHere );
trace( xml.world.@squareunits );

Upvotes: 4

Related Questions