it has been discussed a few days ago. JS doesn't allow alternative inheretance.
Ramon Buckland wrote:
> Hi All,
>
> I am wanting to do an 'if' based inheritance for an object
>
> Below is my Object .. if it is passed ('url=url.htm') then I want the object
> to inherit the LoadPanel
> but if it is passed content, then I want it
> to inheritjust from DynLayer ..
>
> Any ideas .. my problem would be the prototype line at the bottom.
> Thanks
>
> //-------------------------------------------------------------
> function DynFolItem (argumentStr) {
>
> content = url = bgColor = height = null
> if (argumentStr) arguments = argumentStr.split(/\s*,\s*/);
>
> for (i=0; i < arguments.length; i++ ) {
> valpair = arguments[i].split(/\s*=\s*/);
> switch(valpair[0]) {
> case 'content': content =
> unescape(valpair[1]); break;
> case 'url': url = valpair[1];
> break;
> case 'bgColor': bgColor = valpair[1];
> break;
> case 'height': height = valpair[1];
> break;
> }
> }
>
> if (url) {
> this.LoadPanel = LoadPanel;
> this.LoadPanel();
> this.tempURL2 = url
> } else {
> alert('test');
> this.DynLayer = DynLayer
> this.DynLayer()
>
> }
>
> this.isFolder = false
> if (bgColor) this.setBgColor(bgColor)
> if (content) this.setHTML(content)
> this.myHeight = height || null
> alert('test');
> }
> DynFolItem.prototype=new DynLayer();
> //-------------------------------------------------------------
>
> ------------------------------------------------
> Ramon Buckland
> Applications Engineer
>
> email: [EMAIL PROTECTED]
> web: www.f5.com.au
> phone: (07) 3257 7900
> fax: (07) 3257 7955
>
> f5. Make the Medium Work. Simple.
> ------------------------------------------------
>
> _______________________________________________
> 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