Hi

ButtonImage is little buggy..
(http://www.mail-archive.com/dynapi-help%40lists.sourceforge.net/msg03718.ht
ml). I haven't found any cure for the event problem. Instead use ImageButton
found at http://www.merlinsworld.net/dynapi_ri_dcexamples/.

-----Original Message-----
From: Tom Wilcoxen [mailto:[EMAIL PROTECTED]]
Sent: 21. hein�kuuta 2001 1:02
To: [EMAIL PROTECTED]
Subject: �Dynapi-Help� Problem with multiple ButtonImage objects and
events


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

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

Reply via email to