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

Reply via email to