Because with the current system, dynlayers can only be created after
the page has loaded.  And since the dynapi captures the onload event,
you must use DynAPI.onLoad to create objects after the page has
loaded.  Apparently, the next version will support creating of
dynlayers before the page loads (but the syntax may be different).

Rob

On 11/9/2001, Quang Nguyen wrote:
> I guess we create a DynAPI object to make sure the Dynapi.js and any library 
> needed have been loaded.
> However, what are the technical reason why we need DynAPI to create a layer, 
> like the following:


> ...
> DynAPI.onLoad = function()
> {
>         myLayer = new DynLayer()
>         myLayer.setSize(100,100)
>         myLayer.setBgColor('#c0c0c0')
>         myLayer.moveTo(100,100)
>         DynAPI.document.addChild(myLayer)
> }
> ...



> In short, why does the layer myLayer not appear if you write like this:

> ...
> myLayer = new DynLayer()
> myLayer.setSize(100,100)
> myLayer.setBgColor('#c0c0c0')
> myLayer.moveTo(100,100)
> ...

> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


> _______________________________________________
> 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