Groups | Blog | Home
all groups > flash actionscript > september 2007 >

flash actionscript : Listener gone deaf


chopTheWood
9/20/2007 9:46:17 PM
Can anyone shed any light on why my Listener isn't listening any more? It
worked fine until one day it just stopped. I can't find anything else in the
script that would conflict in any way. There are two buttons in a radio group
named "gallery". They are named "water" and "oil" The data for "oil" is "oil"
and the data for "water" is "water". Click on the "oil" button and it will
hilight though the trace msg does not appear. Hear is the script:

----------------------
//LISTEN FOR RADIO BUTTON CLICKS FOR THE GALLERY TYPE, THEN LOAD GALLERY
DIRECTORY OF IMAGE NAMES
var galleryListener:Object = new Object();
gallery.addEventListener("click", galleryListener);
galleryListener.click = function(evt) {
theData = (evt.target.selection.data);
switch (theData) {
case "oil" :
trace("you clicked on the oil button");

break;
case "water" :
break;
default :
trace("no cases selected");
}
};

----------------------
Note that I have another movie with the same script in it which DOES work!
kglad
9/20/2007 10:09:17 PM
chopTheWood
9/20/2007 10:13:54 PM
the data parameter is "oil"
the gropname is "gallery"

kglad
9/20/2007 10:42:43 PM
chopTheWood
9/20/2007 11:05:13 PM
"...unless there are other objects named gallery."

YES!
I renamed a button to "gallery" at some point. After renaming it again the
Listener can hear once again.
I never woulda thunk it... a seperate button would have interfered with a
listener.
You did it again K, thanks
kglad
9/21/2007 12:27:28 AM
AddThis Social Bookmark Button