I have a large graphic consisting of letters from Illustrator. I paste these into flash, break them up into smaller groups and convert these groups to MovieClips. Because of the enormous amount of MovieClips that I have to convert by hand (pressing F8 and Enter), I simply use the default naming of symbols that Flash suggests Symbol 1, Symbol 2 … Symbol 3245.
I place all these MovieClips into one parent MovieClip (select them all and press F8). And at runtime I add EventListeners to them all using this:
for(var i = 0; i < letter_ocean_mc.numChildren; i++)
{
var mc:DisplayObject = letter_ocean_mc.getChildAt(i);
mc.alpha = .1;
mc.addEventListener(MouseEvent.MOUSE_OVER, mOver);
mc.addEventListener(MouseEvent.MOUSE_OUT, mOut);
}
I can now apply the same effect to all these clips at once, which is nice. But …
My problem is, that because each group consist of letters, I can only get Mouse Over Event when I touch the letters them selves, not the holes in the letters and the space between them.
I thought I could easily add a mask or bounding box to get the whole MovieClip to respond to MouseEvents. I hope I thought right, but I just can’t seem to get anything to work. I’ve tried creating both new Sprites, MovieClips, DisplayObjects, Shapes … you name it, and add them to the instance like this:
mc.addChild(myMask); (where myMask has been any of the above mentioned types - both with and without drawn shapes).
Does anyone have any idea how to achieve a thing like this? And it has do be done dynamically, as I haven’t got the three months or so to do it by hand (not to mention if I had to update the graphic ).