topical media & game development

talk show tell print

professional-javascript-04-xbObjectsExample1.htm / htm

          <script type="text/javascript" src="xbObjects.js"></script>
  <script type="text/javascript">
  function ClassA(sColor) {
      _classes.defineClass("ClassA", prototypeFunction);
      function prototypeFunction() {
          ClassA.prototype.init = function (sColor) {
              this.color = sColor;
          ClassA.prototype.sayColor = function () {
  var objA = new ClassA("red");
  objA.sayColor();    //outputs "red"

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.