Chapter 11 Example 1

by actionscriptbible
♥0 | Line 11 | Modified 2009-09-15 06:02:42 | MIT License
play

ActionScript3 source code

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

package {
  import com.actionscriptbible.Example;
  public class ch11ex1 extends Example {
    override public function ch11ex1() {
      trace(makeNode("div", "i am a banana").toXMLString());
      //<div>i am a banana</div>
    }
    protected function makeNode(nodeName:String, contents:String = ""):XML {
      return <{nodeName}>{contents}</{nodeName}>
    }
  }
}