Clear memory or swf's interact

I have a menu and each button reveals a hidden layer which includes it’s submenu (another swf).
The submenus have sub-submenus in the same swf.

When I take the mouse away from these layers the submenus hide again.
All these work.

The problem is that when a sub-submenu is opened and then the layer hides, when it’s shown again the sub-submenu is still opened.
Is there a way to clear memory or unload a swf file through html or through the main menu swf?

Interact between swf’s would really really help.

Thank you all.