I'm trying to use 2 buttonImage objects on a page, but having trouble
with events. I currently have only one listener on the page, assigned
to only one of the buttons. However, when either button is pressed the
listener function is fired. Here is the code:

   var csmbutton  = new ButtonImage();
   var helpbutton = new ButtonImage();

   csmbutton.moveTo(865,10);
   helpbutton.moveTo(915, 10);

   csmbutton.setImages(csmoff,csmon);
   helpbutton.setImages(helpoff,helpon);

   myListener=new EventListener(csmbutton)
   myListener.onpressed=function(e) {
      whichButton = e.getSource();
      alert('Button pressed: ' + whichButton)
   }

   csmbutton.addEventListener(myListener)

   DynAPI.document.addChild(csmbutton)
   DynAPI.document.addChild(helpbutton)


I added the "pressed" event to the buttonImage object on the mouseup
event.

I've tried using two EventListeners, one per button, but that does the
same thing -- only one of the EventListeners gets fired, but for both
of the buttons.

Thanks for any help!
-Tom

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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

Reply via email to