First, thanks for the reply. Using the object literal syntax in my
example I cannot "var" any of the object properties without throwing an
error. I can try rewriting each object as a function but I know that
the current code "should" work. The prototype does created a shared
inheritence but shouldnt be sharing variables especially as I am
instantiating new instances of the classes.... I agree that it appears
to be doing so...
I would prefer to solve the problem in case this comes up again in the
future so any other thoughts are appreciated.
allen
INeedADip wrote:
Quote:
Now I thought that is what SomeClass.prototype was all about.
The prototype applies to all SomeClass objects.
>
Wouldn't you want to do something like:
>
Squadrons = function () {
var privateVariable = '';
return {
title : "",
get : function (plaform_id) {...},
add : function (platform_id) {...},
bla : function ()
}
}
>
var mySquads = new Squadrons();
bla bla bla...