title: js prototype class.create coexistance between variables in subclass and superclass
body: <p>Very simply put, I have lots of classes that share variables and have their own variables. So I created a super class called Resource and many subclasses. The problem is that I want to be able to set and get any value. I simplified the code, but this is what i can't do. Keep in mind that there are many many variables in each class, icluding the superclass and I dont want to redefine the class each time.</p>
  
  <pre><code>var MySuperClass = Class.create({
      initialize:function () {
          var a;
          var b;
          var c;  
          //Getters
      this.getA=function () {
          return a;
      };
      this.getB=function () {
          return b;
      };
      this.getC=function () {
          return c;
      };
  
      //Setters
  
      this.setA=function (val) {
          a = val;
      };
      this.setB=function (val) {
          b = val;
      };
      this.setC=function (val) {
          c = val;
      };
      //end Setters   
  },
  sub:function () {
      return this.getA()-this.getB()-this.getC();
  }
  });
  
  var MyClass = Class.create(MySuperClass, {
    initialize:function () {
          var d;
          var e;
             //Getters
      this.getD=function () {
          return d;
      };
      this.getE=function () {
          return b;
      };
      this.getC=function () {
          return c;
      };
  
      //Setters
  
      this.setA=function (val) {
          a = val;
      };
      this.setB=function (val) {
          b = val;
      };
      this.setC=function (val) {
          c = val;
      };
      //end Setters   
  },
  add:function () {
      return this.getA()+this.getB()+this.getC()+this.getD()+this.getE();
  }
  });
  
  function test() {
   myclass=new MyClass();
   myclass.setA(1);
   myclass.setB(0);
   myclass.setC(3);
   myclass.setD(2);
   myclass.setE(3);
   var result=myclass.add();
   var result2=myclass.sub();
   alert(result+' '+result2);
  }
  </code></pre>
  
  <p>Of course the subclass is overriding the superclass initialize so the values cannot be accessed. How can I initialize subclass variables and superclass variables so that they can both be accessed from the test function?</p>
  
  <p>As always, thank you for your help</p>