MyObject.prototype.bSwitch = true; is the correct way to achieve what you are looking for. Why would you want to do this by using an instance of said class? It seems to me you'd _want_ to _not_ have to know what instances are floating around in your application, so the "class" function's prototype is the natural place to make this change. In other words, you have 10 widgets and a couple of flibbets, maybe a few woozles on your page, each of them possibly containing N instances of MyObject. Why would you want to have to know the name of one of those instances to set this switch across all of them... see my point?
After declaring the Class, I've never had to mess with
a class before. This takes some getting used to, and it seems strange that
I can't reference the class / constructor from an instance without knowing
the constructor's name???
I was under a mistaken assumption
that
oMyObj1.prototype
would move up the prototype chain to reach the constructor
function MyObject.
If
var oMyObj5 = new
MyObject();
doesn't it make sense that there should be a pointer on the
oMyObj5 object which points back to the constructor function? Without
__proto__, there's no way to reach back to the constructor without
knowing the constructor's name?
Sam
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
