From: Scott A. L. <sc...@sc...> - 2000-11-07 18:06:06
|
Yes, that's about correct. children[] contains only the direct child DynLayers of the DynLayer or DynDoc in question. all[] however is only a property of the DynDocument. It hold references to all DynLayers within it, no matter how 'deep.' It's similar to IE's all[] collection, which contains references to all elements in a page regardless of their position in the hierarchy. DynLayers themselves have no all[] collection, just children[]. Pascal Bestebroer wrote: > > Not sure about this, but I think the difference between both arrays > is that the children[] array contains only the direct childs of a > layer/dyndocument > and the all[] array contains all layers within that layer/dyndocument > (all levels of child objects).. > > as mentioned, not sure because I don't have the code with me here. > > Pascal Bestebroer > pb...@oi... > http://www.oibv.com > > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Robert Rainwater > Verzonden: dinsdag 7 november 2000 8:44 > Aan: Scott Andrew LePera > Onderwerp: Re: [Dynapi-Dev] all vs. allID > > > After Robert mentioned it, I can think of no good reason for maintaining > an > > all[] and allID[] array. I don't think there's enough benefit to justify > > having both. As he suggested, the dyndocument could just as easily keep a > > numeric count as DynLayers are added and removed. > > > > This would also remove potential memory leaks and speed things up a bit. > > Unless someone has other ideas, I would suggest removing the numeric all[] > > and replace it with allID, renaming it to all[], of course. > > While it wouldn't be as easy, I think the same can be done for the > .children array. If it were an associative array with the indexes > being ids, it would improve the speed of deleteChild and removeChild > since they would not have to loop through all of the children. The > whole point of those loops is to verify the child exists. Then you > could just say if (this.children[id]). Maybe just add a function > hasChildren() that returns true/false. > > As far as naming, .allID should definately be renamed to .all, but of > course that would affect the way you access inline layers, so the > tutorials would need updating. > > \\Robert > > -- > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-dev > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-dev |