I guess it is simpler than I thought:
DynLayer.getPrototype = function() {
        if (!DynLayer._prototype) DynLayer._prototype=new DynLayer;
        return DynLayer._prototype;
}

ex:
MyWidget.prototype = DynLayer.getPrototype();

> It seems a waste for every DynLayer subclass to do:
> 
> MyWidget.prototype = new DynLayer;
> 
> The purpose here is to create the prototype chain from the DynLayer. 
> So why are we creating a new DynLayer for each widget.  Why not reuse
> the same object.  Like saying:
> 
> DynLayerConst = new DynLayer;
> 
> then say:
> 
> MyWidget.prototype = DynLayerConst
> for each widget.
> 
> The only problem is when to create the DynLayerConst.  It has to be
> done after the DynLayer has loaded and any of its extensions (like
> mouse.js).  Any ideas?
> 
> Rob
> 
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/



_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/

Reply via email to