Hi,
Firstly check the tutorial here:
http://sourceforge.net/docman/display_doc.php?docid=442&group_id=5757
if you haven't done so already.
There are different widget models depending on the author, this ones from
Pascal Bestebroer.
the principle is that you add 1 main dynlayer:
function widgetname() {
this.superClass=DynLayer
this.superClass()
this.id="widgetname"+(widgetname.Count++)
return this
}
widgetname.Count=0
widgetname.prototype=new DynLayer()
widgetname.prototype.getSubClass=function() { return widgetname }
You can't add child layers to the layer yet, 'cause it doesn't exist until
the widget has been created,
so you create a listener to trigger oncreate, and add child layers then.
Basically in your first example you are adding a child layer to something
which doesn't exist yet.
Hope that helps
Richard :)
----- Original Message -----
From: "Pepe Gutierrez" <jav...@ya...>
To: <dyn...@li...>
Sent: Monday, December 11, 2000 10:47 AM
Subject: [Dynapi-Help] Help on widgets
> I'm just and user so excuse me if this is a stupid
> question... :) (My name's Javi, not Pepe (it's a
> little mistake, sorry))
>
> I want to make widgets and I have tested two ways to
> add DynLayers inside the widgets.
>
> The first way is simply something like that:
> this.aLayer = this.addChild(new DynLayer())
>
> The second one is somthing like that:
> this.aLayer = new DynLayer()
>
> l = new EventListener(this)
> l.oncreate = function (e) {
> me = e.getTarget()
> me.addChild(me.aLayer)
> }
> this.addEventListener(l)
>
> Only the second one works. Why? I prefer the first is
> more simple and easy.
>
> I have found some code using the first one, but it
> doesn't work.
>
> What's going on?
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
> _______________________________________________
> Dynapi-Help mailing list
> Dyn...@li...
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
> ____________________________________________________________
> Get your FREE personal .com domain name and
> NAMEzero Personal Portal at: http://www.namezero.com.
> For customer service, mailto:cus...@na....
>
>
|