I do believe that addchild expects an id member of any object.
I'm not sure what other members it expects.
Also, you need to add
MultipleList.prototype = DynLayer();
to give your object the same functionality as a dynlayer
(all objects should be decended from DynLayer)
The error is most likely being generated in .addChild as this function
is trying to treat your object as a DynLayer and not having any luck
----- Original Message -----
From: "ADnoctum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 11:45 AM
Subject: [Dynapi-Help] Multiple List objects.
> Hi everyone.
>
> I need to write a class that will handle several Lists objects in an array
> and I have to show or hide them with a show() method, but when I do
> DynAPI.document.addChild(list) it gives me this error: "The object doesn't
> accept this properity or method.". Some of the code looks like this:
>
> function MultipleList() {
> this.lists = [];
> }
> MultipleList.prototype.add = function(name, items) {
> var i;
> list = new List();
> list.moveTo(100, 100);
> list.setWidth(200);
> for(i = 0; i < items.length; i++) {
> list.add(items[i][0], items[i][1]);
> }
> this.lists[name] = list;
> // This call gives me an error:
> // The object doesn't accept this properity or method.
> DynAPI.document.addChild(list);
> }
> MultipleList.prototype.show = function(name, b) {
> if(this.lists[name]) {
> this.lists[name].show(b);
> }
> }
>
> l0 = Array(
> Array("one", 1),
> Array("two", 2),
> Array("three", 3),
> Array("four", 4)
> );
>
> l1 = Array(
> Array("uno", 1),
> Array("dos", 2),
> Array("tres", 3),
> Array("cuatro", 4)
> );
>
> m = new MultipleList();
> m.add("english", l0);
> m.add("spanish", l1);
> m.show("english", true);
>
>
> The actual code is like the one in the example of the distribution. What
do
> you think it is?.
>
> Thanks.
>
>
> PS: Excuse my bad english.
>
>
>
>
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
---
Outgoing mail is certified Virus Free by AVG Free Edition
Download at: http://www.grisoft.com/html/us_index.cfm
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help