Hi,
If you're learning it, you might as well learn it right, check out the
latest docs included with the latest release, I think the docs on
http://dynapi.sourceforge.net/tutorials.php  are out of date. Eventlisteners
are tackled in them also, and they use the new onprecreation code.

Cheers,
Richard Bennett

[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2)

----- Original Message -----
From: "Michael Towers" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 5:47 PM
Subject: [Dynapi-Help] Help


> Hi,
>
> I'm a little new to this so please bear with me.
>
> I am trying to write a widget which contains of three layers, each of
which
> must be able to repsond to it's mouse events.  Below is a copy of the code
> which creates the layer and displays them on the page.  This code works
> fine.  How do I get the individual layers to respond to mouse events.  I
> know I need an event listener but what's the correct syntax?
>
> Thanks
>
> MT.
>
> function widget( xPos, yPos, width, height) {
>
> this.superClass=DynLayer
> this.superClass()
> this.id="widget"+(widget.Count++)
>
> this.moveTo( xPos||0, yPos||0 )
> this.setSize( width||128, height||36 )
>
> var eventListener = new EventListener( this )
> eventListener.oncreate= function( event ) {
>
> var targetObject = event.getTarget()
> myLayer = new DynLayer( null, xPos ,yPos, width / 2,height /
> 2, '#ffffff')
> myLayer1 = new DynLayer( null, xPos + 10 ,yPos + 10, width /
> 2,height / 2, '#0000f0')
> myLayer2 = new DynLayer( null, xPos + 20 ,yPos + 20, width /
> 2,height / 2, '#FF0033')
>
> targetObject.addChild( myLayer );
> targetObject.addChild( myLayer1 );
> targetObject.addChild( myLayer2 );
>
> targetObject.setVisible( true )
> }
> this.addEventListener(eventListener)
>
>
> return this
> }
> widget.Count=0
> widget.prototype=new DynLayer()
> widget.prototype.getSubClass = function() { return widget}
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
> ____________________________________________________________
> Get your free domain name and domain-based e-mail from
> Namezero.com. New!  Namezero Plus domains now available.
> Find out more at: http://www.namezero.com
>


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to