Sending/receiving vars using JS across frames

I have a frameset set up with two frames, top and main. I have a movie in the main frame that needs to send a variable to the top frame when a button is clicked. Then when I load a new movie into the main frame I need it to read the variable from the top frame.

I think I have to use fsCommand to send and receive the variable, but I’m not sure how to do it. Searching the web I have found how to send it to the same page, but not a seperate frame. Help, please?

Thanks in advance,
rhombusleech