In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

XmlParseTest

Get Adobe Flash player
by RaptorClaw 30 Jan 2012
    Embed
/**
 * Copyright RaptorClaw ( http://wonderfl.net/user/RaptorClaw )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/qXbI
 */

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        
        private var _textfield:TextField;
        public function FlashTest() 
        {
            _textfield = new TextField();
            addChild(_textfield);
            
            testXml();
        }
        
        private function testXml():void
        {
            var xml:XML = 
            <data>
                <thing attr1="a" attr2="b"> </thing>
                <thing attr1="b" attr2="d"> </thing>
                <thing attr2="g"> </thing>
            </data>
            
            _textfield.text = xml.thing.(attribute("attr1") == "a").attribute("attr2");
        }
    }
}