Actionscript 3: foreach drawing object in movieclip
- by Mathias
Hey,
I got a europe map designed in flash (1 movieclip, 1 frame, really simple), which contains the map as drawing objects directly inside the scene and in addition some specific countries as clickable buttons. So far it's working fine. What I need now is to make all the other drawing objects clickable without having to edit and script each object. I'm thinking about something like this (pseudo code):
foreach(obj in MovieClip) {
if(obj !typeof(Button)) {
obj.addEventListener(MouseEvent.MOUSE_DOWN, genericClickListener);
}
}
I just don't know the syntax how to achieve that. Could anybody give me a hint?
Thanks,
Mathias