forked from: SO xml namespace attributes access

by pleclech forked from SO xml namespace attributes access (diff: 47)
♥0 | Line 30 | Modified 2012-09-28 22:36:33 | MIT License
play

ActionScript3 source code

/**
 * Copyright pleclech ( http://wonderfl.net/user/pleclech )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/21xv
 */

// forked from pleclech's SO xml namespace attributes access
// forked from pleclech's SO xml namespace access
package {
    import flash.utils.ByteArray;
    import flash.utils.getQualifiedSuperclassName;
    import flash.utils.getQualifiedClassName;
    import flash.utils.describeType;
    import flash.utils.Dictionary;
    import flash.events.Event;
    import flash.utils.setTimeout;
    import com.bit101.components.TextArea;
    
    public class FlashTest extends TextArea {
        public namespace foo;
        foo var bar:String='baz';
        public function FlashTest() {
            width=400
            height=400
            setTimeout(doTest, 500)                        
        }
        public function doTest():void {
            try {
                var x:XML = new XML('<?xml version="1.0" encoding="UTF-8"?><result status="ok"><code><![CDATA[200]]></code><message><![CDATA[OK]]></message><item><exact_label><![CDATA[animal]]></exact_label><uniq_identifier><![CDATA[animal]]></uniq_identifier></item></result>');
                for each(var y:XML in x..item.children()) trace(y.localName());
            } catch (e:*) {
                trace(e);
            }
        }

        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
    }
}

Forked