Using onRollout in XML menus

I’m working on a XML menu similar to the one in this tutorial:

http://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm

I noticed that the submenus won’t disappear when the mouse isn’t on them unless the mouse button is pressed (onMouseUp). I tried modifying the Actionscript to correct this problem, but I can’t get it to work. How do you fix this problem?

Is there a way you could use something like…

Pseudocode:
if(mouse arrow is visible)
CloseSubmenus()