as far as I know, there is no way of changing the prototype when you call the
constructor.
about the only thing I can think of is to use two separate objects to create
your different classes.

sorry I can't be of much more use.

GORTSILAS ANDREAS wrote:

> I beleive that the problem exist in the
>    > AGVisComp.prototype = (this.isLayer)?new DynLayer():new Object();
> here the "this" object does not exists or at least it is not what I expect
> to be...
>
> If I am not wrong the constructor code is CORRECT! ???
>
> Any ideas on how I can bypass this problem
>
> or
>
> another approach maybe?
>
> Andreas
>
> -----Original Message-----
> From: Michael Pemberton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 5:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Dynapi-Help] Constructor function...
>
> not sure how is the best way d doing what your doing.  all I know is that
> the prototype is very separate from the constructor.  The prototype is
> created when the JS parser gets to it.  The constructor is not called until
> you create an instance of that object.
>
> bottom line.  you're on the wrong path : )
>
> GORTSILAS ANDREAS wrote:
>
> > Can you tell me if the following is correct?
> >
> > function AGVisComp(oOwner, sType, bIsLayer, id, x, y, w, h) {
> >   if (bIsLayer) {
> >     this.DynLayer=DynLayer;
> >     this.DynLayer(id,x||0,y||0,w||128,h||18);
> >   }
> >   else {
> >     this.Object = Object;
> >     this.Object();
> >   }
> >
> >   // Propeties
> >   this.type = sType || 'label';
> >   this.owner = oOwner || ApplObj;
> >   this.container = null;
> >   this.isLayer = bIsLayer || false;
> > }
> > AGVisComp.prototype = (this.isLayer)?new DynLayer():new Object();
> >
> > I want an object (AGVisComp) inherited by the DynLayer or by the Object
> > (bIsLayer parameter)
> >
> > Thanks
> >
> > Andreas Gortsilas
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
> --
> Michael Pemberton
> [EMAIL PROTECTED]
> ICQ: 12107010
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help

--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010




_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to