Javascript has mouseover and mouseout events. Flash has these, but they also have rollover and rollout events. There is a difference, and it can be painful developing Javascript components without the rollover and rollout events. So I put together a little script that provides them for us.
You want to perform some action when the cursor rolls onto and off of an HTML element. When you use the mouseover/mouseout events, you get a mouseout and immediately another mouseover when the cursor is over a child element. Technically the mouse is still over the parent element, why does the mouseout happen? What the... you want it to work like CSS :hover. The way you'd think it SHOULD work. You figure, maybe it's just you're catching because bubbling child events, so you return out of your listener if the target does not equal your element. This removes the second mouseover, but you still get a mouseout when hovering over a child element.
Flash's solution was to build in a non-bubbling rollover/rollout event that works like you'd expect. I've never used a mouseover/mouseout in Flash since these new events came about. So, assuming you've got a modern standards-compliant browser (tested on Safari/Chrome & Firefox), this little bit of code will provide rollover/rollout events for your HTML and is non-intrusive. It saves a lot of headache and works great.
Updated: The code did not previously take into account siblings, only ancestors. Fixed to find the common ancestor.
I hope this helps someone having a rough time with Javascript mouseovers.