Hey, so I created my own function that works much like dojo.declare
for creating classes and implementing simple inheritance, example:
Class('Clock', Component, {
param: 12
constructor: function(){
},
method: function(){
},
obj: {
a: function(){
alert(this.param);
}
}
})
the problem is when I try to call the function "a" contained in "obj".
I try doing something like this:
var clock = new Clock();
clock.obj.a.call(clock);
but that doesn't work, it looses scope, it thinks this.param is also
contained in "obj" despite the fact that I am calling the function
with
the scope of "clock"???
Any help is appreciated.
btw, just so you know:
'Clock' is the class name
Component is the superclass
param, constructor, method, and obj are all added to the prototype of
'Clock'