Bobafart
09-27-2007, 11:57 PM
I need help executing a function and passing a value using a listener.
If my mark up is a series of images for instance (icons in this case):
<img id="imgActivate" src="path/to/png1">
<img id="imgActivate" src="path/to/png2">
<img id="imgActivate" src="path/to/png3">
<img id="imgActivate" src="path/to/png4">
how would I create the code to set up a Listener to execute my function and pass a unique value to that function depending on which image icon was clicked?
function myFunc(e){
what code goes in here to know which icon was clicked? -- ie. how do I pass that value so that I can tell which image was clicked? (png1, png2, png3 or png5???)
}
obj.Listener( "imgActivate", myFunc, true);
If my mark up is a series of images for instance (icons in this case):
<img id="imgActivate" src="path/to/png1">
<img id="imgActivate" src="path/to/png2">
<img id="imgActivate" src="path/to/png3">
<img id="imgActivate" src="path/to/png4">
how would I create the code to set up a Listener to execute my function and pass a unique value to that function depending on which image icon was clicked?
function myFunc(e){
what code goes in here to know which icon was clicked? -- ie. how do I pass that value so that I can tell which image was clicked? (png1, png2, png3 or png5???)
}
obj.Listener( "imgActivate", myFunc, true);