Flash Menu, detecting which site is loaded

Hi! I am setting up a site with a flash menu and html content. The Flash Menu looks different depending on which button is active (moves to different frames in the swf). When I designed the menu I used Iframe so it wasn´t a problem then, but when I dumped the iframes and started using divs instead I ran into the wall.

When I click on a link in the flash menu it reloads the whole page so the swf also starts from frame 1, is it possible to somehow get the swf to understand which html site that is loaded and move to the proper frame? So if I press for example “links” it moves to links.html and when links.html is loaded the swf moves to frame X.

With regards!