I don't know the technical reason, but this is one:

You would want some way of confirming creation, either:

DynAPI.document.addChild(myLayer)
or
myLayer.addToParent(DynAPI.document)

Otherwise your layers are created the moment you create them, while now you
can create them before-hand, and only add them to the document when you need
them.

Richard


----- Original Message -----
From: "Quang Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 10, 2001 12:32 AM
Subject: [Dynapi-Dev] Question about DynAPIObject


> 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