Hello, XML!

by aasdb
♥0 | Line 25 | Modified 2010-07-06 23:44:47 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.Sprite;
    public class HelloXML extends Sprite {
        public function HelloXML() {
            var xml:XML =
                <sample>
                    <message>Hello,</message>
                    <from>XML</from>
                </sample>
                
            
            var t:TextField = new TextField;
            var tf:TextFormat = new TextFormat;
            
            t.text = xml.message + " " +  xml.from + "!"
            t.x = 60;
            t.y = 150;
            t.width = 400;
            t.height = 300;
            tf.size = 50;
            tf.italic = true;
            t.setTextFormat(tf);
            addChild(t);
        }
    }
}

Forked